http://bugs.winehq.org/show_bug.cgi?id=13001
--- Comment #3 from Michael Kosarev russiane39@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;