|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 registers a new device driver with the file system so that applications can access the driver's special device file names.
HANDLE RegisterDevice( LPCWSTR lpszType DWORD dwIndex LPCWSTR lpszLib, DWORD dwInfo );
Stream interface drivers are initialized by a call to this function. For most stream interface drivers, the Device Manager calls this function on behalf of the driver. However, applications can load their own special-purpose stream interface drivers, in which case they also call this function to register the driver. The IpszLibparameter is used to open the device. The IpszTypeparameter is a three-character string that identifies the function entry points in the DLL so that multiple devices can exist in one DLL. The lpszLibparameter is the name of the DLL that contains the entry points. Finally, dwInfois passed to the initialization routine. So, for example, if there are two serial ports on a device and Comm.dll is the DLL implementing the serial driver, it presents the following initialization calls:
h1 = RegisterDevice(L"COM", 1, L"comm.dll",0x3f8);
The DeregisterDevicefunction is used if a device is removed from the system or is being shut down:
In the following code example, h1 is returned from a call to this function.
|Runs on||Versions||Defined in||Include||Link to|
|Windows CE OS||2.0 and later||Ntcompat.h|
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