CM_Reenumerate_DevNode woes...

Hi All,

I’ve a driver installer/remover (much like pnputil + devcon) which works fine in XP + Vista. But when I try
Win7 I get a CR_ACCESS_DENIED when trying CM_Reenumerate_DevNode, even though the process is executed under a user
with administrative rights. Could sure use some help here…

TIA
/Rob

When you say ‘administrative rights,’ do you mean an account with admin rights or executed using ‘Run As Adminstrator’ (UAC)? If the former, you need to do the later.

Good luck,

mm

xxxxx@evitechnology.com skrev:

When you say ‘administrative rights,’ do you mean an account with admin rights or executed using ‘Run As Adminstrator’ (UAC)? If the former, you need to do the later.

So if I shut down UAC, it should work anyway?

/R

Does using “Run as administrator” give joy?

Thomas F. Divine


From: “Robert Bielik”
Sent: Wednesday, March 24, 2010 11:59 AM
To: “Windows System Software Devs Interest List”
Subject: [ntdev] CM_Reenumerate_DevNode woes…

> Hi All,
>
> I’ve a driver installer/remover (much like pnputil + devcon) which works
> fine in XP + Vista. But when I try
> Win7 I get a CR_ACCESS_DENIED when trying CM_Reenumerate_DevNode, even
> though the process is executed under a user
> with administrative rights. Could sure use some help here…
> TIA
> /Rob
>
> —
> 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

Thomas F. Divine skrev:

Does using “Run as administrator” give joy?

Yes, the rescan seems to work. Then I just need to inform users to use the RAA option.

Thnx.
/R

That will do it as well.

Good luck,

mm

xxxxx@evitechnology.com skrev:

That will do it as well.

Nope, unfortunately not. But that’s no big deal. Running it with RAA seems to be the ticket.

Thank you
/R

I forgot:

In case you’re not familar with UAC:

start GPEDIT.MSC:

Under:

Local Computer Policy\Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options

Enable:

User Account Control: Admin Approval Mode for the Built-in Administrator Account
User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode

Good luck,

mm

It certainly should work - disabling UAC, that is; how did you do that?

mm

On this topic, back when I tried out blogging I wrote this one:

“I Just Wanted to Install My Dam Driver on Windows 7…”

http://ndis.blogspot.com/2009/03/i-just-wanted-to-install-my-dam-driver.html

Good luck,

Thomas F. Divine
http://www.rawether.net

P.S. Since I have some free time now perhaps I’ll blog a little more…
Thos


From: “Robert Bielik”
Sent: Wednesday, March 24, 2010 12:19 PM
To: “Windows System Software Devs Interest List”
Subject: Re: [ntdev] CM_Reenumerate_DevNode woes…

> xxxxx@evitechnology.com skrev:
>> That will do it as well.
>
> Nope, unfortunately not. But that’s no big deal. Running it with RAA seems
> to be the ticket.
>
> Thank you
> /R
>
>
> —
> 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

xxxxx@evitechnology.com skrev:

It certainly should work - disabling UAC, that is; how did you do that?

Under user UAC setting, heh. Using your pointers, it works fine now :slight_smile:

/R

Glad to hear it. You had me worried for a minute that this was some new Win7 thing.

mm

Robert Bielik wrote:

Thomas F. Divine skrev:
> Does using “Run as administrator” give joy?

Yes, the rescan seems to work. Then I just need to inform users to use
the RAA option.

No, you just need to include a manifest in your exe that requests elevation.


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

Ok, I was hoping someone else would take the bait and ask how, but since
they didn’t I’ll have to fess up and show my ignorance. How do you request
elevation in a manifest, Tim?

I spent quite a bit of time looking yesterday, so it’s not a matter of not
doing my homework. Nothing in the docs that I recognized, but sometimes
formulating the right question is a more difficult task than the problem
you’re trying to solve.

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Wednesday, March 24, 2010 3:32 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] CM_Reenumerate_DevNode woes…

Robert Bielik wrote:

Thomas F. Divine skrev:
> Does using “Run as administrator” give joy?

Yes, the rescan seems to work. Then I just need to inform users to use
the RAA option.

No, you just need to include a manifest in your exe that requests elevation.


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

__________ Information from ESET Smart Security, version of virus signature
database 4972 (20100324) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature
database 4973 (20100325) __________

The message was checked by ESET Smart Security.

http://www.eset.com

Try searching for requestedExecutionLevel, it’s the secret to getting the
shield icon overlay and having the UAC dialog popped when your application
is run.

-scott


Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com

“Gary G. Little” wrote in message
news:xxxxx@ntdev…
> Ok, I was hoping someone else would take the bait and ask how, but since
> they didn’t I’ll have to fess up and show my ignorance. How do you request
> elevation in a manifest, Tim?
>
> I spent quite a bit of time looking yesterday, so it’s not a matter of not
> doing my homework. Nothing in the docs that I recognized, but sometimes
> formulating the right question is a more difficult task than the problem
> you’re trying to solve.
>
> Gary G. Little
> H (952) 223-1349
> C (952) 454-4629
> xxxxx@comcast.net
>
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
> Sent: Wednesday, March 24, 2010 3:32 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] CM_Reenumerate_DevNode woes…
>
> Robert Bielik wrote:
>> Thomas F. Divine skrev:
>>> Does using “Run as administrator” give joy?
>>
>> Yes, the rescan seems to work. Then I just need to inform users to use
>> the RAA option.
>
> No, you just need to include a manifest in your exe that requests
> elevation.
>
> –
> 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
>
>
> Information from ESET Smart Security, version of virus
> signature
> database 4972 (20100324)

>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
> Information from ESET Smart Security, version of virus
> signature
> database 4973 (20100325)

>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>

In VS2008 the option is in Linker-Manifast File properties.

Bill Wandel

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]
On Behalf Of Scott Noone
Sent: Thursday, March 25, 2010 11:06 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] CM_Reenumerate_DevNode woes…

Try searching for requestedExecutionLevel, it’s the secret to getting the
shield icon overlay and having the UAC dialog popped when your application
is run.

-scott


Scott Noone
Consulting Associate
OSR Open Systems Resources, Inc.
http://www.osronline.com

“Gary G. Little” wrote in message
news:xxxxx@ntdev…
> Ok, I was hoping someone else would take the bait and ask how, but since
> they didn’t I’ll have to fess up and show my ignorance. How do you request
> elevation in a manifest, Tim?
>
> I spent quite a bit of time looking yesterday, so it’s not a matter of not
> doing my homework. Nothing in the docs that I recognized, but sometimes
> formulating the right question is a more difficult task than the problem
> you’re trying to solve.
>
> Gary G. Little
> H (952) 223-1349
> C (952) 454-4629
> xxxxx@comcast.net
>
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
> Sent: Wednesday, March 24, 2010 3:32 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] CM_Reenumerate_DevNode woes…
>
> Robert Bielik wrote:
>> Thomas F. Divine skrev:
>>> Does using “Run as administrator” give joy?
>>
>> Yes, the rescan seems to work. Then I just need to inform users to use
>> the RAA option.
>
> No, you just need to include a manifest in your exe that requests
> elevation.
>
> –
> 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
>
>
> Information from ESET Smart Security, version of virus
> signature
> database 4972 (20100324)

>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
> Information from ESET Smart Security, version of virus
> signature
> database 4973 (20100325)

>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>


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

Actually, I believe it’s dependent on the language in which you’re programming within VS 2008.

I’ve always done it by manually editing the manifest as suggested by SNoone. The specifics are here:

http://msdn.microsoft.com/en-us/library/bb756929.aspx

Peter
OSR

Yeah … I noted no change in a C++ project in either Debug or Release when
using the Linker flag.

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@osr.com
Sent: Thursday, March 25, 2010 11:47 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] CM_Reenumerate_DevNode woes…

Actually, I believe it’s dependent on the language in which you’re
programming within VS 2008.

I’ve always done it by manually editing the manifest as suggested by SNoone.
The specifics are here:

http://msdn.microsoft.com/en-us/library/bb756929.aspx

Peter
OSR


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

__________ Information from ESET Smart Security, version of virus signature
database 4974 (20100325) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature
database 4974 (20100325) __________

The message was checked by ESET Smart Security.

http://www.eset.com

My bad … I was looking at the 32 bit version when I was changing the 64
bit version. Changing the linker flag does indeed appear to work … as long
as your looking at the right file!!!

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gary G. Little
Sent: Thursday, March 25, 2010 1:04 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] CM_Reenumerate_DevNode woes…

Yeah … I noted no change in a C++ project in either Debug or Release when
using the Linker flag.

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@osr.com
Sent: Thursday, March 25, 2010 11:47 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] CM_Reenumerate_DevNode woes…

Actually, I believe it’s dependent on the language in which you’re
programming within VS 2008.

I’ve always done it by manually editing the manifest as suggested by SNoone.
The specifics are here:

http://msdn.microsoft.com/en-us/library/bb756929.aspx

Peter
OSR


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

__________ Information from ESET Smart Security, version of virus signature
database 4974 (20100325) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature
database 4974 (20100325) __________

The message was checked by ESET Smart Security.

http://www.eset.com


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

__________ Information from ESET Smart Security, version of virus signature
database 4974 (20100325) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature
database 4974 (20100325) __________

The message was checked by ESET Smart Security.

http://www.eset.com

> they didn’t I’ll have to fess up and show my ignorance. How do you request

elevation in a manifest, Tim?

Google for “requireAdministrator”


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com