Share via


DllMain Expert

The expert implements the DllMain function. The operating system calls DllMain to obtain a handle to an instance of the expert.

BOOL WINAPIDllMain(HINSTANCEhInstance,
ULONGulReason,
LPVOIDReserved);

Parameters

  • hInstance
    [out] Handle to an instance of the expert.

    If the expert uses the Network Monitor user interface, the hInstance value must be stored in a global variable. This approach is necessary only when the value of the ulReason parameter is set to DLL_PROCESS_ATTACH.

  • ulReason
    [in] Indicator of why the function was called. A value of DLL_PROCESS_ATTACH, (which applies when the DLL is first loaded) indicates that the expert should save the hInstance value in a global variable.

    With any other value, all calls to the DllMain function can be ignored. For a list of all possible flags set by the operating system, see DLLMain.

  • Reserved
    Parameter is not in use.

Return Values

If the function is successful, the return value is TRUE.

If the function is unsuccessful, the return value is FALSE.

Remarks

The operating system calls the DllMain expert function when a process loads or unloads the expert DLL. The DllMain expert function must be exported only if the expert has a user interface for viewing either configuration or results, and then only to return the proper hInstance value.

The DllMain expert function is based on the dynamic link library DllMain function.

Requirements

Client Requires Windows XP, Windows 2000 Professional, or Windows NT Workstation 4.0.
Server Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server 4.0.