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.

146 lines
3.5 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. lsaprtl.h
  5. Abstract:
  6. Local Security Authority - Temporary Rtl Routine Definitions.
  7. This file contains definitions for routines used in the LSA that could
  8. be made into Rtl routines. They have been written in general purpose
  9. form with this in mind - the only exception to thisa is that their names
  10. have Lsap prefixes to indicate that they are currently used only by the
  11. LSA.
  12. Scott Birrell (ScottBi) March 26, 1992
  13. Environment:
  14. Revision History:
  15. --*/
  16. // Options for LsapRtlAddPrivileges
  17. #define RTL_COMBINE_PRIVILEGE_ATTRIBUTES ((ULONG) 0x00000001L)
  18. #define RTL_SUPERSEDE_PRIVILEGE_ATTRIBUTES ((ULONG) 0x00000002L)
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif // __cplusplus
  22. NTSTATUS
  23. LsapRtlAddPrivileges(
  24. IN OUT PPRIVILEGE_SET * RunningPrivileges,
  25. IN OUT PULONG MaxRunningPrivileges,
  26. IN PPRIVILEGE_SET PrivilegesToAdd,
  27. IN ULONG Options,
  28. OUT OPTIONAL BOOLEAN * Changed
  29. );
  30. NTSTATUS
  31. LsapRtlRemovePrivileges(
  32. IN OUT PPRIVILEGE_SET ExistingPrivileges,
  33. IN PPRIVILEGE_SET PrivilegesToRemove
  34. );
  35. PLUID_AND_ATTRIBUTES
  36. LsapRtlGetPrivilege(
  37. IN PLUID_AND_ATTRIBUTES Privilege,
  38. IN PPRIVILEGE_SET Privileges
  39. );
  40. BOOLEAN
  41. LsapRtlPrefixSid(
  42. IN PSID PrefixSid,
  43. IN PSID Sid
  44. );
  45. BOOLEAN
  46. LsapRtlPrefixName(
  47. IN PUNICODE_STRING PrefixName,
  48. IN PUNICODE_STRING Name
  49. );
  50. LONG
  51. LsapRtlFindCharacterInUnicodeString(
  52. IN PUNICODE_STRING InputString,
  53. IN PUNICODE_STRING Character,
  54. IN BOOLEAN CaseInsensitive
  55. );
  56. VOID
  57. LsapRtlSplitNames(
  58. IN PUNICODE_STRING Names,
  59. IN ULONG Count,
  60. IN PUNICODE_STRING Separator,
  61. OUT PUNICODE_STRING PrefixNames,
  62. OUT PUNICODE_STRING SuffixNames
  63. );
  64. VOID
  65. LsapRtlSetSecurityAccessMask(
  66. IN SECURITY_INFORMATION SecurityInformation,
  67. OUT PACCESS_MASK DesiredAccess
  68. );
  69. VOID
  70. LsapRtlQuerySecurityAccessMask(
  71. IN SECURITY_INFORMATION SecurityInformation,
  72. OUT PACCESS_MASK DesiredAccess
  73. );
  74. NTSTATUS
  75. LsapRtlSidToUnicodeRid(
  76. IN PSID Sid,
  77. OUT PUNICODE_STRING UnicodeRid
  78. );
  79. NTSTATUS
  80. LsapRtlWellKnownPrivilegeCheck(
  81. IN PVOID ObjectHandle,
  82. IN ULONG PrivilegeId
  83. );
  84. NTSTATUS
  85. LsapSplitSid(
  86. IN PSID AccountSid,
  87. IN OUT PSID *DomainSid,
  88. OUT ULONG *Rid
  89. );
  90. #define LSAP_ENCRYPTED_AUTH_DATA_FILL 512
  91. //
  92. // This is the individual auth info information stored on, read from, and written to the object
  93. //
  94. typedef struct _LSAPR_TRUST_DOMAIN_AUTH_INFO_HALF {
  95. ULONG AuthInfos;
  96. PLSAPR_AUTH_INFORMATION AuthenticationInformation;
  97. PLSAPR_AUTH_INFORMATION PreviousAuthenticationInformation;
  98. } LSAPR_TRUST_DOMAIN_AUTH_INFO_HALF, *PLSAPR_TRUST_DOMAIN_AUTH_INFO_HALF;
  99. #define LsapDsAuthHalfFromAuthInfo( authinf, incoming ) \
  100. ((incoming) == TRUE ? \
  101. (PLSAPR_TRUST_DOMAIN_AUTH_INFO_HALF) (authinf) : \
  102. (authinf) == NULL ? NULL : \
  103. (PLSAPR_TRUST_DOMAIN_AUTH_INFO_HALF)((PBYTE) (authinf) + \
  104. sizeof(LSAPR_TRUST_DOMAIN_AUTH_INFO_HALF)))
  105. NTSTATUS
  106. LsapDsMarshalAuthInfoHalf(
  107. IN PLSAPR_TRUST_DOMAIN_AUTH_INFO_HALF AuthInfo,
  108. OUT PULONG Length,
  109. OUT PBYTE *Buffer
  110. );
  111. #ifdef __cplusplus
  112. }
  113. #endif // __cplusplus