diff --git a/.gitignore b/.gitignore
index 46509bcf29..960bc7ca59 100644
--- a/.gitignore
+++ b/.gitignore
@@ -56,8 +56,6 @@ Lib/distutils/command/*.pdb
 Lib/lib2to3/*.pickle
 Lib/test/data/*
 !Lib/test/data/README
-Lib/site-packages/*
-!Lib/site-packages/README
 /Makefile
 /Makefile.pre
 Misc/python.pc
@@ -117,8 +115,7 @@ PCbuild/win32/
 Tools/msi/obj
 Tools/ssl/amd64
 Tools/ssl/win32
-Scripts/
-Share/
+
 # Two-trick pony for OSX and other case insensitive file systems:
 # Ignore ./python binary on Unix but still look into ./Python/ directory.
 /python
diff --git a/Include/Python.h b/Include/Python.h
index c41e31a55f..d6e5b139ac 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -3,7 +3,7 @@
 /* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */
 
 /* Include nearly all Python header files */
-#include "winxp.h"
+
 #include "patchlevel.h"
 #include "pyconfig.h"
 #include "pymacconfig.h"
diff --git a/Include/pathcch.h b/Include/pathcch.h
deleted file mode 100644
index b89436b328..0000000000
--- a/Include/pathcch.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#if 0
-#include <stdarg.h>
-#include <string.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "strsafe.h"
-#include "shlwapi.h"
-#include "wininet.h"
-#include "intshcut.h"
-#include "winternl.h"
-
-#define PATHCCH_NONE                            0x00
-#define PATHCCH_ALLOW_LONG_PATHS                0x01
-#define PATHCCH_FORCE_ENABLE_LONG_NAME_PROCESS  0x02
-#define PATHCCH_FORCE_DISABLE_LONG_NAME_PROCESS 0x04
-#define PATHCCH_DO_NOT_NORMALIZE_SEGMENTS       0x08
-#define PATHCCH_ENSURE_IS_EXTENDED_LENGTH_PATH  0x10
-#define PATHCCH_ENSURE_TRAILING_SLASH           0x20
-
-#define PATHCCH_MAX_CCH 0x8000
-
-#define heap_alloc malloc
-
-HRESULT PathAllocCanonicalize(const WCHAR *path_in, DWORD flags, WCHAR **path_out);
-HRESULT  PathAllocCombine(const WCHAR *path1, const WCHAR *path2, DWORD flags, WCHAR **out);
-HRESULT  PathCchAddBackslash(WCHAR *path, SIZE_T size);
-HRESULT  PathCchAddBackslashEx(WCHAR *path, SIZE_T size, WCHAR **end, SIZE_T *remaining);
-HRESULT  PathCchAddExtension(WCHAR *path, SIZE_T size, const WCHAR *extension);
-HRESULT  PathCchAppend(WCHAR *path1, SIZE_T size, const WCHAR *path2);
-HRESULT  PathCchAppendEx(WCHAR *path1, SIZE_T size, const WCHAR *path2, DWORD flags);
-HRESULT  PathCchCanonicalize(WCHAR *out, SIZE_T size, const WCHAR *in);
-HRESULT  PathCchCanonicalizeEx(WCHAR *out, SIZE_T size, const WCHAR *in, DWORD flags);
-HRESULT  PathCchCombine(WCHAR *out, SIZE_T size, const WCHAR *path1, const WCHAR *path2);
-HRESULT  PathCchCombineEx(WCHAR *out, SIZE_T size, const WCHAR *path1, const WCHAR *path2, DWORD flags);
-HRESULT  PathCchFindExtension(const WCHAR *path, SIZE_T size, const WCHAR **extension);
-BOOL     PathCchIsRoot(const WCHAR *path);
-HRESULT  PathCchRemoveBackslash(WCHAR *path, SIZE_T path_size);
-HRESULT  PathCchRemoveBackslashEx(WCHAR *path, SIZE_T path_size, WCHAR **path_end, SIZE_T *free_size);
-HRESULT  PathCchRemoveExtension(WCHAR *path, SIZE_T size);
-HRESULT  PathCchRemoveFileSpec(WCHAR *path, SIZE_T size);
-HRESULT  PathCchRenameExtension(WCHAR *path, SIZE_T size, const WCHAR *extension);
-HRESULT  PathCchSkipRoot(const WCHAR *path, const WCHAR **root_end);
-HRESULT  PathCchStripPrefix(WCHAR *path, SIZE_T size);
-HRESULT  PathCchStripToRoot(WCHAR *path, SIZE_T size);
-BOOL     PathIsUNCEx(const WCHAR *path, const WCHAR **server);
-#endif
diff --git a/Include/winxp.h b/Include/winxp.h
deleted file mode 100644
index 9e345f12b4..0000000000
--- a/Include/winxp.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#define WINXP 1
-#ifndef LOAD_LIBRARY_SEARCH_SYSTEM32
-  #define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0
-  #define LOAD_LIBRARY_SEARCH_APPLICATION_DIR 0
-  #define LOAD_LIBRARY_SEARCH_SYSTEM32 0
-  #define LOAD_LIBRARY_SEARCH_USER_DIRS 0
-  #define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR 0
-#endif
-#include "pathcch.h"
\ No newline at end of file
diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py
index c61e967132..6c5d77746b 100644
--- a/Lib/distutils/cygwinccompiler.py
+++ b/Lib/distutils/cygwinccompiler.py
@@ -82,10 +82,6 @@ def get_msvcr():
         elif msc_ver == '1600':
             # VS2010 / MSVC 10.0
             return ['msvcr100']
-        elif msc_ver == '1900':
-            return ['vcruntime140']
-        elif msc_ver == '1915':
-            return ['vcruntime140']
         else:
             raise ValueError("Unknown MS Compiler version %s " % msc_ver)
 
diff --git a/Lib/os.py b/Lib/os.py
index cc58bf3185..253cad1a59 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -1079,32 +1079,36 @@ class PathLike(abc.ABC):
 
 if name == 'nt':
     class _AddedDllDirectory:
-        def __init__(self, path):
-          self.path = path
-          sys.path.insert(0, self.path)
-          environ["PATH"]= self.path + ";" + environ["PATH"]
-
-        def __enter__(self):
-          sys.path.insert(0, self.path)
-          environ["PATH"]= self.path + ";" + environ["PATH"]
-
+        def __init__(self, path, cookie, remove_dll_directory):
+            self.path = path
+            self._cookie = cookie
+            self._remove_dll_directory = remove_dll_directory
         def close(self):
-          try:
-              sys.path.remove(self.path)
-              tmplist = environ["PATH"].split(";")
-              tmplist.remove(self.path)
-              environ["PATH"] = ";".join(tmplist)
-          except ValueError:
-              pass      
-
-        def __exit__(self, exc_type, exc_value, traceback):
-          self.close(self)
-
+            self._remove_dll_directory(self._cookie)
+            self.path = None
+        def __enter__(self):
+            return self
+        def __exit__(self, *args):
+            self.close()
         def __repr__(self):
             if self.path:
                 return "<AddedDllDirectory({!r})>".format(self.path)
             return "<AddedDllDirectory()>"
 
-
     def add_dll_directory(path):
-        return _AddedDllDirectory(path)
\ No newline at end of file
+        """Add a path to the DLL search path.
+
+        This search path is used when resolving dependencies for imported
+        extension modules (the module itself is resolved through sys.path),
+        and also by ctypes.
+
+        Remove the directory by calling close() on the returned object or
+        using it in a with statement.
+        """
+        import nt
+        cookie = nt._add_dll_directory(path)
+        return _AddedDllDirectory(
+            path,
+            cookie,
+            nt._remove_dll_directory
+        )
diff --git a/Lib/pathlib.py b/Lib/pathlib.py
index 9414bcad2f..350f27e4a0 100644
--- a/Lib/pathlib.py
+++ b/Lib/pathlib.py
@@ -16,7 +16,7 @@ from urllib.parse import quote_from_bytes as urlquote_from_bytes
 supports_symlinks = True
 if os.name == 'nt':
     import nt
-    if sys.getwindowsversion()[:2] >= (5, 0):
+    if sys.getwindowsversion()[:2] >= (6, 0):
         from nt import _getfinalpathname
     else:
         supports_symlinks = False
diff --git a/Lib/test/libregrtest/cmdline.py b/Lib/test/libregrtest/cmdline.py
index 974ad9fc7f..c0bb051bd0 100644
--- a/Lib/test/libregrtest/cmdline.py
+++ b/Lib/test/libregrtest/cmdline.py
@@ -408,8 +408,7 @@ def _parse_args(args, **kwargs):
             ns.ignore_tests = []
         with open(ns.ignore_filename) as fp:
             for line in fp:
-                if len(line.split('#')[0].strip()) > 0:
-                    ns.ignore_tests.append(line.split('#')[0].strip())
+                ns.ignore_tests.append(line.strip())
     if ns.forever:
         # --forever implies --failfast
         ns.failfast = True
diff --git a/Lib/test/mock_socket.py b/Lib/test/mock_socket.py
index 15b02adc2f..b28c4732cc 100644
--- a/Lib/test/mock_socket.py
+++ b/Lib/test/mock_socket.py
@@ -133,7 +133,7 @@ def getdefaulttimeout():
     return _defaulttimeout
 
 
-def getfqdn(name=""):
+def getfqdn():
     return ""
 
 
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 5867e4d1e0..35d9d65f8c 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -19,7 +19,7 @@
   // 0x10101000L == 1.1.1, 30000 == 3.0.0
   #define OPENSSL_API_COMPAT 0x10101000L
 #endif
-//#define OPENSSL_NO_DEPRECATED 1
+#define OPENSSL_NO_DEPRECATED 1
 
 #define PY_SSIZE_T_CLEAN
 
diff --git a/Modules/_stat.c b/Modules/_stat.c
index efa585cbbf..7a799af0ca 100644
--- a/Modules/_stat.c
+++ b/Modules/_stat.c
@@ -598,8 +598,8 @@ PyInit__stat(void)
         PyLong_FromUnsignedLong(IO_REPARSE_TAG_SYMLINK))) return NULL;
     if (PyModule_AddObject(m, "IO_REPARSE_TAG_MOUNT_POINT",
         PyLong_FromUnsignedLong(IO_REPARSE_TAG_MOUNT_POINT))) return NULL;
-  //  if (PyModule_AddObject(m, "IO_REPARSE_TAG_APPEXECLINK",
-  //      PyLong_FromUnsignedLong(IO_REPARSE_TAG_APPEXECLINK))) return NULL;
+    if (PyModule_AddObject(m, "IO_REPARSE_TAG_APPEXECLINK",
+        PyLong_FromUnsignedLong(IO_REPARSE_TAG_APPEXECLINK))) return NULL;
 #endif
 
     return m;
diff --git a/Modules/_winapi.c b/Modules/_winapi.c
index 5084e64026..647075cdb1 100644
--- a/Modules/_winapi.c
+++ b/Modules/_winapi.c
@@ -61,122 +61,6 @@
 
 #define T_HANDLE T_POINTER
 
-struct proc_thread_attr
-{
-    DWORD_PTR attr;
-    SIZE_T size;
-    void *value;
-};
-
-struct _PROC_THREAD_ATTRIBUTE_LIST
-{
-    DWORD mask;  /* bitmask of items in list */
-    DWORD size;  /* max number of items in list */
-    DWORD count; /* number of items in list */
-    DWORD pad;
-    DWORD_PTR unk;
-    struct proc_thread_attr attrs[1];
-};
-/***********************************************************************
- *           InitializeProcThreadAttributeList       (KERNEL32.@)
- */
-BOOL WINAPI InitializeProcThreadAttributeList_XP(struct _PROC_THREAD_ATTRIBUTE_LIST *list,
-                                              DWORD count, DWORD flags, SIZE_T *size)
-{
-    SIZE_T needed;
-    BOOL ret = FALSE;
-
-    needed = FIELD_OFFSET(struct _PROC_THREAD_ATTRIBUTE_LIST, attrs[count]);
-    if (list && *size >= needed)
-    {
-        list->mask = 0;
-        list->size = count;
-        list->count = 0;
-        list->unk = 0;
-        ret = TRUE;
-    }
-    else
-        SetLastError(ERROR_INSUFFICIENT_BUFFER);
-
-    *size = needed;
-    return ret;
-}
-
-/***********************************************************************
- *           UpdateProcThreadAttribute       (KERNEL32.@)
- */
-BOOL WINAPI UpdateProcThreadAttribute_XP(struct _PROC_THREAD_ATTRIBUTE_LIST *list,
-                                      DWORD flags, DWORD_PTR attr, void *value, SIZE_T size,
-                                      void *prev_ret, SIZE_T *size_ret)
-{
-    DWORD mask;
-    struct proc_thread_attr *entry;
-
-    if (list->count >= list->size)
-    {
-        SetLastError(ERROR_GEN_FAILURE);
-        return FALSE;
-    }
-
-    switch (attr)
-    {
-    case PROC_THREAD_ATTRIBUTE_PARENT_PROCESS:
-        if (size != sizeof(HANDLE))
-        {
-            SetLastError(ERROR_BAD_LENGTH);
-            return FALSE;
-        }
-        break;
-
-    case PROC_THREAD_ATTRIBUTE_HANDLE_LIST:
-        if ((size / sizeof(HANDLE)) * sizeof(HANDLE) != size)
-        {
-            SetLastError(ERROR_BAD_LENGTH);
-            return FALSE;
-        }
-        break;
-
-    case PROC_THREAD_ATTRIBUTE_IDEAL_PROCESSOR:
-        if (size != sizeof(PROCESSOR_NUMBER))
-        {
-            SetLastError(ERROR_BAD_LENGTH);
-            return FALSE;
-        }
-        break;
-
-    default:
-        SetLastError(ERROR_NOT_SUPPORTED);
-        return FALSE;
-    }
-
-    mask = 1 << (attr & PROC_THREAD_ATTRIBUTE_NUMBER);
-
-    if (list->mask & mask)
-    {
-        SetLastError(ERROR_OBJECT_NAME_EXISTS);
-        return FALSE;
-    }
-
-    list->mask |= mask;
-
-    entry = list->attrs + list->count;
-    entry->attr = attr;
-    entry->size = size;
-    entry->value = value;
-    list->count++;
-
-    return TRUE;
-}
-
-/***********************************************************************
- *           DeleteProcThreadAttributeList       (KERNEL32.@)
- */
-void WINAPI DeleteProcThreadAttributeList_XP(struct _PROC_THREAD_ATTRIBUTE_LIST *list)
-{
-    return;
-}
-
-
 /* Grab CancelIoEx dynamically from kernel32 */
 static int has_CancelIoEx = -1;
 static BOOL (CALLBACK *Py_CancelIoEx)(HANDLE, LPOVERLAPPED);
@@ -1049,7 +933,7 @@ static void
 freeattributelist(AttributeList *attribute_list)
 {
     if (attribute_list->attribute_list != NULL) {
-        DeleteProcThreadAttributeList_XP(attribute_list->attribute_list);
+        DeleteProcThreadAttributeList(attribute_list->attribute_list);
         PyMem_Free(attribute_list->attribute_list);
     }
 
@@ -1096,7 +980,7 @@ getattributelist(PyObject *obj, const char *name, AttributeList *attribute_list)
         ++attribute_count;
 
     /* Get how many bytes we need for the attribute list */
-    result = InitializeProcThreadAttributeList_XP(NULL, attribute_count, 0, &attribute_list_size);
+    result = InitializeProcThreadAttributeList(NULL, attribute_count, 0, &attribute_list_size);
     if (result || GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
         ret = -1;
         PyErr_SetFromWindowsErr(GetLastError());
@@ -1109,7 +993,7 @@ getattributelist(PyObject *obj, const char *name, AttributeList *attribute_list)
         goto cleanup;
     }
 
-    result = InitializeProcThreadAttributeList_XP(
+    result = InitializeProcThreadAttributeList(
         attribute_list->attribute_list,
         attribute_count,
         0,
@@ -1127,7 +1011,7 @@ getattributelist(PyObject *obj, const char *name, AttributeList *attribute_list)
     }
 
     if (attribute_list->handle_list != NULL) {
-        result = UpdateProcThreadAttribute_XP(
+        result = UpdateProcThreadAttribute(
             attribute_list->attribute_list,
             0,
             PROC_THREAD_ATTRIBUTE_HANDLE_LIST,
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index dd0dd632e0..d7edabe5da 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -500,11 +500,6 @@ PyOS_AfterFork(void)
 
 
 #ifdef MS_WINDOWS
-#define UNICODE 1
-#include <psapi.h>
-//#include <tchar.h>
-#include <strsafe.h>
-DWORD GetFinalPathNameByHandleW_XP(HANDLE hFile, LPWSTR  lpszFilePath, DWORD  cchFilePath, DWORD  dwFlags);
 /* defined in fileutils.c */
 void _Py_time_t_to_FILE_TIME(time_t, int, FILETIME *);
 void _Py_attribute_data_to_stat(BY_HANDLE_FILE_INFORMATION *,
@@ -1778,6 +1773,41 @@ win32_xstat_impl(const wchar_t *path, struct _Py_stat_struct *result,
             goto cleanup;
         }
 
+        /* Query the reparse tag, and traverse a non-link. */
+        if (!traverse) {
+            if (!GetFileInformationByHandleEx(hFile, FileAttributeTagInfo,
+                    &tagInfo, sizeof(tagInfo))) {
+                /* Allow devices that do not support FileAttributeTagInfo. */
+                switch (GetLastError()) {
+                case ERROR_INVALID_PARAMETER:
+                case ERROR_INVALID_FUNCTION:
+                case ERROR_NOT_SUPPORTED:
+                    tagInfo.FileAttributes = FILE_ATTRIBUTE_NORMAL;
+                    tagInfo.ReparseTag = 0;
+                    break;
+                default:
+                    retval = -1;
+                    goto cleanup;
+                }
+            } else if (tagInfo.FileAttributes &
+                         FILE_ATTRIBUTE_REPARSE_POINT) {
+                if (IsReparseTagNameSurrogate(tagInfo.ReparseTag)) {
+                    if (isUnhandledTag) {
+                        /* Traversing previously failed for either this link
+                           or its target. */
+                        SetLastError(ERROR_CANT_ACCESS_FILE);
+                        retval = -1;
+                        goto cleanup;
+                    }
+                /* Traverse a non-link, but not if traversing already failed
+                   for an unhandled tag. */
+                } else if (!isUnhandledTag) {
+                    CloseHandle(hFile);
+                    return win32_xstat_impl(path, result, TRUE);
+                }
+            }
+        }
+
         if (!GetFileInformationByHandle(hFile, &fileInfo)) {
             switch (GetLastError()) {
             case ERROR_INVALID_PARAMETER:
@@ -3925,15 +3955,14 @@ os__getfinalpathname_impl(PyObject *module, path_t *path)
 {
     HANDLE hFile;
     wchar_t buf[MAXPATHLEN], *target_path = buf;
-    wchar_t szTempFile[MAX_PATH], *szTemp = szTempFile;
-    size_t buf_size = Py_ARRAY_LENGTH(buf);
-    size_t result_length;
+    int buf_size = Py_ARRAY_LENGTH(buf);
+    int result_length;
     PyObject *result;
 
     Py_BEGIN_ALLOW_THREADS
     hFile = CreateFileW(
         path->wide,
-		GENERIC_READ, /* desired access */
+        0, /* desired access */
         0, /* share mode */
         NULL, /* security attributes */
         OPEN_EXISTING,
@@ -3943,51 +3972,27 @@ os__getfinalpathname_impl(PyObject *module, path_t *path)
     Py_END_ALLOW_THREADS
 
     if (hFile == INVALID_HANDLE_VALUE) {
-        Py_BEGIN_ALLOW_THREADS
-        hFile = CreateFileW(
-            path->wide,
-            0, /* desired access */
-            0, /* share mode */
-            NULL, /* security attributes */
-            OPEN_EXISTING,
-            /* FILE_FLAG_BACKUP_SEMANTICS is required to open a directory */
-            FILE_FLAG_BACKUP_SEMANTICS,
-            NULL);
-        Py_END_ALLOW_THREADS
-        if (hFile == INVALID_HANDLE_VALUE)
-          return win32_error_object("CreateFileW", path->object);
+        return win32_error_object("CreateFileW", path->object);
     }
 
     /* We have a good handle to the target, use it to determine the
        target path name. */
     while (1) {
         Py_BEGIN_ALLOW_THREADS
-        result_length = GetFinalPathNameByHandleW_XP(hFile, target_path,
+        result_length = GetFinalPathNameByHandleW(hFile, target_path,
                                                   buf_size, VOLUME_NAME_DOS);
         Py_END_ALLOW_THREADS
-        
+
         if (!result_length) {
-          wcsncpy_s(target_path, MAX_PATH, path->wide, wcslen(path->wide));
-         // StringCchPrintf(target_path, MAX_PATH, L"%s", path->wide);
-        }
-        Py_BEGIN_ALLOW_THREADS
-        GetFullPathNameW (target_path, MAX_PATH, szTemp, NULL);
-        Py_END_ALLOW_THREADS
-        //StringCchCopyN(target_path, MAX_PATH, szTempFile, wcslen(szTempFile));
-        if (wcsstr(szTemp,L"\\\\?\\")) {
-          wcsncpy_s(target_path, MAX_PATH, szTemp, wcslen(szTempFile));
-        }else {
-          StringCchPrintf(target_path, MAX_PATH, L"\\\\?\\%s", szTemp);
-        }
-        result_length = wcslen(target_path);
-	    if (!result_length) {
             result = win32_error_object("GetFinalPathNameByHandleW",
                                          path->object);
             goto cleanup;
         }
+
         if (result_length < buf_size) {
             break;
         }
+
         wchar_t *tmp;
         tmp = PyMem_Realloc(target_path != buf ? target_path : NULL,
                             result_length * sizeof(*tmp));
@@ -3995,13 +4000,16 @@ os__getfinalpathname_impl(PyObject *module, path_t *path)
             result = PyErr_NoMemory();
             goto cleanup;
         }
+
         buf_size = result_length;
         target_path = tmp;
     }
+
     result = PyUnicode_FromWideChar(target_path, result_length);
     if (result && path->narrow) {
         Py_SETREF(result, PyUnicode_EncodeFSDefault(result));
     }
+
 cleanup:
     if (target_path != buf) {
         PyMem_Free(target_path);
@@ -8222,8 +8230,8 @@ os_symlink_impl(PyObject *module, path_t *src, path_t *dst,
     if (target_is_directory || _check_dirW(src->wide, dst->wide)) {
         flags |= SYMBOLIC_LINK_FLAG_DIRECTORY;
     }
-	result = 0;
-    //result = CreateSymbolicLinkW(dst->wide, src->wide, flags);
+
+    result = CreateSymbolicLinkW(dst->wide, src->wide, flags);
     _Py_END_SUPPRESS_IPH
     Py_END_ALLOW_THREADS
 
@@ -8243,7 +8251,7 @@ os_symlink_impl(PyObject *module, path_t *src, path_t *dst,
         calls to CreateSymbolicLink.
         */
         flags &= ~(SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE);
-        //result = CreateSymbolicLinkW(dst->wide, src->wide, flags);
+        result = CreateSymbolicLinkW(dst->wide, src->wide, flags);
         _Py_END_SUPPRESS_IPH
         Py_END_ALLOW_THREADS
 
@@ -12454,9 +12462,8 @@ os_cpu_count_impl(PyObject *module)
     int ncpu = 0;
 #ifdef MS_WINDOWS
     /* Declare prototype here to avoid pulling in all of the Win7 APIs in 3.8 */
-//    DWORD WINAPI GetActiveProcessorCount(WORD group);
-//    ncpu = GetActiveProcessorCount(ALL_PROCESSOR_GROUPS);
-      ncpu = 1;
+    DWORD WINAPI GetActiveProcessorCount(WORD group);
+    ncpu = GetActiveProcessorCount(ALL_PROCESSOR_GROUPS);
 #elif defined(__hpux)
     ncpu = mpctl(MPC_GETNUMSPUS, NULL, NULL);
 #elif defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)
@@ -13686,10 +13693,10 @@ error:
 /* bpo-36085: Helper functions for managing DLL search directories
  * on win32
  */
-/*
+
 typedef DLL_DIRECTORY_COOKIE (WINAPI *PAddDllDirectory)(PCWSTR newDirectory);
 typedef BOOL (WINAPI *PRemoveDllDirectory)(DLL_DIRECTORY_COOKIE cookie);
-*/
+
 /*[clinic input]
 os._add_dll_directory
 
@@ -13709,7 +13716,33 @@ static PyObject *
 os__add_dll_directory_impl(PyObject *module, path_t *path)
 /*[clinic end generated code: output=80b025daebb5d683 input=1de3e6c13a5808c8]*/
 {
-    return win32_error_object_err("add_dll_directory", path->object, ERROR_CALL_NOT_IMPLEMENTED);
+    HMODULE hKernel32;
+    PAddDllDirectory AddDllDirectory;
+    DLL_DIRECTORY_COOKIE cookie = 0;
+    DWORD err = 0;
+
+    if (PySys_Audit("os.add_dll_directory", "(O)", path->object) < 0) {
+        return NULL;
+    }
+
+    /* For Windows 7, we have to load this. As this will be a fairly
+       infrequent operation, just do it each time. Kernel32 is always
+       loaded. */
+    Py_BEGIN_ALLOW_THREADS
+    if (!(hKernel32 = GetModuleHandleW(L"kernel32")) ||
+        !(AddDllDirectory = (PAddDllDirectory)GetProcAddress(
+            hKernel32, "AddDllDirectory")) ||
+        !(cookie = (*AddDllDirectory)(path->wide))) {
+        err = GetLastError();
+    }
+    Py_END_ALLOW_THREADS
+
+    if (err) {
+        return win32_error_object_err("add_dll_directory",
+                                      path->object, err);
+    }
+
+    return PyCapsule_New(cookie, "DLL directory cookie", NULL);
 }
 
 /*[clinic input]
@@ -13728,7 +13761,42 @@ static PyObject *
 os__remove_dll_directory_impl(PyObject *module, PyObject *cookie)
 /*[clinic end generated code: output=594350433ae535bc input=c1d16a7e7d9dc5dc]*/
 {
-        return win32_error_object_err("remove_dll_directory", NULL, ERROR_CALL_NOT_IMPLEMENTED);
+    HMODULE hKernel32;
+    PRemoveDllDirectory RemoveDllDirectory;
+    DLL_DIRECTORY_COOKIE cookieValue;
+    DWORD err = 0;
+
+    if (!PyCapsule_IsValid(cookie, "DLL directory cookie")) {
+        PyErr_SetString(PyExc_TypeError,
+            "Provided cookie was not returned from os.add_dll_directory");
+        return NULL;
+    }
+
+    cookieValue = (DLL_DIRECTORY_COOKIE)PyCapsule_GetPointer(
+        cookie, "DLL directory cookie");
+
+    /* For Windows 7, we have to load this. As this will be a fairly
+       infrequent operation, just do it each time. Kernel32 is always
+       loaded. */
+    Py_BEGIN_ALLOW_THREADS
+    if (!(hKernel32 = GetModuleHandleW(L"kernel32")) ||
+        !(RemoveDllDirectory = (PRemoveDllDirectory)GetProcAddress(
+            hKernel32, "RemoveDllDirectory")) ||
+        !(*RemoveDllDirectory)(cookieValue)) {
+        err = GetLastError();
+    }
+    Py_END_ALLOW_THREADS
+
+    if (err) {
+        return win32_error_object_err("remove_dll_directory",
+                                      NULL, err);
+    }
+
+    if (PyCapsule_SetName(cookie, NULL)) {
+        return NULL;
+    }
+
+    Py_RETURN_NONE;
 }
 
 #endif
@@ -14784,107 +14852,3 @@ INITFUNC(void)
 #ifdef __cplusplus
 }
 #endif
-
-#define BUFSIZE 256
-DWORD GetFinalPathNameByHandleW_XP(HANDLE hFile, LPWSTR  lpszFilePath, DWORD  cchFilePath, DWORD  dwFlags)
-//https://docs.microsoft.com/ru-ru/windows/win32/memory/obtaining-a-file-name-from-a-file-handle?redirectedfrom=MSDN
-{
-	BOOL bSuccess = FALSE;
-	//TCHAR pszFilename[MAX_PATH + 1];
-	//static WCHAR pszFilename[BUFSIZE];
-	WCHAR * pszFilename = lpszFilePath;
-	HANDLE hFileMap;
-
-	// Get the file size.
-	DWORD dwFileSizeHi = 0;
-	DWORD dwFileSizeLo = GetFileSize(hFile, &dwFileSizeHi);
-	if (dwFileSizeLo == 0 && dwFileSizeHi == 0)
-	{
-//		printf("Cannot map a file with a length of zero__11__.\n");
-		return FALSE;
-	}
-	// Create a file mapping object.
-	hFileMap = CreateFileMapping(hFile,
-		NULL,
-		PAGE_READONLY,
-		0,
-		1,
-		NULL);
-
-	if (hFileMap)
-	{
-		// Create a file mapping to get the file name.
-		void* pMem = MapViewOfFile(hFileMap, FILE_MAP_READ, 0, 0, 1);
-
-		if (pMem)
-		{
-			if (GetMappedFileNameW(GetCurrentProcess(),
-				pMem,
-				pszFilename,
-				MAX_PATH))
-			{
-				// Translate path with device name to drive letters.
-				WCHAR szTemp[BUFSIZE];
-				szTemp[0] = '\0';
-
-				if (GetLogicalDriveStringsW(BUFSIZE - 1, szTemp))
-				{
-					WCHAR szName[MAX_PATH];
-					WCHAR szDrive[3] = TEXT(L" :");
-					BOOL bFound = FALSE;
-					WCHAR* p = szTemp;
-
-					do
-					{
-						// Copy the drive letter to the template string
-						*szDrive = *p;
-
-						// Look up each device name
-						if (QueryDosDeviceW(szDrive, szName, MAX_PATH))
-						{
-							size_t uNameLen = wcslen(szName);
-
-							if (uNameLen < MAX_PATH)
-							{
-								bFound = _wcsnicmp(pszFilename, szName, uNameLen) == 0
-									&& *(pszFilename + uNameLen) == L'\\';
-
-								if (bFound)
-								{
-									// Reconstruct pszFilename using szTempFile
-									// Replace device path with DOS path
-									WCHAR szTempFile[MAX_PATH];
-									StringCchPrintf(szTempFile,
-										MAX_PATH,
-										TEXT(L"\\\\?\\%s%s"),
-										szDrive,
-										pszFilename + uNameLen);
-									StringCchCopyN(pszFilename, MAX_PATH + 1, szTempFile, wcslen(szTempFile));
-								}
-							}
-						}
-
-						// Go to the next NULL character.
-						while (*p++);
-					} while (!bFound && *p); // end of string
-					WCHAR devMup[] = L"\\Device\\Mup";
-					if (wcsstr(pszFilename, devMup) == pszFilename) {
-						WCHAR szTempFile[MAX_PATH];
-						StringCchPrintf(szTempFile,
-							MAX_PATH,
-							TEXT(L"\\\\?\\UNC%s"),
-							pszFilename + wcslen(devMup));
-						StringCchCopyN(pszFilename, MAX_PATH + 1, szTempFile, wcslen(szTempFile));
-					}
-				}
-			}
-			bSuccess = TRUE;
-			UnmapViewOfFile(pMem);
-		}
-		CloseHandle(hFileMap);
-		lpszFilePath = pszFilename;
-		return wcslen(pszFilename);
-	} else {
-		return FALSE;
-	}
-}
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index e8acf000d2..5406f8b46f 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -344,10 +344,9 @@ http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/net/getaddrinfo.c.diff?r1=1.82&
 #endif /* MS_WINDOWS */
 
 /* Provides the IsWindows7SP1OrGreater() function */
-//#include <versionhelpers.h>
-#define IsWindows7SP1OrGreater() 0
+#include <versionhelpers.h>
 // For if_nametoindex() and if_indextoname()
-//#include <iphlpapi.h>
+#include <iphlpapi.h>
 
 /* remove some flags on older version Windows during run-time.
    https://msdn.microsoft.com/en-us/library/windows/desktop/ms738596.aspx */
@@ -6683,13 +6682,88 @@ Set the default timeout in seconds (float) for new socket objects.\n\
 A value of None indicates that new socket objects have no timeout.\n\
 When the socket module is first imported, the default is None.");
 
-#if defined(HAVE_IF_NAMEINDEX)
+#if defined(HAVE_IF_NAMEINDEX) || defined(MS_WINDOWS)
 /* Python API for getting interface indices and names */
 
 static PyObject *
 socket_if_nameindex(PyObject *self, PyObject *arg)
 {
-    return PyErr_SetFromWindowsErr(ERROR_CALL_NOT_IMPLEMENTED);
+    PyObject *list = PyList_New(0);
+    if (list == NULL) {
+        return NULL;
+    }
+#ifdef MS_WINDOWS
+    PMIB_IF_TABLE2 tbl;
+    int ret;
+    if ((ret = GetIfTable2Ex(MibIfTableRaw, &tbl)) != NO_ERROR) {
+        Py_DECREF(list);
+        // ret is used instead of GetLastError()
+        return PyErr_SetFromWindowsErr(ret);
+    }
+    for (ULONG i = 0; i < tbl->NumEntries; ++i) {
+        MIB_IF_ROW2 r = tbl->Table[i];
+        WCHAR buf[NDIS_IF_MAX_STRING_SIZE + 1];
+        if ((ret = ConvertInterfaceLuidToNameW(&r.InterfaceLuid, buf,
+                                               Py_ARRAY_LENGTH(buf)))) {
+            Py_DECREF(list);
+            FreeMibTable(tbl);
+            // ret is used instead of GetLastError()
+            return PyErr_SetFromWindowsErr(ret);
+        }
+        PyObject *tuple = Py_BuildValue("Iu", r.InterfaceIndex, buf);
+        if (tuple == NULL || PyList_Append(list, tuple) == -1) {
+            Py_XDECREF(tuple);
+            Py_DECREF(list);
+            FreeMibTable(tbl);
+            return NULL;
+        }
+        Py_DECREF(tuple);
+    }
+    FreeMibTable(tbl);
+    return list;
+#else
+    int i;
+    struct if_nameindex *ni;
+
+    ni = if_nameindex();
+    if (ni == NULL) {
+        Py_DECREF(list);
+        PyErr_SetFromErrno(PyExc_OSError);
+        return NULL;
+    }
+
+#ifdef _Py_MEMORY_SANITIZER
+    __msan_unpoison(ni, sizeof(ni));
+    __msan_unpoison(&ni[0], sizeof(ni[0]));
+#endif
+    for (i = 0; ni[i].if_index != 0 && i < INT_MAX; i++) {
+#ifdef _Py_MEMORY_SANITIZER
+        /* This one isn't the end sentinel, the next one must exist. */
+        __msan_unpoison(&ni[i+1], sizeof(ni[0]));
+        /* Otherwise Py_BuildValue internals are flagged by MSan when
+           they access the not-msan-tracked if_name string data. */
+        {
+            char *to_sanitize = ni[i].if_name;
+            do {
+                __msan_unpoison(to_sanitize, 1);
+            } while (*to_sanitize++ != '\0');
+        }
+#endif
+        PyObject *ni_tuple = Py_BuildValue("IO&",
+                ni[i].if_index, PyUnicode_DecodeFSDefault, ni[i].if_name);
+
+        if (ni_tuple == NULL || PyList_Append(list, ni_tuple) == -1) {
+            Py_XDECREF(ni_tuple);
+            Py_DECREF(list);
+            if_freenameindex(ni);
+            return NULL;
+        }
+        Py_DECREF(ni_tuple);
+    }
+
+    if_freenameindex(ni);
+    return list;
+#endif
 }
 
 PyDoc_STRVAR(if_nameindex_doc,
@@ -6700,7 +6774,25 @@ Returns a list of network interface information (index, name) tuples.");
 static PyObject *
 socket_if_nametoindex(PyObject *self, PyObject *args)
 {
-    return PyErr_SetFromWindowsErr(ERROR_CALL_NOT_IMPLEMENTED);
+    PyObject *oname;
+#ifdef MS_WINDOWS
+    NET_IFINDEX index;
+#else
+    unsigned long index;
+#endif
+    if (!PyArg_ParseTuple(args, "O&:if_nametoindex",
+                          PyUnicode_FSConverter, &oname))
+        return NULL;
+
+    index = if_nametoindex(PyBytes_AS_STRING(oname));
+    Py_DECREF(oname);
+    if (index == 0) {
+        /* if_nametoindex() doesn't set errno */
+        PyErr_SetString(PyExc_OSError, "no interface with this name");
+        return NULL;
+    }
+
+    return PyLong_FromUnsignedLong(index);
 }
 
 PyDoc_STRVAR(if_nametoindex_doc,
@@ -6711,7 +6803,23 @@ Returns the interface index corresponding to the interface name if_name.");
 static PyObject *
 socket_if_indextoname(PyObject *self, PyObject *arg)
 {
-    return PyErr_SetFromWindowsErr(ERROR_CALL_NOT_IMPLEMENTED);
+#ifdef MS_WINDOWS
+    NET_IFINDEX index;
+#else
+    unsigned long index;
+#endif
+    char name[IF_NAMESIZE + 1];
+
+    index = PyLong_AsUnsignedLong(arg);
+    if (index == (unsigned long) -1)
+        return NULL;
+
+    if (if_indextoname(index, name) == NULL) {
+        PyErr_SetFromErrno(PyExc_OSError);
+        return NULL;
+    }
+
+    return PyUnicode_DecodeFSDefault(name);
 }
 
 PyDoc_STRVAR(if_indextoname_doc,
@@ -6841,7 +6949,7 @@ static PyMethodDef socket_methods[] = {
      METH_NOARGS, getdefaulttimeout_doc},
     {"setdefaulttimeout",       socket_setdefaulttimeout,
      METH_O, setdefaulttimeout_doc},
-#if defined(HAVE_IF_NAMEINDEX)
+#if defined(HAVE_IF_NAMEINDEX) || defined(MS_WINDOWS)
     {"if_nameindex", socket_if_nameindex,
      METH_NOARGS, if_nameindex_doc},
     {"if_nametoindex", socket_if_nametoindex,
@@ -7870,6 +7978,10 @@ PyInit__socket(void)
 #endif
 #ifdef  IPV6_UNICAST_HOPS
     PyModule_AddIntMacro(m, IPV6_UNICAST_HOPS);
+#endif
+    /* Additional IPV6 socket options, defined in RFC 3493 */
+#ifdef IPV6_V6ONLY
+    PyModule_AddIntMacro(m, IPV6_V6ONLY);
 #endif
     /* Advanced IPV6 socket options, from RFC 3542 */
 #ifdef IPV6_CHECKSUM
diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h
index 35943b1ca4..dff1f8f4e9 100644
--- a/Modules/socketmodule.h
+++ b/Modules/socketmodule.h
@@ -27,10 +27,8 @@
  * any version information.
  * I use SIO_GET_MULTICAST_FILTER to detect a decent SDK.
  */
-//#undef SIO_GET_MULTICAST_FILTER
 # ifdef SIO_GET_MULTICAST_FILTER
 #  include <mstcpip.h> /* for SIO_RCVALL */
-#  include <Wspiapi.h>
 #  define HAVE_ADDRINFO
 #  define HAVE_SOCKADDR_STORAGE
 #  define HAVE_GETADDRINFO
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index a2a1859526..28f9c9bb06 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -7442,7 +7442,7 @@ static DWORD
 encode_code_page_flags(UINT code_page, const char *errors)
 {
     if (code_page == CP_UTF8) {
-        return 0; // XP don't know about WC_ERR_INVALID_CHARS
+        return WC_ERR_INVALID_CHARS;
     }
     else if (code_page == CP_UTF7) {
         /* CP_UTF7 only supports flags=0 */
@@ -7496,15 +7496,6 @@ encode_code_page_strict(UINT code_page, PyObject **outbytes,
     }
     assert(size <= INT_MAX);
 
-    if (code_page == CP_UTF8) {
-        for (size_t i = 0; i < wcslen(p); i++) {
-            if (p[i] >= 0xD800 && p[i] <= 0xDFFF) {
-                SetLastError(ERROR_NO_UNICODE_TRANSLATION);
-                goto error;
-            }
-        }
-    }
-
     /* First get the size of the result */
     outsize = WideCharToMultiByte(code_page, flags,
                                   p, (int)size,
@@ -7656,14 +7647,11 @@ encode_code_page_errors(UINT code_page, PyObject **outbytes,
             chars[1] = Py_UNICODE_LOW_SURROGATE(ch);
             charsize = 2;
         }
-        if (code_page == CP_UTF8 && ch >= 0xD800 && ch <= 0xDFFF) {
-            outsize = 0;
-        } else {
-            outsize = WideCharToMultiByte(code_page, flags,
-                chars, charsize,
-                buffer, Py_ARRAY_LENGTH(buffer),
-                NULL, pusedDefaultChar);
-        }
+
+        outsize = WideCharToMultiByte(code_page, flags,
+                                      chars, charsize,
+                                      buffer, Py_ARRAY_LENGTH(buffer),
+                                      NULL, pusedDefaultChar);
         if (outsize > 0) {
             if (pusedDefaultChar == NULL || !(*pusedDefaultChar))
             {
diff --git a/PC/bdist_wininst/bdist_wininst.vcxproj b/PC/bdist_wininst/bdist_wininst.vcxproj
index e4a5060440..d2f1bb75e3 100644
--- a/PC/bdist_wininst/bdist_wininst.vcxproj
+++ b/PC/bdist_wininst/bdist_wininst.vcxproj
@@ -54,7 +54,6 @@
     <ProjectGuid>{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}</ProjectGuid>
     <RootNamespace>wininst</RootNamespace>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="..\..\PCbuild\python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -63,12 +62,6 @@
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
diff --git a/PC/bdist_wininst/bdist_wininst.vcxproj.filters b/PC/bdist_wininst/bdist_wininst.vcxproj.filters
index 2f1d034d98..b4b6a4d514 100644
--- a/PC/bdist_wininst/bdist_wininst.vcxproj.filters
+++ b/PC/bdist_wininst/bdist_wininst.vcxproj.filters
@@ -18,43 +18,43 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="extract.c">
+    <ClCompile Include="..\PC\bdist_wininst\extract.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="install.c">
+    <ClCompile Include="..\PC\bdist_wininst\install.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\Modules\zlib\adler32.c">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="..\Modules\zlib\adler32.c">
+      <Filter>Source Files\zlib</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\Modules\zlib\crc32.c">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="..\Modules\zlib\crc32.c">
+      <Filter>Source Files\zlib</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\Modules\zlib\inffast.c">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="..\Modules\zlib\inffast.c">
+      <Filter>Source Files\zlib</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\Modules\zlib\inflate.c">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="..\Modules\zlib\inflate.c">
+      <Filter>Source Files\zlib</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\Modules\zlib\inftrees.c">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="..\Modules\zlib\inftrees.c">
+      <Filter>Source Files\zlib</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\Modules\zlib\zutil.c">
-      <Filter>Source Files</Filter>
+    <ClCompile Include="..\Modules\zlib\zutil.c">
+      <Filter>Source Files\zlib</Filter>
     </ClCompile>
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="archive.h">
+    <ClInclude Include="..\PC\bdist_wininst\archive.h">
       <Filter>Header Files</Filter>
     </ClInclude>
   </ItemGroup>
   <ItemGroup>
-    <ResourceCompile Include="install.rc">
-      <Filter>Source Files</Filter>
+    <ResourceCompile Include="..\PC\bdist_wininst\install.rc">
+      <Filter>Resource Files</Filter>
     </ResourceCompile>
   </ItemGroup>
   <ItemGroup>
-    <None Include="PythonPowered.bmp">
+    <None Include="..\PC\bdist_wininst\PythonPowered.bmp">
       <Filter>Resource Files</Filter>
     </None>
   </ItemGroup>
diff --git a/PC/pyconfig.h b/PC/pyconfig.h
index 0d4df2c93f..4f6846b3f0 100644
--- a/PC/pyconfig.h
+++ b/PC/pyconfig.h
@@ -138,7 +138,7 @@ WIN32 is still required for the locale module.
 /* Python 3.5+ requires Windows Vista or greater */
 #define Py_WINVER 0x0600 /* _WIN32_WINNT_VISTA */
 #define Py_NTDDI NTDDI_VISTA
-#undef HAVE_IF_NAMEINDEX
+
 /* We only set these values when building Python - we don't want to force
    these values on extensions, as that will affect the prototypes and
    structures exposed in the Windows headers. Even when building Python, we
diff --git a/PC/pylauncher.rc b/PC/pylauncher.rc
index 8ed156fb40..92987af713 100644
--- a/PC/pylauncher.rc
+++ b/PC/pylauncher.rc
@@ -4,7 +4,7 @@
 
 // Include the manifest file that indicates we support all
 // current versions of Windows.
-//#include <winuser.h>
+#include <winuser.h>
 1 RT_MANIFEST "python.manifest"
 
 #if defined(PY_ICON)
diff --git a/PCbuild/_asyncio.vcxproj b/PCbuild/_asyncio.vcxproj
index e5f5bb792e..ed1e1bc0a4 100644
--- a/PCbuild/_asyncio.vcxproj
+++ b/PCbuild/_asyncio.vcxproj
@@ -70,7 +70,6 @@
     <ProjectGuid>{384C224A-7474-476E-A01B-750EA7DE918C}</ProjectGuid>
     <RootNamespace>_asyncio</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -78,12 +77,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
@@ -113,4 +106,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/_bz2.vcxproj b/PCbuild/_bz2.vcxproj
index a251e7f079..3fe95fbf83 100644
--- a/PCbuild/_bz2.vcxproj
+++ b/PCbuild/_bz2.vcxproj
@@ -70,7 +70,6 @@
     <ProjectGuid>{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}</ProjectGuid>
     <RootNamespace>bz2</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -78,12 +77,7 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
+  <PropertyGroup Label="Configuration" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
diff --git a/PCbuild/_bz2.vcxproj.filters b/PCbuild/_bz2.vcxproj.filters
index e8c0721ab4..eac64dd29d 100644
--- a/PCbuild/_bz2.vcxproj.filters
+++ b/PCbuild/_bz2.vcxproj.filters
@@ -45,7 +45,4 @@
       <Filter>bzip2 1.0.6 Header Files</Filter>
     </ClInclude>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/_ctypes.vcxproj b/PCbuild/_ctypes.vcxproj
index 80aee0157e..69e4271a9b 100644
--- a/PCbuild/_ctypes.vcxproj
+++ b/PCbuild/_ctypes.vcxproj
@@ -70,7 +70,6 @@
     <ProjectGuid>{0E9791DB-593A-465F-98BC-681011311618}</ProjectGuid>
     <RootNamespace>_ctypes</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -78,12 +77,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
@@ -128,4 +121,4 @@
     </ProjectReference>
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/_ctypes_test.vcxproj b/PCbuild/_ctypes_test.vcxproj
index e776ca3fa1..8a01e743a4 100644
--- a/PCbuild/_ctypes_test.vcxproj
+++ b/PCbuild/_ctypes_test.vcxproj
@@ -71,7 +71,6 @@
     <RootNamespace>_ctypes_test</RootNamespace>
     <Keyword>Win32Proj</Keyword>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
diff --git a/PCbuild/_ctypes_test.vcxproj.filters b/PCbuild/_ctypes_test.vcxproj.filters
index 507397e323..c1e94ce1fa 100644
--- a/PCbuild/_ctypes_test.vcxproj.filters
+++ b/PCbuild/_ctypes_test.vcxproj.filters
@@ -18,7 +18,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/_decimal.vcxproj b/PCbuild/_decimal.vcxproj
index efc4b4c4b0..465a7ade9a 100644
--- a/PCbuild/_decimal.vcxproj
+++ b/PCbuild/_decimal.vcxproj
@@ -70,7 +70,6 @@
     <ProjectGuid>{0E9791DB-593A-465F-98BC-681011311617}</ProjectGuid>
     <RootNamespace>_decimal</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -78,12 +77,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
@@ -164,4 +157,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/_decimal.vcxproj.filters b/PCbuild/_decimal.vcxproj.filters
index 51f591a01c..7e19aa2f65 100644
--- a/PCbuild/_decimal.vcxproj.filters
+++ b/PCbuild/_decimal.vcxproj.filters
@@ -113,7 +113,4 @@
       <Filter>Source Files</Filter>
     </CustomBuild>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/_elementtree.vcxproj b/PCbuild/_elementtree.vcxproj
index 6838d9bc20..4a125b243b 100644
--- a/PCbuild/_elementtree.vcxproj
+++ b/PCbuild/_elementtree.vcxproj
@@ -70,7 +70,6 @@
     <ProjectGuid>{17E1E049-C309-4D79-843F-AE483C264AEA}</ProjectGuid>
     <RootNamespace>_elementtree</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -78,12 +77,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
@@ -139,4 +132,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/_elementtree.vcxproj.filters b/PCbuild/_elementtree.vcxproj.filters
index d704c8f41a..6acdf35846 100644
--- a/PCbuild/_elementtree.vcxproj.filters
+++ b/PCbuild/_elementtree.vcxproj.filters
@@ -69,7 +69,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/_freeze_importlib.vcxproj b/PCbuild/_freeze_importlib.vcxproj
index 9a38443deb..a0fe49c464 100644
--- a/PCbuild/_freeze_importlib.vcxproj
+++ b/PCbuild/_freeze_importlib.vcxproj
@@ -71,7 +71,6 @@
     <Keyword>Win32Proj</Keyword>
     <RootNamespace>_freeze_importlib</RootNamespace>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <ConfigurationType>Application</ConfigurationType>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
@@ -135,21 +128,26 @@
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
   <Target Name="_RebuildImportLib">
-    <Exec Command="&quot;$(TargetPath)&quot; &quot;%(None.ModName)&quot; &quot;%(None.FullPath)&quot; &quot;%(None.IntFile)&quot;" />
+    <Exec Command='"$(TargetPath)" "%(None.ModName)" "%(None.FullPath)" "%(None.IntFile)"' />
+    
     <PropertyGroup>
-      <_OldContent Condition="Exists($(OutTargetPath))">
-      </_OldContent>
-      <_NewContent Condition="Exists($(IntTargetPath))">$([System.IO.File]::ReadAllText($(IntTargetPath)).Replace(`
-`, `
-`))</_NewContent>
+      <_OldContent Condition="Exists($(OutTargetPath))"></_OldContent>
+      <_NewContent Condition="Exists($(IntTargetPath))">$([System.IO.File]::ReadAllText($(IntTargetPath)).Replace(`&#x0D;&#x0A;`, `&#x0A;`))</_NewContent>
     </PropertyGroup>
-    <Copy SourceFiles="%(None.IntFile)" DestinationFiles="%(None.OutFile)" Condition="!Exists(%(None.OutFile)) or (Exists(%(None.IntFile)) and '$([System.IO.File]::ReadAllText(%(None.OutFile)).Replace(`&#xD;&#xA;`, `&#xA;`))' != '$([System.IO.File]::ReadAllText(%(None.IntFile)).Replace(`&#xD;&#xA;`, `&#xA;`))')">
+    
+    <Copy SourceFiles="%(None.IntFile)"
+          DestinationFiles="%(None.OutFile)"
+          Condition="!Exists(%(None.OutFile)) or (Exists(%(None.IntFile)) and '$([System.IO.File]::ReadAllText(%(None.OutFile)).Replace(`&#x0D;&#x0A;`, `&#x0A;`))' != '$([System.IO.File]::ReadAllText(%(None.IntFile)).Replace(`&#x0D;&#x0A;`, `&#x0A;`))')">
       <Output TaskParameter="CopiedFiles" ItemName="_Updated" />
     </Copy>
-    <Warning Text="@(_Updated->'%(Filename)%(Extension)',', ') updated. You will need to rebuild pythoncore to see the changes.%0D%0A%0D%0AIf you are not developing on Windows but you see this error on a continuous integration build, you need to run 'make regen-all' and commit any changes." Condition="'@(_Updated)' != '' and $(Configuration) == 'Debug'" />
-    <Error Text="@(_Updated->'%(Filename)%(Extension)',', ') updated. You will need to rebuild pythoncore to see the changes.%0D%0A%0D%0AIf you are not developing on Windows but you see this error on a continuous integration build, you need to run 'make regen-all' and commit any changes." Condition="'@(_Updated)' != '' and $(Configuration) == 'Release'" />
+    
+    <Warning Text="@(_Updated->'%(Filename)%(Extension)',', ') updated. You will need to rebuild pythoncore to see the changes.%0D%0A%0D%0AIf you are not developing on Windows but you see this error on a continuous integration build, you need to run 'make regen-all' and commit any changes."
+             Condition="'@(_Updated)' != '' and $(Configuration) == 'Debug'" />
+    <Error Text="@(_Updated->'%(Filename)%(Extension)',', ') updated. You will need to rebuild pythoncore to see the changes.%0D%0A%0D%0AIf you are not developing on Windows but you see this error on a continuous integration build, you need to run 'make regen-all' and commit any changes."
+           Condition="'@(_Updated)' != '' and $(Configuration) == 'Release'" />
   </Target>
-  <Target Name="RebuildImportLib" AfterTargets="AfterBuild" Condition="$(Configuration) == 'Debug' or $(Configuration) == 'Release'" DependsOnTargets="_RebuildImportLib">
+  <Target Name="RebuildImportLib" AfterTargets="AfterBuild" Condition="$(Configuration) == 'Debug' or $(Configuration) == 'Release'"
+          DependsOnTargets="_RebuildImportLib">
   </Target>
   <Target Name="_CleanImportLib" BeforeTargets="CoreClean">
     <ItemGroup>
@@ -158,4 +156,4 @@
       <Clean Include="$(IntDir)importlib_zipimport.g.h" />
     </ItemGroup>
   </Target>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/_freeze_importlib.vcxproj.filters b/PCbuild/_freeze_importlib.vcxproj.filters
index a436a83522..ccad053a9f 100644
--- a/PCbuild/_freeze_importlib.vcxproj.filters
+++ b/PCbuild/_freeze_importlib.vcxproj.filters
@@ -23,7 +23,5 @@
     <None Include="..\Lib\importlib\_bootstrap.py">
       <Filter>Source Files</Filter>
     </None>
-    <None Include="..\Lib\importlib\_bootstrap_external.py" />
-    <None Include="..\Lib\zipimport.py" />
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/_hashlib.vcxproj b/PCbuild/_hashlib.vcxproj
index 351012e1ec..6dad8183c5 100644
--- a/PCbuild/_hashlib.vcxproj
+++ b/PCbuild/_hashlib.vcxproj
@@ -70,7 +70,6 @@
     <ProjectGuid>{447F05A8-F581-4CAC-A466-5AC7936E207E}</ProjectGuid>
     <RootNamespace>_hashlib</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -78,12 +77,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
@@ -101,7 +94,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <Link>
-      <AdditionalDependencies>ws2_32.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
@@ -119,4 +112,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/_hashlib.vcxproj.filters b/PCbuild/_hashlib.vcxproj.filters
index 0258016b52..a9d993eb3e 100644
--- a/PCbuild/_hashlib.vcxproj.filters
+++ b/PCbuild/_hashlib.vcxproj.filters
@@ -10,7 +10,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/_lzma.vcxproj b/PCbuild/_lzma.vcxproj
index e8150503ee..fe076a6fc5 100644
--- a/PCbuild/_lzma.vcxproj
+++ b/PCbuild/_lzma.vcxproj
@@ -70,7 +70,6 @@
     <ProjectGuid>{F9D71780-F393-11E0-BE50-0800200C9A66}</ProjectGuid>
     <RootNamespace>lzma</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -78,12 +77,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
@@ -126,4 +119,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/_lzma.vcxproj.filters b/PCbuild/_lzma.vcxproj.filters
index ca4b619664..0c5ed74608 100644
--- a/PCbuild/_lzma.vcxproj.filters
+++ b/PCbuild/_lzma.vcxproj.filters
@@ -10,7 +10,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/_msi.vcxproj b/PCbuild/_msi.vcxproj
index ae2e236bd7..720eb2931b 100644
--- a/PCbuild/_msi.vcxproj
+++ b/PCbuild/_msi.vcxproj
@@ -71,7 +71,6 @@
     <RootNamespace>_msi</RootNamespace>
     <Keyword>Win32Proj</Keyword>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
diff --git a/PCbuild/_msi.vcxproj.filters b/PCbuild/_msi.vcxproj.filters
index 3033858d9b..7dec52de0b 100644
--- a/PCbuild/_msi.vcxproj.filters
+++ b/PCbuild/_msi.vcxproj.filters
@@ -10,7 +10,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/_multiprocessing.vcxproj b/PCbuild/_multiprocessing.vcxproj
index 3f89f2083b..77b6bfc8e1 100644
--- a/PCbuild/_multiprocessing.vcxproj
+++ b/PCbuild/_multiprocessing.vcxproj
@@ -70,7 +70,6 @@
     <ProjectGuid>{9E48B300-37D1-11DD-8C41-005056C00008}</ProjectGuid>
     <RootNamespace>_multiprocessing</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -78,12 +77,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
diff --git a/PCbuild/_multiprocessing.vcxproj.filters b/PCbuild/_multiprocessing.vcxproj.filters
index 89975096f4..78133ec0ec 100644
--- a/PCbuild/_multiprocessing.vcxproj.filters
+++ b/PCbuild/_multiprocessing.vcxproj.filters
@@ -21,7 +21,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/_overlapped.vcxproj b/PCbuild/_overlapped.vcxproj
index 4e6620b796..9e60d3b5db 100644
--- a/PCbuild/_overlapped.vcxproj
+++ b/PCbuild/_overlapped.vcxproj
@@ -70,7 +70,6 @@
     <ProjectGuid>{EB6E69DD-04BF-4543-9B92-49FAABCEAC2E}</ProjectGuid>
     <RootNamespace>_overlapped</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -78,12 +77,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
diff --git a/PCbuild/_overlapped.vcxproj.filters b/PCbuild/_overlapped.vcxproj.filters
index 78a9aa1468..78de895055 100644
--- a/PCbuild/_overlapped.vcxproj.filters
+++ b/PCbuild/_overlapped.vcxproj.filters
@@ -10,7 +10,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/_queue.vcxproj b/PCbuild/_queue.vcxproj
index 2d602fff80..8065b23585 100644
--- a/PCbuild/_queue.vcxproj
+++ b/PCbuild/_queue.vcxproj
@@ -70,7 +70,6 @@
     <ProjectGuid>{78D80A15-BD8C-44E2-B49E-1F05B0A0A687}</ProjectGuid>
     <RootNamespace>_queue</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -78,12 +77,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
@@ -113,4 +106,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/_socket.vcxproj b/PCbuild/_socket.vcxproj
index b6551a430f..8fd75f90e7 100644
--- a/PCbuild/_socket.vcxproj
+++ b/PCbuild/_socket.vcxproj
@@ -70,7 +70,6 @@
     <ProjectGuid>{86937F53-C189-40EF-8CE8-8759D8E7D480}</ProjectGuid>
     <RootNamespace>_socket</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -78,12 +77,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
diff --git a/PCbuild/_socket.vcxproj.filters b/PCbuild/_socket.vcxproj.filters
index 8448e80527..790ffa80dd 100644
--- a/PCbuild/_socket.vcxproj.filters
+++ b/PCbuild/_socket.vcxproj.filters
@@ -18,7 +18,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/_sqlite3.vcxproj b/PCbuild/_sqlite3.vcxproj
index 4a4728e237..7e0062692b 100644
--- a/PCbuild/_sqlite3.vcxproj
+++ b/PCbuild/_sqlite3.vcxproj
@@ -70,7 +70,6 @@
     <ProjectGuid>{13CECB97-4119-4316-9D42-8534019A5A44}</ProjectGuid>
     <RootNamespace>_sqlite3</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -78,12 +77,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
diff --git a/PCbuild/_sqlite3.vcxproj.filters b/PCbuild/_sqlite3.vcxproj.filters
index f164882edc..dce77c96a8 100644
--- a/PCbuild/_sqlite3.vcxproj.filters
+++ b/PCbuild/_sqlite3.vcxproj.filters
@@ -66,7 +66,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/_ssl.vcxproj b/PCbuild/_ssl.vcxproj
index 959d276ae6..4907f49b66 100644
--- a/PCbuild/_ssl.vcxproj
+++ b/PCbuild/_ssl.vcxproj
@@ -70,7 +70,6 @@
     <ProjectGuid>{C6E20F84-3247-4AD6-B051-B073268F73BA}</ProjectGuid>
     <RootNamespace>_ssl</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -78,12 +77,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
@@ -106,6 +99,9 @@
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="..\Modules\_ssl.c" />
+    <ClCompile Include="$(opensslIncludeDir)\applink.c">
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;$(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="..\PC\python_nt.rc" />
diff --git a/PCbuild/_ssl.vcxproj.filters b/PCbuild/_ssl.vcxproj.filters
index 1384aeff1f..bd46b60984 100644
--- a/PCbuild/_ssl.vcxproj.filters
+++ b/PCbuild/_ssl.vcxproj.filters
@@ -9,6 +9,9 @@
     <ClCompile Include="..\Modules\_ssl.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="$(opensslIncludeDir)\applink.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="..\PC\python_nt.rc" />
diff --git a/PCbuild/_testbuffer.vcxproj b/PCbuild/_testbuffer.vcxproj
index dace0bf651..917d7ae50f 100644
--- a/PCbuild/_testbuffer.vcxproj
+++ b/PCbuild/_testbuffer.vcxproj
@@ -71,7 +71,6 @@
     <RootNamespace>_testbuffer</RootNamespace>
     <Keyword>Win32Proj</Keyword>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
diff --git a/PCbuild/_testbuffer.vcxproj.filters b/PCbuild/_testbuffer.vcxproj.filters
index e917e68e0e..eadf282750 100644
--- a/PCbuild/_testbuffer.vcxproj.filters
+++ b/PCbuild/_testbuffer.vcxproj.filters
@@ -10,7 +10,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/_testcapi.vcxproj b/PCbuild/_testcapi.vcxproj
index fe6f215721..c1a1943725 100644
--- a/PCbuild/_testcapi.vcxproj
+++ b/PCbuild/_testcapi.vcxproj
@@ -71,7 +71,6 @@
     <RootNamespace>_testcapi</RootNamespace>
     <Keyword>Win32Proj</Keyword>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
diff --git a/PCbuild/_testcapi.vcxproj.filters b/PCbuild/_testcapi.vcxproj.filters
index 9678dea363..7a6ad1a864 100644
--- a/PCbuild/_testcapi.vcxproj.filters
+++ b/PCbuild/_testcapi.vcxproj.filters
@@ -10,7 +10,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/_testconsole.vcxproj b/PCbuild/_testconsole.vcxproj
index 3108a9f862..5d7e14eff1 100644
--- a/PCbuild/_testconsole.vcxproj
+++ b/PCbuild/_testconsole.vcxproj
@@ -71,7 +71,6 @@
     <Keyword>Win32Proj</Keyword>
     <RootNamespace>_testconsole</RootNamespace>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
diff --git a/PCbuild/_testconsole.vcxproj.filters b/PCbuild/_testconsole.vcxproj.filters
index 831a4a6a53..0c25101e1b 100644
--- a/PCbuild/_testconsole.vcxproj.filters
+++ b/PCbuild/_testconsole.vcxproj.filters
@@ -15,13 +15,8 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\PC\_testconsole.c">
+    <ClCompile Include="..\Modules\_testmultiphase.c">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc">
-      <Filter>Resource Files</Filter>
-    </ResourceCompile>
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/_testembed.vcxproj b/PCbuild/_testembed.vcxproj
index 80b5f74af7..a7ea8787e0 100644
--- a/PCbuild/_testembed.vcxproj
+++ b/PCbuild/_testembed.vcxproj
@@ -71,7 +71,6 @@
     <Keyword>Win32Proj</Keyword>
     <RootNamespace>_testembed</RootNamespace>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <ConfigurationType>Application</ConfigurationType>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
diff --git a/PCbuild/_testembed.vcxproj.filters b/PCbuild/_testembed.vcxproj.filters
index 7df948bbc1..f7f9abeb1d 100644
--- a/PCbuild/_testembed.vcxproj.filters
+++ b/PCbuild/_testembed.vcxproj.filters
@@ -19,9 +19,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc">
-      <Filter>Resource Files</Filter>
-    </ResourceCompile>
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/_testimportmultiple.vcxproj b/PCbuild/_testimportmultiple.vcxproj
index 43f89b7ef8..6d80d5779f 100644
--- a/PCbuild/_testimportmultiple.vcxproj
+++ b/PCbuild/_testimportmultiple.vcxproj
@@ -71,7 +71,6 @@
     <RootNamespace>_testimportmultiple</RootNamespace>
     <Keyword>Win32Proj</Keyword>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
@@ -114,4 +107,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/_testimportmultiple.vcxproj.filters b/PCbuild/_testimportmultiple.vcxproj.filters
index 9caede80a3..db0d0a65e1 100644
--- a/PCbuild/_testimportmultiple.vcxproj.filters
+++ b/PCbuild/_testimportmultiple.vcxproj.filters
@@ -10,7 +10,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/_testinternalcapi.vcxproj b/PCbuild/_testinternalcapi.vcxproj
index ec3cf330b5..6c5b12cd40 100644
--- a/PCbuild/_testinternalcapi.vcxproj
+++ b/PCbuild/_testinternalcapi.vcxproj
@@ -71,7 +71,6 @@
     <RootNamespace>_testinternalcapi</RootNamespace>
     <Keyword>Win32Proj</Keyword>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
@@ -114,4 +107,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/_testinternalcapi.vcxproj.filters b/PCbuild/_testinternalcapi.vcxproj.filters
index 92754fc4de..4644f230be 100644
--- a/PCbuild/_testinternalcapi.vcxproj.filters
+++ b/PCbuild/_testinternalcapi.vcxproj.filters
@@ -10,7 +10,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/_testmultiphase.vcxproj b/PCbuild/_testmultiphase.vcxproj
index c48d71ad29..430eb528cc 100644
--- a/PCbuild/_testmultiphase.vcxproj
+++ b/PCbuild/_testmultiphase.vcxproj
@@ -71,7 +71,6 @@
     <Keyword>Win32Proj</Keyword>
     <RootNamespace>_testmultiphase</RootNamespace>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
diff --git a/PCbuild/_testmultiphase.vcxproj.filters b/PCbuild/_testmultiphase.vcxproj.filters
index b88a78d4a7..0c25101e1b 100644
--- a/PCbuild/_testmultiphase.vcxproj.filters
+++ b/PCbuild/_testmultiphase.vcxproj.filters
@@ -19,9 +19,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc">
-      <Filter>Resource Files</Filter>
-    </ResourceCompile>
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/_tkinter.vcxproj b/PCbuild/_tkinter.vcxproj
index 6bb0abee3e..af813b77c1 100644
--- a/PCbuild/_tkinter.vcxproj
+++ b/PCbuild/_tkinter.vcxproj
@@ -70,7 +70,6 @@
     <ProjectGuid>{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}</ProjectGuid>
     <RootNamespace>_tkinter</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -78,12 +77,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
diff --git a/PCbuild/_tkinter.vcxproj.filters b/PCbuild/_tkinter.vcxproj.filters
index cf544464d6..4e5cd479e3 100644
--- a/PCbuild/_tkinter.vcxproj.filters
+++ b/PCbuild/_tkinter.vcxproj.filters
@@ -13,7 +13,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/liblzma.vcxproj b/PCbuild/liblzma.vcxproj
index 1871e48ecc..a6bd59ec0b 100644
--- a/PCbuild/liblzma.vcxproj
+++ b/PCbuild/liblzma.vcxproj
@@ -70,19 +70,14 @@
     <ProjectGuid>{12728250-16EC-4DC6-94D7-E21DD88947F8}</ProjectGuid>
     <RootNamespace>liblzma</RootNamespace>
     <SupportPGO>true</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
+
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+
   <PropertyGroup Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
@@ -248,4 +243,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/openssl.props b/PCbuild/openssl.props
index d11f46a824..a7e16793c7 100644
--- a/PCbuild/openssl.props
+++ b/PCbuild/openssl.props
@@ -10,7 +10,7 @@
     </Link>
   </ItemDefinitionGroup>
   <PropertyGroup>
-    <_DLLSuffix>-*</_DLLSuffix>
+    <_DLLSuffix>-1_1</_DLLSuffix>
     <_DLLSuffix Condition="$(Platform) == 'ARM'">$(_DLLSuffix)-arm</_DLLSuffix>
     <_DLLSuffix Condition="$(Platform) == 'ARM64'">$(_DLLSuffix)-arm64</_DLLSuffix>
   </PropertyGroup>
diff --git a/PCbuild/pyexpat.vcxproj b/PCbuild/pyexpat.vcxproj
index 5bda9d4986..b2d9f5d57d 100644
--- a/PCbuild/pyexpat.vcxproj
+++ b/PCbuild/pyexpat.vcxproj
@@ -70,7 +70,6 @@
     <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
     <ProjectGuid>{D06B6426-4762-44CC-8BAD-D79052507F2F}</ProjectGuid>
     <RootNamespace>pyexpat</RootNamespace>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -78,12 +77,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
@@ -123,4 +116,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/pyexpat.vcxproj.filters b/PCbuild/pyexpat.vcxproj.filters
index 723bbdd80e..f8d46026c9 100644
--- a/PCbuild/pyexpat.vcxproj.filters
+++ b/PCbuild/pyexpat.vcxproj.filters
@@ -30,7 +30,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/pylauncher.vcxproj b/PCbuild/pylauncher.vcxproj
index 1db82cd717..550e084230 100644
--- a/PCbuild/pylauncher.vcxproj
+++ b/PCbuild/pylauncher.vcxproj
@@ -71,7 +71,6 @@
     <RootNamespace>pylauncher</RootNamespace>
     <TargetName>py</TargetName>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <ConfigurationType>Application</ConfigurationType>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
@@ -118,4 +111,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/pyshellext.vcxproj b/PCbuild/pyshellext.vcxproj
index c23f6bbee7..655054e372 100644
--- a/PCbuild/pyshellext.vcxproj
+++ b/PCbuild/pyshellext.vcxproj
@@ -71,7 +71,6 @@
     <RootNamespace>pyshellext</RootNamespace>
     <TargetName>pyshellext</TargetName>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
diff --git a/PCbuild/python.props b/PCbuild/python.props
index 73ae553a15..a2d541bd76 100644
--- a/PCbuild/python.props
+++ b/PCbuild/python.props
@@ -62,8 +62,8 @@
     <libffiDir>$(ExternalsDir)libffi-3.3.0\</libffiDir>
     <libffiOutDir>$(ExternalsDir)libffi-3.3.0\$(ArchName)\</libffiOutDir>
     <libffiIncludeDir>$(libffiOutDir)include</libffiIncludeDir>
-    <opensslDir>$(ExternalsDir)openssl\</opensslDir>
-    <opensslOutDir>$(ExternalsDir)openssl\</opensslOutDir>
+    <opensslDir>$(ExternalsDir)openssl-1.1.1n\</opensslDir>
+    <opensslOutDir>$(ExternalsDir)openssl-bin-1.1.1n\$(ArchName)\</opensslOutDir>
     <opensslIncludeDir>$(opensslOutDir)include</opensslIncludeDir>
     <nasmDir>$(ExternalsDir)\nasm-2.11.06\</nasmDir>
     <zlibDir>$(ExternalsDir)\zlib-1.2.12\</zlibDir>
diff --git a/PCbuild/python.vcxproj b/PCbuild/python.vcxproj
index 6c6e3da80a..2094420a8d 100644
--- a/PCbuild/python.vcxproj
+++ b/PCbuild/python.vcxproj
@@ -68,7 +68,6 @@
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}</ProjectGuid>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -77,12 +76,6 @@
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
@@ -111,7 +104,6 @@
     <ResourceCompile Include="..\PC\python_exe.rc" />
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\externals\openssl\include\applink.c" />
     <ClCompile Include="..\Programs\python.c" />
   </ItemGroup>
   <ItemGroup>
@@ -128,7 +120,9 @@
       <UcrtName>ucrtbase</UcrtName>
       <UcrtName Condition="'$(Configuration)' == 'Debug'">ucrtbased</UcrtName>
     </PropertyGroup>
-    <Exec Command="setlocal&#xD;&#xA;set PYTHONPATH=$(PySourcePath)Lib&#xD;&#xA;&quot;$(OutDir)python$(PyDebugExt).exe&quot; &quot;$(PySourcePath)PC\validate_ucrtbase.py&quot; $(UcrtName)" ContinueOnError="true" />
+    <Exec Command='setlocal
+set PYTHONPATH=$(PySourcePath)Lib
+"$(OutDir)python$(PyDebugExt).exe" "$(PySourcePath)PC\validate_ucrtbase.py" $(UcrtName)' ContinueOnError="true" />
   </Target>
   <Target Name="GeneratePythonBat" AfterTargets="AfterBuild">
     <PropertyGroup>
@@ -153,12 +147,21 @@ $(_PGOPath)
   </Target>
   <Target Name="GenerateLicense" AfterTargets="AfterBuild">
     <ItemGroup>
-      <LicenseFiles Include="$(PySourcePath)LICENSE;&#xD;&#xA;                             $(PySourcePath)PC\crtlicense.txt;&#xD;&#xA;                             $(bz2Dir)LICENSE;&#xD;&#xA;                             $(opensslOutDir)LICENSE;&#xD;&#xA;                             $(libffiDir)LICENSE;" />
-      <LicenseFiles Include="$(tcltkDir)tcllicense.terms;&#xD;&#xA;                             $(tcltkDir)tklicense.terms;&#xD;&#xA;                             $(tcltkDir)tixlicense.terms" Condition="$(IncludeTkinter)" />
+      <LicenseFiles Include="$(PySourcePath)LICENSE;
+                             $(PySourcePath)PC\crtlicense.txt;
+                             $(bz2Dir)LICENSE;
+                             $(opensslOutDir)LICENSE;
+                             $(libffiDir)LICENSE;" />
+      <LicenseFiles Include="$(tcltkDir)tcllicense.terms;
+                             $(tcltkDir)tklicense.terms;
+                             $(tcltkDir)tixlicense.terms" Condition="$(IncludeTkinter)" />
       <_LicenseFiles Include="@(LicenseFiles)">
         <Content Condition="Exists(%(FullPath))">$([System.IO.File]::ReadAllText(%(FullPath)))</Content>
       </_LicenseFiles>
     </ItemGroup>
-    <WriteLinesToFile File="$(OutDir)LICENSE.txt" Overwrite="true" Lines="@(_LicenseFiles->'%(Content)')" />
+
+    <WriteLinesToFile File="$(OutDir)LICENSE.txt"
+                      Overwrite="true"
+                      Lines="@(_LicenseFiles->'%(Content)')" />
   </Target>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/python.vcxproj.filters b/PCbuild/python.vcxproj.filters
index 876a35ae95..0662a4e7f5 100644
--- a/PCbuild/python.vcxproj.filters
+++ b/PCbuild/python.vcxproj.filters
@@ -22,6 +22,5 @@
     <ClCompile Include="..\Programs\python.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\externals\openssl\include\applink.c" />
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/python3dll.vcxproj b/PCbuild/python3dll.vcxproj
index 5726d04f78..ef344bed49 100644
--- a/PCbuild/python3dll.vcxproj
+++ b/PCbuild/python3dll.vcxproj
@@ -72,19 +72,12 @@
     <Keyword>Win32Proj</Keyword>
     <TargetName>python3</TargetName>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
@@ -129,6 +122,7 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
+  
   <Target Name="BuildPython3_dDef" BeforeTargets="BuildStubDef" Condition="$(Configuration) == 'Debug'">
     <ItemGroup>
       <_DefLines Remove="@(_DefLines)" />
@@ -154,8 +148,10 @@
     </ItemGroup>
     <MakeDir Directories="$(IntDir)" />
     <Message Text="Updating python3_d.def" Condition="@(_Lines->'%(New)') != @(_OriginalLines)" Importance="high" />
-    <WriteLinesToFile File="$(IntDir)python3_d.def" Lines="@(_Lines->'%(New)')" Overwrite="true" Condition="@(_Lines->'%(New)') != @(_OriginalLines)" />
+    <WriteLinesToFile File="$(IntDir)python3_d.def" Lines="@(_Lines->'%(New)')" Overwrite="true"
+                      Condition="@(_Lines->'%(New)') != @(_OriginalLines)" />
   </Target>
+  
   <Target Name="BuildStubDef" BeforeTargets="PreLinkEvent">
     <ItemGroup>
       <_DefLines Remove="@(_DefLines)" />
@@ -181,6 +177,7 @@
     </ItemGroup>
     <MakeDir Directories="$(IntDir)" />
     <Message Text="Updating python3stub.def" Condition="@(_Lines) != @(_OriginalLines)" Importance="high" />
-    <WriteLinesToFile File="$(IntDir)python3stub.def" Lines="@(_Lines)" Overwrite="true" Condition="@(_Lines) != @(_OriginalLines)" />
+    <WriteLinesToFile File="$(IntDir)python3stub.def" Lines="@(_Lines)" Overwrite="true"
+                      Condition="@(_Lines) != @(_OriginalLines)" />
   </Target>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/python_uwp.vcxproj b/PCbuild/python_uwp.vcxproj
index fbbd01009a..fb27e9e712 100644
--- a/PCbuild/python_uwp.vcxproj
+++ b/PCbuild/python_uwp.vcxproj
@@ -68,7 +68,6 @@
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{9DE9E23D-C8D4-4817-92A9-920A8B1FE5FF}</ProjectGuid>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -77,12 +76,6 @@
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
@@ -132,4 +125,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index f3eebe0d14..0666b90f66 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -69,7 +69,6 @@
   <PropertyGroup Label="Globals">
     <ProjectGuid>{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}</ProjectGuid>
     <RootNamespace>pythoncore</RootNamespace>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -77,12 +76,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseOfMfc>false</UseOfMfc>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
@@ -113,7 +106,7 @@
       <PreprocessorDefinitions Condition="$(IncludeExternals)">_Py_HAVE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>psapi.lib;version.lib;shlwapi.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>version.lib;shlwapi.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
@@ -472,7 +465,6 @@
     <ClCompile Include="..\Python\sysmodule.c" />
     <ClCompile Include="..\Python\thread.c" />
     <ClCompile Include="..\Python\traceback.c" />
-    <ClCompile Include="..\Python\pathcch.c" />
   </ItemGroup>
   <ItemGroup Condition="$(IncludeExternals)">
     <ClCompile Include="..\Modules\zlibmodule.c" />
@@ -526,6 +518,7 @@
   <Target Name="_WarnAboutZlib" BeforeTargets="PrepareForBuild" Condition="!$(IncludeExternals)">
     <Warning Text="Not including zlib is not a supported configuration." />
   </Target>
+
   <Target Name="_CopyVCRuntime" AfterTargets="Build" Inputs="@(VCRuntimeDLL)" Outputs="$(OutDir)%(Filename)%(Extension)" DependsOnTargets="FindVCRuntime">
     <!-- bpo-38597: When we switch to another VCRuntime DLL, include vcruntime140.dll as well -->
     <Warning Text="A copy of vcruntime140.dll is also required" Condition="!$(VCToolsRedistVersion.StartsWith(`14.`))" />
@@ -534,4 +527,4 @@
   <Target Name="_CleanVCRuntime" AfterTargets="Clean">
     <Delete Files="@(VCRuntimeDLL->'$(OutDir)%(Filename)%(Extension)')" />
   </Target>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters
index b9093e9500..ebab119301 100644
--- a/PCbuild/pythoncore.vcxproj.filters
+++ b/PCbuild/pythoncore.vcxproj.filters
@@ -513,17 +513,39 @@
     <ClInclude Include="..\Include\odictobject.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="$(zlibDir)\crc32.h" />
-    <ClInclude Include="$(zlibDir)\deflate.h" />
-    <ClInclude Include="$(zlibDir)\inffast.h" />
-    <ClInclude Include="$(zlibDir)\inffixed.h" />
-    <ClInclude Include="$(zlibDir)\inflate.h" />
-    <ClInclude Include="$(zlibDir)\inftrees.h" />
-    <ClInclude Include="$(zlibDir)\trees.h" />
-    <ClInclude Include="$(zlibDir)\zconf.h" />
-    <ClInclude Include="$(zlibDir)\zconf.in.h" />
-    <ClInclude Include="$(zlibDir)\zlib.h" />
-    <ClInclude Include="$(zlibDir)\zutil.h" />
+    <ClInclude Include="$(zlibDir)\crc32.h">
+      <Filter>Modules\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="$(zlibDir)\deflate.h">
+      <Filter>Modules\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="$(zlibDir)\inffast.h">
+      <Filter>Modules\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="$(zlibDir)\inffixed.h">
+      <Filter>Modules\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="$(zlibDir)\inflate.h">
+      <Filter>Modules\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="$(zlibDir)\inftrees.h">
+      <Filter>Modules\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="$(zlibDir)\trees.h">
+      <Filter>Modules\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="$(zlibDir)\zconf.h">
+      <Filter>Modules\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="$(zlibDir)\zconf.in.h">
+      <Filter>Modules\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="$(zlibDir)\zlib.h">
+      <Filter>Modules\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="$(zlibDir)\zutil.h">
+      <Filter>Modules\zlib</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\Modules\_abc.c">
@@ -571,6 +593,9 @@
     <ClCompile Include="..\Modules\_pickle.c">
       <Filter>Modules</Filter>
     </ClCompile>
+    <ClCompile Include="..\Modules\_queuemodule.c">
+      <Filter>Modules</Filter>
+    </ClCompile>
     <ClCompile Include="..\Modules\_randommodule.c">
       <Filter>Modules</Filter>
     </ClCompile>
@@ -667,6 +692,9 @@
     <ClCompile Include="..\Modules\xxsubtype.c">
       <Filter>Modules</Filter>
     </ClCompile>
+    <ClCompile Include="..\Modules\zlibmodule.c">
+      <Filter>Modules</Filter>
+    </ClCompile>
     <ClCompile Include="..\Modules\_io\fileio.c">
       <Filter>Modules\_io</Filter>
     </ClCompile>
@@ -898,6 +926,9 @@
     <ClCompile Include="..\Python\compile.c">
       <Filter>Python</Filter>
     </ClCompile>
+    <ClCompile Include="..\Python\context.h">
+      <Filter>Python</Filter>
+    </ClCompile>
     <ClCompile Include="..\Python\dynamic_annotations.c">
       <Filter>Python</Filter>
     </ClCompile>
@@ -940,6 +971,9 @@
     <ClCompile Include="..\Python\graminit.c">
       <Filter>Python</Filter>
     </ClCompile>
+    <ClCompile Include="..\Python\hamt.h">
+      <Filter>Python</Filter>
+    </ClCompile>
     <ClCompile Include="..\Python\import.c">
       <Filter>Python</Filter>
     </ClCompile>
@@ -1057,29 +1091,49 @@
     <ClCompile Include="..\Objects\odictobject.c">
       <Filter>Objects</Filter>
     </ClCompile>
+    <ClCompile Include="..\PC\_findvs.cpp">
+      <Filter>PC</Filter>
+    </ClCompile>
     <ClCompile Include="..\Modules\_contextvarsmodule.c">
       <Filter>Modules</Filter>
     </ClCompile>
-    <ClCompile Include="..\Modules\_xxsubinterpretersmodule.c" />
-    <ClCompile Include="..\Python\context.c" />
-    <ClCompile Include="..\Python\hamt.c" />
-    <ClCompile Include="..\Python\pathcch.c" />
-    <ClCompile Include="..\Modules\zlibmodule.c" />
-    <ClCompile Include="$(zlibDir)\adler32.c" />
-    <ClCompile Include="$(zlibDir)\compress.c" />
-    <ClCompile Include="$(zlibDir)\crc32.c" />
-    <ClCompile Include="$(zlibDir)\deflate.c" />
-    <ClCompile Include="$(zlibDir)\infback.c" />
-    <ClCompile Include="$(zlibDir)\inffast.c" />
-    <ClCompile Include="$(zlibDir)\inflate.c" />
-    <ClCompile Include="$(zlibDir)\inftrees.c" />
-    <ClCompile Include="$(zlibDir)\trees.c" />
-    <ClCompile Include="$(zlibDir)\uncompr.c" />
-    <ClCompile Include="$(zlibDir)\zutil.c" />
+    <ClCompile Include="$(zlibDir)\adler32.c">
+      <Filter>Modules\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="$(zlibDir)\compress.c">
+      <Filter>Modules\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="$(zlibDir)\crc32.c">
+      <Filter>Modules\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="$(zlibDir)\deflate.c">
+      <Filter>Modules\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="$(zlibDir)\infback.c">
+      <Filter>Modules\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="$(zlibDir)\inffast.c">
+      <Filter>Modules\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="$(zlibDir)\inflate.c">
+      <Filter>Modules\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="$(zlibDir)\inftrees.c">
+      <Filter>Modules\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="$(zlibDir)\trees.c">
+      <Filter>Modules\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="$(zlibDir)\uncompr.c">
+      <Filter>Modules\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="$(zlibDir)\zutil.c">
+      <Filter>Modules\zlib</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="..\PC\python_nt.rc">
       <Filter>Resource Files</Filter>
     </ResourceCompile>
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/pythonw.vcxproj b/PCbuild/pythonw.vcxproj
index 66ec648526..e7216dec3a 100644
--- a/PCbuild/pythonw.vcxproj
+++ b/PCbuild/pythonw.vcxproj
@@ -69,7 +69,6 @@
   <PropertyGroup Label="Globals">
     <ProjectGuid>{F4229CC3-873C-49AE-9729-DD308ED4CD4A}</ProjectGuid>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -77,12 +76,6 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseOfMfc>false</UseOfMfc>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
@@ -103,7 +96,6 @@
     <ResourceCompile Include="..\PC\pythonw_exe.rc" />
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\externals\openssl\include\applink.c" />
     <ClCompile Include="..\PC\WinMain.c" />
   </ItemGroup>
   <ItemGroup>
diff --git a/PCbuild/pythonw.vcxproj.filters b/PCbuild/pythonw.vcxproj.filters
index 584ed5e654..259866fbcc 100644
--- a/PCbuild/pythonw.vcxproj.filters
+++ b/PCbuild/pythonw.vcxproj.filters
@@ -9,12 +9,13 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ResourceCompile Include="..\PC\pythonw_exe.rc" />
+    <ResourceCompile Include="..\PC\python_exe.rc">
+      <Filter>Resource Files</Filter>
+    </ResourceCompile>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\PC\WinMain.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\externals\openssl\include\applink.c" />
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/pythonw_uwp.vcxproj b/PCbuild/pythonw_uwp.vcxproj
index 165f0a8edb..e21e46a1b7 100644
--- a/PCbuild/pythonw_uwp.vcxproj
+++ b/PCbuild/pythonw_uwp.vcxproj
@@ -68,7 +68,6 @@
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{AB603547-1E2A-45B3-9E09-B04596006393}</ProjectGuid>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -77,12 +76,6 @@
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
@@ -132,4 +125,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/pywlauncher.vcxproj b/PCbuild/pywlauncher.vcxproj
index 40f1983af8..44e3fc2927 100644
--- a/PCbuild/pywlauncher.vcxproj
+++ b/PCbuild/pywlauncher.vcxproj
@@ -71,7 +71,6 @@
     <RootNamespace>pywlauncher</RootNamespace>
     <TargetName>pyw</TargetName>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <ConfigurationType>Application</ConfigurationType>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
diff --git a/PCbuild/select.vcxproj b/PCbuild/select.vcxproj
index 4417ee9c1a..750a713949 100644
--- a/PCbuild/select.vcxproj
+++ b/PCbuild/select.vcxproj
@@ -69,7 +69,6 @@
   <PropertyGroup Label="Globals">
     <ProjectGuid>{18CAE28C-B454-46C1-87A0-493D91D97F03}</ProjectGuid>
     <RootNamespace>select</RootNamespace>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -77,12 +76,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
diff --git a/PCbuild/select.vcxproj.filters b/PCbuild/select.vcxproj.filters
index 5bd538b834..55a2fc834a 100644
--- a/PCbuild/select.vcxproj.filters
+++ b/PCbuild/select.vcxproj.filters
@@ -10,7 +10,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/sqlite3.vcxproj b/PCbuild/sqlite3.vcxproj
index b5e65c3ad7..90b4d3108f 100644
--- a/PCbuild/sqlite3.vcxproj
+++ b/PCbuild/sqlite3.vcxproj
@@ -71,7 +71,6 @@
     <RootNamespace>sqlite3</RootNamespace>
     <TargetExt>.pyd</TargetExt>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
@@ -125,4 +118,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/sqlite3.vcxproj.filters b/PCbuild/sqlite3.vcxproj.filters
index 9cfd14caba..86680c1c38 100644
--- a/PCbuild/sqlite3.vcxproj.filters
+++ b/PCbuild/sqlite3.vcxproj.filters
@@ -21,7 +21,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\sqlite3.rc" />
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/unicodedata.vcxproj b/PCbuild/unicodedata.vcxproj
index 49dbbcf6ed..addef75335 100644
--- a/PCbuild/unicodedata.vcxproj
+++ b/PCbuild/unicodedata.vcxproj
@@ -70,7 +70,6 @@
     <ProjectGuid>{ECC7CEAC-A5E5-458E-BB9E-2413CC847881}</ProjectGuid>
     <RootNamespace>unicodedata</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -78,12 +77,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
diff --git a/PCbuild/unicodedata.vcxproj.filters b/PCbuild/unicodedata.vcxproj.filters
index fbeefac2d2..20e640ee11 100644
--- a/PCbuild/unicodedata.vcxproj.filters
+++ b/PCbuild/unicodedata.vcxproj.filters
@@ -21,7 +21,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/venvlauncher.vcxproj b/PCbuild/venvlauncher.vcxproj
index 22531c5075..123e84ec4e 100644
--- a/PCbuild/venvlauncher.vcxproj
+++ b/PCbuild/venvlauncher.vcxproj
@@ -71,7 +71,6 @@
     <RootNamespace>venvlauncher</RootNamespace>
     <TargetName>venvlauncher</TargetName>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <ConfigurationType>Application</ConfigurationType>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
@@ -121,4 +114,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/venvwlauncher.vcxproj b/PCbuild/venvwlauncher.vcxproj
index 24488496fb..b8504d5d08 100644
--- a/PCbuild/venvwlauncher.vcxproj
+++ b/PCbuild/venvwlauncher.vcxproj
@@ -71,7 +71,6 @@
     <RootNamespace>venvwlauncher</RootNamespace>
     <TargetName>venvwlauncher</TargetName>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <ConfigurationType>Application</ConfigurationType>
     <CharacterSet>MultiByte</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
@@ -121,4 +114,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/winsound.vcxproj b/PCbuild/winsound.vcxproj
index 5e5517cef6..32cedc9b44 100644
--- a/PCbuild/winsound.vcxproj
+++ b/PCbuild/winsound.vcxproj
@@ -71,7 +71,6 @@
     <RootNamespace>winsound</RootNamespace>
     <Keyword>Win32Proj</Keyword>
     <SupportPGO>false</SupportPGO>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
diff --git a/PCbuild/winsound.vcxproj.filters b/PCbuild/winsound.vcxproj.filters
index c8af6aa82f..7d08931b18 100644
--- a/PCbuild/winsound.vcxproj.filters
+++ b/PCbuild/winsound.vcxproj.filters
@@ -11,7 +11,4 @@
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\PC\python_nt.rc" />
-  </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/xxlimited.vcxproj b/PCbuild/xxlimited.vcxproj
index 8777f5e3a2..776335a15c 100644
--- a/PCbuild/xxlimited.vcxproj
+++ b/PCbuild/xxlimited.vcxproj
@@ -70,7 +70,6 @@
     <ProjectGuid>{F749B822-B489-4CA5-A3AD-CE078F5F338A}</ProjectGuid>
     <RootNamespace>xxlimited</RootNamespace>
     <Keyword>Win32Proj</Keyword>
-    <WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="python.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -79,12 +78,6 @@
     <CharacterSet>NotSet</CharacterSet>
     <SupportPGO>false</SupportPGO>
   </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <PlatformToolset>v140_xp</PlatformToolset>
-  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <PropertyGroup>
     <TargetExt>.pyd</TargetExt>
diff --git a/Python/pathcch.c b/Python/pathcch.c
deleted file mode 100644
index 1b0ca62d0b..0000000000
--- a/Python/pathcch.c
+++ /dev/null
@@ -1,902 +0,0 @@
-#if 0
-#include "pathcch.h"
-
-
-WINE_DEFAULT_DEBUG_CHANNEL(path);
-
-#define isalnum(ch)  (((ch) >= '0' && (ch) <= '9') || \
-                      ((ch) >= 'A' && (ch) <= 'Z') || \
-                      ((ch) >= 'a' && (ch) <= 'z'))
-#define isxdigit(ch) (((ch) >= '0' && (ch) <= '9') || \
-                      ((ch) >= 'A' && (ch) <= 'F') || \
-                      ((ch) >= 'a' && (ch) <= 'f'))
-
-static const char hexDigits[] = "0123456789ABCDEF";
-
-static const unsigned char hashdata_lookup[256] =
-{
-    0x01, 0x0e, 0x6e, 0x19, 0x61, 0xae, 0x84, 0x77, 0x8a, 0xaa, 0x7d, 0x76, 0x1b, 0xe9, 0x8c, 0x33,
-    0x57, 0xc5, 0xb1, 0x6b, 0xea, 0xa9, 0x38, 0x44, 0x1e, 0x07, 0xad, 0x49, 0xbc, 0x28, 0x24, 0x41,
-    0x31, 0xd5, 0x68, 0xbe, 0x39, 0xd3, 0x94, 0xdf, 0x30, 0x73, 0x0f, 0x02, 0x43, 0xba, 0xd2, 0x1c,
-    0x0c, 0xb5, 0x67, 0x46, 0x16, 0x3a, 0x4b, 0x4e, 0xb7, 0xa7, 0xee, 0x9d, 0x7c, 0x93, 0xac, 0x90,
-    0xb0, 0xa1, 0x8d, 0x56, 0x3c, 0x42, 0x80, 0x53, 0x9c, 0xf1, 0x4f, 0x2e, 0xa8, 0xc6, 0x29, 0xfe,
-    0xb2, 0x55, 0xfd, 0xed, 0xfa, 0x9a, 0x85, 0x58, 0x23, 0xce, 0x5f, 0x74, 0xfc, 0xc0, 0x36, 0xdd,
-    0x66, 0xda, 0xff, 0xf0, 0x52, 0x6a, 0x9e, 0xc9, 0x3d, 0x03, 0x59, 0x09, 0x2a, 0x9b, 0x9f, 0x5d,
-    0xa6, 0x50, 0x32, 0x22, 0xaf, 0xc3, 0x64, 0x63, 0x1a, 0x96, 0x10, 0x91, 0x04, 0x21, 0x08, 0xbd,
-    0x79, 0x40, 0x4d, 0x48, 0xd0, 0xf5, 0x82, 0x7a, 0x8f, 0x37, 0x69, 0x86, 0x1d, 0xa4, 0xb9, 0xc2,
-    0xc1, 0xef, 0x65, 0xf2, 0x05, 0xab, 0x7e, 0x0b, 0x4a, 0x3b, 0x89, 0xe4, 0x6c, 0xbf, 0xe8, 0x8b,
-    0x06, 0x18, 0x51, 0x14, 0x7f, 0x11, 0x5b, 0x5c, 0xfb, 0x97, 0xe1, 0xcf, 0x15, 0x62, 0x71, 0x70,
-    0x54, 0xe2, 0x12, 0xd6, 0xc7, 0xbb, 0x0d, 0x20, 0x5e, 0xdc, 0xe0, 0xd4, 0xf7, 0xcc, 0xc4, 0x2b,
-    0xf9, 0xec, 0x2d, 0xf4, 0x6f, 0xb6, 0x99, 0x88, 0x81, 0x5a, 0xd9, 0xca, 0x13, 0xa5, 0xe7, 0x47,
-    0xe6, 0x8e, 0x60, 0xe3, 0x3e, 0xb3, 0xf6, 0x72, 0xa2, 0x35, 0xa0, 0xd7, 0xcd, 0xb4, 0x2f, 0x6d,
-    0x2c, 0x26, 0x1f, 0x95, 0x87, 0x00, 0xd8, 0x34, 0x3f, 0x17, 0x25, 0x45, 0x27, 0x75, 0x92, 0xb8,
-    0xa3, 0xc8, 0xde, 0xeb, 0xf8, 0xf3, 0xdb, 0x0a, 0x98, 0x83, 0x7b, 0xe5, 0xcb, 0x4c, 0x78, 0xd1,
-};
-
-struct parsed_url
-{
-    const WCHAR *scheme;   /* [out] start of scheme                     */
-    DWORD scheme_len;      /* [out] size of scheme (until colon)        */
-    const WCHAR *username; /* [out] start of Username                   */
-    DWORD username_len;    /* [out] size of Username (until ":" or "@") */
-    const WCHAR *password; /* [out] start of Password                   */
-    DWORD password_len;    /* [out] size of Password (until "@")        */
-    const WCHAR *hostname; /* [out] start of Hostname                   */
-    DWORD hostname_len;    /* [out] size of Hostname (until ":" or "/") */
-    const WCHAR *port;     /* [out] start of Port                       */
-    DWORD port_len;        /* [out] size of Port (until "/" or eos)     */
-    const WCHAR *query;    /* [out] start of Query                      */
-    DWORD query_len;       /* [out] size of Query (until eos)           */
-};
-
-enum url_scan_type
-{
-    SCHEME,
-    HOST,
-    PORT,
-    USERPASS,
-};
-
-static WCHAR *heap_strdupAtoW(const char *str)
-{
-    WCHAR *ret = NULL;
-
-    if (str)
-    {
-        DWORD len;
-
-        len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
-        ret = heap_alloc(len * sizeof(WCHAR));
-        MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
-    }
-
-    return ret;
-}
-
-static SIZE_T strnlenW(const WCHAR *string, SIZE_T maxlen)
-{
-    SIZE_T i;
-
-    for (i = 0; i < maxlen; i++)
-        if (!string[i]) break;
-    return i;
-}
-
-static BOOL is_drive_spec( const WCHAR *str )
-{
-    return ((str[0] >= 'A' && str[0] <= 'Z') || (str[0] >= 'a' && str[0] <= 'z')) && str[1] == ':';
-}
-
-static BOOL is_escaped_drive_spec( const WCHAR *str )
-{
-    return ((str[0] >= 'A' && str[0] <= 'Z') || (str[0] >= 'a' && str[0] <= 'z')) &&
-        (str[1] == ':' || str[1] == '|');
-}
-
-static BOOL is_prefixed_unc(const WCHAR *string)
-{
-    return !wcsnicmp(string, L"\\\\?\\UNC\\", 8 );
-}
-
-static BOOL is_prefixed_disk(const WCHAR *string)
-{
-    return !wcsncmp(string, L"\\\\?\\", 4) && is_drive_spec( string + 4 );
-}
-
-static BOOL is_prefixed_volume(const WCHAR *string)
-{
-    const WCHAR *guid;
-    INT i = 0;
-
-    if (wcsnicmp( string, L"\\\\?\\Volume", 10 )) return FALSE;
-
-    guid = string + 10;
-
-    while (i <= 37)
-    {
-        switch (i)
-        {
-        case 0:
-            if (guid[i] != '{') return FALSE;
-            break;
-        case 9:
-        case 14:
-        case 19:
-        case 24:
-            if (guid[i] != '-') return FALSE;
-            break;
-        case 37:
-            if (guid[i] != '}') return FALSE;
-            break;
-        default:
-            if (!isxdigit(guid[i])) return FALSE;
-            break;
-        }
-        i++;
-    }
-
-    return TRUE;
-}
-
-/* Get the next character beyond end of the segment.
-   Return TRUE if the last segment ends with a backslash */
-static BOOL get_next_segment(const WCHAR *next, const WCHAR **next_segment)
-{
-    while (*next && *next != '\\') next++;
-    if (*next == '\\')
-    {
-        *next_segment = next + 1;
-        return TRUE;
-    }
-    else
-    {
-        *next_segment = next;
-        return FALSE;
-    }
-}
-
-/* Find the last character of the root in a path, if there is one, without any segments */
-static const WCHAR *get_root_end(const WCHAR *path)
-{
-    /* Find path root */
-    if (is_prefixed_volume(path))
-        return path[48] == '\\' ? path + 48 : path + 47;
-    else if (is_prefixed_unc(path))
-        return path + 7;
-    else if (is_prefixed_disk(path))
-        return path[6] == '\\' ? path + 6 : path + 5;
-    /* \\ */
-    else if (path[0] == '\\' && path[1] == '\\')
-        return path + 1;
-    /* \ */
-    else if (path[0] == '\\')
-        return path;
-    /* X:\ */
-    else if (is_drive_spec( path ))
-        return path[2] == '\\' ? path + 2 : path + 1;
-    else
-        return NULL;
-}
-
-HRESULT  PathAllocCanonicalize(const WCHAR *path_in, DWORD flags, WCHAR **path_out)
-{
-    WCHAR *buffer, *dst;
-    const WCHAR *src;
-    const WCHAR *root_end;
-    SIZE_T buffer_size, length;
-
- 
-    if (!path_in || !path_out
-        || ((flags & PATHCCH_FORCE_ENABLE_LONG_NAME_PROCESS) && (flags & PATHCCH_FORCE_DISABLE_LONG_NAME_PROCESS))
-        || (flags & (PATHCCH_FORCE_ENABLE_LONG_NAME_PROCESS | PATHCCH_FORCE_DISABLE_LONG_NAME_PROCESS)
-            && !(flags & PATHCCH_ALLOW_LONG_PATHS))
-        || ((flags & PATHCCH_ENSURE_IS_EXTENDED_LENGTH_PATH) && (flags & PATHCCH_ALLOW_LONG_PATHS)))
-    {
-        if (path_out) *path_out = NULL;
-        return E_INVALIDARG;
-    }
-
-    length = lstrlenW(path_in);
-    if ((length + 1 > MAX_PATH && !(flags & (PATHCCH_ALLOW_LONG_PATHS | PATHCCH_ENSURE_IS_EXTENDED_LENGTH_PATH)))
-        || (length + 1 > PATHCCH_MAX_CCH))
-    {
-        *path_out = NULL;
-        return HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE);
-    }
-
-    /* PATHCCH_ENSURE_IS_EXTENDED_LENGTH_PATH implies PATHCCH_DO_NOT_NORMALIZE_SEGMENTS */
-    if (flags & PATHCCH_ENSURE_IS_EXTENDED_LENGTH_PATH) flags |= PATHCCH_DO_NOT_NORMALIZE_SEGMENTS;
-
-    /* path length + possible \\?\ addition + possible \ addition + NUL */
-    buffer_size = (length + 6) * sizeof(WCHAR);
-    buffer = LocalAlloc(LMEM_ZEROINIT, buffer_size);
-    if (!buffer)
-    {
-        *path_out = NULL;
-        return E_OUTOFMEMORY;
-    }
-
-    src = path_in;
-    dst = buffer;
-
-    root_end = get_root_end(path_in);
-    if (root_end) root_end = buffer + (root_end - path_in);
-
-    /* Copy path root */
-    if (root_end)
-    {
-        memcpy(dst, src, (root_end - buffer + 1) * sizeof(WCHAR));
-        src += root_end - buffer + 1;
-        if(PathCchStripPrefix(dst, length + 6) == S_OK)
-        {
-            /* Fill in \ in X:\ if the \ is missing */
-            if (is_drive_spec( dst ) && dst[2]!= '\\')
-            {
-                dst[2] = '\\';
-                dst[3] = 0;
-            }
-            dst = buffer + lstrlenW(buffer);
-            root_end = dst;
-        }
-        else
-            dst += root_end - buffer + 1;
-    }
-
-    while (*src)
-    {
-        if (src[0] == '.')
-        {
-            if (src[1] == '.')
-            {
-                /* Keep one . after * */
-                if (dst > buffer && dst[-1] == '*')
-                {
-                    *dst++ = *src++;
-                    continue;
-                }
-
-                /* Keep the .. if not surrounded by \ */
-                if ((src[2] != '\\' && src[2]) || (dst > buffer && dst[-1] != '\\'))
-                {
-                    *dst++ = *src++;
-                    *dst++ = *src++;
-                    continue;
-                }
-
-                /* Remove the \ before .. if the \ is not part of root */
-                if (dst > buffer && dst[-1] == '\\' && (!root_end || dst - 1 > root_end))
-                {
-                    *--dst = '\0';
-                    /* Remove characters until a \ is encountered */
-                    while (dst > buffer)
-                    {
-                        if (dst[-1] == '\\')
-                        {
-                            *--dst = 0;
-                            break;
-                        }
-                        else
-                            *--dst = 0;
-                    }
-                }
-                /* Remove the extra \ after .. if the \ before .. wasn't deleted */
-                else if (src[2] == '\\')
-                    src++;
-
-                src += 2;
-            }
-            else
-            {
-                /* Keep the . if not surrounded by \ */
-                if ((src[1] != '\\' && src[1]) || (dst > buffer && dst[-1] != '\\'))
-                {
-                    *dst++ = *src++;
-                    continue;
-                }
-
-                /* Remove the \ before . if the \ is not part of root */
-                if (dst > buffer && dst[-1] == '\\' && (!root_end || dst - 1 > root_end)) dst--;
-                /* Remove the extra \ after . if the \ before . wasn't deleted */
-                else if (src[1] == '\\')
-                    src++;
-
-                src++;
-            }
-
-            /* If X:\ is not complete, then complete it */
-            if (is_drive_spec( buffer ) && buffer[2] != '\\')
-            {
-                root_end = buffer + 2;
-                dst = buffer + 3;
-                buffer[2] = '\\';
-                /* If next character is \, use the \ to fill in */
-                if (src[0] == '\\') src++;
-            }
-        }
-        /* Copy over */
-        else
-            *dst++ = *src++;
-    }
-    /* End the path */
-    *dst = 0;
-
-    /* Strip multiple trailing . */
-    if (!(flags & PATHCCH_DO_NOT_NORMALIZE_SEGMENTS))
-    {
-        while (dst > buffer && dst[-1] == '.')
-        {
-            /* Keep a . after * */
-            if (dst - 1 > buffer && dst[-2] == '*')
-                break;
-            /* If . follow a : at the second character, remove the . and add a \ */
-            else if (dst - 1 > buffer && dst[-2] == ':' && dst - 2 == buffer + 1)
-                *--dst = '\\';
-            else
-                *--dst = 0;
-        }
-    }
-
-    /* If result path is empty, fill in \ */
-    if (!*buffer)
-    {
-        buffer[0] = '\\';
-        buffer[1] = 0;
-    }
-
-    /* Extend the path if needed */
-    length = lstrlenW(buffer);
-    if (((length + 1 > MAX_PATH && is_drive_spec( buffer ))
-         || (is_drive_spec( buffer ) && flags & PATHCCH_ENSURE_IS_EXTENDED_LENGTH_PATH))
-        && !(flags & PATHCCH_FORCE_ENABLE_LONG_NAME_PROCESS))
-    {
-        memmove(buffer + 4, buffer, (length + 1) * sizeof(WCHAR));
-        buffer[0] = '\\';
-        buffer[1] = '\\';
-        buffer[2] = '?';
-        buffer[3] = '\\';
-    }
-
-    /* Add a trailing backslash to the path if needed */
-    if (flags & PATHCCH_ENSURE_TRAILING_SLASH)
-        PathCchAddBackslash(buffer, buffer_size);
-
-    *path_out = buffer;
-    return S_OK;
-}
-
-HRESULT  PathAllocCombine(const WCHAR *path1, const WCHAR *path2, DWORD flags, WCHAR **out)
-{
-    SIZE_T combined_length, length2;
-    WCHAR *combined_path;
-    BOOL add_backslash = FALSE;
-    HRESULT hr;
-
-    if ((!path1 && !path2) || !out)
-    {
-        if (out) *out = NULL;
-        return E_INVALIDARG;
-    }
-
-    if (!path1 || !path2) return PathAllocCanonicalize(path1 ? path1 : path2, flags, out);
-
-    /* If path2 is fully qualified, use path2 only */
-    if (is_drive_spec( path2 ) || (path2[0] == '\\' && path2[1] == '\\'))
-    {
-        path1 = path2;
-        path2 = NULL;
-        add_backslash = (is_drive_spec(path1) && !path1[2])
-                        || (is_prefixed_disk(path1) && !path1[6]);
-    }
-
-    length2 = path2 ? lstrlenW(path2) : 0;
-    /* path1 length + path2 length + possible backslash + NULL */
-    combined_length = lstrlenW(path1) + length2 + 2;
-
-    combined_path = HeapAlloc(GetProcessHeap(), 0, combined_length * sizeof(WCHAR));
-    if (!combined_path)
-    {
-        *out = NULL;
-        return E_OUTOFMEMORY;
-    }
-
-    lstrcpyW(combined_path, path1);
-    PathCchStripPrefix(combined_path, combined_length);
-    if (add_backslash) PathCchAddBackslashEx(combined_path, combined_length, NULL, NULL);
-
-    if (path2 && path2[0])
-    {
-        if (path2[0] == '\\' && path2[1] != '\\')
-        {
-            PathCchStripToRoot(combined_path, combined_length);
-            path2++;
-        }
-
-        PathCchAddBackslashEx(combined_path, combined_length, NULL, NULL);
-        lstrcatW(combined_path, path2);
-    }
-
-    hr = PathAllocCanonicalize(combined_path, flags, out);
-    HeapFree(GetProcessHeap(), 0, combined_path);
-    return hr;
-}
-
-HRESULT  PathCchAddBackslash(WCHAR *path, SIZE_T size)
-{
-    return PathCchAddBackslashEx(path, size, NULL, NULL);
-}
-
-HRESULT  PathCchAddBackslashEx(WCHAR *path, SIZE_T size, WCHAR **endptr, SIZE_T *remaining)
-{
-    BOOL needs_termination;
-    SIZE_T length;
-
-       length = lstrlenW(path);
-    needs_termination = size && length && path[length - 1] != '\\';
-
-    if (length >= (needs_termination ? size - 1 : size))
-    {
-        if (endptr) *endptr = NULL;
-        if (remaining) *remaining = 0;
-        return STRSAFE_E_INSUFFICIENT_BUFFER;
-    }
-
-    if (!needs_termination)
-    {
-        if (endptr) *endptr = path + length;
-        if (remaining) *remaining = size - length;
-        return S_FALSE;
-    }
-
-    path[length++] = '\\';
-    path[length] = 0;
-
-    if (endptr) *endptr = path + length;
-    if (remaining) *remaining = size - length;
-
-    return S_OK;
-}
-
-HRESULT  PathCchAddExtension(WCHAR *path, SIZE_T size, const WCHAR *extension)
-{
-    const WCHAR *existing_extension, *next;
-    SIZE_T path_length, extension_length, dot_length;
-    BOOL has_dot;
-    HRESULT hr;
-
-      if (!path || !size || size > PATHCCH_MAX_CCH || !extension) return E_INVALIDARG;
-
-    next = extension;
-    while (*next)
-    {
-        if ((*next == '.' && next > extension) || *next == ' ' || *next == '\\') return E_INVALIDARG;
-        next++;
-    }
-
-    has_dot = extension[0] == '.';
-
-    hr = PathCchFindExtension(path, size, &existing_extension);
-    if (FAILED(hr)) return hr;
-    if (*existing_extension) return S_FALSE;
-
-    path_length = strnlenW(path, size);
-    dot_length = has_dot ? 0 : 1;
-    extension_length = lstrlenW(extension);
-
-    if (path_length + dot_length + extension_length + 1 > size) return STRSAFE_E_INSUFFICIENT_BUFFER;
-
-    /* If extension is empty or only dot, return S_OK with path unchanged */
-    if (!extension[0] || (extension[0] == '.' && !extension[1])) return S_OK;
-
-    if (!has_dot)
-    {
-        path[path_length] = '.';
-        path_length++;
-    }
-
-    lstrcpyW(path + path_length, extension);
-    return S_OK;
-}
-
-HRESULT  PathCchAppend(WCHAR *path1, SIZE_T size, const WCHAR *path2)
-{
-
-    return PathCchAppendEx(path1, size, path2, PATHCCH_NONE);
-}
-
-HRESULT  PathCchAppendEx(WCHAR *path1, SIZE_T size, const WCHAR *path2, DWORD flags)
-{
-    HRESULT hr;
-    WCHAR *result;
-
-
-    if (!path1 || !size) return E_INVALIDARG;
-
-    /* Create a temporary buffer for result because we need to keep path1 unchanged if error occurs.
-     * And PathCchCombineEx writes empty result if there is error so we can't just use path1 as output
-     * buffer for PathCchCombineEx */
-    result = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR));
-    if (!result) return E_OUTOFMEMORY;
-
-    /* Avoid the single backslash behavior with PathCchCombineEx when appending */
-    if (path2 && path2[0] == '\\' && path2[1] != '\\') path2++;
-
-    hr = PathCchCombineEx(result, size, path1, path2, flags);
-    if (SUCCEEDED(hr)) memcpy(path1, result, size * sizeof(WCHAR));
-
-    HeapFree(GetProcessHeap(), 0, result);
-    return hr;
-}
-
-HRESULT  PathCchCanonicalize(WCHAR *out, SIZE_T size, const WCHAR *in)
-{
-
-    /* Not X:\ and path > MAX_PATH - 4, return HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE) */
-    if (lstrlenW(in) > MAX_PATH - 4 && !(is_drive_spec( in ) && in[2] == '\\'))
-        return HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE);
-
-    return PathCchCanonicalizeEx(out, size, in, PATHCCH_NONE);
-}
-
-HRESULT  PathCchCanonicalizeEx(WCHAR *out, SIZE_T size, const WCHAR *in, DWORD flags)
-{
-    WCHAR *buffer;
-    SIZE_T length;
-    HRESULT hr;
-
-
-    if (!size) return E_INVALIDARG;
-
-    hr = PathAllocCanonicalize(in, flags, &buffer);
-    if (FAILED(hr)) return hr;
-
-    length = lstrlenW(buffer);
-    if (size < length + 1)
-    {
-        /* No root and path > MAX_PATH - 4, return HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE) */
-        if (length > MAX_PATH - 4 && !(in[0] == '\\' || (is_drive_spec( in ) && in[2] == '\\')))
-            hr = HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE);
-        else
-            hr = STRSAFE_E_INSUFFICIENT_BUFFER;
-    }
-
-    if (SUCCEEDED(hr))
-    {
-        memcpy(out, buffer, (length + 1) * sizeof(WCHAR));
-
-        /* Fill a backslash at the end of X: */
-        if (is_drive_spec( out ) && !out[2] && size > 3)
-        {
-            out[2] = '\\';
-            out[3] = 0;
-        }
-    }
-
-    LocalFree(buffer);
-    return hr;
-}
-
-HRESULT  PathCchCombine(WCHAR *out, SIZE_T size, const WCHAR *path1, const WCHAR *path2)
-{
-
-    return PathCchCombineEx(out, size, path1, path2, PATHCCH_NONE);
-}
-
-HRESULT  PathCchCombineEx(WCHAR *out, SIZE_T size, const WCHAR *path1, const WCHAR *path2, DWORD flags)
-{
-    HRESULT hr;
-    WCHAR *buffer;
-    SIZE_T length;
-
-
-    if (!out || !size || size > PATHCCH_MAX_CCH) return E_INVALIDARG;
-
-    hr = PathAllocCombine(path1, path2, flags, &buffer);
-    if (FAILED(hr))
-    {
-        out[0] = 0;
-        return hr;
-    }
-
-    length = lstrlenW(buffer);
-    if (length + 1 > size)
-    {
-        out[0] = 0;
-        LocalFree(buffer);
-        return STRSAFE_E_INSUFFICIENT_BUFFER;
-    }
-    else
-    {
-        memcpy(out, buffer, (length + 1) * sizeof(WCHAR));
-        LocalFree(buffer);
-        return S_OK;
-    }
-}
-
-HRESULT  PathCchFindExtension(const WCHAR *path, SIZE_T size, const WCHAR **extension)
-{
-    const WCHAR *lastpoint = NULL;
-    SIZE_T counter = 0;
-
-
-    if (!path || !size || size > PATHCCH_MAX_CCH)
-    {
-        *extension = NULL;
-        return E_INVALIDARG;
-    }
-
-    while (*path)
-    {
-        if (*path == '\\' || *path == ' ')
-            lastpoint = NULL;
-        else if (*path == '.')
-            lastpoint = path;
-
-        path++;
-        counter++;
-        if (counter == size || counter == PATHCCH_MAX_CCH)
-        {
-            *extension = NULL;
-            return E_INVALIDARG;
-        }
-    }
-
-    *extension = lastpoint ? lastpoint : path;
-    return S_OK;
-}
-
-BOOL  PathCchIsRoot(const WCHAR *path)
-{
-    const WCHAR *root_end;
-    const WCHAR *next;
-    BOOL is_unc;
-
-
-    if (!path || !*path) return FALSE;
-
-    root_end = get_root_end(path);
-    if (!root_end) return FALSE;
-
-    if ((is_unc = is_prefixed_unc(path)) || (path[0] == '\\' && path[1] == '\\' && path[2] != '?'))
-    {
-        next = root_end + 1;
-        /* No extra segments */
-        if ((is_unc && !*next) || (!is_unc && !*next)) return TRUE;
-
-        /* Has first segment with an ending backslash but no remaining characters */
-        if (get_next_segment(next, &next) && !*next) return FALSE;
-        /* Has first segment with no ending backslash */
-        else if (!*next)
-            return TRUE;
-        /* Has first segment with an ending backslash and has remaining characters*/
-        else
-        {
-            next++;
-            /* Second segment must have no backslash and no remaining characters */
-            return !get_next_segment(next, &next) && !*next;
-        }
-    }
-    else if (*root_end == '\\' && !root_end[1])
-        return TRUE;
-    else
-        return FALSE;
-}
-
-HRESULT  PathCchRemoveBackslash(WCHAR *path, SIZE_T path_size)
-{
-    WCHAR *path_end;
-    SIZE_T free_size;
-
-
-    return PathCchRemoveBackslashEx(path, path_size, &path_end, &free_size);
-}
-
-HRESULT  PathCchRemoveBackslashEx(WCHAR *path, SIZE_T path_size, WCHAR **path_end, SIZE_T *free_size)
-{
-    const WCHAR *root_end;
-    SIZE_T path_length;
-
-
-    if (!path_size || !path_end || !free_size)
-    {
-        if (path_end) *path_end = NULL;
-        if (free_size) *free_size = 0;
-        return E_INVALIDARG;
-    }
-
-    path_length = strnlenW(path, path_size);
-    if (path_length == path_size && !path[path_length]) return E_INVALIDARG;
-
-    root_end = get_root_end(path);
-    if (path_length > 0 && path[path_length - 1] == '\\')
-    {
-        *path_end = path + path_length - 1;
-        *free_size = path_size - path_length + 1;
-        /* If the last character is beyond end of root */
-        if (!root_end || path + path_length - 1 > root_end)
-        {
-            path[path_length - 1] = 0;
-            return S_OK;
-        }
-        else
-            return S_FALSE;
-    }
-    else
-    {
-        *path_end = path + path_length;
-        *free_size = path_size - path_length;
-        return S_FALSE;
-    }
-}
-
-HRESULT  PathCchRemoveExtension(WCHAR *path, SIZE_T size)
-{
-    const WCHAR *extension;
-    WCHAR *next;
-    HRESULT hr;
-
-
-    if (!path || !size || size > PATHCCH_MAX_CCH) return E_INVALIDARG;
-
-    hr = PathCchFindExtension(path, size, &extension);
-    if (FAILED(hr)) return hr;
-
-    next = path + (extension - path);
-    while (next - path < size && *next) *next++ = 0;
-
-    return next == extension ? S_FALSE : S_OK;
-}
-
-HRESULT  PathCchRemoveFileSpec(WCHAR *path, SIZE_T size)
-{
-    const WCHAR *root_end = NULL;
-    SIZE_T length;
-    WCHAR *last;
-
-
-    if (!path || !size || size > PATHCCH_MAX_CCH) return E_INVALIDARG;
-
-    if (PathCchIsRoot(path)) return S_FALSE;
-
-    PathCchSkipRoot(path, &root_end);
-
-    /* The backslash at the end of UNC and \\* are not considered part of root in this case */
-    if (root_end && root_end > path && root_end[-1] == '\\'
-        && (is_prefixed_unc(path) || (path[0] == '\\' && path[1] == '\\' && path[2] != '?')))
-        root_end--;
-
-    length = lstrlenW(path);
-    last = path + length - 1;
-    while (last >= path && (!root_end || last >= root_end))
-    {
-        if (last - path >= size) return E_INVALIDARG;
-
-        if (*last == '\\')
-        {
-            *last-- = 0;
-            break;
-        }
-
-        *last-- = 0;
-    }
-
-    return last != path + length - 1 ? S_OK : S_FALSE;
-}
-
-HRESULT  PathCchRenameExtension(WCHAR *path, SIZE_T size, const WCHAR *extension)
-{
-    HRESULT hr;
-
-
-    hr = PathCchRemoveExtension(path, size);
-    if (FAILED(hr)) return hr;
-
-    hr = PathCchAddExtension(path, size, extension);
-    return FAILED(hr) ? hr : S_OK;
-}
-
-HRESULT  PathCchSkipRoot(const WCHAR *path, const WCHAR **root_end)
-{
-    printf("PathCchSkipRootIn : %ws, %ws***\n", path, *root_end);
-    if (!path || !path[0] || !root_end
-        || (!wcsnicmp(path, L"\\\\?", 3) && !is_prefixed_volume(path) && !is_prefixed_unc(path)
-            && !is_prefixed_disk(path)))
-        return E_INVALIDARG;
-    printf("PathCchSkipRoot2\n");
-    *root_end = get_root_end(path);
-    printf("PathCchSkipRoot3\n");
-    if (*root_end)
-    {
-        (*root_end)++;
-        printf("PathCchSkipRoot4\n");
-        if (is_prefixed_unc(path))
-        {
-            get_next_segment(*root_end, root_end);
-            get_next_segment(*root_end, root_end);
-        }
-        else if (path[0] == '\\' && path[1] == '\\' && path[2] != '?')
-        {
-            /* Skip share server */
-            get_next_segment(*root_end, root_end);
-            /* If mount point is empty, don't skip over mount point */
-            if (**root_end != '\\') get_next_segment(*root_end, root_end);
-        }
-    }
-    printf("PathCchSkipRootOut : %ws, %ws***\n", path, *root_end);
-    return *root_end ? S_OK : E_INVALIDARG;
-}
-
-HRESULT  PathCchStripPrefix(WCHAR *path, SIZE_T size)
-{
-
-    if (!path || !size || size > PATHCCH_MAX_CCH) return E_INVALIDARG;
-
-    if (is_prefixed_unc(path))
-    {
-        /* \\?\UNC\a -> \\a */
-        if (size < lstrlenW(path + 8) + 3) return E_INVALIDARG;
-        lstrcpyW(path + 2, path + 8);
-        return S_OK;
-    }
-    else if (is_prefixed_disk(path))
-    {
-        /* \\?\C:\ -> C:\ */
-        if (size < lstrlenW(path + 4) + 1) return E_INVALIDARG;
-        lstrcpyW(path, path + 4);
-        return S_OK;
-    }
-    else
-        return S_FALSE;
-}
-
-HRESULT  PathCchStripToRoot(WCHAR *path, SIZE_T size)
-{
-    const WCHAR *root_end;
-    WCHAR *segment_end;
-    BOOL is_unc;
-
-
-    if (!path || !*path || !size || size > PATHCCH_MAX_CCH) return E_INVALIDARG;
-
-    /* \\\\?\\UNC\\* and \\\\* have to have at least two extra segments to be striped,
-     * e.g. \\\\?\\UNC\\a\\b\\c -> \\\\?\\UNC\\a\\b
-     *      \\\\a\\b\\c         -> \\\\a\\b         */
-    if ((is_unc = is_prefixed_unc(path)) || (path[0] == '\\' && path[1] == '\\' && path[2] != '?'))
-    {
-        root_end = is_unc ? path + 8 : path + 3;
-        if (!get_next_segment(root_end, &root_end)) return S_FALSE;
-        if (!get_next_segment(root_end, &root_end)) return S_FALSE;
-
-        if (root_end - path >= size) return E_INVALIDARG;
-
-        segment_end = path + (root_end - path) - 1;
-        *segment_end = 0;
-        return S_OK;
-    }
-    else if (PathCchSkipRoot(path, &root_end) == S_OK)
-    {
-        if (root_end - path >= size) return E_INVALIDARG;
-
-        segment_end = path + (root_end - path);
-        if (!*segment_end) return S_FALSE;
-
-        *segment_end = 0;
-        return S_OK;
-    }
-    else
-        return E_INVALIDARG;
-}
-
-BOOL  PathIsUNCEx(const WCHAR *path, const WCHAR **server)
-{
-    const WCHAR *result = NULL;
-
-
-    if (is_prefixed_unc(path))
-        result = path + 8;
-    else if (path[0] == '\\' && path[1] == '\\' && path[2] != '?')
-        result = path + 2;
-
-    if (server) *server = result;
-    return !!result;
-}
-#endif
diff --git a/Python/pytime.c b/Python/pytime.c
index c04e1c605b..109d52692c 100644
--- a/Python/pytime.c
+++ b/Python/pytime.c
@@ -770,7 +770,7 @@ pymonotonic(_PyTime_t *tp, _Py_clock_info_t *info, int raise)
 
     assert(info == NULL || raise);
 
-    ticks = GetTickCount();
+    ticks = GetTickCount64();
     Py_BUILD_ASSERT(sizeof(ticks) <= sizeof(_PyTime_t));
     t = (_PyTime_t)ticks;
 
@@ -787,7 +787,7 @@ pymonotonic(_PyTime_t *tp, _Py_clock_info_t *info, int raise)
     if (info) {
         DWORD timeAdjustment, timeIncrement;
         BOOL isTimeAdjustmentDisabled, ok;
-        info->implementation = "GetTickCount()";
+        info->implementation = "GetTickCount64()";
         info->monotonic = 1;
         ok = GetSystemTimeAdjustment(&timeAdjustment, &timeIncrement,
                                      &isTimeAdjustmentDisabled);
diff --git a/Python/thread_nt.h b/Python/thread_nt.h
index b48b199f3d..23d585cf9f 100644
--- a/Python/thread_nt.h
+++ b/Python/thread_nt.h
@@ -75,13 +75,13 @@ EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds)
         }
     } else if (milliseconds != 0) {
         /* wait at least until the target */
-        ULONGLONG now, target = GetTickCount() + milliseconds;
+        ULONGLONG now, target = GetTickCount64() + milliseconds;
         while (mutex->locked) {
             if (PyCOND_TIMEDWAIT(&mutex->cv, &mutex->cs, (long long)milliseconds*1000) < 0) {
                 result = WAIT_FAILED;
                 break;
             }
-            now = GetTickCount();
+            now = GetTickCount64();
             if (target <= now)
                 break;
             milliseconds = (DWORD)(target-now);
