Open the process with enough privileges before adjusting them

svn path=/trunk/; revision=29160
This commit is contained in:
Hervé Poussineau 2007-09-23 13:14:03 +00:00
parent 2ff2329ed3
commit 0b3a854203

View file

@ -432,7 +432,7 @@ BOOL WINAPI EnablePrivilege(LPCWSTR lpPrivilegeName, BOOL bEnable)
TRACE("%s %s\n", debugstr_w(lpPrivilegeName), bEnable ? "TRUE" : "FALSE");
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken))
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
return FALSE;
Privileges.PrivilegeCount = 1;