Hi all,

I am new to driver development. i need to perform a task where in, i need to
divert the SPOOL data of the complete system( i.e., all the print tasks of
the systems) to USB port to which printer is connected.

Re: virtual com driver by chris

chris
Wed Sep 13 10:28:21 CDT 2006

Mohd Moinuddin Pasha wrote:

> I am new to driver development.

James Smith? Is that you?

> i need to perform a task where in, i need to
> divert the SPOOL data of the complete system( i.e., all the print tasks of
> the systems) to USB port to which printer is connected.

We've already asked you for more details about your device in the other
thread. Without more information I don't see how we can give any more
specific advice.


Re: virtual com driver by Kevin

Kevin
Wed Sep 13 12:55:56 CDT 2006

Why not set the printer ports to the desired USB port? Then, all spooled
printer-data will go to that USB port.

Naturally, all the installed printers had better be the same type as the
printer on that port!!

On the other hand, the subject "virtual com driver" suggests that you have
applications that print directly to a COM: port, and you want to send the
output of whatever goes to a COM: port to the USB port? Is that correct?



"Mohd Moinuddin Pasha" <MohdMoinuddinPasha@discussions.microsoft.com> wrote
in message news:DC0F8F02-C55E-49F9-BA0B-5FDC1BDD5A81@microsoft.com...
> Hi all,
>
> I am new to driver development. i need to perform a task where in, i need
to
> divert the SPOOL data of the complete system( i.e., all the print tasks of
> the systems) to USB port to which printer is connected.



Re: virtual com driver by MohdMoinuddinPasha

MohdMoinuddinPasha
Thu Sep 14 00:30:01 CDT 2006

hi,

firstly thank you for your response?
Now my requirement is, we had made an application by using which i am able
to write to the printer using the USB( we have USB Interface functions to
write data on the the USB). This part is working fine.

the problem is that when we give print from any other applications(other
then my application) the data is not coming to USB but it is by default going
to Printer's Parallel Port. now I want to wirte a driver which can monitor
the Parallel port. and whenever the data is aviable i can forword that data
to my USB port. From there any how i am able to intaract with the printer or
plotter connect to usb.

Thanks a lot,



"chris.aseltine@gmail.com" wrote:

> Mohd Moinuddin Pasha wrote:
>
> > I am new to driver development.
>
> James Smith? Is that you?
>
> > i need to perform a task where in, i need to
> > divert the SPOOL data of the complete system( i.e., all the print tasks of
> > the systems) to USB port to which printer is connected.
>
> We've already asked you for more details about your device in the other
> thread. Without more information I don't see how we can give any more
> specific advice.
>
>

Re: virtual com driver by MohdMoinuddinPasha

MohdMoinuddinPasha
Thu Sep 14 00:36:02 CDT 2006

Hi Kevin,


firstly thank you for your response?
Now my requirement is, we had made an application by using which i am able
to write to the printer using the USB( we have USB Interface functions to
write data on the the USB). This part is working fine.

the problem is that when we give print from any other applications(other
then my application) the data is not coming to USB but it is by default going
to Printer's Parallel Port. now I want to wirte a driver which can monitor
the Parallel port. and whenever the data is aviable i can forword that data
to my USB port. From there any how i am able to intaract with the printer or
plotter connect to usb.

Thanks a lot,



"Kevin" wrote:

> Why not set the printer ports to the desired USB port? Then, all spooled
> printer-data will go to that USB port.
>
> Naturally, all the installed printers had better be the same type as the
> printer on that port!!
>
> On the other hand, the subject "virtual com driver" suggests that you have
> applications that print directly to a COM: port, and you want to send the
> output of whatever goes to a COM: port to the USB port? Is that correct?
>
>
>
> "Mohd Moinuddin Pasha" <MohdMoinuddinPasha@discussions.microsoft.com> wrote
> in message news:DC0F8F02-C55E-49F9-BA0B-5FDC1BDD5A81@microsoft.com...
> > Hi all,
> >
> > I am new to driver development. i need to perform a task where in, i need
> to
> > divert the SPOOL data of the complete system( i.e., all the print tasks of
> > the systems) to USB port to which printer is connected.
>
>
>

Re: virtual com driver by Kevin

Kevin
Thu Sep 14 13:50:05 CDT 2006


"Mohd Moinuddin Pasha" <MohdMoinuddinPasha@discussions.microsoft.com> wrote
in message news:3728C0FD-2BE8-4C81-BB94-C082F55663F7@microsoft.com...
> Hi Kevin,
>
>
> firstly thank you for your response?
> Now my requirement is, we had made an application by using which i am able
> to write to the printer using the USB( we have USB Interface functions to
> write data on the the USB). This part is working fine.

I think you are saying that your application is NOT using the "normal"
printing subsystem to print, and is instead using customized USB Interface
functions to control the printer.


>
> the problem is that when we give print from any other applications(other
> then my application) the data is not coming to USB but it is by default
going
> to Printer's Parallel Port.

This is probably because the other applications ARE using the "normal"
printing subsystem, where the printer Port is set to LPT1.


> now I want to wirte a driver which can monitor
> the Parallel port. and whenever the data is aviable i can forword that
data
> to my USB port.

If my understanding is correct, you COULD set the printer Port to a
file-name, then send the file to the printer connected to the USB port via
your customized USB Interface functions.


> From there any how i am able to intaract with the printer or
> plotter connect to usb.

So, here is my suggestion: set the printer Port to a file-name, then have a
user-level app create a named-pipe with that file-name in
%systemroot%\system32. When an application prints to that file-name, your
user-level app will receive the data via the named-pipe, and write it to the
USB port via your customized USB Interface functions.




Re: virtual com driver by MohdMoinuddinPasha

MohdMoinuddinPasha
Fri Sep 15 00:35:01 CDT 2006



"Kevin" wrote:

>
> "Mohd Moinuddin Pasha" <MohdMoinuddinPasha@discussions.microsoft.com> wrote
> in message news:3728C0FD-2BE8-4C81-BB94-C082F55663F7@microsoft.com...
> > Hi Kevin,
> >
> >
> > firstly thank you for your response?
> > Now my requirement is, we had made an application by using which i am able
> > to write to the printer using the USB( we have USB Interface functions to
> > write data on the the USB). This part is working fine.
>
> I think you are saying that your application is NOT using the "normal"
> printing subsystem to print, and is instead using customized USB Interface
> functions to control the printer.
>
>
> >
> > the problem is that when we give print from any other applications(other
> > then my application) the data is not coming to USB but it is by default
> going
> > to Printer's Parallel Port.
>
> This is probably because the other applications ARE using the "normal"
> printing subsystem, where the printer Port is set to LPT1.
>
>
> > now I want to wirte a driver which can monitor
> > the Parallel port. and whenever the data is aviable i can forword that
> data
> > to my USB port.
>
> If my understanding is correct, you COULD set the printer Port to a
> file-name, then send the file to the printer connected to the USB port via
> your customized USB Interface functions.
>
>
> > From there any how i am able to intaract with the printer or
> > plotter connect to usb.
>
> So, here is my suggestion: set the printer Port to a file-name, then have a
> user-level app create a named-pipe with that file-name in
> %systemroot%\system32. When an application prints to that file-name, your
> user-level app will receive the data via the named-pipe, and write it to the
> USB port via your customized USB Interface functions.
>

Hi Kevin,

Thanks and I think ur suggestion is just right for my requirement.
I you do one more favor by sending in the details how to set a file-name to
a printer port and how does our application get notification of when the data
arrives to that file or we need to write a thread which monitors constantly.

Bye and waiting for your advice to go ahead with my work.

Regards

Re: virtual com driver by Kevin

Kevin
Fri Sep 15 12:57:33 CDT 2006

"Mohd Moinuddin Pasha" <MohdMoinuddinPasha@discussions.microsoft.com> wrote
in message news:A7486484-064F-4FFC-8A22-3C99714BB944@microsoft.com...
>
> "Kevin" wrote:
> >
<snip>
> >
> > So, here is my suggestion: set the printer Port to a file-name, then
have a
> > user-level app create a named-pipe with that file-name in
> > %systemroot%\system32. When an application prints to that file-name,
your
> > user-level app will receive the data via the named-pipe, and write it to
the
> > USB port via your customized USB Interface functions.
> >
>
> Hi Kevin,
>
> Thanks and I think ur suggestion is just right for my requirement.
> I you do one more favor by sending in the details how to set a file-name
to
> a printer port

When you assign the Printer Port, go to Add Port / Local Port, and enter a
filename, like "MYPPORT". This file will be written to in
%SYSTEMROOT%\system32 by the Windows spooler. If the file / named-pipe does
not exist, the spooler will create it as a normal file when it first
attempts to print to a printer using that file as the port. You will need
to make sure the named-pipe exists before the spooler tries to print to that
port.


> and how does our application get notification of when the data
> arrives to that file or we need to write a thread which monitors
constantly.


You write a normal application that uses CreateNamedPipe() with that same
name in that same directory. This application then waits for data via
ReadFile().

A "pipe" is just like a "file", except that it only has "contents" when some
other program writes to it (using CreateFile() and WriteFile()).

So, whatever the spooler writes to that file will appear in your application
from ReadFile(), which you then use with your custom USB Interface function
to send to your printer.




Re: virtual com driver by MohdMoinuddinPasha

MohdMoinuddinPasha
Mon Sep 18 00:01:02 CDT 2006

hi Kevin,

Thank you, it looks like my problem is solved. I will come back If i face
some problem. Thank You Once Again.

Regards,

"Kevin" wrote:

> "Mohd Moinuddin Pasha" <MohdMoinuddinPasha@discussions.microsoft.com> wrote
> in message news:A7486484-064F-4FFC-8A22-3C99714BB944@microsoft.com...
> >
> > "Kevin" wrote:
> > >
> <snip>
> > >
> > > So, here is my suggestion: set the printer Port to a file-name, then
> have a
> > > user-level app create a named-pipe with that file-name in
> > > %systemroot%\system32. When an application prints to that file-name,
> your
> > > user-level app will receive the data via the named-pipe, and write it to
> the
> > > USB port via your customized USB Interface functions.
> > >
> >
> > Hi Kevin,
> >
> > Thanks and I think ur suggestion is just right for my requirement.
> > I you do one more favor by sending in the details how to set a file-name
> to
> > a printer port
>
> When you assign the Printer Port, go to Add Port / Local Port, and enter a
> filename, like "MYPPORT". This file will be written to in
> %SYSTEMROOT%\system32 by the Windows spooler. If the file / named-pipe does
> not exist, the spooler will create it as a normal file when it first
> attempts to print to a printer using that file as the port. You will need
> to make sure the named-pipe exists before the spooler tries to print to that
> port.
>
>
> > and how does our application get notification of when the data
> > arrives to that file or we need to write a thread which monitors
> constantly.
>
>
> You write a normal application that uses CreateNamedPipe() with that same
> name in that same directory. This application then waits for data via
> ReadFile().
>
> A "pipe" is just like a "file", except that it only has "contents" when some
> other program writes to it (using CreateFile() and WriteFile()).
>
> So, whatever the spooler writes to that file will appear in your application
> from ReadFile(), which you then use with your custom USB Interface function
> to send to your printer.
>
>
>
>

Re: virtual com driver by Kevin

Kevin
Mon Sep 18 13:47:46 CDT 2006


"Mohd Moinuddin Pasha" <MohdMoinuddinPasha@discussions.microsoft.com> wrote
in message news:75B48C24-C96E-443A-93A1-3D64EEF1AA4A@microsoft.com...
> hi Kevin,
>
> Thank you, it looks like my problem is solved. I will come back If i face
> some problem. Thank You Once Again.

You are welcome.



Re: virtual com driver by MohdMoinuddinPasha

MohdMoinuddinPasha
Tue Sep 19 01:16:02 CDT 2006

Hi Kevin,

Sorry to trouble you, but what we have made has not satisfied my Client
expectations he needs the same to happen using virtual com port.
He want the data to come to COM port.
What my Appln needs to Do is Grab the data comming to the COM port and
Send the same to USB(By using custom calls which communicate to the printer).

Is there any way I can Write a Virtual COM Driver and grab the data coming
to My COM port.
Plz help me out I am new to the Driver's World.

Waiting for Your Reply,

Bye,

Moin.

"Kevin" wrote:

>
> "Mohd Moinuddin Pasha" <MohdMoinuddinPasha@discussions.microsoft.com> wrote
> in message news:75B48C24-C96E-443A-93A1-3D64EEF1AA4A@microsoft.com...
> > hi Kevin,
> >
> > Thank you, it looks like my problem is solved. I will come back If i face
> > some problem. Thank You Once Again.
>
> You are welcome.
>
>
>

Re: virtual com driver by Abhishek

Abhishek
Tue Sep 19 12:42:45 CDT 2006

Hi Moin,

The serial sample driver in the WDK can be used as a starting point.
That driver is for a real serial port. You'll need to modify that to create
a virtual serial port driver. You'll need to remove the hardware-specific
parts from it, but retain the part that handles read, write and the IOCTL
requests. For example, when the application sends a write request to the COM
port, the OS will deliver the request to your driver. The write request
handler in your driver could just take the data supplied by the application
and send it to USB.
Depending on your exact requirements, you may be able to get away with
supporting only a subset of the read, write and IOCTL requests.
I also recommend reviewing the User Mode Driver Framework (UMDF)
technology and see if you can use it to write your driver.

Thanks,
Abhishek


"Mohd Moinuddin Pasha" <MohdMoinuddinPasha@discussions.microsoft.com> wrote
in message news:498A49C3-C95D-46A8-943B-33785B3D5F23@microsoft.com...
> Hi Kevin,
>
> Sorry to trouble you, but what we have made has not satisfied my Client
> expectations he needs the same to happen using virtual com port.
> He want the data to come to COM port.
> What my Appln needs to Do is Grab the data comming to the COM port and
> Send the same to USB(By using custom calls which communicate to the
> printer).
>
> Is there any way I can Write a Virtual COM Driver and grab the data coming
> to My COM port.
> Plz help me out I am new to the Driver's World.
>
> Waiting for Your Reply,
>
> Bye,
>
> Moin.
>
> "Kevin" wrote:
>
>>
>> "Mohd Moinuddin Pasha" <MohdMoinuddinPasha@discussions.microsoft.com>
>> wrote
>> in message news:75B48C24-C96E-443A-93A1-3D64EEF1AA4A@microsoft.com...
>> > hi Kevin,
>> >
>> > Thank you, it looks like my problem is solved. I will come back If i
>> > face
>> > some problem. Thank You Once Again.
>>
>> You are welcome.
>>
>>
>>



Re: virtual com driver by Kevin

Kevin
Tue Sep 19 13:16:30 CDT 2006


"Mohd Moinuddin Pasha" <MohdMoinuddinPasha@discussions.microsoft.com> wrote
in message news:498A49C3-C95D-46A8-943B-33785B3D5F23@microsoft.com...
> Hi Kevin,
>
> Sorry to trouble you, but what we have made has not satisfied my Client
> expectations he needs the same to happen using virtual com port.
> He want the data to come to COM port.
> What my Appln needs to Do is Grab the data comming to the COM port and
> Send the same to USB(By using custom calls which communicate to the
printer).

Instead, grab the data from the named-pipe and send it to the COM port AND
the USB port at the same time. That way the data goes to the COM port (as
client wants) and to the USB port (as client wants), without needing a
Virtual Com Driver (which is very difficult to get right).


> Is there any way I can Write a Virtual COM Driver and grab the data coming
> to My COM port.

Your client probably already knows that a Virtual COM Driver is not an easy
thing to write correctly, and is hoping that you do not know this and will
go ahead and accept the job.


> Plz help me out I am new to the Driver's World.

If a Virtual Com Driver is REQUIRED (because the application can not be
changed to write to a named-pipe) then:

1) buy an already-developed solution and sell it to your client with support
or
2) decline the contract
or
3) accept the contract, and plan on 1 year worth of development

You can probably get something working in 3 months, but it will take another
6 months to understand the details of fitting into the Windows Driver Model,
and another 3 months fixing all the bugs with that.

Do not use my estimate of 1 year without getting more input, especially from
people who have actually done this!!





Re: virtual com driver by MohdMoinuddinPasha

MohdMoinuddinPasha
Mon Oct 09 00:35:01 CDT 2006



"Kevin" wrote:

>
> "Mohd Moinuddin Pasha" <MohdMoinuddinPasha@discussions.microsoft.com> wrote
> in message news:498A49C3-C95D-46A8-943B-33785B3D5F23@microsoft.com...
> > Hi Kevin,
> >
> > Sorry to trouble you, but what we have made has not satisfied my Client
> > expectations he needs the same to happen using virtual com port.
> > He want the data to come to COM port.
> > What my Appln needs to Do is Grab the data comming to the COM port and
> > Send the same to USB(By using custom calls which communicate to the
> printer).
>
> Instead, grab the data from the named-pipe and send it to the COM port AND
> the USB port at the same time. That way the data goes to the COM port (as
> client wants) and to the USB port (as client wants), without needing a
> Virtual Com Driver (which is very difficult to get right).
>
>
> > Is there any way I can Write a Virtual COM Driver and grab the data coming
> > to My COM port.
>
> Your client probably already knows that a Virtual COM Driver is not an easy
> thing to write correctly, and is hoping that you do not know this and will
> go ahead and accept the job.
>
>
> > Plz help me out I am new to the Driver's World.
>
> If a Virtual Com Driver is REQUIRED (because the application can not be
> changed to write to a named-pipe) then:
>
> 1) buy an already-developed solution and sell it to your client with support
> or
> 2) decline the contract
> or
> 3) accept the contract, and plan on 1 year worth of development
>
> You can probably get something working in 3 months, but it will take another
> 6 months to understand the details of fitting into the Windows Driver Model,
> and another 3 months fixing all the bugs with that.
>
> Do not use my estimate of 1 year without getting more input, especially from
> people who have actually done this!!
>
>


Hi Kevin,

Sorry to trouble you once again,

From the print port's i have selected local port and gave a name PLOT1 for it.

When iam printing any text document, it is creating a file in the system32
folder.

Now my problem is how to memtion the first parameter in the
CreateNamedPipe(...)
API call.

Can you please elebroate on this plz It will be of great help to me.

Thank you very much,

Regards,