bpo-45720: Drop references to shlwapi.dll on Windows (GH-29417)

This commit is contained in:
Steve Dower 2021-11-05 23:06:45 +00:00 committed by GitHub
parent 4d8f2e09b6
commit a4774f42e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 4 deletions

View File

@ -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.

View File

@ -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");

View File

@ -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>

View File

@ -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>