Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This function is called by the Device Manager to initialize a device.
DWORD XXX_Init( DWORD dwContext );
Parameters
Return Values
Returns a handle to the device context created, or 0 if unsuccessful. This handle is passed to the XXX_Open, XXX_PowerDown, XXX_PowerUp, and XXX_Deinitfunctions.
Remarks
The Device Manager calls this function as a result of a call to the RegisterDevicefunction. 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. Stream interface drivers that support multiple instances of the same type of special device file name--such as Microsoft's sample serial port driver, which supports multiple "COM x:" device filenames — should expect their XXX_Initfunction to be called once for each instance. For such drivers, this function should return separate handles each time it is called. Stream interface drivers that only support a single special device file name then this function can return any non-zero value.
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 dwContextparameter. Usually, the string contains the registry path to a numbered subkey of the HKEY_LOCAL_MACHINE\Drivers\Activekey. 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 Ioctlfor the driver, and if such a key is present, the Device Manager calls XXX_IOControl,passing the value specified by Ioctlas the dwCodeparameter. 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.
Requirements
Runs on | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 1.0 and later |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
Last updated on Tuesday, July 13, 2004