Serial ports Emulation through a driver

Hi,

I need to create a driver that is able to emulate Serial ports, by this I mean
that a user mode application can ‘communicate’ with the driver by treating it as normal comports

(i.e createfile on COM4 . COM3)

the idea is that we have an application that commutates with modems and for testing purpose we would like to create solution that is able to emulate multiple modems

what kind of driver should I create to achieve this? (no user mode solution is available right?)

Have you considered a null serial cable, connect it to another com port and just emulate the modem in an app that opens the secondary port? Way simpler than writing a driver

d

debt from my phone


From: xxxxx@yahoo.com
Sent: 5/19/2012 8:05 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Serial ports Emulation through a driver

Hi,

I need to create a driver that is able to emulate Serial ports, by this I mean
that a user mode application can ‘communicate’ with the driver by treating it as normal comports

(i.e createfile on COM4 . COM3)

the idea is that we have an application that commutates with modems and for testing purpose we would like to create solution that is able to emulate multiple modems

what kind of driver should I create to achieve this? (no user mode solution is available right?)


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

Thanks for your reply,

That is out current setup, but it has the some limitations that we are attempting to solve

1 - we want to be able create multiple com ports with much hassle (i.e no hardware set ups etc…)
2 - we would like to automate this process (the driver will be used to test our application)

The basic idea is to have a console application that will communicate with a driver that creates multiple com ports, the console will then set up each COM port (by communicating with the driver) with particular profile (depending on what modem we want to test).

is some thing like this possible? if so what kind of driver should we be looking at?

Thanks :slight_smile:

Bill J. West wrote:

The basic idea is to have a console application that will
communicate with a driver that creates multiple com ports,
the console will then set up each COM port (by communicating
with the driver) with particular profile (depending on what
modem we want to test). is some thing like this possible?
if so what kind of driver should we be looking at?

Here is my odd suggestion based on the fact that making a serial driver is difficult, and making a bus driver in KMDF is relatively easy. I think I told a guy on this group to do it this way once and he eventually got it working without a lot of trouble.

Make a bus driver that emulates CDC ACM on the PDOs that it creates. Spawn as many instances as you need of the inbox usbser.sys driver. Then use the FDO of the bus driver to “feed” data to (and retrieve data from) the virtual serial devices. The first part of the bus driver IOCTL is a cookie that designates which COM port you’re trying to talk to, the rest is the payload.

I see,

thanks, dp you know if there is serial driver example in the wddk? so as to consider both options

There is a serial sample driver in the wdk (src\serial\serial). It is online if you are using the win8 wdk, http://code.msdn.microsoft.com/windowshardware/Serial-73a4564d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Monday, May 21, 2012 12:21 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Serial ports Emulation through a driver

I see,

thanks, dp you know if there is serial driver example in the wddk? so as to consider both options


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