Source code of Windows XP (NT5)
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.

154 lines
3.2 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. secobj.h
  5. Abstract:
  6. This header file defines the structures and function prototypes of
  7. routines which simplify the creation of security descriptors for
  8. user-mode objects.
  9. Author:
  10. Rita Wong (ritaw) 27-Feb-1991
  11. Revision History:
  12. --*/
  13. #ifndef _SECOBJ_INCLUDED_
  14. #define _SECOBJ_INCLUDED_
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. //
  19. // Global declarations
  20. //
  21. //
  22. // NT well-known SIDs
  23. //
  24. extern PSID NullSid; // No members SID
  25. extern PSID WorldSid; // All users SID
  26. extern PSID LocalSid; // NT local users SID
  27. extern PSID NetworkSid; // NT remote users SID
  28. extern PSID LocalSystemSid; // NT system processes SID
  29. extern PSID BuiltinDomainSid; // Domain Id of the Builtin Domain
  30. extern PSID AuthenticatedUserSid; // Authenticated user SID
  31. extern PSID AnonymousLogonSid; // Anonymous Logon SID
  32. extern PSID LocalServiceSid; // NT service processes SID
  33. //
  34. // Well Known Aliases.
  35. //
  36. // These are aliases that are relative to the built-in domain.
  37. //
  38. extern PSID LocalAdminSid; // NT local admins SID
  39. extern PSID AliasAdminsSid; // Administrator Sid
  40. extern PSID AliasUsersSid; // User Sid
  41. extern PSID AliasGuestsSid; // Guest Sid
  42. extern PSID AliasPowerUsersSid; // Power User Sid
  43. extern PSID AliasAccountOpsSid; // Account Operator Sid
  44. extern PSID AliasSystemOpsSid; // System Operator Sid
  45. extern PSID AliasPrintOpsSid; // Print Operator Sid
  46. extern PSID AliasBackupOpsSid; // Backup Operator Sid
  47. //
  48. // Structure to hold information about an ACE to be created
  49. //
  50. typedef struct {
  51. UCHAR AceType;
  52. UCHAR InheritFlags;
  53. UCHAR AceFlags;
  54. ACCESS_MASK Mask;
  55. PSID *Sid;
  56. } ACE_DATA, *PACE_DATA;
  57. //
  58. // Function prototypes
  59. //
  60. NTSTATUS
  61. NetpCreateWellKnownSids(
  62. PSID DomainId
  63. );
  64. VOID
  65. NetpFreeWellKnownSids(
  66. VOID
  67. );
  68. NTSTATUS
  69. NetpAllocateAndInitializeSid(
  70. OUT PSID *Sid,
  71. IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
  72. IN ULONG SubAuthorityCount
  73. );
  74. NET_API_STATUS
  75. NetpDomainIdToSid(
  76. IN PSID DomainId,
  77. IN ULONG RelativeId,
  78. OUT PSID *Sid
  79. );
  80. NTSTATUS
  81. NetpCreateSecurityDescriptor(
  82. IN PACE_DATA AceData,
  83. IN ULONG AceCount,
  84. IN PSID OwnerSid,
  85. IN PSID GroupSid,
  86. OUT PSECURITY_DESCRIPTOR *NewDescriptor
  87. );
  88. NTSTATUS
  89. NetpCreateSecurityObject(
  90. IN PACE_DATA AceData,
  91. IN ULONG AceCount,
  92. IN PSID OwnerSid,
  93. IN PSID GroupSid,
  94. IN PGENERIC_MAPPING GenericMapping,
  95. OUT PSECURITY_DESCRIPTOR *NewDescriptor
  96. );
  97. NTSTATUS
  98. NetpDeleteSecurityObject(
  99. IN PSECURITY_DESCRIPTOR *Descriptor
  100. );
  101. NET_API_STATUS
  102. NetpAccessCheckAndAudit(
  103. IN LPTSTR SubsystemName,
  104. IN LPTSTR ObjectTypeName,
  105. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  106. IN ACCESS_MASK DesiredAccess,
  107. IN PGENERIC_MAPPING GenericMapping
  108. );
  109. NET_API_STATUS
  110. NetpAccessCheck(
  111. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  112. IN ACCESS_MASK DesiredAccess,
  113. IN PGENERIC_MAPPING GenericMapping
  114. );
  115. NET_API_STATUS
  116. NetpGetBuiltinDomainSID(
  117. PSID *BuiltinDomainSID
  118. );
  119. #ifdef __cplusplus
  120. } // extern "C"
  121. #endif
  122. #endif // ifndef _SECOBJ_INCLUDED_