Logo Search packages:      
Sourcecode: virtualbox-ose version File versions

BOOL WINAPI DllMain ( HINSTANCE  hInstDLL,
DWORD  fdwReason,
PVOID  pReserved 
)

The DLL Main for the kPrf DLL.

This is required because we need to initialize the profiler at some point and because we need to know when threads terminate. (We don't care about when threads get created, we simply pick them up when we see them the first time.)

Returns:
Success indicator.
Parameters:
hInstDll The instance handle of the DLL. (i.e. the module handle)
fdwReason The reason why we're here. This is a 'flag' for reasons of tradition, it's really a kind of enum.
pReserved Reserved / undocumented something.

Definition at line 49 of file dllmain-win.cpp.

References kPrfInitialize(), kPrfTerminate(), and kPrfTerminateThread().

{
    switch (fdwReason)
    {
        case DLL_PROCESS_ATTACH:
            if (kPrfInitialize())
                return FALSE;
            break;

        case DLL_PROCESS_DETACH:
            kPrfTerminate();
            break;

        case DLL_THREAD_ATTACH:
            break;

        case DLL_THREAD_DETACH:
            kPrfTerminateThread();
            break;
    }

    return TRUE;
}


Generated by  Doxygen 1.6.0   Back to index