blob: 2608f7e7aaf101454b5d70c70bec478d8eeb6a7c [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*/
10#include "windows.h"
11
12/* NT and Python share these */
Martin v. Löwis4f1cd8b2001-07-26 13:41:06 +000013#include "pyconfig.h"
Guido van Rossuma1ebdbd1997-05-05 22:18:50 +000014#include "Python.h"
Guido van Rossum6dbd1901996-08-21 15:03:37 +000015
Guido van Rossumec680921997-09-29 23:37:12 +000016char dllVersionBuffer[16] = ""; // a private buffer
17
18// Python Globals
Guido van Rossum6dbd1901996-08-21 15:03:37 +000019HMODULE PyWin_DLLhModule = NULL;
Guido van Rossumec680921997-09-29 23:37:12 +000020const char *PyWin_DLLVersionString = dllVersionBuffer;
21
Guido van Rossum6dbd1901996-08-21 15:03:37 +000022
23BOOL WINAPI DllMain (HANDLE hInst,
24 ULONG ul_reason_for_call,
25 LPVOID lpReserved)
26{
27 switch (ul_reason_for_call)
28 {
29 case DLL_PROCESS_ATTACH:
30 PyWin_DLLhModule = hInst;
Guido van Rossumec680921997-09-29 23:37:12 +000031 // 1000 is a magic number I picked out of the air. Could do with a #define, I spose...
32 LoadString(hInst, 1000, dllVersionBuffer, sizeof(dllVersionBuffer));
Guido van Rossuma1ebdbd1997-05-05 22:18:50 +000033 //initall();
Guido van Rossum6dbd1901996-08-21 15:03:37 +000034 break;
35 case DLL_PROCESS_DETACH:
36 break;
37 }
38 return TRUE;
39}