Hi,
I am new in device driver programming. I have a situation where I need to write a device driver that will create or install some virtual COM ports and underlying communication protocol will be TCP/IP, socket based calls using Microsoft winsock.
In brief, this is how it will work:
* Limited number of Virtual COM ports are created or installed on the Client PC. A configuration utility maps these COM ports to remote IP addresses and their listening ports.
* Data arriving in ports are redirected to TCP ports. Use of socket calls are made to contruct socket data to send over the ethernet. In other words, data are delivered as they come on virtual COM ports.
* In this context, we have an old serial communication client program. This shall remain unchanged and the idea is that this program will now use the virtual COM port which will then send data to the server using the underlying TCP/IP; thus, avoiding any client modification at the program level.
I believe I would need to write a VDD to intercept the NTVDM and then, I/O calls manipulated to construct and deliver to TCP ports using winsock APIs. I had been looking for sample codes relating to VDD, but it seems microsoft has removed the sample COM_VDD (Ref: NT 4.0 DDK samples from microsoft). For documentation, I had been looking at MSDN ( MSDN Home > MSDN Library > Virtual Device Drivers for MS-DOS Applications or Special Hardware > How to Provide Virtual Device Support: VDM-Based Intercepts ) I also have the book on “Programming the Windows Driver Model, Walter Oney”, but the book doesn’t seem to give any details of virtual device drivers and creating virtual COM ports.
I had been looking thoroughly for any sample codes on creating virtual COM ports but many of the search results from the web are quite confusing. If someone could provide me guidelines, or some informative resources, that will be really helpful for me.
Thanks,
Jayanta
You know, there is allready such a tool. C can’t remember the name of the
company correctly, but it exists. Even multiplatform.
----- Original Message -----
From: “Konjengbam J. Singh”
To: “NT Developers Interest List”
Sent: Friday, October 25, 2002 2:59 PM
Subject: [ntdev] Beginner’s question: Writing device driver ( creating
virtual COM port and redirecting to TCP/IP port)
Hi,
I am new in device driver programming. I have a situation where I need to
write a device driver that will create or install some virtual COM ports and
underlying communication protocol will be TCP/IP, socket based calls using
Microsoft winsock.
In brief, this is how it will work:
* Limited number of Virtual COM ports are created or installed on the Client
PC. A configuration utility maps these COM ports to remote IP addresses and
their listening ports.
* Data arriving in ports are redirected to TCP ports. Use of socket calls
are made to contruct socket data to send over the ethernet. In other words,
data are delivered as they come on virtual COM ports.
* In this context, we have an old serial communication client program. This
shall remain unchanged and the idea is that this program will now use the
virtual COM port which will then send data to the server using the
underlying TCP/IP; thus, avoiding any client modification at the program
level.
I believe I would need to write a VDD to intercept the NTVDM and then, I/O
calls manipulated to construct and deliver to TCP ports using winsock APIs.
I had been looking for sample codes relating to VDD, but it seems microsoft
has removed the sample COM_VDD (Ref: NT 4.0 DDK samples from microsoft). For
documentation, I had been looking at MSDN ( MSDN Home > MSDN Library >
Virtual Device Drivers for MS-DOS Applications or Special Hardware > How to
Provide Virtual Device Support: VDM-Based Intercepts ) I also have the book
on “Programming the Windows Driver Model, Walter Oney”, but the book doesn’t
seem to give any details of virtual device drivers and creating virtual COM
ports.
I had been looking thoroughly for any sample codes on creating virtual COM
ports but many of the search results from the web are quite confusing. If
someone could provide me guidelines, or some informative resources, that
will be really helpful for me.
Thanks,
Jayanta
—
You are currently subscribed to ntdev as: xxxxx@miem.edu.ru
To unsubscribe send a blank email to %%email.unsub%%
Just to clarify…your existing application is a 16-bit dos application
that uses direct access to the serial I/O ports (IN / OUT instructions)?
----- Original Message -----
From: “Konjengbam J. Singh”
To: “NT Developers Interest List”
Sent: Friday, October 25, 2002 2:59 PM
Subject: [ntdev] Beginner’s question: Writing device driver ( creating
virtual COM port and redirecting to TCP/IP port)
Hi,
I am new in device driver programming. I have a situation where I need to
write a device driver that will create or install some virtual COM ports
and
underlying communication protocol will be TCP/IP, socket based calls using
Microsoft winsock.
In brief, this is how it will work:
* Limited number of Virtual COM ports are created or installed on the
Client
PC. A configuration utility maps these COM ports to remote IP addresses and
their listening ports.
* Data arriving in ports are redirected to TCP ports. Use of socket calls
are made to contruct socket data to send over the ethernet. In other words,
data are delivered as they come on virtual COM ports.
* In this context, we have an old serial communication client program. This
shall remain unchanged and the idea is that this program will now use the
virtual COM port which will then send data to the server using the
underlying TCP/IP; thus, avoiding any client modification at the program
level.
I believe I would need to write a VDD to intercept the NTVDM and then, I/O
calls manipulated to construct and deliver to TCP ports using winsock APIs.
I had been looking for sample codes relating to VDD, but it seems microsoft
has removed the sample COM_VDD (Ref: NT 4.0 DDK samples from microsoft).
For
documentation, I had been looking at MSDN ( MSDN Home > MSDN Library >
Virtual Device Drivers for MS-DOS Applications or Special Hardware > How
to
Provide Virtual Device Support: VDM-Based Intercepts ) I also have the book
on “Programming the Windows Driver Model, Walter Oney”, but the book
doesn’t
seem to give any details of virtual device drivers and creating virtual COM
ports.
I had been looking thoroughly for any sample codes on creating virtual COM
ports but many of the search results from the web are quite confusing. If
someone could provide me guidelines, or some informative resources, that
will be really helpful for me.
Thanks,
Jayanta
—
You are currently subscribed to ntdev as: xxxxx@miem.edu.ru
To unsubscribe send a blank email to %%email.unsub%%
—
You are currently subscribed to ntdev as: xxxxx@tenpennies.com
To unsubscribe send a blank email to %%email.unsub%%
Hi,
I have been told that there is no 16-bit MS-DOS application. The
information as is provided me is as thus: 32-bit serial communication
client program running on Win2000 machines. On second thought, maybe, its
not a VDD that I require.
What I would require in essence is the following:
A virtual COM port driver, that will support TCP/IP as underlying
communication protocol. This driver shall be operating in user-mode as a
DLL and will have nothing to do with hardware interrupts directly.
Communication with TCP/IP layer will be made using Winsock calls as driver
shall be operating in user-mode. The target platform shall be Win2000.
Example usage of this driver will be providing support for Hyperterminal
session through some virtual COM port set up using my driver. Tactical
software has written something like that for their “DialOutIP”. But, there
is little information and so less resources on how this thing can be done.
Functionality wise, the driver I would need will be similar to that of
their “DialOutIP” with raw TCP/IP feature.
To put it simply, I want to know first how to create virtual COM ports.
Where can I get sample codes for such device driver development?
Any help will be appreciated.
Thanks,
Jayanta
Just to clarify…your existing application is a 16-bit dos application
that uses direct access to the serial I/O ports (IN / OUT instructions)?
----- Original Message -----
From: “Konjengbam J. Singh”
> To: “NT Developers Interest List”
> Sent: Friday, October 25, 2002 2:59 PM
> Subject: [ntdev] Beginner’s question: Writing device driver ( creating
> virtual COM port and redirecting to TCP/IP port)
>
>
> Hi,
>
> I am new in device driver programming. I have a situation where I need to
> write a device driver that will create or install some virtual COM ports
> and
> underlying communication protocol will be TCP/IP, socket based calls using
> Microsoft winsock.
>
> In brief, this is how it will work:
> * Limited number of Virtual COM ports are created or installed on the
> Client
> PC. A configuration utility maps these COM ports to remote IP addresses and
> their listening ports.
> * Data arriving in ports are redirected to TCP ports. Use of socket calls
> are made to contruct socket data to send over the ethernet. In other words,
> data are delivered as they come on virtual COM ports.
> * In this context, we have an old serial communication client program. This
> shall remain unchanged and the idea is that this program will now use the
> virtual COM port which will then send data to the server using the
> underlying TCP/IP; thus, avoiding any client modification at the program
> level.
>
> …
> someone could provide me guidelines, or some informative resources, that
> will be really helpful for me.
>
> Thanks,
>
> Jayanta
>
It’s definitely not a VDD that you want.
You can look at the serial sample in the DDK for information on how to
write a driver that exports a serial interface. What you actually
communicate with in response to the calls into the driver is your business.
But…if you want an application like HyperTerminal to be able to use your
virtual ports you can do a couple of things. 1) Write a kernel mode
driver that handles all the IOCTL of a serial port. Use a kernel mode
sockets library (like that provided by our lists hosts for examples) to
simplify your programming. This would be the most flexible solution. 2)
Write a kernel mode driver that uses an inverted call model in conjunction
with a user mode service. The kernel driver would handle the I/O requests,
and then communicate with a helper service in user mode that will actually
perform the network communications. You can look at the back issues of the
NT insider for information on an inverted call model. 3) For a
completely user mode solution, you can start doing things like hooking the
read / write / ioctl / open / close calls and inspect the parameters to
determine if it is a real serial port or you’re your that you’re interested
in. I really wouldn’t recommend this route, but admittedly don’t have much
experience with those techniques.
My recommendation (based on the information I have)…1) if you have more
money than time…2) if you have more time than money.
Shaun
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@lesswire.com
Sent: Tuesday, October 29, 2002 1:53 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Beginner’s question: Writing device driver ( creating
virtual COM port and redirecting to TCP/IP port)
Hi,
I have been told that there is no 16-bit MS-DOS application. The
information as is provided me is as thus: 32-bit serial communication
client program running on Win2000 machines. On second thought, maybe, its
not a VDD that I require.
What I would require in essence is the following:
A virtual COM port driver, that will support TCP/IP as underlying
communication protocol. This driver shall be operating in user-mode as a
DLL and will have nothing to do with hardware interrupts directly.
Communication with TCP/IP layer will be made using Winsock calls as driver
shall be operating in user-mode. The target platform shall be Win2000.
Example usage of this driver will be providing support for Hyperterminal
session through some virtual COM port set up using my driver. Tactical
software has written something like that for their “DialOutIP”. But, there
is little information and so less resources on how this thing can be done.
Functionality wise, the driver I would need will be similar to that of
their “DialOutIP” with raw TCP/IP feature.
To put it simply, I want to know first how to create virtual COM ports.
Where can I get sample codes for such device driver development?
Any help will be appreciated.
Thanks,
Jayanta
Now, I know where to start…
Thanks Shaun and all of you who gave me
this kick-start… 
Cheers~
Jayanta
It’s definitely not a VDD that you want.
You can look at the serial sample in the DDK for information on how to
write a driver that exports a serial interface. What you actually
communicate with in response to the calls into the driver is your business.
But…if you want an application like HyperTerminal to be able to use your
virtual ports you can do a couple of things. 1) Write a kernel mode
driver that handles all the IOCTL of a serial port. Use a kernel mode
sockets library (like that provided by our lists hosts for examples) to
simplify your programming. This would be the most flexible solution. 2)
Write a kernel mode driver that uses an inverted call model in conjunction
with a user mode service. The kernel driver would handle the I/O requests,
and then communicate with a helper service in user mode that will actually
perform the network communications. You can look at the back issues of the
NT insider for information on an inverted call model. 3) For a
completely user mode solution, you can start doing things like hooking the
read / write / ioctl / open / close calls and inspect the parameters to
determine if it is a real serial port or you’re your that you’re interested
in. I really wouldn’t recommend this route, but admittedly don’t have much
experience with those techniques.
My recommendation (based on the information I have)…1) if you have more
money than time…2) if you have more time than money.
Shaun
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@lesswire.com
Sent: Tuesday, October 29, 2002 1:53 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Beginner’s question: Writing device driver ( creating
virtual COM port and redirecting to TCP/IP port)
Hi,
I have been told that there is no 16-bit MS-DOS application. The
…
not a VDD that I require.
What I would require in essence is the following:
A virtual COM port driver, that will support TCP/IP as underlying
communication protocol.
…
…
… similar to that of
their “DialOutIP” with raw TCP/IP feature.
To put it simply, I want to know first how to create virtual COM ports.
Where can I get sample codes for such device driver development?
Any help will be appreciated.
Thanks,
Jayanta
>I believe I would need to write a VDD to intercept the NTVDM and
then, I/O calls manipulated
This will support COM port for 16bit apps only. You will need a real
kernel-mode driver to support it for Win32 apps.
Max