Device Manager calls xxx_Init function to initialize your device.
DWORD xxx_Init( DWORD dwContext );
Returns a handle to the device context created. This handle is passed to the xxx_Open, xxx_PowerDown, xxx_PowerUp, and xxx_Deinit functions.
When the user starts using a device, such as when a PC Card is inserted, the Device Manager calls this function to initialize the device. This function is not called by applications.
The Device Manager specifies a pointer to a string containing the registry path to the active key of the specific PC Card device in the dwContext parameter. Usually the string contains the registry path to a numbered subkey of the HKEY_LOCAL_MACHINE\Drivers\Active key. Your initialization function can use this information to access data stored in the registry.
Some tasks this function might perform include:
After this function returns, the Device Manager checks the registry for a key named Ctrl for the driver, and if such a key is present Device Manger calls xxx_IOControl. Your driver can use this function to finish initializing itself after it has been installed. For example, a driver might load additional modules that require the underlying driver to be installed before they can load.