我把那些简单封装了一下:
$PBExportHeader$nvo_shutdownnew.sru
forward
global type nvo_shutdownnew from nonvisualobject
end type
type luid from structure within nvo_shutdownnew
end type
type luid_and_attributes from structure within nvo_shutdownnew
end type
type token_privileges from structure within nvo_shutdownnew
end type
end forward
type LUID from structure
long lowpart
long highpart
end type
type luid_and_attributes from structure
luid pluid
long attributes
end type
type token_privileges from structure
long privilegecount
luid_and_attributes privileges[]
end type
global type nvo_shutdownnew from nonvisualobject autoinstantiate
end type
type prototypes
FUNCTION ulong ExitWindowsEx(ulong uFlags,ulong dwReserved) LIBRARY "user32.dll"
FUNCTION ulong GetCurrentProcess() LIBRARY "kernel32.dll"
FUNCTION ulong LookupPrivilegevalue(ref string lpSystemName,ref string lpName,ref Luid
lpLuid) LIBRARY "advapi32.dll" ALIAS FOR "LookupPrivilegevalueA"
FUNCTION ulong AdjustTokenPrivileges(ulong TokenHandle,boolean DisableAllPrivileges,ref