Windows 7 Embedded: Open driver fails

Hello,

I wrote a simple device driver for a PCI device.

This driver is based on the Plx9x5x sample supplied with DDK (7600.16385.1).

The driver was successfully installed under Windows 7 Embedded.

I ran a code to open the driver and start sending IOCTL requests.

But open fails.

The open is copied from WinDDK\7600.16385.1\src\general\PLX9x5x\test\plx.cpp

The method GetDevicePath returns a null path.

I used the same code before under Windows XP and it was OK.

The device driver and the user level driver both use the same definition:

DEFINE_GUID (GUID_PLX_INTERFACE,
0x29d2a384, 0x2e47, 0x49b5, 0xae, 0xbf, 0x69, 0x62, 0xc2, 0x2b, 0xd7, 0xc2);

Can you help ?

Thanks,
Zvika.

Are your running elevated as admin on win7?

d

debt from my phone


From: Zvi Vered
Sent: 2/15/2012 7:20 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Windows 7 Embedded: Open driver fails

Hello,

I wrote a simple device driver for a PCI device.

This driver is based on the Plx9x5x sample supplied with DDK (7600.16385.1).

The driver was successfully installed under Windows 7 Embedded.

I ran a code to open the driver and start sending IOCTL requests.

But open fails.

The open is copied from WinDDK\7600.16385.1\src\general\PLX9x5x\test\plx.cpp

The method GetDevicePath returns a null path.

I used the same code before under Windows XP and it was OK.

The device driver and the user level driver both use the same definition:

DEFINE_GUID (GUID_PLX_INTERFACE,
0x29d2a384, 0x2e47, 0x49b5, 0xae, 0xbf, 0x69, 0x62, 0xc2, 0x2b, 0xd7, 0xc2);

Can you help ?

Thanks,
Zvika.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Dear Mr. Holan,

The windows installation contains only one user which is administrator.
Under this user I installed the driver.

Thanks,
Zvika.

From: Doron Holan
Sent: Thursday, February 16, 2012 5:34 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Windows 7 Embedded: Open driver fails

Are your running elevated as admin on win7?

d

debt from my phone


From: Zvi Vered
Sent: 2/15/2012 7:20 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Windows 7 Embedded: Open driver fails

Hello,

I wrote a simple device driver for a PCI device.

This driver is based on the Plx9x5x sample supplied with DDK (7600.16385.1).

The driver was successfully installed under Windows 7 Embedded.

I ran a code to open the driver and start sending IOCTL requests.

But open fails.

The open is copied from WinDDK\7600.16385.1\src\general\PLX9x5x\test\plx.cpp

The method GetDevicePath returns a null path.

I used the same code before under Windows XP and it was OK.

The device driver and the user level driver both use the same definition:

DEFINE_GUID (GUID_PLX_INTERFACE,
0x29d2a384, 0x2e47, 0x49b5, 0xae, 0xbf, 0x69, 0x62, 0xc2, 0x2b, 0xd7, 0xc2);

Can you help ?

Thanks,
Zvika.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Zvi Vered wrote:

Dear Mr. Holan,

The windows installation contains only one user which is administrator.
Under this user I installed the driver.

Since Vista, being an administrator does not mean you have
administrative privileges at all times. It means you are ALLOWED to
become an administrator, but you have to request the permissions you
need. That’s called “elevation”. You can use a manifest in your
application to request elevation, or you can run it from a command line
that has been configured to “Run as administrator.”


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Dear Mr. Roberts,

I did not try it yet.

But why should I “elevate” or request a permission in order to open a file ?
The opening is done from user level.
Every user should be able to do it.
The dll (which also opens the file) is used by non-admin customers.

Thanks,
Zvika.

-----Original Message-----
From: Tim Roberts
Sent: Thursday, February 16, 2012 8:04 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Windows 7 Embedded: Open driver fails

Zvi Vered wrote:

Dear Mr. Holan,

The windows installation contains only one user which is administrator.
Under this user I installed the driver.

Since Vista, being an administrator does not mean you have
administrative privileges at all times. It means you are ALLOWED to
become an administrator, but you have to request the permissions you
need. That’s called “elevation”. You can use a manifest in your
application to request elevation, or you can run it from a command line
that has been configured to “Run as administrator.”


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Zvi Vered wrote:

I did not try it yet.

But why should I “elevate” or request a permission in order to open a file ?

You’re not opening a file. You’re opening a device driver. That
requires additional permissions.

The opening is done from user level.
Every user should be able to do it.

Then you have to set the security descriptor in the INF file to one that
allows general users to access the device, or use IoCreateDeviceSecure
in the driver and specify a more generous security descriptor. The
default one allows only administrative access.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Dear Mr. Roberts,

Sorry, my mistake.

The code for “GetDevicePath” was an old code that works under XP.

When I used the code in plx.cpp taken from WDK7600 it worked.

I did not have to “Run as Administrator”

Your help is highly appreciated,
Zvika.

-----Original Message-----
From: Tim Roberts
Sent: Friday, February 17, 2012 9:09 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Windows 7 Embedded: Open driver fails

Zvi Vered wrote:

I did not try it yet.

But why should I “elevate” or request a permission in order to open a file
?

You’re not opening a file. You’re opening a device driver. That
requires additional permissions.

The opening is done from user level.
Every user should be able to do it.

Then you have to set the security descriptor in the INF file to one that
allows general users to access the device, or use IoCreateDeviceSecure
in the driver and specify a more generous security descriptor. The
default one allows only administrative access.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

On XP you did not have to elevate, there was no concept of elevation. Vista introduced a whole bunch of new security concepts

d

debt from my phone


From: Zvi Vered
Sent: 2/19/2012 10:33 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Windows 7 Embedded: Open driver fails

Dear Mr. Roberts,

Sorry, my mistake.

The code for “GetDevicePath” was an old code that works under XP.

When I used the code in plx.cpp taken from WDK7600 it worked.

I did not have to “Run as Administrator”

Your help is highly appreciated,
Zvika.

-----Original Message-----
From: Tim Roberts
Sent: Friday, February 17, 2012 9:09 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Windows 7 Embedded: Open driver fails

Zvi Vered wrote:

I did not try it yet.

But why should I “elevate” or request a permission in order to open a file
?

You’re not opening a file. You’re opening a device driver. That
requires additional permissions.

The opening is done from user level.
Every user should be able to do it.

Then you have to set the security descriptor in the INF file to one that
allows general users to access the device, or use IoCreateDeviceSecure
in the driver and specify a more generous security descriptor. The
default one allows only administrative access.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer