Microsoft Windows CE 3.0  

ActivateDevice

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.

ActivateDeviceloads a device driver and adds registry keys for it to the HLEY_LOCAL_MACHINE\Drivers\Activebranch of the registry. This function supplements RegisterDevice.

HANDLE ActivateDevice(
LPCWSTR
lpszDevKey, 
DWORD
dwClientInfo
);

Parameters

lpszDevKey
Pointer to a string containing the registry path of the device driver's key. This key contains the driver's DLL name and prefix, and other data.
dwClientInfo
Data that will be stored in the device's Active key in the ClientInfo value. The registry path to the driver's Active key is passed in as the contextparameter to the device's XXX_Initfunction. The value in dwClientInfois stored in the registry before XXX_Initis called.

Return Values

On success, ActivateDeviceReturns a handle to the device that can be used in subsequent calls to DeactivateDevice.

Remarks

ActivateDeviceloads a device driver in the manner that the plug and play system loads a device driver. ActivateDevicereads the registry key specified in lpszDevKeyto get the DLL name, device prefix, index, and other values. Next it adds the device to the active device list in the registry branch HKEY_LOCAL_MACHINE\Drivers\Active, and stores the relevant values there. If no device index was specified in the key named in lpszDevKey, then it assigns a free index. Then it calls RegisterDeviceto actually load the device driver DLL in the process space of the Device Manager. Finally, it broadcasts a WM_DEVICECHANGE message for the new device.

Additionally, you can call CeResyncFilesysto cause a file system driver to remount a device because of a media change.

Applications that need to load custom-purpose device drivers can do so by invoking ActivateDevice, if they need the system as a whole to be aware of the device driver. Otherwise, they can use RegisterDevice.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.11 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.

See Also

CeResyncFilesys, RegisterDevice, XXX_Init



 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.