blob: 7f17ee168727f0e80587cbc8968c1f9507361468 [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
Antoine Pitrouf95a1b32010-05-09 15:52:27 +00006be called, removing that burden (and possible source of frustration if
Guido van Rossum6dbd1901996-08-21 15:03:37 +00007forgotten) 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 +000015
16// Python Globals
Guido van Rossum6dbd1901996-08-21 15:03:37 +000017HMODULE PyWin_DLLhModule = NULL;
Nikita Nemkin4efc3362020-06-24 00:05:57 +050018const char *PyWin_DLLVersionString = MS_DLL_ID;
Guido van Rossumec680921997-09-29 23:37:12 +000019
Antoine Pitrouf95a1b32010-05-09 15:52:27 +000020BOOL WINAPI DllMain (HANDLE hInst,
21 ULONG ul_reason_for_call,
22 LPVOID lpReserved)
Guido van Rossum6dbd1901996-08-21 15:03:37 +000023{
Antoine Pitrouf95a1b32010-05-09 15:52:27 +000024 switch (ul_reason_for_call)
25 {
26 case DLL_PROCESS_ATTACH:
27 PyWin_DLLhModule = hInst;
Antoine Pitrouf95a1b32010-05-09 15:52:27 +000028 break;
Mark Hammond9844a1f2009-01-27 23:46:57 +000029
Antoine Pitrouf95a1b32010-05-09 15:52:27 +000030 case DLL_PROCESS_DETACH:
Antoine Pitrouf95a1b32010-05-09 15:52:27 +000031 break;
32 }
33 return TRUE;
Guido van Rossum6dbd1901996-08-21 15:03:37 +000034}
Christian Heimesd59c64c2007-11-30 19:27:20 +000035
36#endif /* Py_ENABLE_SHARED */