summaryrefslogtreecommitdiffstats
path: root/PC/dl_nt.c
diff options
context:
space:
mode:
Diffstat (limited to 'PC/dl_nt.c')
-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.