From: Steve Dower Date: Thu, 15 Jan 2015 17:10:16 +0000 (-0800) Subject: Fixes sys.winver generation and removes dependency on user32.dll X-Git-Tag: v3.5.0a1~166 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2587952f2fc4abb3adf6a838bf8a1fc3997c81be;p=python Fixes sys.winver generation and removes dependency on user32.dll --- diff --git a/PC/dl_nt.c b/PC/dl_nt.c index ae10fb5623..c87c51eb55 100644 --- a/PC/dl_nt.c +++ b/PC/dl_nt.c @@ -12,7 +12,12 @@ forgotten) from the programmer. #include "windows.h" #ifdef Py_ENABLE_SHARED +#ifdef MS_DLL_ID +// The string is available at build, so fill the buffer immediately +char dllVersionBuffer[16] = MS_DLL_ID; +#else char dllVersionBuffer[16] = ""; // a private buffer +#endif // Python Globals HMODULE PyWin_DLLhModule = NULL; @@ -88,8 +93,11 @@ BOOL WINAPI DllMain (HANDLE hInst, { case DLL_PROCESS_ATTACH: PyWin_DLLhModule = hInst; +#ifndef MS_DLL_ID + // If we have MS_DLL_ID, we don't need to load the string. // 1000 is a magic number I picked out of the air. Could do with a #define, I spose... LoadString(hInst, 1000, dllVersionBuffer, sizeof(dllVersionBuffer)); +#endif #if HAVE_SXS // and capture our activation context for use when loading extensions. diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 85aebebe2f..33570d7842 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -87,7 +87,7 @@ diff --git a/PCbuild/python.props b/PCbuild/python.props index 99eebf0fe2..788df56bdd 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -1,7 +1,7 @@ - + - Win32 + Win32 Release .cp$(MajorVersionNumber)$(MinorVersionNumber)-win32 .cp$(MajorVersionNumber)$(MinorVersionNumber)-win_amd64 + + + $(MajorVersionNumber).$(MinorVersionNumber) + $(SysWinVer)-32 diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 4ecfd102c1..479f68df55 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -67,7 +67,7 @@ /Zm200 %(AdditionalOptions) $(PySourcePath)Python;$(PySourcePath)Modules\zlib;%(AdditionalIncludeDirectories) - _USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;%(PreprocessorDefinitions) + _USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;MS_DLL_ID="$(SysWinVer)";%(PreprocessorDefinitions) ws2_32.lib;%(AdditionalDependencies) @@ -335,7 +335,6 @@ - @@ -386,6 +385,9 @@ + + + @@ -393,7 +395,7 @@ - +