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.

127 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. scseclib.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 _SCSECLIB_INCLUDED_
  14. #define _SCSECLIB_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 LocalServiceSid; // NT LocalService SID
  30. extern PSID NetworkServiceSid; // NT NetworkService SID
  31. extern PSID BuiltinDomainSid; // Domain Id of the Builtin Domain
  32. extern PSID AuthenticatedUserSid; // NT authenticated users SID
  33. extern PSID AnonymousLogonSid; // Anonymous Logon SID
  34. //
  35. // Well Known Aliases.
  36. //
  37. // These are aliases that are relative to the built-in domain.
  38. //
  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. } SC_ACE_DATA, *PSC_ACE_DATA;
  57. NTSTATUS
  58. ScCreateWellKnownSids(
  59. VOID
  60. );
  61. NTSTATUS
  62. ScAllocateAndInitializeSid(
  63. OUT PSID *Sid,
  64. IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
  65. IN ULONG SubAuthorityCount
  66. );
  67. NTSTATUS
  68. ScDomainIdToSid(
  69. IN PSID DomainId,
  70. IN ULONG RelativeId,
  71. OUT PSID *Sid
  72. );
  73. NTSTATUS
  74. ScCreateAndSetSD(
  75. IN PSC_ACE_DATA AceData,
  76. IN ULONG AceCount,
  77. IN PSID OwnerSid OPTIONAL,
  78. IN PSID GroupSid OPTIONAL,
  79. OUT PSECURITY_DESCRIPTOR *NewDescriptor
  80. );
  81. NTSTATUS
  82. ScCreateUserSecurityObject(
  83. IN PSECURITY_DESCRIPTOR ParentSD,
  84. IN PSC_ACE_DATA AceData,
  85. IN ULONG AceCount,
  86. IN PSID OwnerSid,
  87. IN PSID GroupSid,
  88. IN BOOLEAN IsDirectoryObject,
  89. IN BOOLEAN UseImpersonationToken,
  90. IN PGENERIC_MAPPING GenericMapping,
  91. OUT PSECURITY_DESCRIPTOR *NewDescriptor
  92. );
  93. DWORD
  94. ScCreateStartEventSD(
  95. PSECURITY_DESCRIPTOR *pEventSD
  96. );
  97. #ifdef __cplusplus
  98. }
  99. #endif
  100. #endif // ifdef _SCSECLIB_INCLUDED_