blob: e143c780ac4b23dfaf3d27cd45338683afa8849d [file] [log] [blame]
Guido van Rossum6dbd1901996-08-21 15:03:37 +00001/*
2
3Entry point for the Windows NT DLL.
4
5About the only reason for having this, is so initall() can automatically
6be called, removing that burden (and possible source of frustration if
7forgotten) from the programmer.
8
9*/
Guido van Rossum6dbd1901996-08-21 15:03:37 +000010
Guido van Rossuma1ebdbd1997-05-05 22:18:50 +000011#include "Python.h"
Guido van Rossume7ba4952007-06-06 23:52:48 +000012#include "windows.h"
Guido van Rossum6dbd1901996-08-21 15:03:37 +000013
Christian Heimesd59c64c2007-11-30 19:27:20 +000014#ifdef Py_ENABLE_SHARED
Guido van Rossumec680921997-09-29 23:37:12 +000015char dllVersionBuffer[16] = ""; // a private buffer
16
17// Python Globals
Guido van Rossum6dbd1901996-08-21 15:03:37 +000018HMODULE PyWin_DLLhModule = NULL;
Guido van Rossumec680921997-09-29 23:37:12 +000019const char *PyWin_DLLVersionString = dllVersionBuffer;
20
Guido van Rossum6dbd1901996-08-21 15:03:37 +000021
22BOOL WINAPI DllMain (HANDLE hInst,
23 ULONG ul_reason_for_call,
24 LPVOID lpReserved)
25{
26 switch (ul_reason_for_call)
27 {
28 case DLL_PROCESS_ATTACH:
29 PyWin_DLLhModule = hInst;
Guido van Rossumec680921997-09-29 23:37:12 +000030 // 1000 is a magic number I picked out of the air. Could do with a #define, I spose...
31 LoadString(hInst, 1000, dllVersionBuffer, sizeof(dllVersionBuffer));
Guido van Rossuma1ebdbd1997-05-05 22:18:50 +000032 //initall();
Guido van Rossum6dbd1901996-08-21 15:03:37 +000033 break;
34 case DLL_PROCESS_DETACH:
35 break;
36 }
37 return TRUE;
38}
Christian Heimesd59c64c2007-11-30 19:27:20 +000039
40#endif /* Py_ENABLE_SHARED */