Re: CreateFile() returns ERROR_ACCESS_DENIED to the user
- From: "SteM" <xxx@xxxxxxx>
- Date: Mon, 20 Nov 2006 12:36:08 +0100
I solved with:
// Open driver
rv = CreateFile (
ifDetail->DevicePath,
0, // Desidered access // GENERIC_READ | GENERIC_WRITE,
0, // Share mode
NULL, // Security attrib
OPEN_EXISTING, // How to create CREATE_NEW,
FILE_ATTRIBUTE_NORMAL, // File attribute FILE_FLAG_DELETE_ON_CLOSE,
NULL // Template file
);
Thanks !
--
SteM
"Alexander Grigoriev" <alegr@xxxxxxxxxxxxx> ha scritto nel messaggio
news:u1RwdvgCHHA.4292@xxxxxxxxxxxxxxxxxxxxxxx
1. Use OPEN_EXISTING with non-file devices.on
2. Don't specify DELETE_ON_CLOSE - that was requirement for VxD only.
3. Add HKR,,Security, ,<security descriptor string> to AddReg section of
your INF file.
"SteM" <xxx@xxxxxxx> wrote in message
news:umtKAF0BHHA.204@xxxxxxxxxxxxxxxxxxxxxxx
Hello,
I've written a small wdm driver for Win2000 to access an old custom hw
parallel port.
The accesses are via a couple of DeviceIoControl() custom commands.
It works fine, does exactly what i intended; however, it only works if I
am
logged in as Administrator (or equivalent).
If I log in as a regular user (Power User) the call to CreateFile fails
with
ACCESS_DENIED.
// Open driver
rv = CreateFile (
ifDetail->DevicePath,
0, // Desidered access
0, // Share mode
NULL, // Security attrb
CREATE_NEW, // How to create
FILE_FLAG_DELETE_ON_CLOSE, // File attribute
NULL // Template file
);
if (rv==INVALID_HANDLE_VALUE)
{
......
Thanks in advance for any pointers...
--
SteM
.
- References:
- CreateFile() returns ERROR_ACCESS_DENIED to the user
- From: SteM
- Re: CreateFile() returns ERROR_ACCESS_DENIED to the user
- From: Alexander Grigoriev
- CreateFile() returns ERROR_ACCESS_DENIED to the user
- Prev by Date: Re: How to recover from a EXCEPTION_STACK_OVERFLOW?
- Next by Date: Re: How to recover from a EXCEPTION_STACK_OVERFLOW?
- Previous by thread: Re: CreateFile() returns ERROR_ACCESS_DENIED to the user
- Next by thread: Has anyone used the fpfilter ddk sample?
- Index(es):
Relevant Pages
|