DrvLibInit

BOOL
   DrvLibInit(
       HINSTANCE
hModule,
       ULONG
Reason,
       PCONTEXT
pContext
       );

The DrvLibInit function initializes drvlib.lib for use with the calling user-mode audio driver. User-mode audio drivers call this function before they begin calling other functions in drvlib.lib. They call the function again prior to being unloaded.

Parameters

hModule

Instance handle of the module that opened the user-mode driver. Obtained by calling GetDriverModuleHandle, which is described in the Win32 SDK.

Reason

Set to one of the following values.

·DLL_PROCESS_ATTACH, if attaching to drvlib.lib.

·DLL_PROCESS_DETACH, if detaching from drvlib.lib.

pContext

Not used. Should be set to NULL.

Return Value

Returns TRUE if the operation succeeds. Otherwise returns FALSE.

Comments

When the driver’s DriverProc function receives a DRV_LOAD message, it should call DrvLibInit with a Reason value of DLL_PROCESS_ATTACH.

When the driver’s DriverProc function receives a DRV_FREE message, it should call DrvLibInit with a Reason value of DLL_PROCESS_DETACH.

For additional information, see Installing and Configuring your Driver, Using drvlib.lib.