Moris,
This is the reply to a previous question which is very similar to yours.
Hopefully this will help you.
–
Mats
Moris asked:
I have write a keyboard filter ( just like Ctrl2Cap) , After install, two
usermode app try to get the handle of it using “CreateFile”, but the first
one success, the second one failed!! why??
any suggestion is appreciated.
Older e-mail starts here:
-----Original Message-----
From: yatindra vaishnav [mailto:xxxxx@hotmail.com]
Sent: Tuesday, January 20, 2004 12:12 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] failure to get a file handle when multiple user
programs involved.
Hi John,
you are setting the execlusive flag of “IoCreateDevice” as TRUE, because of
that you are gettin the problem of not opening the multiple handles to the
same device. Just set it as FALSE u will get the success in opening device
handle and all.
Good Luck,
>From: John F Davis
>Reply-To: “Windows System Software Devs Interest List”
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] failure to get a file handle when multiple user programs
involved.
>Date: Mon, 19 Jan 2004 17:59:04 -0500
>
>Hello
>
>I am reading “The windows 2000 Device Driver Book” by Art Baker and Jerry
>Lozano. I am at the point where I have built the loopback driver and I
>have installed it on my target machine. I also have a host machine which
>allows me to run WinDbg so that I can get DbgPrint output from the driver.
> Everything works ok when I run one copy of the user land test program. It
>writes a buffer to the device driver and then reads back the same buffer.
>
>However, when I more than one copy of the user land test program
>simulataneously, I often get “Failed to obtain file handle to Device: LBK1
>with Win32 error code: 5” which corresponds to Access is Denied. This is
>generated when the test program attempts to CreateFile the device.
>
>By default, the test code has the CreateFile share mode parameter set to
>0. I added SHARE_READ | SHARE_WRITE but it still fails with this error
>code. Any idea how to fix this? I’m only trying to read/write
>simulataneosly because his book says that is a good test.
>
>JD
>
>—
>Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com
>To unsubscribe send a blank email to xxxxx@lists.osr.com
_____
Marriage? Join http: BharatMatrimony.com
and get married. —
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@3dlabs.com
To unsubscribe send a blank email to xxxxx@lists.osr.com</http:>