I am just curious, but what am I actually doing when I
CreateFile to LPT1, is there a protocol which explains
this?

Re: What am I doing when I read/write to LPT1 ? by Ali

Ali
Mon Jun 19 08:37:52 CDT 2006


StephaniDeltufo wrote:
> I am just curious, but what am I actually doing when I
> CreateFile to LPT1, is there a protocol which explains
> this?

Answer to your question is not that easy, we need to know a little or
at least fundamentals of underlying hardware , operating systems in
general and specifically printer drivers in your case.All the things
are tightly inter-related so it wont take so much time to figure out
how things are happening;-)
Search this group with printer driver queries and you will come up with
ample resources to start!
http://groups.google.com/group/microsoft.public.development.device.dr...


ali


Re: What am I doing when I read/write to LPT1 ? by Tim

Tim
Mon Jun 19 23:28:26 CDT 2006

<Stephani Deltufo> wrote:
>
>I am just curious, but what am I actually doing when I
>CreateFile to LPT1, is there a protocol which explains
>this?

The operating system looks in the kernel namespace for a link called
\DosDevices\LPT1. That link will point to a device. Assuming the
permissions are OK, the system then sends an IRP_MJ_CREATE request to the
driver for that device. Assuming that succeed, a file object is created,
and the handle is returned to you.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Re: What am I doing when I read/write to LPT1 ? by Ali

Ali
Tue Jun 20 02:51:16 CDT 2006


Tim Roberts wrote:
> <Stephani Deltufo> wrote:
> >
> >I am just curious, but what am I actually doing when I
> >CreateFile to LPT1, is there a protocol which explains
> >this?
>
> The operating system looks in the kernel namespace for a link called
> \DosDevices\LPT1. That link will point to a device. Assuming the
> permissions are OK, the system then sends an IRP_MJ_CREATE request to the
> driver for that device. Assuming that succeed, a file object is created,
> and the handle is returned to you.
> --
> - Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc.


And to what this \DosDevices\Links will resolve is straight forward,
yeah it will link up to \Devices\0x378 (IBM defined three standard port
base addresses (in 80x86 IO address space).The Printer Adaptor could
use base address 0x378, or later 0x278, while the Monochrome Display
and Printer Adaptor used base address 0x3BC.) starting address.

As Mr. Object manager visualizes all the piece of hardware as objects
and in fact this is the entity in system which is responsible to
allocate resources (ports , IRQ etc.) to particular device and helps
the security manager to grant permissions . So once you get the
permission and valid symbolic link then what ever you do in user space
will affect the kernel space.
Think about the pipes though device drivers have nothing common on that
but still it is a good to digest the real idea ;-)
Kernel space \\Device\ <=> \\DosDevices\" User space


AFAIK
ali


Re: What am I doing when I read/write to LPT1 ? by Ali

Ali
Thu Jun 22 00:46:43 CDT 2006

Hmm , no comments from folks than it must be right.
How to remove 'AFAIK' from previous post?

L0L;-)


Ali wrote:
> Tim Roberts wrote:
> > <Stephani Deltufo> wrote:
> > >
> > >I am just curious, but what am I actually doing when I
> > >CreateFile to LPT1, is there a protocol which explains
> > >this?
> >
> > The operating system looks in the kernel namespace for a link called
> > \DosDevices\LPT1. That link will point to a device. Assuming the
> > permissions are OK, the system then sends an IRP_MJ_CREATE request to the
> > driver for that device. Assuming that succeed, a file object is created,
> > and the handle is returned to you.
> > --
> > - Tim Roberts, timr@probo.com
> > Providenza & Boekelheide, Inc.
>
>
> And to what this \DosDevices\Links will resolve is straight forward,
> yeah it will link up to \Devices\0x378 (IBM defined three standard port
> base addresses (in 80x86 IO address space).The Printer Adaptor could
> use base address 0x378, or later 0x278, while the Monochrome Display
> and Printer Adaptor used base address 0x3BC.) starting address.
>
> As Mr. Object manager visualizes all the piece of hardware as objects
> and in fact this is the entity in system which is responsible to
> allocate resources (ports , IRQ etc.) to particular device and helps
> the security manager to grant permissions . So once you get the
> permission and valid symbolic link then what ever you do in user space
> will affect the kernel space.
> Think about the pipes though device drivers have nothing common on that
> but still it is a good to digest the real idea ;-)
> Kernel space \\Device\ <=> \\DosDevices\" User space
>
>
> AFAIK
> ali


Re: What am I doing when I read/write to LPT1 ? by Tim

Tim
Fri Jun 23 22:26:50 CDT 2006

"Ali" <abdulrazaq@gmail.com> wrote:
>
>Hmm , no comments from folks than it must be right.

That is NOT the definitive conclusion. I'm afraid that I found your
followup to be a bit rambling and confusing. I couldn't tell where you
were going, so decided that I probably couldn't contribute any more.

>> And to what this \DosDevices\Links will resolve is straight forward,
>> yeah it will link up to \Devices\0x378 (IBM defined three standard port
>> base addresses (in 80x86 IO address space).The Printer Adaptor could
>> use base address 0x378, or later 0x278, while the Monochrome Display
>> and Printer Adaptor used base address 0x3BC.) starting address.
>>
>> As Mr. Object manager visualizes all the piece of hardware as objects
>> and in fact this is the entity in system which is responsible to
>> allocate resources (ports , IRQ etc.) to particular device and helps
>> the security manager to grant permissions . So once you get the
>> permission and valid symbolic link then what ever you do in user space
>> will affect the kernel space.
>> Think about the pipes though device drivers have nothing common on that
>> but still it is a good to digest the real idea ;-)
>> Kernel space \\Device\ <=> \\DosDevices\" User space
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Re: What am I doing when I read/write to LPT1 ? by Ali

Ali
Sun Jun 25 01:54:55 CDT 2006


Tim Roberts wrote:
> "Ali" <abdulrazaq@gmail.com> wrote:
> >
> >Hmm , no comments from folks than it must be right.
>
> That is NOT the definitive conclusion. I'm afraid that I found your
> followup to be a bit rambling and confusing. I couldn't tell where you
> were going, so decided that I probably couldn't contribute any more.
>
> >> And to what this \DosDevices\Links will resolve is straight forward,
> >> yeah it will link up to \Devices\0x378 (IBM defined three standard port
> >> base addresses (in 80x86 IO address space).The Printer Adaptor could
> >> use base address 0x378, or later 0x278, while the Monochrome Display
> >> and Printer Adaptor used base address 0x3BC.) starting address.
> >>
> >> As Mr. Object manager visualizes all the piece of hardware as objects
> >> and in fact this is the entity in system which is responsible to
> >> allocate resources (ports , IRQ etc.) to particular device and helps
> >> the security manager to grant permissions . So once you get the
> >> permission and valid symbolic link then what ever you do in user space
> >> will affect the kernel space.
> >> Think about the pipes though device drivers have nothing common on that
> >> but still it is a good to digest the real idea ;-)
> >> Kernel space \\Device\ <=> \\DosDevices\" User space
> --
> - Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc.


Then how \DosDevices\LPT1 link is resolved?


Re: What am I doing when I read/write to LPT1 ? by Maxim

Maxim
Sun Jun 25 11:09:11 CDT 2006

> Then how \DosDevices\LPT1 link is resolved?

Named pipe pointing to the spooler service.

Use NONSPOOLED_LPT1 for the parallel port itself.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com