MSFN Forum: SetUpCreateDeviceInfo()API is not working in Windows Vista with UAC Of - MSFN Forum

Jump to content



Windows Vista Forum Rules

If you have questions about customizing Windows Vista that are vLite-specific, please post them in the vLite forum, not here. If you have questions regarding the unattended installation of Windows Vista, please post them in the Unattended Windows Vista/Server 2008 section.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

SetUpCreateDeviceInfo()API is not working in Windows Vista with UAC Of SetUpCreateDeviceInfo()API is not working in Windows Vista with UAC Of Rate Topic: -----

#1 User is offline   wanni 

  • Group: Members
  • Posts: 2
  • Joined: 24-October 08

Posted 24 October 2008 - 06:31 AM

Hi ,
I am using SetUpCreateDeviceInfo()API in my application, It works fine on XP as well as on Vista with UAC OFF, but it fails on Vista with UAC ON. The SetUpCreateDeviceInfo() fails but GetLastError() function returns 0. Can anyone please tell the solution?

Note: SetUpCreateDeviceInfo()API definition is in setupapi.h in WINDDK.

Thanks & Regards
Umesh Bansal.


#2 User is offline   cluberti 

  • Gustatus similis pullus
  • Group: Supervisor
  • Posts: 11,000
  • Joined: 09-September 01
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 24 October 2008 - 08:43 AM

I think you might mean SetupDiCreateDeviceInfo. Anyway, sounds like it's failing outside your code, likely in the registry. If you run process monitor whilst reproducing the error, do you see any access denied or sharing violation messages in the procmon log that correlate to your repro? That'd be the first thing I would check (especially if GetLastError returns 0).

#3 User is offline   MagicAndre1981 

  • after Windows 7 GA still Vista lover :)
  • Group: Patrons
  • Posts: 3,732
  • Joined: 28-August 05
  • OS:Vista Ultimate x86
  • Country: Country Flag

Posted 24 October 2008 - 09:48 AM

Quote

The caller of this function must be a member of the Administrators group


How do you start your application? if UAC is on, you're not elevated rights by default. So tell your application it should run with elevated rights (this can be requested by editing your manifest file)

#4 User is offline   wanni 

  • Group: Members
  • Posts: 2
  • Joined: 24-October 08

Posted 31 October 2008 - 03:42 AM

Hi it also looks to me this is elevated priviliges problem.
I make an manifest file and try again but of no use.
Here is sample of mine manifets file

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="amd64"
name="iKeyDriver.msi"
type="win64"/>
<description>elevate execution level</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

Can you point out where i am wrong.

Regards,
Umesh.

#5 User is offline   softice 

  • Newbie
  • Group: Members
  • Posts: 38
  • Joined: 06-December 05

Posted 02 November 2008 - 02:21 AM

I uses this code, it works.

But it have one issue: when your exe file run in Windows XP SP2, it may lead to a BSOD.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
  <assemblyIdentity version="1.0.0.0"
	 processorArchitecture="*"
	 name="IsUserAdmin"
	 type="win32"/> 
  <description>Description of your application</description> 
  <!-- Identify the application security requirements. -->
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
	<security>
	  <requestedPrivileges>
		<requestedExecutionLevel
		  level="requireAdministrator"
		  uiAccess="false"/>
		</requestedPrivileges>
	   </security>
  </trustInfo>
</assembly>

This post has been edited by softice: 02 November 2008 - 02:22 AM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy