wanni Posted October 24, 2008 Share Posted October 24, 2008 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 & RegardsUmesh Bansal. Link to comment Share on other sites More sharing options...
cluberti Posted October 24, 2008 Share Posted October 24, 2008 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). Link to comment Share on other sites More sharing options...
MagicAndre1981 Posted October 24, 2008 Share Posted October 24, 2008 The caller of this function must be a member of the Administrators groupHow 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) Link to comment Share on other sites More sharing options...
wanni Posted October 31, 2008 Author Share Posted October 31, 2008 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. Link to comment Share on other sites More sharing options...
softice Posted November 2, 2008 Share Posted November 2, 2008 (edited) 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> Edited November 2, 2008 by softice Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now