文件名称:net_lim
介绍说明--下载内容均来自于网络,请自行研究使用
procedure tform1.ShutDown
procedure AdjustToken() //获取关机控制权
var
hdlProcessHandle, hdlTokenHandle, lBufferNeeded: Cardinal
tmpLuid: Int64
//tkpPrivilegeCount: Int64
tkp, tkpNewButIgnored: TOKEN_PRIVILEGES
Privilege: array[0..0] of _LUID_AND_ATTRIBUTES
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,-procedure tform1.ShutDown procedure AdjustToken ()// obtain the shutdown control varhdlProcessHandle, hdlTokenHandle, lBufferNeeded: Cardinal tmpLuid: Int64// tkpPrivilegeCount: Int64 tkp, tkpNewButIgnored: TOKEN_PRIVILEGES Privilege: array [0 .. 0] of _LUID_AND_ATTRIBUTES beginhdlProcessHandle: = 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 settkp.Privileges [0]: = Privilege [0]// Enable the shutdown privilege in the access token of this process.AdjustTokenPrivileges (hdlTokenHandle,
procedure AdjustToken() //获取关机控制权
var
hdlProcessHandle, hdlTokenHandle, lBufferNeeded: Cardinal
tmpLuid: Int64
//tkpPrivilegeCount: Int64
tkp, tkpNewButIgnored: TOKEN_PRIVILEGES
Privilege: array[0..0] of _LUID_AND_ATTRIBUTES
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,-procedure tform1.ShutDown procedure AdjustToken ()// obtain the shutdown control varhdlProcessHandle, hdlTokenHandle, lBufferNeeded: Cardinal tmpLuid: Int64// tkpPrivilegeCount: Int64 tkp, tkpNewButIgnored: TOKEN_PRIVILEGES Privilege: array [0 .. 0] of _LUID_AND_ATTRIBUTES beginhdlProcessHandle: = 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 settkp.Privileges [0]: = Privilege [0]// Enable the shutdown privilege in the access token of this process.AdjustTokenPrivileges (hdlTokenHandle,
(系统自动生成,下载前可以参看下载内容)
下载文件列表
net_lim
.......\Project1.cfg
.......\Project1.dof
.......\Project1.dpr
.......\Project1.exe
.......\Project1.i64
.......\Project1.res
.......\Project1.stat
.......\Unit1.dcu
.......\Unit1.ddp
.......\Unit1.dfm
.......\Unit1.pas
.......\Unit1.~ddp
.......\Unit1.~dfm
.......\Unit1.~pas
.......\Project1.cfg
.......\Project1.dof
.......\Project1.dpr
.......\Project1.exe
.......\Project1.i64
.......\Project1.res
.......\Project1.stat
.......\Unit1.dcu
.......\Unit1.ddp
.......\Unit1.dfm
.......\Unit1.pas
.......\Unit1.~ddp
.......\Unit1.~dfm
.......\Unit1.~pas