Microsoft Windows CE 3.0  

XXX_Init

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

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_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:

  • 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 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

    © 2004 Microsoft Corporation. All rights reserved.