---------------------------------------------------------
procedure TForm1.N1Click(Sender: TObject);
var
Token:Cardinal;
TokenPri:TOKEN_PRIVILEGES;
ProcessDest:int64;
begin
if not OpenProcessToken(GetCurrentProcess,TOKEN_QUERY,Token) then
RaiseLastOSError
else
begin
if LookupPrivilegeValue(nil,'SeDebugPrivilege',ProcessDest) then
begin
TokenPri.PrivilegeCount:=1;
TokenPri.Privileges[0].Attributes:=SE_PRIVILEGE_ENABLED;
TokenPri.Privileges[0].Luid:=ProcessDest;
if AdjustTokenPrivileges(Token,False,TokenPri,sizeof(TokenPri),nil,nil) then
showmessage('successfully')
else
showmessage('faid');
end;
end;
--------------------------------------------------------------------
When I completed these code,it had an error,the error information is "There is no overload version of "AdjustTokenPrivilege" that can be called with these arguments". Who can help me?? TKS.
This post has been edited by lanyus: 29 October 2005 - 10:19 PM



Help
Back to top








