Hi,
I need to create a number of virtual serial ports under win2k/XP and have
been considering the following alternatives:
-
Modify serial.sys by removing hardware access. This looks a little
difficult as serial.sys seems to access hardware in many places, but has
the advantage of correctly implementing all serial functionality.
-
Building a virtual serial driver from scratch and adding in all serial
functionality.
Which route would be the best to follow?
In addition, what is the best way to create multiple instances of a virtual
serial port?
Any help would be appreciated!
Regards,
Lance
You can start with either a PnP version of the serial driver or you can
start with a PnP driver and add in the serial interface. Either way, the
bottom side of the driver will be modified to do what you want with the
data.
You shouldn’t have to start from scratch in either scenario since there
are examples of both.
Pete
Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com
>-----Original Message-----
>From: xxxxx@lists.osr.com [mailto:bounce-ntdev-
>xxxxx@lists.osr.com] On Behalf Of Lance Pompe
>Sent: Friday, June 28, 2002 3:44 AM
>To: NT Developers Interest List
>Subject: [ntdev] Virtual serial ports
>
>Hi,
>
>I need to create a number of virtual serial ports under win2k/XP and
have
>been considering the following alternatives:
>
>1) Modify serial.sys by removing hardware access. This looks a little
>difficult as serial.sys seems to access hardware in many places, but
has
>the advantage of correctly implementing all serial functionality.
>
>2) Building a virtual serial driver from scratch and adding in all
serial
>functionality.
>
>Which route would be the best to follow?
>
>In addition, what is the best way to create multiple instances of a
>virtual
>serial port?
>
>Any help would be appreciated!
>
>Regards,
>Lance
>
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@KernelDrivers.com
>To unsubscribe send a blank email to %%email.unsub%%
Hi,
I am presently doing exactly the same - creating virtual COM ports. I
have done it in this manner. I started with a generic WDM driver which
handles all the IRPs that the Serial driver handles (see serial.sys source
available in the NT DDK to create this list). With in the despatch
function you do whatever “virtual” you want to do with the data that is
being sent to you. In case you need to actually transmit this data on the
COM port, send read/write IRPs to the Serial.sys driver from within your
driver by getting an device object pointer to it.
However one thing I still have not figured out is how to make my driver
appear as another “COMx” in the device manager. Any points here will help
as I have been fiddling with the registry to make this happen!
Regards,
Ganesh Okade
Hi Ganesh,
I have created a generic WDM driver that appears as a COMx port in device
manager as follows:
Your inf file for installing the driver must include
[Version]
Signature=$CHICAGO$
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
This tells the system to install the driver as a port.
Create a registry entry in HKLM\HARDWARE\DEVICEMAP\SERIALCOMM
for legacy applications to see COMx.
I am going to include support for all IRPs that serial.sys handles. Is it
possible to load more than one
instance of the driver to create multiple virtual serial ports? I get a
conflict when attempting this.
Regards,
Lance
“Ganesh Okade” wrote in message
news:xxxxx@ntdev…
>
> Hi,
> I am presently doing exactly the same - creating virtual COM ports. I
> have done it in this manner. I started with a generic WDM driver which
> handles all the IRPs that the Serial driver handles (see serial.sys source
> available in the NT DDK to create this list). With in the despatch
> function you do whatever “virtual” you want to do with the data that is
> being sent to you. In case you need to actually transmit this data on the
> COM port, send read/write IRPs to the Serial.sys driver from within your
> driver by getting an device object pointer to it.
> However one thing I still have not figured out is how to make my driver
> appear as another “COMx” in the device manager. Any points here will help
> as I have been fiddling with the registry to make this happen!
>
> Regards,
> Ganesh Okade
>
>
Hi,
You can do this by adding multiple entries in the [DeviceList] INF
Section.
Regards,
Rajiv.
Hi Rajiv,
Thanks for your suggestion.
I have tried adding multiple entries of the form
[DeviceList]
%DESCRIPTION%=DriverInstall,*WCO0905
%DESCRIPTION%=DriverInstall,*WCO0905
but this results in only one port being added to device manager as before.
Is there something I am missing?
Regards,
Lance
“Rajiv B.L.” wrote in message news:xxxxx@ntdev…
>
> Hi,
>
> You can do this by adding multiple entries in the [DeviceList] INF
> Section.
>
> Regards,
> Rajiv.
>
>
Actually, if the driver is supporting multiple ports, then it would be
better to use
Signature=“$Windows NT$”
Class=MultiPortSerial
ClassGuid={50906CB8-BA12-11D1-BF5D-0000F805F530}
for the main driver and then the port inf Lance refers to for each
individual port.
I would also discourage writin to HKLM\HARDWARE\DEVICEMAP\SERIALCOMM
as this is maintained by the PnP manager. When you enumerate your port with
PnP, it will
create the entry in the device map.
“Lance Pompe” wrote in message news:xxxxx@ntdev…
>
> Hi Ganesh,
>
> I have created a generic WDM driver that appears as a COMx port in device
> manager as follows:
>
> Your inf file for installing the driver must include
>
> [Version]
> Signature=$CHICAGO$
> Class=Ports
> ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
>
> This tells the system to install the driver as a port.
>
> Create a registry entry in HKLM\HARDWARE\DEVICEMAP\SERIALCOMM
> for legacy applications to see COMx.
>
> I am going to include support for all IRPs that serial.sys handles. Is it
> possible to load more than one
> instance of the driver to create multiple virtual serial ports? I get a
> conflict when attempting this.
>
> Regards,
> Lance
>
> “Ganesh Okade” wrote in message
> news:xxxxx@ntdev…
> >
> > Hi,
> > I am presently doing exactly the same - creating virtual COM ports. I
> > have done it in this manner. I started with a generic WDM driver which
> > handles all the IRPs that the Serial driver handles (see serial.sys
source
> > available in the NT DDK to create this list). With in the despatch
> > function you do whatever “virtual” you want to do with the data that is
> > being sent to you. In case you need to actually transmit this data on
the
> > COM port, send read/write IRPs to the Serial.sys driver from within your
> > driver by getting an device object pointer to it.
> > However one thing I still have not figured out is how to make my
driver
> > appear as another “COMx” in the device manager. Any points here will
help
> > as I have been fiddling with the registry to make this happen!
> >
> > Regards,
> > Ganesh Okade
> >
> >
>
>
>
>
The entry in the device map must be written by the driver; PnP or the
I/O subsystem have no idea about this key or its function.
D
This posting is provided “AS IS” with no warranties, and confers no
rights.
-----Original Message-----
From: Del Fredricks [mailto:xxxxx@comtrol.com]
Sent: Monday, July 15, 2002 9:15 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Virtual serial ports
Actually, if the driver is supporting multiple ports, then it would be
better to use
Signature=“$Windows NT$”
Class=MultiPortSerial ClassGuid={50906CB8-BA12-11D1-BF5D-0000F805F530}
for the main driver and then the port inf Lance refers to for each
individual port.
I would also discourage writin to HKLM\HARDWARE\DEVICEMAP\SERIALCOMM
as this is maintained by the PnP manager. When you enumerate your port
with PnP, it will create the entry in the device map.
“Lance Pompe” wrote in message news:xxxxx@ntdev…
>
> Hi Ganesh,
>
> I have created a generic WDM driver that appears as a COMx port in
> device manager as follows:
>
> Your inf file for installing the driver must include
>
> [Version]
> Signature=$CHICAGO$
> Class=Ports
> ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
>
> This tells the system to install the driver as a port.
>
> Create a registry entry in HKLM\HARDWARE\DEVICEMAP\SERIALCOMM
> for legacy applications to see COMx.
>
> I am going to include support for all IRPs that serial.sys handles. Is
> it possible to load more than one instance of the driver to create
> multiple virtual serial ports? I get a conflict when attempting this.
>
> Regards,
> Lance
>
> “Ganesh Okade” wrote in message
> news:xxxxx@ntdev…
> >
> > Hi,
> > I am presently doing exactly the same - creating virtual COM
> > ports. I have done it in this manner. I started with a generic WDM
> > driver which handles all the IRPs that the Serial driver handles
> > (see serial.sys
source
> > available in the NT DDK to create this list). With in the despatch
> > function you do whatever “virtual” you want to do with the data that
> > is being sent to you. In case you need to actually transmit this
> > data on
the
> > COM port, send read/write IRPs to the Serial.sys driver from within
> > your driver by getting an device object pointer to it.
> > However one thing I still have not figured out is how to make my
driver
> > appear as another “COMx” in the device manager. Any points here will
help
> > as I have been fiddling with the registry to make this happen!
> >
> > Regards,
> > Ganesh Okade
> >
> >
>
>
>
>
—
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%