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.

78 lines
2.0 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1999.
  5. //
  6. // File: AccessCk.h
  7. //
  8. // Contents: Code copied and modified from private\ntos\se\accessck.c
  9. //
  10. //
  11. //----------------------------------------------------------------------------
  12. #ifndef __ACCESSCK_ADUTILS_H
  13. #define __ACCESSCK_ADUTILS_H
  14. #define SID_ARRAY_SIZE sizeof (ULONG) * 8
  15. class IOBJECT_TYPE_LIST {
  16. public:
  17. IOBJECT_TYPE_LIST () :
  18. Level (0),
  19. Flags (0),
  20. ParentIndex (0),
  21. Remaining (0),
  22. CurrentGranted (0),
  23. CurrentDenied (0)
  24. {
  25. ::ZeroMemory (&ObjectType, sizeof (GUID));
  26. ::ZeroMemory (grantingSid, sizeof (grantingSid));
  27. ::ZeroMemory (denyingSid, sizeof (denyingSid));
  28. }
  29. ~IOBJECT_TYPE_LIST ()
  30. {
  31. for (UINT nIndex = 0; nIndex < SID_ARRAY_SIZE; nIndex++)
  32. {
  33. if ( grantingSid[nIndex] )
  34. CoTaskMemFree (grantingSid[nIndex]);
  35. if ( denyingSid[nIndex] )
  36. CoTaskMemFree (denyingSid[nIndex]);
  37. }
  38. }
  39. USHORT Level;
  40. USHORT Flags;
  41. #define OBJECT_SUCCESS_AUDIT 0x1
  42. #define OBJECT_FAILURE_AUDIT 0x2
  43. GUID ObjectType;
  44. LONG ParentIndex;
  45. ULONG Remaining;
  46. ULONG CurrentGranted;
  47. ULONG CurrentDenied;
  48. PSID grantingSid[SID_ARRAY_SIZE];
  49. PSID denyingSid[SID_ARRAY_SIZE];
  50. };
  51. typedef IOBJECT_TYPE_LIST* PIOBJECT_TYPE_LIST;
  52. HRESULT SepInit ();
  53. VOID SepCleanup ();
  54. HRESULT
  55. SepMaximumAccessCheck(
  56. list<PSID>& psidList,
  57. IN PACL Dacl,
  58. IN PSID PrincipalSelfSid,
  59. IN size_t LocalTypeListLength,
  60. IN PIOBJECT_TYPE_LIST LocalTypeList,
  61. IN size_t ObjectTypeListLength);
  62. NTSTATUS
  63. SeCaptureObjectTypeList (
  64. IN POBJECT_TYPE_LIST ObjectTypeList OPTIONAL,
  65. IN size_t ObjectTypeListLength,
  66. OUT PIOBJECT_TYPE_LIST *CapturedObjectTypeList
  67. );
  68. #endif