Back to index

python3.2  3.2.2
Functions | Variables
frozen_dllmain.c File Reference
#include "windows.h"

Go to the source code of this file.

Functions

BOOL CallModuleDllMain (char *modName, DWORD dwReason)
void PyWinFreeze_ExeInit (void)
void PyWinFreeze_ExeTerm (void)
BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)

Variables

static char * possibleModules []

Function Documentation

BOOL CallModuleDllMain ( char *  modName,
DWORD  dwReason 
)

Definition at line 116 of file frozen_dllmain.c.

{
    BOOL (WINAPI * pfndllmain)(HINSTANCE, DWORD, LPVOID);

    char funcName[255];
    HMODULE hmod = GetModuleHandle(NULL);
    strcpy(funcName, "_DllMain");
    strcat(funcName, modName);
    strcat(funcName, "@12"); // stdcall convention.
    pfndllmain = (BOOL (WINAPI *)(HINSTANCE, DWORD, LPVOID))GetProcAddress(hmod, funcName);
    if (pfndllmain==NULL) {
        /* No function by that name exported - then that module does
           not appear in our frozen program - return OK
        */
        return TRUE;
    }
    return (*pfndllmain)(hmod, dwReason, NULL);
}

Here is the caller graph for this function:

BOOL WINAPI DllMain ( HINSTANCE  hInstance,
DWORD  dwReason,
LPVOID  lpReserved 
)

Definition at line 88 of file frozen_dllmain.c.

{
    BOOL ret = TRUE;
    switch (dwReason) {
        case DLL_PROCESS_ATTACH:
        {
            char **modName;
            for (modName = possibleModules;*modName;*modName++) {
                BOOL ok = CallModuleDllMain(*modName, dwReason);
                if (!ok)
                    ret = FALSE;
            }
            break;
        }
        case DLL_PROCESS_DETACH:
        {
            // Must go backwards
            char **modName;
            for (modName = possibleModules+(sizeof(possibleModules) / sizeof(char *))-2;
                 modName >= possibleModules;
                 *modName--)
                CallModuleDllMain(*modName, DLL_PROCESS_DETACH);
            break;
        }
    }
    return ret;
}

Here is the call graph for this function:

Definition at line 63 of file frozen_dllmain.c.

{
    char **modName;
    for (modName = possibleModules;*modName;*modName++) {
/*              printf("Initialising '%s'\n", *modName); */
        CallModuleDllMain(*modName, DLL_PROCESS_ATTACH);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 76 of file frozen_dllmain.c.

{
    // Must go backwards
    char **modName;
    for (modName = possibleModules+(sizeof(possibleModules) / sizeof(char *))-2;
         modName >= possibleModules;
         *modName--) {
/*              printf("Terminating '%s'\n", *modName);*/
        CallModuleDllMain(*modName, DLL_PROCESS_DETACH);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

char* possibleModules[] [static]
Initial value:
 {
    "pywintypes",
    "pythoncom",
    "win32ui",
    NULL,
}

Definition at line 49 of file frozen_dllmain.c.