[Bug 13001] LookupPrivilegeValue

wine-bugs at winehq.org wine-bugs at winehq.org
Mon May 5 20:37:17 CDT 2008


http://bugs.winehq.org/show_bug.cgi?id=13001





--- Comment #3 from Michael Kosarev <russiane39 at gmail.com>  2008-05-05 20:37:17 ---
Here is example portion of code, utilizes that WinApi function:
procedure EnableDebugPrivileges;
var
 hToken: THandle;
 tp: TTokenPrivileges;
 DebugNameValue: Int64;
 ret: Cardinal;
begin
 OpenProcessToken(GetCurrentProcess, TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY,
hToken);
 LookupPrivilegeValue(nil, 'SeDebugPrivilege', DebugNameValue);
 tp.PrivilegeCount:=1;
 tp.Privileges[0].Luid:=DebugNameValue;
 tp.Privileges[0].Attributes:=SE_PRIVILEGE_ENABLED;
 AdjustTokenPrivileges(hToken, False, tp, sizeof(tp), nil, ret);
end;


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list