BthModem.sys filter driver

Hello community!
First I must say, I’m new to driver development.
I have some issues on programming a filter driver, that can manipulate
communication between a user mode program and a specific bluetooth
device, which registers itself as a bluetooth COM port. Every time the
application uses some control commands, like changing baud rate, the
driver should create some device specific character strings to perform
this operations on the connected bluetooth device. For now, i need some
design help to implement such a functionality. As far as i have read i
need to programm an upperclass filter driver for the BthModem.sys,
offers a virtual COM port to windows, right? Furthermore i need to catch
the IRP’s (IRP_MJ_DEVICE_CONTROL…?) to generate associated IRP’s
(IRP_MJ_WRITE) with the controle strings for the bluetooth device. These
should be passed to the underlaying BthModem driver.
I saw some skeleton samples in the kmdf section of the WDF, for example
“filter” in the toaster directory. Can i use this as a starting point
and am I generally on the right way?
Thanks in advance :wink:

Just curious, why do you need to convert an IOCTL into a bunch of writes?

The KMDF toaster filter sample is your best starting point. I would make it a device upper filter, not class upper filter. A class upper filter would be loaded for any modem, regardless of how it is connected. You want your filter to only load for bth modems. But, for many many of the bth modems out there, the hw ID is going to be generic (the class guid from the sdp record) and there will be no way for you to know if you are filtering your magical bth modem or somebody elses (like my cell phone’s) modem unless the remote device implements the PnP ID SDP record, in which case the modem’s hardware ID will include a VID and a PID which will truly limit your filter to your special device

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Hannes Finck
Sent: Friday, October 31, 2008 10:15 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] BthModem.sys filter driver

Hello community!
First I must say, I’m new to driver development.
I have some issues on programming a filter driver, that can manipulate
communication between a user mode program and a specific bluetooth
device, which registers itself as a bluetooth COM port. Every time the
application uses some control commands, like changing baud rate, the
driver should create some device specific character strings to perform
this operations on the connected bluetooth device. For now, i need some
design help to implement such a functionality. As far as i have read i
need to programm an upperclass filter driver for the BthModem.sys,
offers a virtual COM port to windows, right? Furthermore i need to catch
the IRP’s (IRP_MJ_DEVICE_CONTROL…?) to generate associated IRP’s
(IRP_MJ_WRITE) with the controle strings for the bluetooth device. These
should be passed to the underlaying BthModem driver.
I saw some skeleton samples in the kmdf section of the WDF, for example
“filter” in the toaster directory. Can i use this as a starting point
and am I generally on the right way?
Thanks in advance :wink:


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Just to explain, this driver is for bluetooth modules wich are plugged on an electricity meter and communicate with it via IRDA interface. To change properties of the connection (i.e baud rate) between e meter and pc software the bluetooth module expects specific character strings, but the software on the pc doesn’t know this. It simply calls the API routines for setting connection parameters. The filter driver needs to do the work and convert this IOCTL to a WRITE with the character string command. To complicate that this should only happen to one bluetooth device, for example the one connected to COM362 or whatever. The port which needs to be filtered should be set through usermode software (i need to develop this,too). I read where is way to directly communicate with the driver through an WMI interface? Or maybe, this is possible with a registry entry so the driver (on load) knows which COM port to filter. I don’t exactly know where the driver should hook into the driver stack to do that. For this i need some design help. I never developed a driver before, but all this seems very interesting for me :slight_smile:

I see. You want a device filter, the driver should not read from the registry for which port to attach to. You driver shou be installed as a filter through pnp. You can do this with your app when it picks the port to filter. This does assum the underlying bth stack enumerates SSP services on remote devices as unique pnp device nodes.

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: xxxxx@device.de
Sent: Friday, October 31, 2008 3:48 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] BthModem.sys filter driver

Just to explain, this driver is for bluetooth modules wich are plugged on an electricity meter and communicate with it via IRDA interface. To change properties of the connection (i.e baud rate) between e meter and pc software the bluetooth module expects specific character strings, but the software on the pc doesn’t know this. It simply calls the API routines for setting connection parameters. The filter driver needs to do the work and convert this IOCTL to a WRITE with the character string command. To complicate that this should only happen to one bluetooth device, for example the one connected to COM362 or whatever. The port which needs to be filtered should be set through usermode software (i need to develop this,too). I read where is way to directly communicate with the driver through an WMI interface? Or maybe, this is possible with a registry entry so the driver (on load) knows which COM port to filter. I don’t exactly know where the driver should hook into the driver stack to do that. For this i need some design help. I never developed a driver before, but all this seems very interesting for me :slight_smile:


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer