Guido van Rossum | 6dbd190 | 1996-08-21 15:03:37 +0000 | [diff] [blame] | 1 | /* |
2 | |||||
3 | Entry point for the Windows NT DLL. | ||||
4 | |||||
5 | About the only reason for having this, is so initall() can automatically | ||||
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 6 | be called, removing that burden (and possible source of frustration if |
Guido van Rossum | 6dbd190 | 1996-08-21 15:03:37 +0000 | [diff] [blame] | 7 | forgotten) from the programmer. |
8 | |||||
9 | */ | ||||
Guido van Rossum | 6dbd190 | 1996-08-21 15:03:37 +0000 | [diff] [blame] | 10 | |
Guido van Rossum | a1ebdbd | 1997-05-05 22:18:50 +0000 | [diff] [blame] | 11 | #include "Python.h" |
Guido van Rossum | e7ba495 | 2007-06-06 23:52:48 +0000 | [diff] [blame] | 12 | #include "windows.h" |
Guido van Rossum | 6dbd190 | 1996-08-21 15:03:37 +0000 | [diff] [blame] | 13 | |
Christian Heimes | d59c64c | 2007-11-30 19:27:20 +0000 | [diff] [blame] | 14 | #ifdef Py_ENABLE_SHARED |
Guido van Rossum | ec68092 | 1997-09-29 23:37:12 +0000 | [diff] [blame] | 15 | |
16 | // Python Globals | ||||
Guido van Rossum | 6dbd190 | 1996-08-21 15:03:37 +0000 | [diff] [blame] | 17 | HMODULE PyWin_DLLhModule = NULL; |
Nikita Nemkin | 4efc336 | 2020-06-24 00:05:57 +0500 | [diff] [blame] | 18 | const char *PyWin_DLLVersionString = MS_DLL_ID; |
Guido van Rossum | ec68092 | 1997-09-29 23:37:12 +0000 | [diff] [blame] | 19 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 20 | BOOL WINAPI DllMain (HANDLE hInst, |
21 | ULONG ul_reason_for_call, | ||||
22 | LPVOID lpReserved) | ||||
Guido van Rossum | 6dbd190 | 1996-08-21 15:03:37 +0000 | [diff] [blame] | 23 | { |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 24 | switch (ul_reason_for_call) |
25 | { | ||||
26 | case DLL_PROCESS_ATTACH: | ||||
27 | PyWin_DLLhModule = hInst; | ||||
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 28 | break; |
Mark Hammond | 9844a1f | 2009-01-27 23:46:57 +0000 | [diff] [blame] | 29 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 30 | case DLL_PROCESS_DETACH: |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 31 | break; |
32 | } | ||||
33 | return TRUE; | ||||
Guido van Rossum | 6dbd190 | 1996-08-21 15:03:37 +0000 | [diff] [blame] | 34 | } |
Christian Heimes | d59c64c | 2007-11-30 19:27:20 +0000 | [diff] [blame] | 35 | |
36 | #endif /* Py_ENABLE_SHARED */ |