RES: Multiple instances of control device

Very Very Thanks Doron and Maxim !!!
The problem was the exclusive parameter in IoCreateDevice. I was passing
TRUE…
Now I have the filter working fine again…

Best regards !!

Wilson

-----Mensagem original-----
De: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]Em nome de Doron Holan
Enviada em: quinta-feira, 25 de maio de 2006 17:44
Para: Windows System Software Devs Interest List
Assunto: RE: [ntdev] Multiple instances of control device

You are describing an exclusive device. There are typically 2
causes for this

  1. you are passing true for the Exclusive parameter to
    IoCreateDevice (the 6th one)
  2. in your IRP_MJ_CREATE handler, you are maintaining an open
    handle count and failing the create. KbFilter_CreateClose does
    have such logic to maintain the count, but does not act on the
    count itself. Also, in this case you would need to distinguish
    the create on the control devobj vs the filter devobj. You need
    to pass through the filter devobj create and maintain your own
    logic only for the control devobj.

d

– I can spell, I just can’t type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Wilson
Sent: Thursday, May 25, 2006 1:38 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Multiple instances of control device

Hi All,

I wrote a PS/2 keyboard filter driver (pure WDM), some years ago,
with a control device who have a symbolic link name to expose
funcionalities to user mode.
Well, this driver have worked fine… until now…
I have a customer who needs several application instances to
access the keyboard with that filter.
Each instance calls CreateFile with the symbolic link name to get
the handle but only the first call do this succeful.
Maybe it´s a silly question but I really don´t know how to solve
this problem…

Any light would be very appreciated.

Regards

Wilson

There is a great topic on this in the DDK titled " Specifying Exclusive Access to Device Objects". I also wrote about this topic last night,

http://blogs.msdn.com/doronh/archive/2006/05/25/607708.aspx

d

– I can spell, I just can’t type.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Wilson
Sent: Friday, May 26, 2006 6:14 AM
To: Windows System Software Devs Interest List
Subject: RES: [ntdev] Multiple instances of control device

Very Very Thanks Doron and Maxim !!!
The problem was the exclusive parameter in IoCreateDevice. I was passing TRUE…
Now I have the filter working fine again…

Best regards !!

Wilson

-----Mensagem original-----
De: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]Em nome de Doron Holan
Enviada em: quinta-feira, 25 de maio de 2006 17:44
Para: Windows System Software Devs Interest List
Assunto: RE: [ntdev] Multiple instances of control device

You are describing an exclusive device. There are typically 2 causes
for this

  1. you are passing true for the Exclusive parameter to IoCreateDevice
    (the 6th one)
  2. in your IRP_MJ_CREATE handler, you are maintaining an open handle
    count and failing the create. KbFilter_CreateClose does have such
    logic to maintain the count, but does not act on the count itself.
    Also, in this case you would need to distinguish the create on the
    control devobj vs the filter devobj. You need to pass through the
    filter devobj create and maintain your own logic only for the control
    devobj.

d

– I can spell, I just can’t type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Wilson
Sent: Thursday, May 25, 2006 1:38 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Multiple instances of control device

Hi All,

I wrote a PS/2 keyboard filter driver (pure WDM), some years ago, with
a control device who have a symbolic link name to expose
funcionalities to user mode.
Well, this driver have worked fine… until now…
I have a customer who needs several application instances to access
the keyboard with that filter.
Each instance calls CreateFile with the symbolic link name to get the
handle but only the first call do this succeful.
Maybe it?s a silly question but I really don?t know how to solve this
problem…

Any light would be very appreciated.

Regards

Wilson


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