From: soviet_bloke on
Maxim,

> No you cannot.

In fact, you can, but it does not necessarily mean that you should.....

Anton Bassov

Maxim S. Shatskih wrote:
> > but I was thinking that I could easily attach it to the keyboard class
> > driver by doing something like:
> >
> > CCHAR ntNameBuffer[64] = "\\Device\\KeyboardClass0";
> > STRING ntNameString;
> > UNICODE_STRING uKeyboardDeviceName;
> > RtlInitAnsiString( &ntNameString, ntNameBuffer );
> > RtlAnsiStringToUnicodeString( &uKeyboardDeviceName, &ntNameString,
> >TRUE
> > );
> > IoAttachDevice(pKeyboardDeviceObject,&uKeyboardDeviceName,&devExt-
> >pKeyboardDevice);
>
> No you cannot. Use PnP instead and UpperFilters registration, forget
> IoAttachDevice for PnP stacks.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim(a)storagecraft.com
> http://www.storagecraft.com

From: Jon on
Hey Maxim,

> No you cannot. Use PnP instead and UpperFilters registration, forget
> IoAttachDevice for PnP stacks.

Would you be able to provide an example of what an UpperFilters
registration would look like for PnP? I have two books that I am
currently reading; Device Driver Development by Peter V. and Windows
driver model by Walter Oney. I couldn't find an example inside either
one of these books. Would there be one inside the WDK?

Thanks

From: Maxim S. Shatskih on
> > No you cannot.
>
> In fact, you can, but it does not necessarily mean that you should.....

Yes, you can use the hammer for screws and the screwdriver for nails, but for
what?

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

From: Maxim S. Shatskih on
> Would you be able to provide an example of what an UpperFilters
> registration would look like for PnP?

Scan your SYSTEM registry for "kbdclass".

Note - the UpperFilters field is MULTI_SZ. The driver SC database key names are
listed there, and the order of them is - the former in the UpperFilters list is
the upper in the devnode.

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

From: anton bassov on
Maxim,

> > In fact, you can, but it does not necessarily mean that you should.....
>
> Yes, you can use the hammer for screws and the screwdriver for nails, but for
> what?


The problem is that, when you say "you cannot do it" and the OP knows
that he *CAN*,
it automatically invalidates your advice in his eyes - after all, you
don't explain things to him simply by saying NO, do you??? However,
when you tell him "actually, you can, but doing things this way is just
unreasonable - it is like using hammer for screws", it gives him a
second thought......

Anton Bassov


Maxim S. Shatskih wrote:
> > > No you cannot.
> >
> > In fact, you can, but it does not necessarily mean that you should.....
>
> Yes, you can use the hammer for screws and the screwdriver for nails, but for
> what?
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim(a)storagecraft.com
> http://www.storagecraft.com