your Windows® embedded community
The driver is written as a basic streams interface, however it only uses the Init and Deinit functions. These are the required entry points needed by DEVICE.EXE in order to load as a device driver.
The driver reads the registry to get which COM port to use via the function
GetCommPort(). Example registry:
IF CEPC_SERMOUSE
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SerMouse]
"Index"=dword:1
"Dll"="SerMouse.dll"
"Prefix"="SRM"
"Order"=dword:1
"Port"=dword:1
ENDIF
Implemenation note: You could make a Mouse Set Speed utility by allowing an app to do a CreateFile on "SRM1:" and making IOCTL calls. Thus you'd also have to implement SRM_Open, SRM_Close, SRM_IOControl.