Leaked source code of windows server 2003
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.

70 lines
1.2 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. security.c
  5. Abstract
  6. Security routines.
  7. Note: This file uses NTDDK.H, which is blocked out by WDM.H .
  8. So it does not include PCH.H et al.
  9. Author:
  10. Ervin P.
  11. Environment:
  12. Kernel mode only
  13. Revision History:
  14. --*/
  15. #include "pch.h"
  16. /*
  17. * Copied from ntrtl.h, which won't compile here.
  18. */
  19. __inline LUID RtlConvertLongToLuid(LONG Long)
  20. {
  21. LUID TempLuid;
  22. LARGE_INTEGER TempLi;
  23. TempLi = RtlConvertLongToLargeInteger(Long);
  24. TempLuid.LowPart = TempLi.LowPart;
  25. TempLuid.HighPart = TempLi.HighPart;
  26. return(TempLuid);
  27. }
  28. NTKERNELAPI BOOLEAN SeSinglePrivilegeCheck(LUID PrivilegeValue, KPROCESSOR_MODE PreviousMode);
  29. BOOLEAN MyPrivilegeCheck(PIRP Irp)
  30. {
  31. BOOLEAN result;
  32. #if DBG
  33. if (dbgSkipSecurity){
  34. return TRUE;
  35. }
  36. #endif
  37. {
  38. #ifndef SE_TCB_PRIVILEGE
  39. #define SE_TCB_PRIVILEGE (7L)
  40. #endif
  41. LUID priv = RtlConvertLongToLuid(SE_TCB_PRIVILEGE);
  42. result = SeSinglePrivilegeCheck(priv, Irp->RequestorMode);
  43. }
  44. return result;
  45. }