summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2015-01-15 17:10:16 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2015-01-15 17:10:16 (GMT)
commit2587952f2fc4abb3adf6a838bf8a1fc3997c81be (patch)
tree4c3004cb2dc2e833993cc1aa421fbd92e0d5b332 /PC
parenta39eb0f42b8926aad10fe4f11371f0ec219da276 (diff)
downloadcpython-2587952f2fc4abb3adf6a838bf8a1fc3997c81be.zip
cpython-2587952f2fc4abb3adf6a838bf8a1fc3997c81be.tar.gz
cpython-2587952f2fc4abb3adf6a838bf8a1fc3997c81be.tar.bz2
Fixes sys.winver generation and removes dependency on user32.dll
Diffstat (limited to 'PC')
-rw-r--r--PC/dl_nt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/PC/dl_nt.c b/PC/dl_nt.c
index ae10fb5..c87c51e 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.