diff options
author | Steve Dower <steve.dower@python.org> | 2021-11-05 23:06:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-05 23:06:45 (GMT) |
commit | a4774f42e35861c4bb16928cffb011c2d8a285ac (patch) | |
tree | 7f996828acfbced9695297ee6b957b2ede44bdf1 | |
parent | 4d8f2e09b6216449f7b10eb42fd9af0d32f99be3 (diff) | |
download | cpython-a4774f42e35861c4bb16928cffb011c2d8a285ac.zip cpython-a4774f42e35861c4bb16928cffb011c2d8a285ac.tar.gz cpython-a4774f42e35861c4bb16928cffb011c2d8a285ac.tar.bz2 |
bpo-45720: Drop references to shlwapi.dll on Windows (GH-29417)
-rw-r--r-- | Misc/NEWS.d/next/Windows/2021-11-05-01-05-46.bpo-45720.47Nc5I.rst | 3 | ||||
-rw-r--r-- | PC/getpathp.c | 4 | ||||
-rw-r--r-- | PCbuild/_freeze_module.vcxproj | 2 | ||||
-rw-r--r-- | PCbuild/pythoncore.vcxproj | 2 |
4 files changed, 7 insertions, 4 deletions
diff --git a/Misc/NEWS.d/next/Windows/2021-11-05-01-05-46.bpo-45720.47Nc5I.rst b/Misc/NEWS.d/next/Windows/2021-11-05-01-05-46.bpo-45720.47Nc5I.rst new file mode 100644 index 0000000..315759b --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2021-11-05-01-05-46.bpo-45720.47Nc5I.rst @@ -0,0 +1,3 @@ +Internal reference to :file:`shlwapi.dll` was dropped to help improve +startup time. This DLL will no longer be loaded at the start of every Python +process. diff --git a/PC/getpathp.c b/PC/getpathp.c index 549353d..a273480 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -92,7 +92,6 @@ #include <windows.h> #include <pathcch.h> -#include <shlwapi.h> #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -265,7 +264,8 @@ canonicalize(wchar_t *buffer, const wchar_t *path) return _PyStatus_NO_MEMORY(); } - if (PathIsRelativeW(path)) { + const wchar_t *pathTail; + if (FAILED(PathCchSkipRoot(path, &pathTail)) || path == pathTail) { wchar_t buff[MAXPATHLEN + 1]; if (!GetCurrentDirectoryW(MAXPATHLEN, buff)) { return _PyStatus_ERR("unable to find current working directory"); diff --git a/PCbuild/_freeze_module.vcxproj b/PCbuild/_freeze_module.vcxproj index 12bdde2..d33e07c 100644 --- a/PCbuild/_freeze_module.vcxproj +++ b/PCbuild/_freeze_module.vcxproj @@ -92,7 +92,7 @@ </ClCompile> <Link> <SubSystem>Console</SubSystem> - <AdditionalDependencies>version.lib;shlwapi.lib;ws2_32.lib;pathcch.lib;bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>version.lib;ws2_32.lib;pathcch.lib;bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies> </Link> </ItemDefinitionGroup> <ItemGroup> diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 646bc8e..b659981 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -106,7 +106,7 @@ <PreprocessorDefinitions Condition="$(IncludeExternals)">_Py_HAVE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> </ClCompile> <Link> - <AdditionalDependencies>version.lib;shlwapi.lib;ws2_32.lib;pathcch.lib;bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>version.lib;ws2_32.lib;pathcch.lib;bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies> </Link> </ItemDefinitionGroup> <ItemGroup> |