Microsoft Windows CE 3.0  

Driver Registration

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.

One aspect where Windows CE drivers differ from Windows 95/98 drivers is in registration. Since Plug-and-Play functionality is not generally an issue on Windows CE devices, drivers are not required to register themselves in such a manner. Instead, DirectSound queries the registry for available DirectSound Drivers.

DirectSound Driver Registry Entries

A Windows CE DirectSound driver should register a GUID, as well as the location of the DLL where the driver code can be found. A typical registry entry might look as follows:

[HKEY_LOCAL_MACHINE\Drivers\DSound\SBAWE64]
"CLSID"="{e437ebb6-534f-11ce-9f53-0020af0ba770}"
"Dll"="dssbawe64.dll" "Desc"="Sound Blaster AWE 64"

or, perhaps if a system has more than one DirectSound compatible device:

[HKEY_LOCAL_MACHINE\Drivers\DSound\SBAWE64]
"CLSID"="{e437ebb6-534f-11ce-9f53-0020af0ba770}"
"Dll"="dssbawe64.dll" "Desc"="Sound Blaster AWE 64"
[HKEY_LOCAL_MACHINE\Drivers\DSound\ES1371]
"CLSID"="{e437ebb6-537f-115e-9f53-0020af3b1770}"
"Dll"="dses1371.dll" "Desc"="Sound Blaster Ensoniq PCI128"

When a client of the DirectSound API calls DirectSoundEnumerate, it will look through the HKEY_LOCAL_MACHINE\Drivers\DSoundentries and report them back to the client application through the DSEnumCallbackthe client registered. The CLSID, Desc and DLL entries in the registry will correspond to the first three parameters DSEnumCallbackexpects. When the client app then selects one of the enumerated devices and calls DirectSoundCreate, the GUID it passes in will be used by DirectSound to select find the correct DLL and create the IDsDriverobject.

Registration of capture drivers is basically the same except that it is under HKEY_LOCAL_MACHINE\Drivers\DSoundCaptureinstead of DSound.

Driver Information Stored in Registry

If the driver requires some parameters, such as an IRQ setting or a DMA address, the registry entry for that driver can contain extra entries that have meaning only for that driver. Since the driver can also access the registry, it can look under HKEY_LOCAL_MACHINE\Drivers\DSoundfor any extra information it might need. For example:

[HKEY_LOCAL_MACHINE\Drivers\DSound\SBAWE64]
"CLSID"="{e437ebb6-534f-11ce-9f53-0020af0ba770}"
"Dll"="dssbawe64.dll" "Desc"="Sound Blaster AWE 64" "Irq"=dword:0a
"Dma"=dword:5 "IoBase"=dword:220

Multiple Devices Handled by the Same Driver

It is conceivable that a device might have more than one instance of a given piece of hardware, all being handled by the same driver. Alternatively, as in the case of DirectSoundCaptureone driver DLL will be responsible for exporting several different interfaces representing different functionality. In this case, separate GUIDs would represent separate functionality. For example, here's what the registry entries might look like for a fictional device that had two Ensoniq cards, each supporting playback and capture:

[HKEY_LOCAL_MACHINE\Drivers\DSound\ES1371A]
"CLSID"="{e437ebb6-537f-115e-9f53-0020af3b1770}"
"Dll"="dses1371.dll" "Desc"="Sound Blaster Ensoniq PCI128 A"
[HKEY_LOCAL_MACHINE\Drivers\DSound\ES1371B]
"CLSID"="{e437ebb6-537f-115e-9f53-0020af3b1771}"
"Dll"="dses1371.dll" "Desc"="Sound Blaster Ensoniq PCI128 B"
[HKEY_LOCAL_MACHINE\Drivers\DSoundCapture\ES1371A]
"CLSID"="{e437ebb6-537f-115e-9f53-0020af3b1780}"
"Dll"="dses1371.dll" "Desc"="Sound Blaster Ensoniq PCI128 A"
[HKEY_LOCAL_MACHINE\Drivers\DSoundCapture\ES1371B]
"CLSID"="{e437ebb6-537f-115e-9f53-0020af3b1781}"
"Dll"="dses1371.dll" "Desc"="Sound Blaster Ensoniq PCI128 B"

Note that each entry has a distinct GUID, but all the entries point to the same driver. The driver will be able to distinguish which object it is being asked to create based on the GUID. Driver writers should publish GUIDs for the functionality their drivers can manage.



 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.