c# Windows Mobile 6.0关机代码?
来源:百度知道 编辑:UC知道 时间:2024/05/21 11:04:49
public struct TokPriv1Luid
{
public int Count;
public long Luid;
public int Attr;
}
[DllImport("kernel32.dll",ExactSpelling=true)]
public static extern IntPtr GetCurrentProcess();
[DllImport("advapi32.dll",ExactSpelling=true,SetLastError=true)]
public static extern bool OpenProcessToken(IntPtr h,int acc,ref IntPtr phtok );
[DllImport("advapi32.dll",SetLastError=true)]
public static extern bool LookupPrivilegeValue(string host,string name,ref long pluid );
[DllImport("advapi32.dll",ExactSpelling=true, SetLastError=true) ]
public static extern bool AdjustTokenPrivileges(IntPtr htok,bool disall,
ref TokPriv1Luid newst,int len,IntPtr prev, IntPtr relen);
[DllImport("user32.dll",ExactSpelling=true,SetLastError=true) ]
public static extern bool ExitWindowsEx(int flg,int rea);
public const int SE_PR