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.

155 lines
3.5 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. extern PSID OtherOrganizationSid; // Other org SID
  34. //
  35. // Well Known Aliases.
  36. //
  37. // These are aliases that are relative to the built-in domain.
  38. //
  39. extern PSID LocalAdminSid; // NT local admins SID
  40. extern PSID AliasAdminsSid; // Administrator Sid
  41. extern PSID AliasUsersSid; // User Sid
  42. extern PSID AliasGuestsSid; // Guest Sid
  43. extern PSID AliasPowerUsersSid; // Power User Sid
  44. extern PSID AliasAccountOpsSid; // Account Operator Sid
  45. extern PSID AliasSystemOpsSid; // System Operator Sid
  46. extern PSID AliasPrintOpsSid; // Print Operator Sid
  47. extern PSID AliasBackupOpsSid; // Backup Operator Sid
  48. //
  49. // Structure to hold information about an ACE to be created
  50. //
  51. typedef struct {
  52. UCHAR AceType;
  53. UCHAR InheritFlags;
  54. UCHAR AceFlags;
  55. ACCESS_MASK Mask;
  56. PSID *Sid;
  57. } ACE_DATA, *PACE_DATA;
  58. //
  59. // Function prototypes
  60. //
  61. NTSTATUS
  62. NetpCreateWellKnownSids(
  63. PSID DomainId
  64. );
  65. VOID
  66. NetpFreeWellKnownSids(
  67. VOID
  68. );
  69. NTSTATUS
  70. NetpAllocateAndInitializeSid(
  71. OUT PSID *Sid,
  72. IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
  73. IN ULONG SubAuthorityCount
  74. );
  75. NET_API_STATUS
  76. NetpDomainIdToSid(
  77. IN PSID DomainId,
  78. IN ULONG RelativeId,
  79. OUT PSID *Sid
  80. );
  81. NTSTATUS
  82. NetpCreateSecurityDescriptor(
  83. IN PACE_DATA AceData,
  84. IN ULONG AceCount,
  85. IN PSID OwnerSid,
  86. IN PSID GroupSid,
  87. OUT PSECURITY_DESCRIPTOR *NewDescriptor
  88. );
  89. NTSTATUS
  90. NetpCreateSecurityObject(
  91. IN PACE_DATA AceData,
  92. IN ULONG AceCount,
  93. IN PSID OwnerSid,
  94. IN PSID GroupSid,
  95. IN PGENERIC_MAPPING GenericMapping,
  96. OUT PSECURITY_DESCRIPTOR *NewDescriptor
  97. );
  98. NTSTATUS
  99. NetpDeleteSecurityObject(
  100. IN PSECURITY_DESCRIPTOR *Descriptor
  101. );
  102. NET_API_STATUS
  103. NetpAccessCheckAndAudit(
  104. IN LPTSTR SubsystemName,
  105. IN LPTSTR ObjectTypeName,
  106. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  107. IN ACCESS_MASK DesiredAccess,
  108. IN PGENERIC_MAPPING GenericMapping
  109. );
  110. NET_API_STATUS
  111. NetpAccessCheck(
  112. IN PSECURITY_DESCRIPTOR SecurityDescriptor,
  113. IN ACCESS_MASK DesiredAccess,
  114. IN PGENERIC_MAPPING GenericMapping
  115. );
  116. NET_API_STATUS
  117. NetpGetBuiltinDomainSID(
  118. PSID *BuiltinDomainSID
  119. );
  120. #ifdef __cplusplus
  121. } // extern "C"
  122. #endif
  123. #endif // ifndef _SECOBJ_INCLUDED_