Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This function is called by the Device Manager to initialize a device.
DWORD XXX_Init(
DWORD dwContext );
Parameters
- dwContext
Specifies a pointer to a string containing the registry path to the active key for the stream interface driver.
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_Deinit functions.
Remarks
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. 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 "COMx:" device filenames — should expect their XXX_Init function 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 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:
- Initialize the installed device to a default state.
- Allocate resources used globally by the device driver.
- Register a status callback function with Card Services. When the status of the device changes, the operating system calls this status callback function. For example, the status of a PC Card changes when you insert it or remove it.
- Map system memory and I/O space to a PC Card device's memory and I/O space.
- Request notification on specific callback events.
- For an interrupt-driven device, register an interrupt callback function. When the device generates an interrupt, the operating system calls this interrupt callback function.
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.
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
© 1992-2000 Microsoft Corporation. All rights reserved.