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

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

Check your Exclusive argument to IoCreateDevice call.

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

----- Original Message -----
From: “Wilson”
To: “Windows System Software Devs Interest List”
Sent: Friday, May 26, 2006 12:37 AM
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