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.

171 lines
3.9 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. NTSTATUS
  41. LsapRtlLookupKnownPrivilegeValue(
  42. IN PSTRING PrivilegeName,
  43. OUT PLUID Value
  44. );
  45. NTSTATUS
  46. LsapRtlValidatePrivilegeSet(
  47. IN PPRIVILEGE_SET Privileges
  48. );
  49. BOOLEAN
  50. LsapRtlIsValidPrivilege(
  51. IN PLUID_AND_ATTRIBUTES Privilege
  52. );
  53. BOOLEAN
  54. LsapRtlPrefixSid(
  55. IN PSID PrefixSid,
  56. IN PSID Sid
  57. );
  58. BOOLEAN
  59. LsapRtlPrefixName(
  60. IN PUNICODE_STRING PrefixName,
  61. IN PUNICODE_STRING Name
  62. );
  63. LONG
  64. LsapRtlFindCharacterInUnicodeString(
  65. IN PUNICODE_STRING InputString,
  66. IN PUNICODE_STRING Character,
  67. IN BOOLEAN CaseInsensitive
  68. );
  69. VOID
  70. LsapRtlSplitNames(
  71. IN PUNICODE_STRING Names,
  72. IN ULONG Count,
  73. IN PUNICODE_STRING Separator,
  74. OUT PUNICODE_STRING PrefixNames,
  75. OUT PUNICODE_STRING SuffixNames
  76. );
  77. VOID
  78. LsapRtlSetSecurityAccessMask(
  79. IN SECURITY_INFORMATION SecurityInformation,
  80. OUT PACCESS_MASK DesiredAccess
  81. );
  82. VOID
  83. LsapRtlQuerySecurityAccessMask(
  84. IN SECURITY_INFORMATION SecurityInformation,
  85. OUT PACCESS_MASK DesiredAccess
  86. );
  87. NTSTATUS
  88. LsapRtlSidToUnicodeRid(
  89. IN PSID Sid,
  90. OUT PUNICODE_STRING UnicodeRid
  91. );
  92. NTSTATUS
  93. LsapRtlPrivilegeSetToLuidAndAttributes(
  94. IN OPTIONAL PPRIVILEGE_SET PrivilegeSet,
  95. OUT PULONG PrivilegeCount,
  96. OUT PLUID_AND_ATTRIBUTES *LuidAndAttributes
  97. );
  98. NTSTATUS
  99. LsapRtlWellKnownPrivilegeCheck(
  100. IN PVOID ObjectHandle,
  101. IN BOOLEAN ImpersonateClient,
  102. IN ULONG PrivilegeId,
  103. IN OPTIONAL PCLIENT_ID ClientId
  104. );
  105. NTSTATUS
  106. LsapSplitSid(
  107. IN PSID AccountSid,
  108. IN OUT PSID *DomainSid,
  109. OUT ULONG *Rid
  110. );
  111. #define LSAP_ENCRYPTED_AUTH_DATA_FILL 512
  112. //
  113. // This is the individual auth info information stored on, read from, and written to the object
  114. //
  115. typedef struct _LSAPR_TRUST_DOMAIN_AUTH_INFO_HALF {
  116. ULONG AuthInfos;
  117. PLSAPR_AUTH_INFORMATION AuthenticationInformation;
  118. PLSAPR_AUTH_INFORMATION PreviousAuthenticationInformation;
  119. } LSAPR_TRUST_DOMAIN_AUTH_INFO_HALF, *PLSAPR_TRUST_DOMAIN_AUTH_INFO_HALF;
  120. #define LsapDsAuthHalfFromAuthInfo( authinf, incoming ) \
  121. ((incoming) == TRUE ? \
  122. (PLSAPR_TRUST_DOMAIN_AUTH_INFO_HALF) (authinf) : \
  123. (authinf) == NULL ? NULL : \
  124. (PLSAPR_TRUST_DOMAIN_AUTH_INFO_HALF)((PBYTE) (authinf) + \
  125. sizeof(LSAPR_TRUST_DOMAIN_AUTH_INFO_HALF)))
  126. NTSTATUS
  127. LsapDsMarshalAuthInfoHalf(
  128. IN PLSAPR_TRUST_DOMAIN_AUTH_INFO_HALF AuthInfo,
  129. OUT PULONG Length,
  130. OUT PBYTE *Buffer
  131. );
  132. #ifdef __cplusplus
  133. }
  134. #endif // __cplusplus