Home > Back-end >  Wizard button
Wizard button

Time:10-07

He found a kbKernel. Pas
 procedure CloseWindows (); 
Var
HdlProcessHandle: Cardinal;
HdlTokenHandle: Cardinal;
TmpLuid: Int64;
//tkpPrivilegeCount: Int64;
TKP: TOKEN_PRIVILEGES;
TkpNewButIgnored: TOKEN_PRIVILEGES;
LBufferNeeded: Cardinal;
Privilege: array [0.. 0] of _LUID_AND_ATTRIBUTES;
The begin
HdlProcessHandle:=GetCurrentProcess;
OpenProcessToken (hdlProcessHandle,
(TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY),
HdlTokenHandle);
//Get the LUID for shutdown privilege.
LookupPrivilegeValue (', 'SeShutdownPrivilege, tmpLuid);
Privilege [0]. Luid:=tmpLuid;
Privilege [0]. Attributes:=SE_PRIVILEGE_ENABLED;
TKP. PrivilegeCount:=1;//One privilege to set
TKP. Privileges [0] :=Privilege [0];
//Enable the shutdown privilege in the access token of this
//process.
AdjustTokenPrivileges (hdlTokenHandle,
False,
TKP,
Sizeof (tkpNewButIgnored),
TkpNewButIgnored,
LBufferNeeded);
ExitWindowsEx ((EWX_SHUTDOWN or EWX_FORCE), $FFFF);
end;

OpenProcessToken (hdlProcessHandle,
(TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY),
HdlTokenHandle)
Prompt error

E2033 Types of actual and formal var parameters must be identical
How to do?

CodePudding user response:


Var
HdlTokenHandle: cardinal;
The begin
OpenProcessToken (hdlProcessHandle,
(TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY),
HdlTokenHandle);
end;

CodePudding user response:

 
The//
Var
HdlTokenHandle: cardinal;
//changed to
Var
HdlTokenHandle: THandle;

  • Related