This function is called by the Device Manager to initialize a 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.
The Device Manager calls this function as a result of a call to the RegisterDevice function. 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 uses this information to access data stored in the registry.
This function might perform the following tasks:
After this function returns, the Device Manager checks the registry for a key named Ioctl for the driver, and if such a key is present the Device Manager calls XXX_IOControl, passing the value specified by Ioctl as the dwCode parameter. 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.