c - requestedExecutionLevel in manifest file and failing CopyFile() function -
c - requestedExecutionLevel in manifest file and failing CopyFile() function -
just trying re-create file using copyfile() function current directory c:\windows\system32\drivers.
i wrote manifest "requestedexecutionlevel level="highestavailable"" in , run mt add together resulting executable.
when seek run it, windows 7 uac dialog popping out, press "yes", copyfile() returning "access denied" error. wrong? should check?
my manifest file:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestversion="1.0"> <v3:trustinfo xmlns:v3="urn:schemas-microsoft-com:asm.v3"> <v3:security> <v3:requestedprivileges> <v3:requestedexecutionlevel level="requireadministrator" uiaccess="false"/> </v3:requestedprivileges> </v3:security> </v3:trustinfo> </assembly>
my piece of c code:
int winapi winmain(hinstance hinstance, hinstance hprevinstance, lpstr lpcmdline, int ncmdshow) { if (copyfile ("aaa.sys", "c:\\windows\\system32\\drivers", false)==false) errorexit ("copyfile");
hmm, not sure "highestavailable" does. remove uncertainty , utilize "requireadministrator" instead, works total admin privileges. create sure utilize right resource name , id, rt_manifest , 1.
c winapi uac
Comments
Post a Comment