You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
886 B

  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace Apewer.Internals.Interop
  4. {
  5. [System.Security.SecuritySafeCritical]
  6. class AdvApi32
  7. {
  8. [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
  9. internal static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall, ref TokenPrivilege newst, int len, IntPtr prev, IntPtr relen);
  10. [DllImport("advapi32.dll", SetLastError = true)]
  11. internal static extern bool LookupPrivilegeValue(string host, string name, ref long pluid);
  12. [DllImport("advapi32.dll", SetLastError = true)]
  13. internal static extern bool LookupPrivilegeValueA(string host, string name, ref long pluid);
  14. [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)]
  15. internal static extern bool OpenProcessToken(IntPtr h, int acc, ref IntPtr phtok);
  16. }
  17. }