ActivateDevice

ActivateDevice loads a device driver and adds registry keys for it to the HLEY_LOCAL_MACHINE\Drivers\Active branch 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 context parameter to the device's XXX_Init function. The value in dwClientInfo is stored in the registry before XXX_Init is called.

Return Values

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

Remarks

ActivateDevice loads a device driver in the manner that the plug and play system loads a device driver. ActivateDevice reads the registry key specified in lpszDevKey to 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 RegisterDevice to 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 CeResyncFilesys to 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

© 1992-2000 Microsoft Corporation. All rights reserved.