Re: CreateFile() returns ERROR_ACCESS_DENIED to the user



Even simpler way is to specify a security descriptor for the device in the
INF file.

"Don Burn" <burn@xxxxxxxxxxxxxxxx> wrote in message
news:eVu%23CA3BHHA.1300@xxxxxxxxxxxxxxxxxxxxxxx
Actually, a simpler way is to use IoCreateDeviceSecure with a SDDL string
that allows geneal users access.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply



"anton bassov" <soviet_bloke@xxxxxxxxxxx> wrote in message
news:1163454664.839974.119450@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Do i must modify user rights or driver rights ????

In actuality, none of the above....

You have to modify not user rights and DEFINITELY not driver rights,
but access permission to your target device (i.e. its ACL) Check MSDN,
namely, GetSecurityInfo()/SetSecurityInfo(), plus SetEntriesInAcl(),
for more info

Anton Bassov

SteM wrote:
Thanks Anton,
my guess was that, at least, open, close and DeviceIoControl was allowed
....
How can i solve ?
Do i must modify user rights or driver rights ????

Thanks
--
SteM


"anton bassov" <soviet_bloke@xxxxxxxxxxx> ha scritto nel messaggio
news:1163436308.076405.201750@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi mate

This is just absolutely normal default behaviour - limited users have
no access to devices by default. If you want non-privileged users to
gain access to it, you have to EXPLICITLY allow the above (it is
understandable that it can be done only from the Admin account)

Anton Bassov


SteM wrote:
Hello,
I've written a small wdm driver for Win2000 to access an old custom
hw
on
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






.



Relevant Pages

  • Re: Bad INF, how to clean registry now?
    ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... Delete the files copied by the INF from the system. ... >> your device identifier will determine the OEM* name of your inf file. ... >> Don Burn (MVP, Windows DDK) ...
    (microsoft.public.development.device.drivers)
  • Re: INF file - [SourceDisksNames] and [SourceDisksFiles]
    ... Use SetupCopyOEMInf and do not modify the INF file. ... Don Burn (MVP, Windows DDK) ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ...
    (microsoft.public.development.device.drivers)
  • Re: CreateFile() returns ERROR_ACCESS_DENIED to the user
    ... Don Burn (MVP, Windows DDK) ... Windows 2k/XP/2k3 Filesystem and Driver Consulting ... You have to modify not user rights and DEFINITELY not driver rights, ... The accesses are via a couple of DeviceIoControl() custom commands. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Obtaining driver version programatically
    ... Control Panel or the INF file. ... > to get the path to the driver then use GetFileVersion to get the version. ... > Don Burn (MVP, Windows DDK) ...
    (microsoft.public.development.device.drivers)
  • Re: I cannot get my Saitek AV8R Joystick to install
    ... 2.Saitek AV8R Classic Stick5.6.0.54 Saitek ... would need to look at the .inf file contents. ... 3.Saitek AV8R Classic Stick5.6.0.54 Saitek Windows Update I have no ... You may get into a situation that requires that you install the driver ...
    (microsoft.public.windowsxp.games)