Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results
The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
Upcoming OSR Seminars | ||
---|---|---|
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead! | ||
Internals & Software Drivers | 19-23 June 2023 | Live, Online |
Writing WDF Drivers | 10-14 July 2023 | Live, Online |
Kernel Debugging | 16-20 October 2023 | Live, Online |
Developing Minifilters | 13-17 November 2023 | Live, Online |
Comments
Exclusive parameter? To allow multiple processes access, you must set it to
FALSE.
Gary
-----Original Message-----
From: Barak Mandelovich [mailto:[email protected]]
Sent: Tuesday, March 21, 2000 4:44 AM
To: NT Developers Interest List
Subject: [ntdev] problems using CreateFile
I have a driver, to which I want to connect from my application,
using CreateFile(), and I have 2 processes that try to
attach to the driver.
The first succeeds, and the second fails with error code #2
(ERROR_FILE_NOT_FOUND).
returned to the second process? I would have though ERROR_ACCESS_DENIED
would be returned in that case.
- Matt
From: "Gary Little" <[email protected]>
Sent: Tuesday, March 21, 2000 11:09 AM
> When you called IoCreateDevice in the DriverEntry, how did you set the
> Exclusive parameter? To allow multiple processes access, you must set it
to
> FALSE.
[snip]
> From: Barak Mandelovich [mailto:[email protected]]
> To: NT Developers Interest List
>
> > I have a driver, to which I want to connect from my application,
> > using CreateFile(), and I have 2 processes that try to
> > attach to the driver.
> >
> > The first succeeds, and the second fails with error code #2
> > (ERROR_FILE_NOT_FOUND).
[snip]
cases ?
You'll also need to set FILE_SHARE READ | FILE_SHARE_WRITE to the 3rd
parameter of CreateFile.
As previously pointed out, you'll need to set the Exclusive bit to FALSE
when calling IoCreateDevice().
Regards,
Paul Bunn, UltraBac.Com, 425-644-6000
Microsoft MVP - WindowsNT
http://www.ultrabac.com
-----Original Message-----
From: Barak Mandelovich [mailto:[email protected]]
Sent: Tuesday, March 21, 2000 4:44 AM
To: NT Developers Interest List
Subject: [ntdev] problems using CreateFile
Hi everybody, and sorry for troubling you with
newbies questions, but I have a problem with CreateFile
that I just can't figure out:
I have a driver, to which I want to connect from my application,
using CreateFile(), and I have 2 processes that try to
attach to the driver.
The first succeeds, and the second fails with error code #2
(ERROR_FILE_NOT_FOUND).
The CreateFile line is this:
CreateFile(SymbolicLinkName,
GENERIC_WRITE | GENERIC_READ,
0,
NULL,
CREATE_ALWAYS,
FILE_FLAG_OVERLAPPED,0);
My guess is that it's something with the flags, but I don't seem
to find the correct flag....
> to find the correct flag....
Maybe not. The symlink name is
\\.\name
where "name" is what will go after "\??\" in kernel mode.
Max
Regards
Mark
Paul Bunn wrote:
> Have you verified that the value of SymbolicLinkName is identical in both
> cases ?
>
> You'll also need to set FILE_SHARE READ | FILE_SHARE_WRITE to the 3rd
> parameter of CreateFile.
>
> As previously pointed out, you'll need to set the Exclusive bit to FALSE
> when calling IoCreateDevice().
>
> Regards,
>
> Paul Bunn, UltraBac.Com, 425-644-6000
> Microsoft MVP - WindowsNT
> http://www.ultrabac.com
>
> -----Original Message-----
> From: Barak Mandelovich [mailto:[email protected]]
> Sent: Tuesday, March 21, 2000 4:44 AM
> To: NT Developers Interest List
> Subject: [ntdev] problems using CreateFile
>
> Hi everybody, and sorry for troubling you with
> newbies questions, but I have a problem with CreateFile
> that I just can't figure out:
>
> I have a driver, to which I want to connect from my application,
> using CreateFile(), and I have 2 processes that try to
> attach to the driver.
>
> The first succeeds, and the second fails with error code #2
> (ERROR_FILE_NOT_FOUND).
>
> The CreateFile line is this:
> CreateFile(SymbolicLinkName,
> GENERIC_WRITE | GENERIC_READ,
> 0,
> NULL,
> CREATE_ALWAYS,
> FILE_FLAG_OVERLAPPED,0);
>
> My guess is that it's something with the flags, but I don't seem
> to find the correct flag....
>
> ---
> You are currently subscribed to ntdev as: [email protected]
> To unsubscribe send a blank email to $subst('Email.Unsub')