windows node creation for printer

can any body tell how to create a node,when a device is attached to
windows system it will automatically create tht particular node,so how
to create it .

Saritha Reddy wrote:

can any body tell how to create a node,when a device is attached to
windows system it will automatically create tht particular node,so how
to create it .

What do you mean by “node”? The term has several meaning, so I’d like
to get a clearer idea of what you are asking.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

i think she is asking about device entries.

On 6/12/07, Tim Roberts wrote:
>
> Saritha Reddy wrote:
> > can any body tell how to create a node,when a device is attached to
> > windows system it will automatically create tht particular node,so how
> > to create it .
>
> What do you mean by “node”? The term has several meaning, so I’d like
> to get a clearer idea of what you are asking.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Barun Kumar Parichha,
Research Scholar,
Dept of Computer Science & Engg.
I.I.T. Madras
Chennai - 36

She wants to know about the steps of device registry. In other words how a
windows machine recognizes a device attached ?

On 6/12/07, barun parichha wrote:
>
> i think she is asking about device entries.
>
> On 6/12/07, Tim Roberts wrote:
> >
> > Saritha Reddy wrote:
> > > can any body tell how to create a node,when a device is attached to
> > > windows system it will automatically create tht particular node,so how
> > > to create it .
> >
> > What do you mean by “node”? The term has several meaning, so I’d like
> > to get a clearer idea of what you are asking.
> >
> > –
> > Tim Roberts, xxxxx@probo.com
> > Providenza & Boekelheide, Inc.
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > To unsubscribe, visit the List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServer
> >
>
>
>
> –
> Barun Kumar Parichha,
> Research Scholar,
> Dept of Computer Science & Engg.
> I.I.T. Madras
> Chennai - 36


Barun Kumar Parichha,
Research Scholar,
Dept of Computer Science & Engg.
I.I.T. Madras
Chennai - 36

i think she is asking about device entries.

I think she is asking about the nodes in the device tree of device manager … :slight_smile:

On 6/12/07, Tim Roberts wrote:
Saritha Reddy wrote:
> can any body tell how to create a node,when a device is attached to
> windows system it will automatically create tht particular node,so how
> to create it .

What do you mean by “node”? The term has several meaning, so I’d like
to get a clearer idea of what you are asking.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


Barun Kumar Parichha,
Research Scholar,
Dept of Computer Science & Engg.
I.I.T. Madras
Chennai - 36 — Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

barun parichha wrote:

i think she is asking about device entries.

That doesn’t help very much; that term doesn’t have a precise meaning,
either.

Saritha Reddy wrote:
> can any body tell how to create a node,when a device is attached to
> windows system it will automatically create tht particular
node,so how
> to create it .

Like all devices, a printer needs an INF file. When the printer is
attached to a bus and recognized by plug-and-play, it is assigned a
plug-and-play ID. The system will search through all of the INF files
it knows about looking for a match on that ID. That INF file, then,
tells it what driver(s) to load.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

You are right …
but still u have not answered her question.
how can we cheat our machine to understand that a real printer has been attached, evenif it is not attached in practical.

thanks in advance…

barun parichha wrote:

how can we cheat our machine to understand that a real printer
has been attached, evenif it is not attached in practical.

Write a bus driver that enumerates a child device with the same hardware and compatible ID’s as the real printer.

so can u help me how to write bus driver that enumerates a child device with same hardware and compatible ID’s as real printer.

thanks

seema wrote:

so can u help me how to write bus driver that enumerates a child
device with same hardware and compatible ID’s as real printer.

No, but you can help yourself by looking at the toaster bus sample in the WDK.

xxxxx@gmail.com wrote:

so can u help me how to write bus driver that enumerates a child device with same hardware and compatible ID’s as real printer.

Why? What is the real top-level problem that you are trying to solve?
The printing subsystem already supports the ability to have a program on
one computer spool up a file for a printer on another computer. If
that’s what you want to do, there are better ways to do it.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

If you just want to create a printer, you don’t need to go near plug-and-play. The Win32 API AddPrinter can do this.

If you need to virtualize some sort of non-existent underlying hardware, then you can write a port monitor.

The print subsystem has many replacable components and provides many ways to accomplish tasks without ever going near the kernel.

It all depends upon what you are trying to do. So as Tim (and perhaps others) hahas / have mentioned, it might get you a clearer answer if you would describe what it is you are trying to accomplish.

thanks for ur reply, actually my problem is tht in linux i created a node for printer device using mknode,so how to do in windows,how to create a devnode for printer in windows.

if a device is connected to usb port it will create a devnode using pnp,so i want to create a devnode for printer instead of pnp,can any one help me.

thanks in advance for helping me

xxxxx@gmail.com wrote:

thanks for ur reply, actually my problem is tht in linux i created a node for printer device using mknode,so how to do in windows,how to create a devnode for printer in windows.

if a device is connected to usb port it will create a devnode using pnp,so i want to create a devnode for printer instead of pnp,can any one help me.

This STILL doesn’t give us any clue as to what you are really trying to
do. Are you trying to create a new “virtual” printer, something like
PDFCreator?

You can’t just “create a devnode”. The operating system creates a
devnode when a new device appears. A new device appears when some other
driver exposes a new plug-and-play ID, and the system finds an INF file
that tells it how to support that ID. In the case of USB, the USB bus
driver tells the system about new hardware.

For a virtual printer, I suggest you go look at the “bitmap” sample in
the WDK, in src\print\oemdll\bitmap.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

thanks for reply can i create my own printer inf file,is tht possible,actually my problem is tht printer is attached to remote machine i want to access tht printer from my machine,can u help me.

thanks in advance

xxxxx@gmail.com wrote:

thanks for reply can i create my own printer inf file,is tht possible,actually my problem is tht printer is attached to remote machine i want to access tht printer from my machine,can u help me.

As long as the printer is shared from the machine it is attached to, you
can use the standard Add Printer tool in the Printers and Faxes control
panel applet. No programming of any kind is needed. In most cases, the
system will automatically fetch the appropriate driver from the machine
where the printer resides.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

thanks for ur reply, problem is tht when a usb printer is connected to usb port ,the usb bus driver creates pdo with hardware id and compatible id class_7 the devnode for this created under Enum\USB.…class-7 and identifies a printer device connected over a USB port, so i want to create this node in registry is tht possilble can any one help me

xxxxx@gmail.com wrote:

thanks for ur reply, problem is tht when a usb printer is connected to usb port ,the usb bus driver creates pdo with hardware id and compatible id class_7 the devnode for this created under Enum\USB.…class-7 and identifies a printer device connected over a USB port, so i want to create this node in registry is tht possilble can any one help me

I am absolutely convinced you are trying to solve the wrong problem. If
you want to print to a USB printer on another computer, then you need to
share that printer using the standard printer sharing mechanism, then
add the printer on your remote computer using the standard “add printer
via network” wizard.

If you create a fake USB printer on your remote printer, the system will
load a driver that expects to talk to a USB device. However, you don’t
HAVE a USB device. By using the standard mechanisms, the system will
route the print data over the network to the other computer, and let
THAT driver talk to the hardware.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

thanks for ur reply,can u tell me abt this"i am going to write a protocol where device is attached to a remote machine(linux/windows) without driver. But the real driver is in application end (windows). Actually this is nothing but an extension of usb stack over network. But to use this device windows must create approprite entry even if the device is remotely"

xxxxx@gmail.com wrote:

thanks for ur reply,can u tell me abt this"i am going to write a protocol where device is attached to a remote machine(linux/windows) without driver.

Well, there has to be a driver of SOME kind at the remote end. You have
to talk to the USB hardware in some way. You’ll also have to compete
with the operating system, which is going to want to install standard
drivers when it finds a device in one of the standard classes.

But the real driver is in application end (windows). Actually this is nothing but an extension of usb stack over network. But to use this device windows must create approprite entry even if the device is remotely"

This is an ENTIRELY different question from the one you originally
asked. Had you said it this way to begin with, we could have given you
good starting advice weeks ago.

To do this, you will need to write a bus driver, to act as a substitute
for the USB host controller. Your bus driver will advertise the
presence of new devices by using normal USB plug-and-play ids. Once you
do that, the operating system will handle everything. It will create
all the necessary registry entries, it will go searching for the
appropriate drivers, and it will load and start the drivers.

Having said that, your task is not an easy one. Bus drivers are hard,
and the USB bus driver has a lot of behavior that is not thoroughly
documented. It does sound like a fun project, but if you are not an
experienced Windows driver writer, you have half a year of work ahead of
you.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.