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.

1039 lines
26 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. lsaisrv.h
  5. Abstract:
  6. This file contains interfaces to internal routines in the Lsa
  7. Server that provide additional functionality not contained in
  8. the Lsar routines. These routines are only used by LSA clients which
  9. live in the same process as the LSA server.
  10. Author:
  11. Scott Birrell (ScottBi) April 8, 1992
  12. Environment:
  13. User Mode - Win32
  14. Revision History:
  15. --*/
  16. #ifndef _LSAISRV_
  17. #define _LSAISRV_
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. //
  22. // The following constants are defined for callers of the LsaIHealthCheckRoutine
  23. //
  24. // 1. LSAI_SAM_STATE_SESS_KEY is used to convey the syskey by SAM to LSA.
  25. // This is used in upgrade cases from NT4 and win2k B3 and RC1.
  26. // SAM in these cases knows the syskey
  27. //
  28. // 2. LSAI_SAM_STATE_UNROLL_SP4_ENCRYPTION is used to convey SAM's password
  29. // encryption key to LSA. This is used to unroll encryption used in NT4 SP4
  30. // ( incorrectly ) using SAM's password encryption key
  31. //
  32. // 3. LSAI_SAM_STATE_RETRIEVE_SESS_KEY is used by SAM/DS to retrieve the
  33. // from LSA to decrypt their respective password encryption keys
  34. //
  35. // 4. LSAI_SAM_GENERATE_SESS_KEY is used by SAM to tell the LSA to generate
  36. // a new Password Encryption key in the case where we are upgrading
  37. // from a NT4 or Win2k B3 or RC1 Machine and the machine is not syskey'd
  38. //
  39. // 5. LSAI_SAM_STATE_CLEAR_SESS_KEY is used by SAM or DS to clear the syskey
  40. // after it has been used for decrypting their respective password
  41. // encryption keys.
  42. //
  43. // 6. LSAI_SAM_STATE_OLD_SESS_KEY This is used to retrieve the old syskey in
  44. // to implement error recovery during syskey change cases.
  45. //
  46. #define LSAI_SAM_STATE_SESS_KEY 0x1
  47. #define LSAI_SAM_STATE_UNROLL_SP4_ENCRYPTION 0x2
  48. #define LSAI_SAM_STATE_RETRIEVE_SESS_KEY 0x3
  49. #define LSAI_SAM_STATE_CLEAR_SESS_KEY 0x4
  50. #define LSAI_SAM_GENERATE_SESS_KEY 0x5
  51. #define LSAI_SAM_STATE_OLD_SESS_KEY 0x6
  52. //
  53. // Internal limit on the number of SIDs that can be assigned to a single
  54. // security context. If, for some reason, someone logs on to an account
  55. // and is assigned more than this number of SIDs, the logon will fail.
  56. // An error should be logged in this case.
  57. //
  58. #define LSAI_CONTEXT_SID_LIMIT 1024
  59. ///////////////////////////////////////////////////////////////////////////////
  60. // //
  61. // The following prototypes are usable throughout the process that the //
  62. // LSA server resides in. //
  63. // //
  64. ///////////////////////////////////////////////////////////////////////////////
  65. NTSTATUS NTAPI
  66. LsaIHealthCheck(
  67. IN LSAPR_HANDLE DomainHandle OPTIONAL,
  68. IN ULONG StateChange,
  69. IN OUT PVOID StateChangeData,
  70. IN OUT PULONG StateChangeDataLength
  71. );
  72. NTSTATUS NTAPI
  73. LsaIOpenPolicyTrusted(
  74. OUT PLSAPR_HANDLE PolicyHandle
  75. );
  76. NTSTATUS NTAPI
  77. LsaIQueryInformationPolicyTrusted(
  78. IN POLICY_INFORMATION_CLASS InformationClass,
  79. OUT PLSAPR_POLICY_INFORMATION *Buffer
  80. );
  81. NTSTATUS NTAPI
  82. LsaIGetSerialNumberPolicy(
  83. IN LSAPR_HANDLE PolicyHandle,
  84. OUT PLARGE_INTEGER ModifiedCount,
  85. OUT PLARGE_INTEGER CreationTime
  86. );
  87. NTSTATUS NTAPI
  88. LsaISetSerialNumberPolicy(
  89. IN LSAPR_HANDLE PolicyHandle,
  90. IN PLARGE_INTEGER ModifiedCount,
  91. IN PLARGE_INTEGER CreationTime,
  92. IN BOOLEAN StartOfFullSync
  93. );
  94. NTSTATUS NTAPI
  95. LsaIEnumerateSecrets(
  96. IN LSAPR_HANDLE PolicyHandle,
  97. IN OUT PLSA_ENUMERATION_HANDLE EnumerationContext,
  98. OUT PVOID *Buffer,
  99. IN ULONG PreferedMaximumLength,
  100. OUT PULONG CountReturned
  101. );
  102. NTSTATUS NTAPI
  103. LsaISetTimesSecret(
  104. IN LSAPR_HANDLE SecretHandle,
  105. IN PLARGE_INTEGER CurrentValueSetTime,
  106. IN PLARGE_INTEGER OldValueSetTime
  107. );
  108. #ifdef __LOGONMSV_H__ // This API is only of interest to users of logonmsv.h
  109. NTSTATUS NTAPI
  110. LsaIFilterSids(
  111. IN PUNICODE_STRING TrustedDomainName,
  112. IN ULONG TrustDirection,
  113. IN ULONG TrustType,
  114. IN ULONG TrustAttributes,
  115. IN OPTIONAL PSID Sid,
  116. IN NETLOGON_VALIDATION_INFO_CLASS InfoClass,
  117. IN OUT PVOID SamInfo,
  118. IN OPTIONAL PSID ResourceGroupDomainSid,
  119. IN OUT OPTIONAL PULONG ResourceGroupCount,
  120. IN OUT OPTIONAL PGROUP_MEMBERSHIP ResourceGroupIds
  121. );
  122. NTSTATUS NTAPI
  123. LsaIFilterNamespace(
  124. IN PUNICODE_STRING TrustedDomainName,
  125. IN ULONG TrustDirection,
  126. IN ULONG TrustType,
  127. IN ULONG TrustAttributes,
  128. IN PUNICODE_STRING Namespace
  129. );
  130. #endif
  131. typedef enum {
  132. RoutingMatchDomainSid,
  133. RoutingMatchDomainName,
  134. RoutingMatchUpn,
  135. RoutingMatchSpn,
  136. RoutingMatchNamespace
  137. } LSA_ROUTING_MATCH_TYPE;
  138. NTSTATUS NTAPI
  139. LsaIForestTrustFindMatch(
  140. IN LSA_ROUTING_MATCH_TYPE Type,
  141. IN PVOID Data,
  142. OUT PLSA_UNICODE_STRING Match
  143. );
  144. VOID
  145. LsaIFree_LSA_FOREST_TRUST_INFORMATION(
  146. IN PLSA_FOREST_TRUST_INFORMATION * ForestTrustInfo
  147. );
  148. VOID
  149. LsaIFree_LSA_FOREST_TRUST_COLLISION_INFORMATION(
  150. IN PLSA_FOREST_TRUST_COLLISION_INFORMATION * CollisionInfo
  151. );
  152. BOOLEAN NTAPI
  153. LsaISetupWasRun(
  154. );
  155. BOOLEAN NTAPI
  156. LsaISafeMode(
  157. VOID
  158. );
  159. BOOLEAN NTAPI
  160. LsaILookupWellKnownName(
  161. IN PUNICODE_STRING WellKnownName
  162. );
  163. VOID NTAPI
  164. LsaIFree_LSAPR_ACCOUNT_ENUM_BUFFER (
  165. IN PLSAPR_ACCOUNT_ENUM_BUFFER EnumerationBuffer
  166. );
  167. VOID NTAPI
  168. LsaIFree_LSAPR_TRANSLATED_SIDS (
  169. IN PLSAPR_TRANSLATED_SIDS TranslatedSids
  170. );
  171. VOID NTAPI
  172. LsaIFree_LSAPR_TRANSLATED_NAMES (
  173. IN PLSAPR_TRANSLATED_NAMES TranslatedNames
  174. );
  175. VOID NTAPI
  176. LsaIFree_LSAPR_POLICY_INFORMATION (
  177. IN POLICY_INFORMATION_CLASS InformationClass,
  178. IN PLSAPR_POLICY_INFORMATION PolicyInformation
  179. );
  180. VOID NTAPI
  181. LsaIFree_LSAPR_POLICY_DOMAIN_INFORMATION (
  182. IN POLICY_DOMAIN_INFORMATION_CLASS DomainInformationClass,
  183. IN PLSAPR_POLICY_DOMAIN_INFORMATION PolicyDomainInformation
  184. );
  185. VOID NTAPI
  186. LsaIFree_LSAPR_TRUSTED_DOMAIN_INFO (
  187. IN TRUSTED_INFORMATION_CLASS InformationClass,
  188. IN PLSAPR_TRUSTED_DOMAIN_INFO TrustedDomainInformation
  189. );
  190. VOID NTAPI
  191. LsaIFree_LSAPR_REFERENCED_DOMAIN_LIST (
  192. IN PLSAPR_REFERENCED_DOMAIN_LIST ReferencedDomains
  193. );
  194. VOID NTAPI
  195. LsaIFree_LSAPR_TRUSTED_ENUM_BUFFER (
  196. IN PLSAPR_TRUSTED_ENUM_BUFFER EnumerationBuffer
  197. );
  198. VOID NTAPI
  199. LsaIFree_LSAPR_TRUSTED_ENUM_BUFFER_EX (
  200. PLSAPR_TRUSTED_ENUM_BUFFER_EX EnumerationBuffer
  201. );
  202. VOID NTAPI
  203. LsaIFree_LSAPR_TRUST_INFORMATION (
  204. IN PLSAPR_TRUST_INFORMATION TrustInformation
  205. );
  206. VOID NTAPI
  207. LsaIFree_LSAP_SECRET_ENUM_BUFFER (
  208. IN PVOID Buffer,
  209. IN ULONG Count
  210. );
  211. VOID NTAPI
  212. LsaIFree_LSAPR_PRIVILEGE_ENUM_BUFFER (
  213. PLSAPR_PRIVILEGE_ENUM_BUFFER EnumerationBuffer
  214. );
  215. VOID NTAPI
  216. LsaIFree_LSAPR_SR_SECURITY_DESCRIPTOR (
  217. IN PLSAPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor
  218. );
  219. VOID
  220. LsaIFree_LSAI_SECRET_ENUM_BUFFER (
  221. IN PVOID Buffer,
  222. IN ULONG Count
  223. );
  224. VOID NTAPI
  225. LsaIFree_LSAI_PRIVATE_DATA (
  226. IN PVOID Data
  227. );
  228. VOID NTAPI
  229. LsaIFree_LSAPR_UNICODE_STRING (
  230. IN PLSAPR_UNICODE_STRING UnicodeName
  231. );
  232. VOID NTAPI
  233. LsaIFree_LSAPR_UNICODE_STRING_BUFFER (
  234. IN PLSAPR_UNICODE_STRING UnicodeName
  235. );
  236. VOID NTAPI
  237. LsaIFree_LSAPR_PRIVILEGE_SET (
  238. IN PLSAPR_PRIVILEGE_SET PrivilegeSet
  239. );
  240. VOID NTAPI
  241. LsaIFree_LSAPR_CR_CIPHER_VALUE (
  242. IN PLSAPR_CR_CIPHER_VALUE CipherValue
  243. );
  244. //
  245. // Enumeration to describe the attribute value data
  246. //
  247. typedef enum _LSAP_AUDIT_SAM_ATTR_DELTA_TYPE
  248. {
  249. LsapAuditSamAttrUnchanged = 0,
  250. LsapAuditSamAttrNewValue,
  251. LsapAuditSamAttrNoValue,
  252. LsapAuditSamAttrSecret
  253. } LSAP_SAM_AUDIT_ATTR_DELTA_TYPE, *PLSAP_SAM_AUDIT_ATTR_DELTA_TYPE;
  254. //
  255. // Macro to compute the UINT_PTR offset of a field in a structure type
  256. //
  257. #define LSAP_FIELD_PTR(Type, Field) \
  258. ((FIELD_OFFSET(Type, Field)) / sizeof(UINT_PTR))
  259. //
  260. // Macro to compute the index into AttrDeltaType given the containing
  261. // structure's base address and the address of the associated field whos
  262. // delta type is desired.
  263. //
  264. // Base - pointer to the structure
  265. // Field - pointer to attribute field whos deltatype is being indexed
  266. //
  267. #define LSAP_INDEX_ATTR_DELTA_TYPE(Base, Field) \
  268. ((((UINT_PTR)(Field)) - ((UINT_PTR)(Base))) / sizeof(UINT_PTR))
  269. //
  270. // Attribute change information for auditing domain objects
  271. //
  272. #define LSAP_DOMAIN_ATTR_COUNT 13
  273. //
  274. // The above count must match the number of attribute pointers in the
  275. // associated structure as it determines how many attributes we
  276. // maintain LSAI_SAM_AUDIT_ATTR_DELTA_TYPEs for.
  277. //
  278. typedef struct _LSAP_AUDIT_DOMAIN_ATTR_VALUES
  279. {
  280. PLARGE_INTEGER MinPasswordAge;
  281. PLARGE_INTEGER MaxPasswordAge;
  282. PLARGE_INTEGER ForceLogoff;
  283. PUSHORT LockoutThreshold;
  284. PLARGE_INTEGER LockoutObservationWindow;
  285. PLARGE_INTEGER LockoutDuration;
  286. PULONG PasswordProperties;
  287. PUSHORT MinPasswordLength;
  288. PUSHORT PasswordHistoryLength;
  289. PULONG MachineAccountQuota;
  290. PULONG MixedDomainMode;
  291. PULONG DomainBehaviorVersion;
  292. PUNICODE_STRING OemInformation;
  293. LSAP_SAM_AUDIT_ATTR_DELTA_TYPE AttrDeltaType[LSAP_DOMAIN_ATTR_COUNT];
  294. } LSAP_AUDIT_DOMAIN_ATTR_VALUES, *PLSAP_AUDIT_DOMAIN_ATTR_VALUES;
  295. //
  296. // Attribute change information for auditing user/computer objects
  297. //
  298. #define LSAP_USER_ATTR_COUNT 18
  299. //
  300. // The above count must match the number of attribute pointers in the
  301. // associated structure as it determines how many attributes we
  302. // maintain LSAI_SAM_AUDIT_ATTR_DELTA_TYPEs for.
  303. //
  304. typedef struct _LSAP_AUDIT_USER_ATTR_VALUES
  305. {
  306. PUNICODE_STRING SamAccountName;
  307. PUNICODE_STRING DisplayName;
  308. PUNICODE_STRING UserPrincipalName;
  309. PUNICODE_STRING HomeDirectory;
  310. PUNICODE_STRING HomeDrive;
  311. PUNICODE_STRING ScriptPath;
  312. PUNICODE_STRING ProfilePath;
  313. PUNICODE_STRING UserWorkStations;
  314. PFILETIME PasswordLastSet;
  315. PFILETIME AccountExpires;
  316. PULONG PrimaryGroupId;
  317. PLSA_ADT_STRING_LIST AllowedToDelegateTo;
  318. PULONG UserAccountControl;
  319. PUNICODE_STRING UserParameters;
  320. PLSA_ADT_SID_LIST SidHistory;
  321. PLOGON_HOURS LogonHours;
  322. // Computers only
  323. PUNICODE_STRING DnsHostName;
  324. PLSA_ADT_STRING_LIST ServicePrincipalNames;
  325. // Metadata indicating how each of the above were changed
  326. LSAP_SAM_AUDIT_ATTR_DELTA_TYPE AttrDeltaType[LSAP_USER_ATTR_COUNT];
  327. // Valid only if UserAccountControl is non-NULL
  328. PULONG PrevUserAccountControl;
  329. } LSAP_AUDIT_USER_ATTR_VALUES, *PLSAP_AUDIT_USER_ATTR_VALUES;
  330. //
  331. // Attribute change information for auditing group/alias objects
  332. //
  333. #define LSAP_GROUP_ATTR_COUNT 2
  334. //
  335. // The above count must match the number of attribute pointers in the
  336. // associated structure as it determines how many attributes we
  337. // maintain LSAI_SAM_AUDIT_ATTR_DELTA_TYPEs for.
  338. //
  339. typedef struct _LSAP_AUDIT_GROUP_ATTR_VALUES
  340. {
  341. PUNICODE_STRING SamAccountName;
  342. PLSA_ADT_SID_LIST SidHistory;
  343. LSAP_SAM_AUDIT_ATTR_DELTA_TYPE AttrDeltaType[LSAP_GROUP_ATTR_COUNT];
  344. } LSAP_AUDIT_GROUP_ATTR_VALUES, *PLSAP_AUDIT_GROUP_ATTR_VALUES;
  345. NTSTATUS NTAPI
  346. LsaIAuditSamEvent(
  347. IN NTSTATUS Status,
  348. IN ULONG AuditId,
  349. IN PSID DomainSid,
  350. IN PUNICODE_STRING AdditionalInfo OPTIONAL,
  351. IN PULONG MemberRid OPTIONAL,
  352. IN PSID MemberSid OPTIONAL,
  353. IN PUNICODE_STRING AccountName OPTIONAL,
  354. IN PUNICODE_STRING DomainName,
  355. IN PULONG AccountRid OPTIONAL,
  356. IN PPRIVILEGE_SET Privileges OPTIONAL,
  357. IN PVOID ExtendedInfo OPTIONAL
  358. );
  359. NTSTATUS NTAPI
  360. LsaIAuditNotifyPackageLoad(
  361. PUNICODE_STRING PackageFileName
  362. );
  363. NTSTATUS NTAPI
  364. LsaIAuditKdcEvent(
  365. IN ULONG AuditId,
  366. IN PUNICODE_STRING ClientName,
  367. IN PUNICODE_STRING ClientDomain,
  368. IN PSID ClientSid,
  369. IN PUNICODE_STRING ServiceName,
  370. IN PSID ServiceSid,
  371. IN PULONG KdcOptions,
  372. IN PULONG KerbStatus,
  373. IN PULONG EncryptionType,
  374. IN PULONG PreAuthType,
  375. IN PBYTE ClientAddress,
  376. IN LPGUID LogonGuid OPTIONAL,
  377. IN PLSA_ADT_STRING_LIST TransittedServices OPTIONAL,
  378. IN PUNICODE_STRING CertIssuerName OPTIONAL,
  379. IN PUNICODE_STRING CertSerialNumber OPTIONAL,
  380. IN PUNICODE_STRING CertThumbprint OPTIONAL
  381. );
  382. NTSTATUS
  383. LsaIGetLogonGuid(
  384. IN PUNICODE_STRING pUserName,
  385. IN PUNICODE_STRING pUserDomain,
  386. IN PBYTE pBuffer,
  387. IN UINT BufferSize,
  388. OUT LPGUID pLogonGuid
  389. );
  390. NTSTATUS
  391. LsaISetLogonGuidInLogonSession(
  392. IN PLUID LogonId,
  393. IN LPGUID LogonGuid OPTIONAL
  394. );
  395. VOID
  396. LsaIAuditKerberosLogon(
  397. IN NTSTATUS LogonStatus,
  398. IN NTSTATUS LogonSubStatus,
  399. IN PUNICODE_STRING AccountName,
  400. IN PUNICODE_STRING AuthenticatingAuthority,
  401. IN PUNICODE_STRING WorkstationName,
  402. IN PSID UserSid, OPTIONAL
  403. IN SECURITY_LOGON_TYPE LogonType,
  404. IN PTOKEN_SOURCE TokenSource,
  405. IN PLUID LogonId,
  406. IN LPGUID LogonGuid,
  407. IN PLSA_ADT_STRING_LIST TransittedServices
  408. );
  409. NTSTATUS
  410. LsaIAuditLogonUsingExplicitCreds(
  411. IN USHORT AuditEventType,
  412. IN PLUID pUser1LogonId,
  413. IN LPGUID pUser1LogonGuid, OPTIONAL
  414. IN HANDLE User1ProcessId,
  415. IN PUNICODE_STRING pUser2Name,
  416. IN PUNICODE_STRING pUser2Domain,
  417. IN LPGUID pUser2LogonGuid,
  418. IN PUNICODE_STRING pTargetName,
  419. IN PUNICODE_STRING pTargetInfo
  420. );
  421. NTSTATUS
  422. LsaIAdtAuditingEnabledByCategory(
  423. IN POLICY_AUDIT_EVENT_TYPE Category,
  424. IN USHORT AuditEventType,
  425. IN PSID pUserSid OPTIONAL,
  426. IN PLUID pLogonId OPTIONAL,
  427. OUT PBOOLEAN pbAudit
  428. );
  429. NTSTATUS
  430. LsaIAuditAccountLogon(
  431. IN ULONG AuditId,
  432. IN BOOLEAN Successful,
  433. IN PUNICODE_STRING Source,
  434. IN PUNICODE_STRING ClientName,
  435. IN PUNICODE_STRING MappedName,
  436. IN NTSTATUS Status OPTIONAL
  437. );
  438. NTSTATUS
  439. LsaIAuditAccountLogonEx(
  440. IN ULONG AuditId,
  441. IN BOOLEAN Successful,
  442. IN PUNICODE_STRING Source,
  443. IN PUNICODE_STRING ClientName,
  444. IN PUNICODE_STRING MappedName,
  445. IN NTSTATUS Status, OPTIONAL
  446. IN PSID ClientSid
  447. );
  448. NTSTATUS NTAPI
  449. LsaIAuditDPAPIEvent(
  450. IN ULONG AuditId,
  451. IN PSID UserSid,
  452. IN PUNICODE_STRING MasterKeyID,
  453. IN PUNICODE_STRING RecoveryServer,
  454. IN PULONG Reason,
  455. IN PUNICODE_STRING RecoverykeyID,
  456. IN PULONG FailureReason
  457. );
  458. #define LSA_AUDIT_PARAMETERS_ABSOLUTE 1
  459. NTSTATUS NTAPI
  460. LsaIWriteAuditEvent(
  461. IN PSE_ADT_PARAMETER_ARRAY AuditParameters,
  462. IN ULONG Options
  463. );
  464. NTSTATUS
  465. LsaIAuditPasswordAccessEvent(
  466. IN USHORT EventType,
  467. IN PCWSTR pszTargetUserName,
  468. IN PCWSTR pszTargetUserDomain
  469. );
  470. VOID
  471. LsaIAuditFailed(
  472. NTSTATUS AuditStatus
  473. );
  474. NTSTATUS NTAPI
  475. LsaICallPackage(
  476. IN PUNICODE_STRING AuthenticationPackage,
  477. IN PVOID ProtocolSubmitBuffer,
  478. IN ULONG SubmitBufferLength,
  479. OUT PVOID *ProtocolReturnBuffer,
  480. OUT PULONG ReturnBufferLength,
  481. OUT PNTSTATUS ProtocolStatus
  482. );
  483. VOID NTAPI
  484. LsaIFreeReturnBuffer(
  485. IN PVOID Buffer
  486. );
  487. //
  488. // NT5 routines for using the Ds for Lsa store
  489. //
  490. #define LSAI_FOREST_ROOT_TRUST 0x00000001
  491. #define LSAI_FOREST_DOMAIN_GUID_PRESENT 0x00000002
  492. //
  493. // These structures correspond to the private interface Kerberos uses
  494. // to build a tree of the domains in an organization.
  495. //
  496. typedef struct _LSAPR_TREE_TRUST_INFO {
  497. UNICODE_STRING DnsDomainName;
  498. UNICODE_STRING FlatName;
  499. GUID DomainGuid;
  500. PSID DomainSid;
  501. ULONG Flags;
  502. ULONG Children;
  503. struct _LSAPR_TREE_TRUST_INFO *ChildDomains;
  504. } LSAPR_TREE_TRUST_INFO, *PLSAPR_TREE_TRUST_INFO;
  505. typedef struct _LSAPR_FOREST_TRUST_INFO {
  506. LSAPR_TREE_TRUST_INFO RootTrust;
  507. PLSAPR_TREE_TRUST_INFO ParentDomainReference;
  508. } LSAPR_FOREST_TRUST_INFO, *PLSAPR_FOREST_TRUST_INFO;
  509. VOID
  510. LsaIFreeForestTrustInfo(
  511. IN PLSAPR_FOREST_TRUST_INFO ForestTrustInfo
  512. );
  513. NTSTATUS
  514. NTAPI
  515. LsaIQueryForestTrustInfo(
  516. IN LSAPR_HANDLE PolicyHandle,
  517. OUT PLSAPR_FOREST_TRUST_INFO *ForestTrustInfo
  518. );
  519. NTSTATUS NTAPI
  520. LsaISetTrustedDomainAuthInfoBlobs(
  521. IN LSAPR_HANDLE PolicyHandle,
  522. IN PLSAPR_UNICODE_STRING TrustedDomainName,
  523. IN PLSAPR_TRUSTED_DOMAIN_AUTH_BLOB IncomingBlob,
  524. IN PLSAPR_TRUSTED_DOMAIN_AUTH_BLOB OutgoingBlob);
  525. NTSTATUS NTAPI
  526. LsaIUpgradeRegistryToDs(
  527. IN BOOLEAN DeleteOnly
  528. );
  529. NTSTATUS NTAPI
  530. LsaIGetTrustedDomainAuthInfoBlobs(
  531. IN LSAPR_HANDLE PolicyHandle,
  532. IN PLSAPR_UNICODE_STRING TrustedDomainName,
  533. OUT PLSAPR_TRUSTED_DOMAIN_AUTH_BLOB IncomingBlob,
  534. OUT PLSAPR_TRUSTED_DOMAIN_AUTH_BLOB OutgoingBlob
  535. );
  536. NTSTATUS NTAPI
  537. LsaIDsNotifiedObjectChange(
  538. IN ULONG Class,
  539. IN PVOID ObjectPath, // This is a DSNAME
  540. IN SECURITY_DB_DELTA_TYPE DeltaType,
  541. IN PSID UserSid,
  542. IN LUID AuthenticationId,
  543. IN BOOLEAN fReplicatedIn,
  544. IN BOOLEAN ChangeOriginatedInLSA
  545. );
  546. typedef NTSTATUS (NTAPI *pfLsaIDsNotifiedObjectChange )(
  547. ULONG, PVOID, SECURITY_DB_DELTA_TYPE, PSID, LUID, BOOLEAN, BOOLEAN );
  548. //
  549. // NT5 routines for moving some SAM domain object properties to the Lsa Ds objects
  550. //
  551. NTSTATUS NTAPI
  552. LsaISamIndicatedDsStarted(
  553. IN BOOLEAN PerformDomainRenameCheck
  554. );
  555. //
  556. // Netlogon routines for enumerating subnets
  557. //
  558. typedef struct _LSAP_SUBNET_INFO_ENTRY {
  559. UNICODE_STRING SubnetName;
  560. UNICODE_STRING SiteName;
  561. } LSAP_SUBNET_INFO_ENTRY, *PLSAP_SUBNET_INFO_ENTRY;
  562. typedef struct _LSAP_SUBNET_INFO {
  563. ULONG SiteCount;
  564. ULONG SubnetCount;
  565. LSAP_SUBNET_INFO_ENTRY Subnets[1];
  566. } LSAP_SUBNET_INFO, *PLSAP_SUBNET_INFO;
  567. NTSTATUS NTAPI
  568. LsaIQuerySubnetInfo(
  569. OUT PLSAP_SUBNET_INFO *SubnetInformation
  570. );
  571. VOID NTAPI
  572. LsaIFree_LSAP_SUBNET_INFO(
  573. IN PLSAP_SUBNET_INFO SubnetInfo
  574. );
  575. //
  576. // Netlogon routines for UPN/SPN suffixes
  577. //
  578. typedef struct _LSAP_UPN_SUFFIXES {
  579. ULONG SuffixCount;
  580. UNICODE_STRING Suffixes[1];
  581. } LSAP_UPN_SUFFIXES, *PLSAP_UPN_SUFFIXES;
  582. NTSTATUS
  583. LsaIQueryUpnSuffixes(
  584. OUT PLSAP_UPN_SUFFIXES *UpnSuffixes
  585. );
  586. VOID
  587. LsaIFree_LSAP_UPN_SUFFIXES(
  588. IN PLSAP_UPN_SUFFIXES UpnSuffixes
  589. );
  590. NTSTATUS
  591. LsaIGetForestTrustInformation(
  592. OUT PLSA_FOREST_TRUST_INFORMATION *ForestTrustInfo
  593. );
  594. NTSTATUS
  595. LsaIUpdateForestTrustInformation(
  596. IN LSAPR_HANDLE PolicyHandle,
  597. IN UNICODE_STRING * TrustedDomainName,
  598. IN PLSA_FOREST_TRUST_INFORMATION NewForestTrustInfo
  599. );
  600. //
  601. // Netlogon routines for enumerating sites
  602. //
  603. typedef struct _LSAP_SITE_INFO_ENTRY {
  604. UNICODE_STRING SiteName;
  605. } LSAP_SITE_INFO_ENTRY, *PLSAP_SITE_INFO_ENTRY;
  606. typedef struct _LSAP_SITE_INFO {
  607. ULONG SiteCount;
  608. LSAP_SITE_INFO_ENTRY Sites[1];
  609. } LSAP_SITE_INFO, *PLSAP_SITE_INFO;
  610. NTSTATUS NTAPI
  611. LsaIQuerySiteInfo(
  612. OUT PLSAP_SITE_INFO *SiteInformation
  613. );
  614. VOID NTAPI
  615. LsaIFree_LSAP_SITE_INFO(
  616. IN PLSAP_SITE_INFO SubnetInfo
  617. );
  618. //
  619. // Netlogon routines for getting the name of the site we're in.
  620. //
  621. typedef struct _LSAP_SITENAME_INFO {
  622. UNICODE_STRING SiteName;
  623. GUID DsaGuid;
  624. ULONG DsaOptions;
  625. } LSAP_SITENAME_INFO, *PLSAP_SITENAME_INFO;
  626. NTSTATUS NTAPI
  627. LsaIGetSiteName(
  628. OUT PLSAP_SITENAME_INFO *SiteNameInformation
  629. );
  630. VOID NTAPI
  631. LsaIFree_LSAP_SITENAME_INFO(
  632. IN PLSAP_SITENAME_INFO SiteNameInfo
  633. );
  634. BOOLEAN NTAPI
  635. LsaIIsDsPaused(
  636. VOID
  637. );
  638. //
  639. // Lsa notification routine definitions
  640. //
  641. //
  642. // Notification callback routine prototype
  643. //
  644. typedef VOID ( NTAPI fLsaPolicyChangeNotificationCallback) (
  645. IN POLICY_NOTIFICATION_INFORMATION_CLASS ChangedInfoClass
  646. );
  647. typedef fLsaPolicyChangeNotificationCallback *pfLsaPolicyChangeNotificationCallback;
  648. NTSTATUS NTAPI
  649. LsaIRegisterPolicyChangeNotificationCallback(
  650. IN pfLsaPolicyChangeNotificationCallback Callback,
  651. IN POLICY_NOTIFICATION_INFORMATION_CLASS MonitorInfoClass
  652. );
  653. NTSTATUS NTAPI
  654. LsaIUnregisterPolicyChangeNotificationCallback(
  655. IN pfLsaPolicyChangeNotificationCallback Callback,
  656. IN POLICY_NOTIFICATION_INFORMATION_CLASS MonitorInfoClass
  657. );
  658. NTSTATUS NTAPI
  659. LsaIUnregisterAllPolicyChangeNotificationCallback(
  660. IN pfLsaPolicyChangeNotificationCallback Callback
  661. );
  662. HANDLE NTAPI
  663. LsaIRegisterNotification(
  664. IN PTHREAD_START_ROUTINE StartFunction,
  665. IN PVOID Parameter,
  666. IN ULONG NotificationType,
  667. IN ULONG NotificationClass,
  668. IN ULONG NotificationFlags,
  669. IN ULONG IntervalMinutes,
  670. IN OPTIONAL HANDLE WaitEvent
  671. );
  672. NTSTATUS NTAPI
  673. LsaICancelNotification(
  674. IN HANDLE NotifyHandle
  675. );
  676. //
  677. // This is the notification Kerberos registers to receive updates on changing trusts
  678. //
  679. typedef VOID (fLsaTrustChangeNotificationCallback) (
  680. IN SECURITY_DB_DELTA_TYPE DeltaType
  681. );
  682. typedef fLsaTrustChangeNotificationCallback *pfLsaTrustChangeNotificationCallback;
  683. typedef enum LSAP_REGISTER {
  684. LsaRegister = 0,
  685. LsaUnregister
  686. } LSAP_REGISTER, *PLSAP_REGISTER;
  687. NTSTATUS NTAPI
  688. LsaIKerberosRegisterTrustNotification(
  689. IN pfLsaTrustChangeNotificationCallback Callback,
  690. IN LSAP_REGISTER Register
  691. );
  692. //
  693. // See secpkg.h : LsaGetCallInfo and SECPKG_CALL_INFO
  694. //
  695. BOOLEAN
  696. NTAPI
  697. LsaIGetCallInfo(
  698. PVOID
  699. );
  700. NTSTATUS
  701. LsaISetTokenDacl(
  702. IN HANDLE Token
  703. );
  704. NTSTATUS
  705. LsaISetClientDnsHostName(
  706. IN PWSTR ClientName,
  707. IN PWSTR ClientDnsHostName OPTIONAL,
  708. IN POSVERSIONINFOEXW OsVersionInfo OPTIONAL,
  709. IN PWSTR OsName OPTIONAL,
  710. OUT PWSTR *OldDnsHostName OPTIONAL
  711. );
  712. NTSTATUS
  713. LsaICallPackageEx(
  714. IN PUNICODE_STRING AuthenticationPackage,
  715. IN PVOID ClientBufferBase,
  716. IN PVOID ProtocolSubmitBuffer,
  717. IN ULONG SubmitBufferLength,
  718. OUT PVOID * ProtocolReturnBuffer,
  719. OUT PULONG ReturnBufferLength,
  720. OUT PNTSTATUS ProtocolStatus
  721. );
  722. NTSTATUS
  723. LsaICallPackagePassthrough(
  724. IN PUNICODE_STRING AuthenticationPackage,
  725. IN PVOID ClientBufferBase,
  726. IN PVOID ProtocolSubmitBuffer,
  727. IN ULONG SubmitBufferLength,
  728. OUT PVOID * ProtocolReturnBuffer,
  729. OUT PULONG ReturnBufferLength,
  730. OUT PNTSTATUS ProtocolStatus
  731. );
  732. NTSTATUS
  733. LsaISetBootOption(
  734. IN ULONG BootOption,
  735. IN PVOID OldKey,
  736. IN ULONG OldKeyLength,
  737. IN PVOID NewKey,
  738. IN ULONG NewKeyLength
  739. );
  740. NTSTATUS
  741. LsaIGetBootOption(
  742. OUT PULONG BootOption
  743. );
  744. VOID
  745. LsaINotifyPasswordChanged(
  746. IN PUNICODE_STRING NetbiosDomainName OPTIONAL,
  747. IN PUNICODE_STRING UserName,
  748. IN PUNICODE_STRING DnsDomainName OPTIONAL,
  749. IN PUNICODE_STRING Upn OPTIONAL,
  750. IN PUNICODE_STRING OldPassword,
  751. IN PUNICODE_STRING NewPassword,
  752. IN BOOLEAN Impersonating
  753. );
  754. NTSTATUS
  755. LsaINotifyChangeNotification(
  756. IN POLICY_NOTIFICATION_INFORMATION_CLASS InfoClass
  757. );
  758. NTSTATUS
  759. LsaIGetNbAndDnsDomainNames(
  760. IN PUNICODE_STRING DomainName,
  761. OUT PUNICODE_STRING DnsDomainName,
  762. OUT PUNICODE_STRING NetbiosDomainName
  763. );
  764. //
  765. // This flag indicates the the protected blob is a system blob, and cannot
  766. // be decrypted by the user-space.
  767. //
  768. #define CRYPTPROTECT_SYSTEM 0x20000000
  769. //
  770. // Local Free should be used to free the returned buffer
  771. //
  772. BOOLEAN
  773. LsaICryptProtectData(
  774. IN PVOID DataIn,
  775. IN ULONG DataInLength,
  776. IN PUNICODE_STRING szDataDescr,
  777. IN PVOID OptionalEntropy,
  778. IN ULONG OptionalEntropyLength,
  779. IN PVOID Reserved,
  780. IN PVOID Reserved2,
  781. IN ULONG Flags,
  782. OUT PVOID * DataOut,
  783. OUT PULONG DataOutLength);
  784. //
  785. // Local Free should be used to free the returned buffer
  786. //
  787. BOOLEAN
  788. LsaICryptUnprotectData(
  789. IN PVOID DataIn,
  790. IN ULONG DataInLength,
  791. IN PVOID OptionalEntropy,
  792. IN ULONG OptionalEntropyLength,
  793. IN PVOID Reserved,
  794. IN PVOID Reserved2,
  795. IN ULONG Flags,
  796. OUT PUNICODE_STRING szDataDescr,
  797. OUT PVOID * DataOut,
  798. OUT PULONG DataOutLength);
  799. //
  800. // Heap allocator for the LSA process
  801. //
  802. PVOID
  803. NTAPI
  804. LsaIAllocateHeap(
  805. IN SIZE_T cbMemory
  806. );
  807. VOID
  808. NTAPI
  809. LsaIFreeHeap(
  810. IN PVOID Base
  811. );
  812. typedef enum LSAP_NETLOGON_PARAMETER {
  813. LsaEmulateNT4,
  814. } LSAP_NETLOGON_PARAMETER;
  815. VOID
  816. NTAPI
  817. LsaINotifyNetlogonParametersChangeW(
  818. IN LSAP_NETLOGON_PARAMETER Parameter,
  819. IN DWORD dwType,
  820. IN PWSTR lpData,
  821. IN DWORD cbData
  822. );
  823. NTSTATUS
  824. NTAPI
  825. LsaIChangeSecretCipherKey(
  826. IN PVOID NewSysKey
  827. );
  828. BOOLEAN
  829. LsaINoMoreWin2KDomain();
  830. void
  831. LsaINotifyGCStatusChange(
  832. IN BOOLEAN PromotingToGC
  833. );
  834. NTSTATUS
  835. LsaIIsDomainWithinForest(
  836. IN UNICODE_STRING * TrustedDomainName,
  837. OUT BOOL * WithinForest,
  838. OUT OPTIONAL BOOL * ThisDomain,
  839. OUT OPTIONAL PSID * TrustedDomainSid,
  840. OUT OPTIONAL ULONG * TrustDirection,
  841. OUT OPTIONAL ULONG * TrustType,
  842. OUT OPTIONAL ULONG * TrustAttributes
  843. );
  844. #ifdef __cplusplus
  845. }
  846. #endif
  847. #endif // _LSAISRV_