blob: a87b523818a3d2a27917fe37c0ca073d350fe2ed [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
Guido van Rossumec680921997-09-29 23:37:12 +000014char dllVersionBuffer[16] = ""; // a private buffer
15
16// Python Globals
Guido van Rossum6dbd1901996-08-21 15:03:37 +000017HMODULE PyWin_DLLhModule = NULL;
Guido van Rossumec680921997-09-29 23:37:12 +000018const char *PyWin_DLLVersionString = dllVersionBuffer;
19
Guido van Rossum6dbd1901996-08-21 15:03:37 +000020
21BOOL WINAPI DllMain (HANDLE hInst,
22 ULONG ul_reason_for_call,
23 LPVOID lpReserved)
24{
25 switch (ul_reason_for_call)
26 {
27 case DLL_PROCESS_ATTACH:
28 PyWin_DLLhModule = hInst;
Guido van Rossumec680921997-09-29 23:37:12 +000029 // 1000 is a magic number I picked out of the air. Could do with a #define, I spose...
30 LoadString(hInst, 1000, dllVersionBuffer, sizeof(dllVersionBuffer));
Guido van Rossuma1ebdbd1997-05-05 22:18:50 +000031 //initall();
Guido van Rossum6dbd1901996-08-21 15:03:37 +000032 break;
33 case DLL_PROCESS_DETACH:
34 break;
35 }
36 return TRUE;
37}