summaryrefslogtreecommitdiffstats
path: root/PC/frozen_dllmain.c
diff options
context:
space:
mode:
Diffstat (limited to 'PC/frozen_dllmain.c')
-rw-r--r--PC/frozen_dllmain.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/PC/frozen_dllmain.c b/PC/frozen_dllmain.c
index a8cc885..0156c50 100644
--- a/PC/frozen_dllmain.c
+++ b/PC/frozen_dllmain.c
@@ -77,7 +77,7 @@ void PyWinFreeze_ExeTerm(void)
{
// Must go backwards
char **modName;
- for (modName = possibleModules+(sizeof(possibleModules) / sizeof(char *))-2;
+ for (modName = possibleModules+Py_ARRAY_LENGTH(possibleModules)-2;
modName >= possibleModules;
*modName--) {
/* printf("Terminating '%s'\n", *modName);*/
@@ -103,7 +103,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
// Must go backwards
char **modName;
- for (modName = possibleModules+(sizeof(possibleModules) / sizeof(char *))-2;
+ for (modName = possibleModules+Py_ARRAY_LENGTH(possibleModules)-2;
modName >= possibleModules;
*modName--)
CallModuleDllMain(*modName, DLL_PROCESS_DETACH);
@@ -118,7 +118,7 @@ BOOL CallModuleDllMain(char *modName, DWORD dwReason)
BOOL (WINAPI * pfndllmain)(HINSTANCE, DWORD, LPVOID);
char funcName[255];
- HMODULE hmod = GetModuleHandle(NULL);
+ HMODULE hmod = GetModuleHandleW(NULL);
strcpy(funcName, "_DllMain");
strcat(funcName, modName);
strcat(funcName, "@12"); // stdcall convention.