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.

1383 lines
34 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. db.h
  5. Abstract:
  6. LSA Database Exported Function Definitions, Datatypes and Defines
  7. This module contains the LSA Database Routines that may be called
  8. by parts of the LSA outside the Database sub-component.
  9. Author:
  10. Scott Birrell (ScottBi) August 26, 1991
  11. Environment:
  12. Revision History:
  13. --*/
  14. #ifndef _LSA_DB_
  15. #define _LSA_DB_
  16. //
  17. // Maximum Number of attributes in the various object types
  18. //
  19. #define LSAP_DB_ATTRS_POLICY ((ULONG) 0x00000010L)
  20. #define LSAP_DB_ATTRS_ACCOUNT ((ULONG) 0x00000010L)
  21. #define LSAP_DB_ATTRS_DOMAIN ((ULONG) 0x00000012L)
  22. #define LSAP_DB_ATTRS_SECRET ((ULONG) 0x00000010L)
  23. //
  24. // Constants for matching options on Sid/Name lookup operations
  25. //
  26. #define LSAP_DB_MATCH_ON_SID ((ULONG) 0x00000001L)
  27. #define LSAP_DB_MATCH_ON_NAME ((ULONG) 0x00000002L)
  28. //
  29. // Options for LsapDbLookupSidsInLocalDomains()
  30. //
  31. #define LSAP_DB_SEARCH_BUILT_IN_DOMAIN ((ULONG) 0x00000001L)
  32. #define LSAP_DB_SEARCH_ACCOUNT_DOMAIN ((ULONG) 0x00000002L)
  33. //
  34. // Options for LsapDbMergeDisjointReferencedDomains
  35. //
  36. #define LSAP_DB_USE_FIRST_MERGAND_GRAPH ((ULONG) 0x00000001L)
  37. #define LSAP_DB_USE_SECOND_MERGAND_GRAPH ((ULONG) 0x00000002L)
  38. //
  39. // Option for updating Policy Database
  40. //
  41. #define LSAP_DB_UPDATE_POLICY_DATABASE ((ULONG) 0x00000001L)
  42. //
  43. // Option for updating Policy Database
  44. //
  45. #define LSAP_DB_UPDATE_POLICY_DATABASE ((ULONG) 0x00000001L)
  46. //
  47. // Maximum number of attributes corresponding to a Policy Object
  48. // Information Class
  49. //
  50. #define LSAP_DB_ATTRS_INFO_CLASS_POLICY ((ULONG) 0x00000007L)
  51. //
  52. // Maximum number of attributes corresponding to a Trusted Domain Object
  53. // Information Class
  54. //
  55. #define LSAP_DB_ATTRS_INFO_CLASS_DOMAIN ((ULONG) 0x00000010L)
  56. //
  57. // Global variables
  58. //
  59. extern BOOLEAN LsapDbRequiresSidInfo[];
  60. extern BOOLEAN LsapDbRequiresNameInfo[];
  61. extern LSAPR_HANDLE LsapDbHandle;
  62. extern BOOLEAN LsapSetupWasRun;
  63. extern BOOLEAN LsapDatabaseSetupPerformed;
  64. extern NT_PRODUCT_TYPE LsapProductType;
  65. extern WORD LsapProductSuiteMask;
  66. extern BOOLEAN LsapDsIsRunning;
  67. extern BOOLEAN LsapDsWReplEnabled;
  68. //
  69. // Table of accesses required to query Policy Information. This table
  70. // is indexed by Policy Information Class
  71. //
  72. extern ACCESS_MASK LsapDbRequiredAccessQueryPolicy[];
  73. extern ACCESS_MASK LsapDbRequiredAccessQueryDomainPolicy[];
  74. //
  75. // Table of accesses required to set Policy Information. This table
  76. // is indexed by Policy Information Class
  77. //
  78. extern ACCESS_MASK LsapDbRequiredAccessSetPolicy[];
  79. extern ACCESS_MASK LsapDbRequiredAccessSetDomainPolicy[];
  80. //
  81. // Table of accesses required to query TrustedDomain Information. This table
  82. // is indexed by TrustedDomain Information Class
  83. //
  84. extern ACCESS_MASK LsapDbRequiredAccessQueryTrustedDomain[];
  85. //
  86. // Table of accesses required to set TrustedDomain Information. This table
  87. // is indexed by TrustedDomain Information Class
  88. //
  89. extern ACCESS_MASK LsapDbRequiredAccessSetTrustedDomain[];
  90. //
  91. // Maximum Handle Reference Count
  92. //
  93. #define LSAP_DB_MAXIMUM_REFERENCE_COUNT ((ULONG) 0x00001000L)
  94. //
  95. // Maximum handles per user logon id
  96. // This was determined by taking the "interesting" access bits and generating possible
  97. // permutations and using that. The interesting bits were determined to be:
  98. // POLICY_VIEW_LOCAL_INFORMATION
  99. // POLICY_VIEW_AUDIT_INFORMATION
  100. // POLICY_TRUST_ADMIN
  101. // POLICY_CREATE_ACCOUNT
  102. // POLICY_CREATE_SECRET
  103. // POLICY_LOOKUP_NAMES
  104. // The possible combinations add up to 720 entries
  105. #define LSAP_DB_MAXIMUM_HANDLES_PER_USER 0x000002D0
  106. //
  107. // Default Computer Name used for Policy Account Domain Info
  108. //
  109. #define LSAP_DB_DEFAULT_COMPUTER_NAME (L"MACHINENAME")
  110. //
  111. // Options for the LsaDbReferenceObject and LsaDbDereferenceObject
  112. //
  113. #define LSAP_DB_LOCK ((ULONG) 0x00000001L)
  114. #define LSAP_DB_NO_LOCK ((ULONG) 0x00000004L)
  115. #define LSAP_DB_START_TRANSACTION ((ULONG) 0x00000008L)
  116. #define LSAP_DB_FINISH_TRANSACTION ((ULONG) 0x00000010L)
  117. #define LSAP_DB_VALIDATE_HANDLE ((ULONG) 0x00000020L)
  118. #define LSAP_DB_TRUSTED ((ULONG) 0x00000040L)
  119. #define LSAP_DB_STANDALONE_REFERENCE ((ULONG) 0x00000080L)
  120. #define LSAP_DB_DEREFERENCE_CONTR ((ULONG) 0x00000100L)
  121. #define LSAP_DB_LOG_QUEUE_LOCK ((ULONG) 0x00001000L)
  122. #define LSAP_DB_OMIT_REPLICATOR_NOTIFICATION ((ULONG) 0x00004000L)
  123. #define LSAP_DB_USE_LPC_IMPERSONATE ((ULONG) 0x00008000L)
  124. #define LSAP_DB_ADMIT_DELETED_OBJECT_HANDLES ((ULONG) 0x00010000L)
  125. #define LSAP_DB_DS_NO_PARENT_OBJECT ((ULONG) 0x00080000L)
  126. #define LSAP_DB_OBJECT_SCOPE_DS ((ULONG) 0x00100000L)
  127. #define LSAP_DB_DS_TRUSTED_DOMAIN_AS_SECRET ((ULONG) 0x00400000L)
  128. #define LSAP_DB_READ_ONLY_TRANSACTION ((ULONG) 0x01000000L)
  129. #define LSAP_DB_DS_OP_TRANSACTION ((ULONG) 0x02000000L)
  130. #define LSAP_DB_NO_DS_OP_TRANSACTION ((ULONG) 0x04000000L)
  131. #define LSAP_DB_HANDLE_UPGRADE ((ULONG) 0x10000000L)
  132. #define LSAP_DB_HANDLE_CREATED_SECRET ((ULONG) 0x20000000L)
  133. #define LSAP_DB_SCE_POLICY_HANDLE ((ULONG) 0x40000000L)
  134. #define LSAP_DB_STATE_MASK \
  135. (LSAP_DB_LOCK | LSAP_DB_NO_LOCK | \
  136. LSAP_DB_START_TRANSACTION | LSAP_DB_FINISH_TRANSACTION | \
  137. LSAP_DB_LOG_QUEUE_LOCK | \
  138. LSAP_DB_READ_ONLY_TRANSACTION | LSAP_DB_DS_OP_TRANSACTION | \
  139. LSAP_DB_NO_DS_OP_TRANSACTION)
  140. //
  141. // Configuration Registry Root Key for Lsa Database. All Physical Object
  142. // and Attribute Names are relative to this Key.
  143. //
  144. #define LSAP_DB_ROOT_REG_KEY_NAME L"\\Registry\\Machine\\Security"
  145. //
  146. // LSA Database Object Defines
  147. //
  148. #define LSAP_DB_OBJECT_OPEN FILE_OPEN
  149. #define LSAP_DB_OBJECT_OPEN_IF FILE_OPEN_IF
  150. #define LSAP_DB_OBJECT_CREATE FILE_CREATE
  151. #define LSAP_DB_KEY_VALUE_MAX_LENGTH (0x00000040L)
  152. #define LSAP_DB_LOGICAL_NAME_MAX_LENGTH (0x00000100L)
  153. #define LSAP_DB_CREATE_OBJECT_IN_DS (0x00000200L)
  154. #define LSAP_DB_CREATE_VALID_EXTENDED_FLAGS 0x00000600
  155. //
  156. // LSA Database Object SubKey Defines
  157. //
  158. #define LSAP_DB_SUBKEY_OPEN FILE_OPEN
  159. #define LSAP_DB_SUBKEY_OPEN_IF FILE_OPEN_IF
  160. #define LSAP_DB_SUBKEY_CREATE FILE_CREATE
  161. //
  162. // Growth Delta for Referenced Domain Lists
  163. //
  164. #define LSAP_DB_REF_DOMAIN_DELTA ((ULONG) 0x00000020L )
  165. //
  166. // Object options values for the object handles
  167. //
  168. #define LSAP_DB_OBJECT_SECRET_INTERNAL 0x00000001 // M$
  169. #define LSAP_DB_OBJECT_SECRET_LOCAL 0x00000002 // L$
  170. //
  171. // The following data type is used in name and SID lookup services to
  172. // describe the domains referenced in the lookup operation.
  173. //
  174. // WARNING! This is an internal version of LSA_REFERENCED_DOMAIN_LIST
  175. // in ntlsa.h. It has an additional field, MaxEntries.
  176. //
  177. typedef struct _LSAP_DB_REFERENCED_DOMAIN_LIST {
  178. ULONG Entries;
  179. PLSA_TRUST_INFORMATION Domains;
  180. ULONG MaxEntries;
  181. } LSAP_DB_REFERENCED_DOMAIN_LIST, *PLSAP_DB_REFERENCED_DOMAIN_LIST;
  182. // where members have the following usage:
  183. //
  184. // Entries - Is a count of the number of domains described in the
  185. // Domains array.
  186. //
  187. // Domains - Is a pointer to an array of Entries LSA_TRUST_INFORMATION data
  188. // structures.
  189. //
  190. // MaxEntries - Is the maximum number of entries that can be stored
  191. // in the current array
  192. /////////////////////////////////////////////////////////////////////////////
  193. //
  194. // LSA Database Object Types
  195. //
  196. /////////////////////////////////////////////////////////////////////////////
  197. //
  198. // Lsa Database Object Type
  199. //
  200. typedef enum _LSAP_DB_OBJECT_TYPE_ID {
  201. NullObject = 0,
  202. PolicyObject,
  203. TrustedDomainObject,
  204. AccountObject,
  205. SecretObject,
  206. AllObject,
  207. NewTrustedDomainObject,
  208. DummyLastObject
  209. } LSAP_DB_OBJECT_TYPE_ID, *PLSAP_DB_OBJECT_TYPE_ID;
  210. //
  211. // LSA Database Object Handle structure (Internal definition of LSAPR_HANDLE)
  212. //
  213. // Note that the Handle structure is public to clients of the Lsa Database
  214. // exported functions, e.g server API workers) so that they can get at things
  215. // like GrantedAccess.
  216. //
  217. // Access to all fields serialized by LsapDbHandleTableEx.TableLock
  218. //
  219. typedef struct _LSAP_DB_HANDLE {
  220. struct _LSAP_DB_HANDLE *Next;
  221. struct _LSAP_DB_HANDLE *Previous;
  222. LIST_ENTRY UserHandleList;
  223. BOOLEAN Allocated;
  224. BOOLEAN SceHandle; // Sce Open Policy handle (opened with LsaOpenPolicySce)
  225. BOOLEAN SceHandleChild; // Child handle of an Sce Open Policy Handle
  226. ULONG ReferenceCount;
  227. UNICODE_STRING LogicalNameU;
  228. UNICODE_STRING PhysicalNameU;
  229. PSID Sid;
  230. HANDLE KeyHandle;
  231. LSAP_DB_OBJECT_TYPE_ID ObjectTypeId;
  232. struct _LSAP_DB_HANDLE *ContainerHandle;
  233. ACCESS_MASK DesiredAccess;
  234. ACCESS_MASK GrantedAccess;
  235. ACCESS_MASK RequestedAccess;
  236. BOOLEAN GenerateOnClose;
  237. BOOLEAN Trusted;
  238. BOOLEAN DeletedObject;
  239. BOOLEAN NetworkClient;
  240. ULONG Options;
  241. // New for the Ds
  242. UNICODE_STRING PhysicalNameDs;
  243. BOOLEAN fWriteDs;
  244. ULONG ObjectOptions;
  245. PVOID UserEntry;
  246. #if DBG == 1
  247. LARGE_INTEGER HandleCreateTime;
  248. LARGE_INTEGER HandleLastAccessTime;
  249. #endif
  250. } *LSAP_DB_HANDLE, **PLSAP_DB_HANDLE;
  251. //
  252. // LSA Database Object Sid Enumeration Buffer
  253. //
  254. typedef struct _LSAP_DB_SID_ENUMERATION_BUFFER {
  255. ULONG EntriesRead;
  256. PSID *Sids;
  257. } LSAP_DB_SID_ENUMERATION_BUFFER, *PLSAP_DB_SID_ENUMERATION_BUFFER;
  258. //
  259. // LSA Database Object Name Enumeration Buffer
  260. //
  261. typedef struct _LSAP_DB_NAME_ENUMERATION_BUFFER {
  262. ULONG EntriesRead;
  263. PUNICODE_STRING Names;
  264. } LSAP_DB_NAME_ENUMERATION_BUFFER, *PLSAP_DB_NAME_ENUMERATION_BUFFER;
  265. #define LSAP_DB_OBJECT_TYPE_COUNT 0x00000005L
  266. //
  267. // Default System Access assigned to Account objects
  268. //
  269. #define LSAP_DB_ACCOUNT_DEFAULT_SYS_ACCESS ((ULONG) 0L);
  270. //
  271. // LSA Database Account Object Information
  272. //
  273. typedef struct _LSAP_DB_ACCOUNT_INFORMATION {
  274. QUOTA_LIMITS QuotaLimits;
  275. PRIVILEGE_SET Privileges;
  276. } LSAP_DB_ACCOUNT_INFORMATION, *PLSAP_DB_ACCOUNT_INFORMATION;
  277. //
  278. // LSA Database Change Account Privilege Mode
  279. //
  280. typedef enum _LSAP_DB_CHANGE_PRIVILEGE_MODE {
  281. AddPrivileges = 1,
  282. RemovePrivileges,
  283. SetPrivileges
  284. } LSAP_DB_CHANGE_PRIVILEGE_MODE;
  285. //
  286. // Self-Relative Unicode String Structure.
  287. //
  288. //
  289. // UNICODE_STRING_SR is used to store self-relative unicode strings in
  290. // the database. Prior to Sundown, the UNICODE_STRING structure was used,
  291. // overloading the "Buffer" field with a byte offset.
  292. //
  293. typedef struct _UNICODE_STRING_SR {
  294. USHORT Length;
  295. USHORT MaximumLength;
  296. ULONG Offset;
  297. } UNICODE_STRING_SR, *PUNICODE_STRING_SR;
  298. typedef struct _LSAP_DB_MULTI_UNICODE_STRING {
  299. ULONG Entries;
  300. UNICODE_STRING_SR UnicodeStrings[1];
  301. } LSAP_DB_MULTI_UNICODE_STRING, *PLSAP_DB_MULTI_UNICODE_STRING;
  302. //
  303. // LSA Database Object SubKey names in Unicode Form
  304. //
  305. typedef enum _LSAP_DB_NAMES {
  306. SecDesc = 0,
  307. Privilgs,
  308. Sid,
  309. Name,
  310. AdminMod,
  311. OperMode,
  312. QuotaLim,
  313. DefQuota,
  314. QuAbsMin,
  315. QuAbsMax,
  316. AdtLog,
  317. AdtEvent,
  318. PrDomain,
  319. EnPasswd,
  320. Policy,
  321. Accounts,
  322. Domains,
  323. Secrets,
  324. CurrVal,
  325. OldVal,
  326. CupdTime,
  327. OupdTime,
  328. WkstaMgr,
  329. PolAdtLg,
  330. PolAdtEv,
  331. PolAcDmN,
  332. PolAcDmS,
  333. PolDnDDN,
  334. PolDnTrN,
  335. PolDnDmG,
  336. PolEfDat,
  337. PolPrDmN,
  338. PolPrDmS,
  339. PolPdAcN,
  340. PolRepSc,
  341. PolRepAc,
  342. PolRevision,
  343. PolDefQu,
  344. PolMod,
  345. PolAdtFL,
  346. PolState,
  347. PolNxPxF,
  348. ActSysAc,
  349. TrDmName,
  350. TrDmTrPN, // Netbios name of trust partner
  351. TrDmSid,
  352. TrDmAcN,
  353. TrDmCtN,
  354. TrDmPxOf,
  355. TrDmCtEn,
  356. TrDmTrTy, // Type of trust
  357. TrDmTrDi, // Trust direction
  358. TrDmTrLA, // Trust attributes
  359. TrDmTrPr, // Trust partner
  360. TrDmTrRt, // Trust root partner
  361. TrDmSAI, // Auth inbound
  362. TrDmSAO, // Auth outbound
  363. TrDmForT, // Forest trust info
  364. AcMaPCF, // Machine account password change frequency
  365. PolIPSec, // IPSec object reference
  366. PolDIPSec, // Domain wide IPSec object reference
  367. PolLoc, // Policy location,
  368. PolPubK, // Public key policy
  369. KerOpts, // Kerberos authentication options
  370. KerMinT, // Kerberos Minimum ticket age
  371. KerMaxT, // Kerberos maximum ticket age
  372. KerMaxR, // Kerberos maximum renewal age
  373. KerProxy, // Kerberos proxy lifetime
  374. KerLogoff, // Kerberos force logoff duration
  375. DmLDur, // Lockout duration
  376. DmLObWin, // Lockout observation window
  377. DmLThrs, // Lockout threshold
  378. DmPMinL, // Minimum password length
  379. DmPHisL, // Password history length
  380. DmPProp, // Password properties
  381. DmPMinA, // Minimum password age
  382. DmPMaxA, // Maximum password age
  383. BhvrVers, // Behavior-Version
  384. AuditLog,
  385. AuditLogMaxSize,
  386. AuditRecordRetentionPeriod, // Entries beyond this point don't correspond to real policy
  387. // entries, but are pseudo entries only
  388. PseudoSystemCritical,
  389. PolSecretEncryptionKey,
  390. XRefDnsRoot, // DNS name of cross-ref object
  391. XRefNetbiosName, // NETBIOS name of cross-ref object
  392. DummyLastName
  393. } LSAP_DB_NAMES;
  394. typedef struct _LSAP_DB_ACCOUNT_TYPE_SPECIFIC_INFO {
  395. ULONG SystemAccess;
  396. QUOTA_LIMITS QuotaLimits;
  397. PPRIVILEGE_SET PrivilegeSet;
  398. } LSAP_DB_ACCOUNT_TYPE_SPECIFIC_INFO, *PLSAP_DB_ACCOUNT_TYPE_SPECIFIC_INFO;
  399. #ifdef __cplusplus
  400. extern "C" {
  401. #endif // __cplusplus
  402. extern UNICODE_STRING LsapDbNames[DummyLastName];
  403. extern UNICODE_STRING LsapDbObjectTypeNames[DummyLastObject];
  404. //
  405. // LSA Database Object Type-specific attribute names and values. If
  406. // supplied on a call to LsapDbCreateObject, they will be stored with
  407. // the object.
  408. //
  409. typedef enum _LSAP_DB_ATTRIB_TYPE {
  410. LsapDbAttribUnknown = 0,
  411. LsapDbAttribUnicode,
  412. LsapDbAttribMultiUnicode,
  413. LsapDbAttribSid,
  414. LsapDbAttribGuid,
  415. LsapDbAttribULong,
  416. LsapDbAttribUShortAsULong,
  417. LsapDbAttribSecDesc,
  418. LsapDbAttribDsName,
  419. LsapDbAttribPByte,
  420. LsapDbAttribTime,
  421. LsapDbAttribDsNameAsUnicode,
  422. LsapDbAttribDsNameAsSid,
  423. LsapDbAttribIntervalAsULong
  424. } LSAP_DB_ATTRIB_TYPE, *PLSAP_DB_ATTRIB_TYPE;
  425. typedef struct _LSAP_DB_ATTRIBUTE {
  426. PUNICODE_STRING AttributeName;
  427. PVOID AttributeValue;
  428. ULONG AttributeValueLength;
  429. BOOLEAN MemoryAllocated;
  430. BOOLEAN CanDefaultToZero;
  431. BOOLEAN PseudoAttribute;
  432. ULONG DsAttId;
  433. LSAP_DB_ATTRIB_TYPE AttribType;
  434. LSAP_DB_NAMES DbNameIndex;
  435. } LSAP_DB_ATTRIBUTE, *PLSAP_DB_ATTRIBUTE;
  436. typedef enum _LSAP_DB_DS_LOCATION {
  437. LsapDsLocUnknown = 0,
  438. LsapDsLocRegistry,
  439. LsapDsLocDs,
  440. LsapDsLocDsLocalPolObj,
  441. LsapDsLocDsDomainPolObj,
  442. LsapDsLocLocalAndReg
  443. } LSAP_DB_DS_LOCATION, *PLSAP_DB_DS_LOCATION;
  444. typedef struct _LSAP_DB_DS_INFO {
  445. ULONG AttributeId;
  446. LSAP_DB_ATTRIB_TYPE AttributeType;
  447. LSAP_DB_DS_LOCATION AttributeLocation;
  448. } LSAP_DB_DS_INFO, *PLSAP_DB_DS_INFO;
  449. //
  450. // LSA Database Object General Information.
  451. //
  452. typedef struct _LSAP_DB_OBJECT_INFORMATION {
  453. LSAP_DB_OBJECT_TYPE_ID ObjectTypeId;
  454. LSAP_DB_OBJECT_TYPE_ID ContainerTypeId;
  455. OBJECT_ATTRIBUTES ObjectAttributes;
  456. PLSAP_DB_ATTRIBUTE TypeSpecificAttributes;
  457. PSID Sid;
  458. BOOLEAN ObjectAttributeNameOnly;
  459. ULONG DesiredObjectAccess;
  460. } LSAP_DB_OBJECT_INFORMATION, *PLSAP_DB_OBJECT_INFORMATION;
  461. //
  462. // New for the Ds integration
  463. //
  464. extern PLSAP_DB_DS_INFO LsapDbDsAttInfo;
  465. //
  466. // Installed, absolute minimum and absolute maximum Quota Limits.
  467. //
  468. extern QUOTA_LIMITS LsapDbInstalledQuotaLimits;
  469. extern QUOTA_LIMITS LsapDbAbsMinQuotaLimits;
  470. extern QUOTA_LIMITS LsapDbAbsMaxQuotaLimits;
  471. //
  472. // Required Ds data types
  473. //
  474. //
  475. // This is the state of the machine with respect to the Ds. It will control
  476. // some of the basic functionality of the Lsa APIs by determing who can write
  477. // what where, etc...
  478. //
  479. typedef enum _LSADS_INIT_STATE {
  480. LsapDsUnknown = 0,
  481. LsapDsNoDs,
  482. LsapDsDs,
  483. LsapDsDsMaintenance,
  484. LsapDsDsSetup
  485. } LSADS_INIT_STATE, *PLSADS_INIT_STATE;
  486. //
  487. // LSA Database Exported Function Prototypes
  488. //
  489. // NOTE: These are callable only from the LSA
  490. //
  491. BOOLEAN
  492. LsapDbIsServerInitialized(
  493. );
  494. NTSTATUS
  495. LsapDbOpenPolicy(
  496. IN PLSAPR_SERVER_NAME SystemName OPTIONAL,
  497. IN OPTIONAL PLSAPR_OBJECT_ATTRIBUTES ObjectAttributes,
  498. IN ACCESS_MASK DesiredAccess,
  499. IN ULONG Options,
  500. OUT PLSAPR_HANDLE PolicyHandle,
  501. IN BOOLEAN TrustedClient
  502. );
  503. NTSTATUS
  504. LsapDbOpenTrustedDomain(
  505. IN LSAPR_HANDLE PolicyHandle,
  506. IN PSID TrustedDomainSid,
  507. IN ACCESS_MASK DesiredAccess,
  508. OUT PLSAPR_HANDLE TrustedDomainHandle,
  509. IN ULONG Options
  510. );
  511. NTSTATUS
  512. LsapDbOpenTrustedDomainByName(
  513. IN LSAPR_HANDLE PolicyHandle OPTIONAL,
  514. IN PUNICODE_STRING TrustedDomainName,
  515. OUT PLSAPR_HANDLE TrustedDomainHandle,
  516. IN ULONG AccessMask,
  517. IN ULONG Options,
  518. IN BOOLEAN Trusted
  519. );
  520. NTSTATUS
  521. LsapDbOpenObject(
  522. IN PLSAP_DB_OBJECT_INFORMATION ObjectInformation,
  523. IN ACCESS_MASK DesiredAccess,
  524. IN ULONG Options,
  525. OUT PLSAPR_HANDLE LsaHandle
  526. );
  527. NTSTATUS
  528. LsapDbCreateObject(
  529. IN PLSAP_DB_OBJECT_INFORMATION ObjectInformation,
  530. IN ACCESS_MASK DesiredAccess,
  531. IN ULONG CreateDisposition,
  532. IN ULONG Options,
  533. IN OPTIONAL PLSAP_DB_ATTRIBUTE TypeSpecificAttributes,
  534. IN ULONG TypeSpecificAttributeCount,
  535. OUT PLSAPR_HANDLE LsaHandle
  536. );
  537. NTSTATUS
  538. LsapCloseHandle(
  539. IN OUT LSAPR_HANDLE *ObjectHandle,
  540. IN NTSTATUS PreliminaryStatus
  541. );
  542. NTSTATUS
  543. LsapDbCloseObject(
  544. IN PLSAPR_HANDLE ObjectHandle,
  545. IN ULONG Options,
  546. IN NTSTATUS PreliminaryStatus
  547. );
  548. NTSTATUS
  549. LsapDbDeleteObject(
  550. IN LSAPR_HANDLE ObjectHandle
  551. );
  552. NTSTATUS
  553. LsapDbReferenceObject(
  554. IN LSAPR_HANDLE ObjectHandle,
  555. IN ACCESS_MASK DesiredAccess,
  556. IN LSAP_DB_OBJECT_TYPE_ID HandleTypeId,
  557. IN LSAP_DB_OBJECT_TYPE_ID ObjectTypeId,
  558. IN ULONG Options
  559. );
  560. NTSTATUS
  561. LsapDbDereferenceObject(
  562. IN OUT PLSAPR_HANDLE ObjectHandle,
  563. IN LSAP_DB_OBJECT_TYPE_ID HandleTypeId,
  564. IN LSAP_DB_OBJECT_TYPE_ID ObjectTypeId,
  565. IN ULONG Options,
  566. IN SECURITY_DB_DELTA_TYPE SecurityDbDeltaType,
  567. IN NTSTATUS PreliminaryStatus
  568. );
  569. NTSTATUS
  570. LsapDbReadAttributeObject(
  571. IN LSAPR_HANDLE ObjectHandle,
  572. IN PUNICODE_STRING AttributeNameU,
  573. IN OPTIONAL PVOID AttributeValue,
  574. IN OUT PULONG AttributeValueLength
  575. );
  576. NTSTATUS
  577. LsapDbReadAttributeObjectEx(
  578. IN LSAPR_HANDLE ObjectHandle,
  579. IN LSAP_DB_NAMES AttributeIndex,
  580. IN OPTIONAL PVOID AttributeValue,
  581. IN OUT PULONG AttributeValueLength,
  582. IN BOOLEAN CanDefaultToZero
  583. );
  584. NTSTATUS
  585. LsapDbWriteAttributeObject(
  586. IN LSAPR_HANDLE ObjectHandle,
  587. IN PUNICODE_STRING AttributeNameU,
  588. IN PVOID AttributeValue,
  589. IN ULONG AttributeValueLength
  590. );
  591. NTSTATUS
  592. LsapDbWriteAttributeObjectEx(
  593. IN LSAPR_HANDLE ObjectHandle,
  594. IN LSAP_DB_NAMES AttributeIndex,
  595. IN PVOID AttributeValue,
  596. IN ULONG AttributeValueLength
  597. );
  598. NTSTATUS
  599. LsapDbWriteAttributesObject(
  600. IN LSAPR_HANDLE ObjectHandle,
  601. IN PLSAP_DB_ATTRIBUTE Attributes,
  602. IN ULONG AttributeCount
  603. );
  604. NTSTATUS
  605. LsapDbReadAttributesObject(
  606. IN LSAPR_HANDLE ObjectHandle,
  607. IN ULONG Options,
  608. IN OUT PLSAP_DB_ATTRIBUTE Attributes,
  609. IN ULONG AttributeCount
  610. );
  611. NTSTATUS
  612. LsapDbDeleteAttributeObject(
  613. IN LSAPR_HANDLE ObjectHandle,
  614. IN PUNICODE_STRING AttributeNameU,
  615. IN BOOLEAN DeleteSecurely
  616. );
  617. NTSTATUS
  618. LsapDbDeleteAttributesObject(
  619. IN LSAPR_HANDLE ObjectHandle,
  620. IN PLSAP_DB_ATTRIBUTE Attributes,
  621. IN ULONG AttributeCount
  622. );
  623. NTSTATUS
  624. LsapDbQueryInformationAccounts(
  625. IN LSAPR_HANDLE PolicyHandle,
  626. IN ULONG IdCount,
  627. IN PSID_AND_ATTRIBUTES Ids,
  628. OUT PULONG PrivilegeCount,
  629. OUT PLUID_AND_ATTRIBUTES *Privileges,
  630. OUT PQUOTA_LIMITS QuotaLimits,
  631. OUT PULONG SystemAccess
  632. );
  633. NTSTATUS
  634. LsapDbOpenTransaction(
  635. IN ULONG Options
  636. );
  637. NTSTATUS
  638. LsapDbApplyTransaction(
  639. IN LSAPR_HANDLE ObjectHandle,
  640. IN ULONG Options,
  641. IN SECURITY_DB_DELTA_TYPE SecurityDbDeltaType
  642. );
  643. NTSTATUS
  644. LsapDbAbortTransaction(
  645. IN ULONG Options
  646. );
  647. NTSTATUS
  648. LsapDbSidToLogicalNameObject(
  649. IN PSID Sid,
  650. OUT PUNICODE_STRING LogicalNameU
  651. );
  652. NTSTATUS
  653. LsapDbMakeTemporaryObject(
  654. IN LSAPR_HANDLE ObjectHandle
  655. );
  656. NTSTATUS
  657. LsapDbChangePrivilegesAccount(
  658. IN LSAPR_HANDLE AccountHandle,
  659. IN LSAP_DB_CHANGE_PRIVILEGE_MODE ChangeMode,
  660. IN BOOLEAN AllPrivileges,
  661. IN OPTIONAL PPRIVILEGE_SET Privileges,
  662. IN BOOL LockSce
  663. );
  664. NTSTATUS
  665. LsapDbEnumerateSids(
  666. IN LSAPR_HANDLE ContainerHandle,
  667. IN LSAP_DB_OBJECT_TYPE_ID ObjectTypeId,
  668. IN OUT PLSA_ENUMERATION_HANDLE EnumerationContext,
  669. OUT PLSAP_DB_SID_ENUMERATION_BUFFER DbEnumerationBuffer,
  670. IN ULONG PreferedMaximumLength
  671. );
  672. NTSTATUS
  673. LsapDbFindNextSid(
  674. IN LSAPR_HANDLE ContainerHandle,
  675. IN OUT PLSA_ENUMERATION_HANDLE EnumerationContext,
  676. IN LSAP_DB_OBJECT_TYPE_ID ObjectTypeId,
  677. OUT PLSAPR_SID *NextSid
  678. );
  679. NTSTATUS
  680. LsapDbEnumeratePrivileges(
  681. IN OUT PLSA_ENUMERATION_HANDLE EnumerationContext,
  682. OUT PLSAPR_PRIVILEGE_ENUM_BUFFER EnumerationBuffer,
  683. IN ULONG PreferedMaximumLength
  684. );
  685. NTSTATUS
  686. LsapDbEnumerateNames(
  687. IN LSAPR_HANDLE ContainerHandle,
  688. IN LSAP_DB_OBJECT_TYPE_ID ObjectTypeId,
  689. IN OUT PLSA_ENUMERATION_HANDLE EnumerationContext,
  690. OUT PLSAP_DB_NAME_ENUMERATION_BUFFER DbEnumerationBuffer,
  691. IN ULONG PreferedMaximumLength
  692. );
  693. NTSTATUS
  694. LsapDbFindNextName(
  695. IN LSAPR_HANDLE ContainerHandle,
  696. IN OUT PLSA_ENUMERATION_HANDLE EnumerationContext,
  697. IN LSAP_DB_OBJECT_TYPE_ID ObjectTypeId,
  698. OUT PLSAPR_UNICODE_STRING Name
  699. );
  700. VOID
  701. LsapDbFreeEnumerationBuffer(
  702. IN PLSAP_DB_NAME_ENUMERATION_BUFFER DbEnumerationBuffer
  703. );
  704. NTSTATUS
  705. LsapDbInitializeServer(
  706. IN ULONG Pass
  707. );
  708. NTSTATUS
  709. LsapDbInstallRegistry(
  710. );
  711. //
  712. // These routines may someday migrate to Rtl runtime library. Their
  713. // names have Lsap Prefixes only temporarily, so that they can be located
  714. // easily.
  715. //
  716. // Options for LsapRtlAddPrivileges
  717. #define RTL_COMBINE_PRIVILEGE_ATTRIBUTES ((ULONG) 0x00000001L)
  718. #define RTL_SUPERSEDE_PRIVILEGE_ATTRIBUTES ((ULONG) 0x00000002L)
  719. NTSTATUS
  720. LsapRtlAddPrivileges(
  721. IN OUT PPRIVILEGE_SET * RunningPrivileges,
  722. IN OUT PULONG MaxRunningPrivileges,
  723. IN PPRIVILEGE_SET PrivilegesToAdd,
  724. IN ULONG Options,
  725. OUT OPTIONAL BOOLEAN * Changed
  726. );
  727. NTSTATUS
  728. LsapRtlRemovePrivileges(
  729. IN OUT PPRIVILEGE_SET ExistingPrivileges,
  730. IN PPRIVILEGE_SET PrivilegesToRemove
  731. );
  732. PLUID_AND_ATTRIBUTES
  733. LsapRtlGetPrivilege(
  734. IN PLUID_AND_ATTRIBUTES Privilege,
  735. IN PPRIVILEGE_SET Privileges
  736. );
  737. BOOLEAN
  738. LsapRtlPrefixSid(
  739. IN PSID PrefixSid,
  740. IN PSID Sid
  741. );
  742. ULONG
  743. LsapDbGetSizeTextSid(
  744. IN PSID Sid
  745. );
  746. NTSTATUS
  747. LsapDbSidToTextSid(
  748. IN PSID Sid,
  749. OUT PSZ TextSid
  750. );
  751. NTSTATUS
  752. LsapDbSidToUnicodeSid(
  753. IN PSID Sid,
  754. OUT PUNICODE_STRING SidU,
  755. IN BOOLEAN AllocateDestinationString
  756. );
  757. NTSTATUS
  758. LsapDbInitializeWellKnownValues();
  759. #if defined(REMOTE_BOOT)
  760. VOID
  761. LsapDbInitializeRemoteBootState();
  762. #endif // defined(REMOTE_BOOT)
  763. NTSTATUS
  764. LsapDbVerifyInformationObject(
  765. IN PLSAP_DB_OBJECT_INFORMATION ObjectInformation
  766. );
  767. /*++
  768. BOOLEAN
  769. LsapDbIsValidTypeObject(
  770. IN LSAP_DB_OBJECT_TYPE_ID ObjectTypeId
  771. )
  772. Routine Description:
  773. This macro function determines if a given Object Type Id is valid.
  774. Arguments:
  775. ObjectTypeId - Object Type Id.
  776. Return Values:
  777. BOOLEAN - TRUE if object type id is valid, else FALSE.
  778. --*/
  779. #define LsapDbIsValidTypeObject(ObjectTypeId) \
  780. (((ObjectTypeId) > NullObject) && \
  781. ((ObjectTypeId) < DummyLastObject))
  782. NTSTATUS
  783. LsapDbGetRequiredAccessQueryPolicy(
  784. IN POLICY_INFORMATION_CLASS InformationClass,
  785. OUT PACCESS_MASK RequiredAccess
  786. );
  787. NTSTATUS
  788. LsapDbVerifyInfoQueryPolicy(
  789. IN LSAPR_HANDLE PolicyHandle,
  790. IN POLICY_INFORMATION_CLASS InformationClass,
  791. OUT PACCESS_MASK RequiredAccess
  792. );
  793. NTSTATUS
  794. LsapDbVerifyInfoSetPolicy(
  795. IN LSAPR_HANDLE PolicyHandle,
  796. IN POLICY_INFORMATION_CLASS InformationClass,
  797. IN PLSAPR_POLICY_INFORMATION PolicyInformation,
  798. OUT PACCESS_MASK RequiredAccess
  799. );
  800. BOOLEAN
  801. LsapDbValidInfoPolicy(
  802. IN POLICY_INFORMATION_CLASS InformationClass,
  803. IN OPTIONAL PLSAPR_POLICY_INFORMATION PolicyInformation
  804. );
  805. NTSTATUS
  806. LsapDbVerifyInfoQueryTrustedDomain(
  807. IN TRUSTED_INFORMATION_CLASS InformationClass,
  808. IN BOOLEAN Trusted,
  809. OUT PACCESS_MASK RequiredAccess
  810. );
  811. NTSTATUS
  812. LsapDbVerifyInfoSetTrustedDomain(
  813. IN TRUSTED_INFORMATION_CLASS InformationClass,
  814. IN PLSAPR_TRUSTED_DOMAIN_INFO TrustedDomainInformation,
  815. IN BOOLEAN Trusted,
  816. OUT PACCESS_MASK RequiredAccess
  817. );
  818. BOOLEAN
  819. LsapDbValidInfoTrustedDomain(
  820. IN TRUSTED_INFORMATION_CLASS InformationClass,
  821. IN OPTIONAL PLSAPR_TRUSTED_DOMAIN_INFO TrustedDomainInformation
  822. );
  823. NTSTATUS
  824. LsapDbMakeUnicodeAttribute(
  825. IN OPTIONAL PUNICODE_STRING UnicodeValue,
  826. IN PUNICODE_STRING AttributeName,
  827. OUT PLSAP_DB_ATTRIBUTE Attribute
  828. );
  829. NTSTATUS
  830. LsapDbMakeMultiUnicodeAttribute(
  831. OUT PLSAP_DB_ATTRIBUTE Attribute,
  832. IN PUNICODE_STRING AttributeName,
  833. IN PUNICODE_STRING UnicodeNames,
  834. IN ULONG Entries
  835. );
  836. VOID
  837. LsapDbCopyUnicodeAttributeNoAlloc(
  838. OUT PUNICODE_STRING OutputString,
  839. IN PLSAP_DB_ATTRIBUTE Attribute,
  840. IN BOOLEAN SelfRelative
  841. );
  842. NTSTATUS
  843. LsapDbCopyUnicodeAttribute(
  844. OUT PUNICODE_STRING OutputString,
  845. IN PLSAP_DB_ATTRIBUTE Attribute,
  846. IN BOOLEAN SelfRelative
  847. );
  848. NTSTATUS
  849. LsapDbMakeSidAttribute(
  850. IN PSID Sid,
  851. IN PUNICODE_STRING AttributeName,
  852. OUT PLSAP_DB_ATTRIBUTE Attribute
  853. );
  854. NTSTATUS
  855. LsapDbMakeGuidAttribute(
  856. IN GUID *Guid,
  857. IN PUNICODE_STRING AttributeName,
  858. OUT PLSAP_DB_ATTRIBUTE Attribute
  859. );
  860. NTSTATUS
  861. LsapDbMakeBlobAttribute(
  862. IN ULONG BlobLength,
  863. IN PBYTE pBlob,
  864. IN PUNICODE_STRING AttributeName,
  865. OUT PLSAP_DB_ATTRIBUTE Attribute
  866. );
  867. NTSTATUS
  868. LsapDbMakeUnicodeAttributeDs(
  869. IN OPTIONAL PUNICODE_STRING UnicodeValue,
  870. IN LSAP_DB_NAMES Name,
  871. OUT PLSAP_DB_ATTRIBUTE Attribute
  872. );
  873. NTSTATUS
  874. LsapDbMakeMultiUnicodeAttributeDs(
  875. OUT PLSAP_DB_ATTRIBUTE Attribute,
  876. IN LSAP_DB_NAMES Name,
  877. IN PUNICODE_STRING UnicodeNames,
  878. IN ULONG Entries
  879. );
  880. NTSTATUS
  881. LsapDbMakeSidAttributeDs(
  882. IN PSID Sid,
  883. IN IN LSAP_DB_NAMES Name,
  884. OUT PLSAP_DB_ATTRIBUTE Attribute
  885. );
  886. NTSTATUS
  887. LsapDbMakeGuidAttributeDs(
  888. IN GUID *Guid,
  889. IN LSAP_DB_NAMES Name,
  890. OUT PLSAP_DB_ATTRIBUTE Attribute
  891. );
  892. NTSTATUS
  893. LsapDbMakeBlobAttributeDs(
  894. IN ULONG BlobLength,
  895. IN PBYTE pBlob,
  896. IN LSAP_DB_NAMES Name,
  897. OUT PLSAP_DB_ATTRIBUTE Attribute
  898. );
  899. NTSTATUS
  900. LsapDbMakePByteAttributeDs(
  901. IN OPTIONAL PBYTE Buffer,
  902. IN ULONG BufferLength,
  903. IN LSAP_DB_ATTRIB_TYPE AttribType,
  904. IN PUNICODE_STRING AttributeName,
  905. OUT PLSAP_DB_ATTRIBUTE Attribute
  906. );
  907. NTSTATUS
  908. LsapDbReadAttribute(
  909. IN LSAPR_HANDLE ObjectHandle,
  910. IN OUT PLSAP_DB_ATTRIBUTE Attribute
  911. );
  912. NTSTATUS
  913. LsapDbFreeAttributes(
  914. IN ULONG Count,
  915. IN PLSAP_DB_ATTRIBUTE Attributes
  916. );
  917. /*++
  918. VOID
  919. LsapDbInitializeAttribute(
  920. IN PLSAP_DB_ATTRIBUTE AttributeP,
  921. IN PUNICODE_STRING AttributeNameP,
  922. IN OPTIONAL PVOID AttributeValueP,
  923. IN ULONG AttributeValueLengthP,
  924. IN BOOLEAN MemoryAllocatedP
  925. )
  926. Routine Description:
  927. This macro function initialize an Lsa Database Object Attribute
  928. structure. No validation is done.
  929. Arguments:
  930. AttributeP - Pointer to Lsa Database Attribute structure to be
  931. initialized.
  932. AttributeNameP - Pointer to Unicode String containing the attribute's
  933. name.
  934. AttributeValueP - Pointer to the attribute's value. NULL may be
  935. specified.
  936. AttributeValueLengthP - Length of the attribute's value in bytes.
  937. MemoryAllocatedP - TRUE if memory is allocated by MIDL_user_allocate
  938. within the LSA Server code (not by RPC server stubs), else FALSE.
  939. Return Values:
  940. None.
  941. --*/
  942. #define LsapDbInitializeAttribute( \
  943. AttributeP, \
  944. AttributeNameP, \
  945. AttributeValueP, \
  946. AttributeValueLengthP, \
  947. MemoryAllocatedP \
  948. ) \
  949. \
  950. { \
  951. (AttributeP)->AttributeName = AttributeNameP; \
  952. (AttributeP)->AttributeValue = AttributeValueP; \
  953. (AttributeP)->AttributeValueLength = AttributeValueLengthP; \
  954. (AttributeP)->MemoryAllocated = MemoryAllocatedP; \
  955. (AttributeP)->DsAttId = 0; \
  956. (AttributeP)->AttribType = LsapDbAttribUnknown; \
  957. (AttributeP)->CanDefaultToZero = FALSE; \
  958. (AttributeP)->PseudoAttribute = FALSE; \
  959. }
  960. /*++
  961. VOID
  962. LsapDbInitializeAttributeDs(
  963. IN PLSAP_DB_ATTRIBUTE AttributeP,
  964. IN LSAP_DB_NAMES Name,
  965. IN OPTIONAL PVOID AttributeValueP,
  966. IN ULONG AttributeValueLengthP,
  967. IN BOOLEAN MemoryAllocatedP
  968. )
  969. Routine Description:
  970. This macro function initialize an Lsa Database Object Attribute
  971. structure. No validation is done.
  972. Arguments:
  973. AttributeP - Pointer to Lsa Database Attribute structure to be
  974. initialized.
  975. Name - Name index to create
  976. AttributeValueP - Pointer to the attribute's value. NULL may be
  977. specified.
  978. AttributeValueLengthP - Length of the attribute's value in bytes.
  979. MemoryAllocatedP - TRUE if memory is allocated by MIDL_user_allocate
  980. within the LSA Server code (not by RPC server stubs), else FALSE.
  981. Return Values:
  982. None.
  983. --*/
  984. #define LsapDbInitializeAttributeDs( \
  985. AttributeP, \
  986. Name, \
  987. AttributeValueP, \
  988. AttributeValueLengthP, \
  989. MemoryAllocatedP \
  990. ) \
  991. \
  992. { \
  993. LsapDbInitializeAttribute( (AttributeP), &LsapDbNames[Name], \
  994. AttributeValueP, AttributeValueLengthP, \
  995. MemoryAllocatedP ); \
  996. (AttributeP)->DsAttId = LsapDbDsAttInfo[Name].AttributeId; \
  997. (AttributeP)->AttribType = LsapDbDsAttInfo[Name].AttributeType; \
  998. (AttributeP)->CanDefaultToZero = FALSE; \
  999. (AttributeP)->DbNameIndex = Name; \
  1000. }
  1001. #define LsapDbAttributeCanNotExist( \
  1002. AttributeP \
  1003. ) \
  1004. { \
  1005. (AttributeP)->CanDefaultToZero = TRUE; \
  1006. }
  1007. NTSTATUS
  1008. LsapDbGetPrivilegesAndQuotas(
  1009. IN LSAPR_HANDLE PolicyHandle,
  1010. IN SECURITY_LOGON_TYPE LogonType,
  1011. IN ULONG IdCount,
  1012. IN PSID_AND_ATTRIBUTES Ids,
  1013. OUT PULONG PrivilegeCount,
  1014. OUT PLUID_AND_ATTRIBUTES *Privileges,
  1015. OUT PQUOTA_LIMITS QuotaLimits
  1016. );
  1017. NTSTATUS
  1018. LsapInitializeNotifiyList(
  1019. VOID
  1020. );
  1021. NTSTATUS
  1022. LsapCrServerGetSessionKeySafe(
  1023. IN LSAPR_HANDLE ObjectHandle,
  1024. IN LSAP_DB_OBJECT_TYPE_ID ObjectTypeId,
  1025. OUT PLSAP_CR_CIPHER_KEY *SessionKey
  1026. );
  1027. NTSTATUS
  1028. LsapDbVerifyHandle(
  1029. IN LSAPR_HANDLE ObjectHandle,
  1030. IN ULONG Options,
  1031. IN LSAP_DB_OBJECT_TYPE_ID ExpectedObjectTypeId,
  1032. IN BOOLEAN ReferenceHandle
  1033. );
  1034. BOOLEAN
  1035. LsapDbDereferenceHandle(
  1036. IN LSAPR_HANDLE ObjectHandle
  1037. );
  1038. NTSTATUS
  1039. LsapDbQueryAllInformationAccounts(
  1040. IN LSAPR_HANDLE PolicyHandle,
  1041. IN ULONG IdCount,
  1042. IN PSID_AND_ATTRIBUTES Ids,
  1043. OUT PLSAP_DB_ACCOUNT_TYPE_SPECIFIC_INFO AccountInfo
  1044. );
  1045. NTSTATUS
  1046. LsapCreateTrustedDomain2(
  1047. IN LSAPR_HANDLE PolicyHandle,
  1048. IN PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX TrustedDomainInformation,
  1049. IN PLSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION AuthenticationInformation,
  1050. IN ACCESS_MASK DesiredAccess,
  1051. OUT PLSAPR_HANDLE TrustedDomainHandle
  1052. );
  1053. NTSTATUS
  1054. LsapDsInitializeDsStateInfo(
  1055. IN LSADS_INIT_STATE DsInitState
  1056. );
  1057. NTSTATUS
  1058. LsapDsUnitializeDsStateInfo(
  1059. );
  1060. /*++
  1061. BOOLEAN
  1062. LsapValidateLsaUnicodeString(
  1063. IN PLSAPR_UNICODE_STRING UnicodeString
  1064. );
  1065. Returns TRUE if the LSAPR_UNICODE_STRING is valid. FALSE otherwise
  1066. --*/
  1067. #define LsapValidateLsaUnicodeString( _us_ ) \
  1068. (( (_us_) == NULL || \
  1069. ( \
  1070. (_us_)->MaximumLength >= ( _us_ )->Length && \
  1071. (_us_)->Length % 2 == 0 && \
  1072. (_us_)->MaximumLength % 2 == 0 && \
  1073. ((_us_)->Length == 0 || (_us_)->Buffer != NULL ) \
  1074. ) \
  1075. ) ? TRUE : FALSE )
  1076. /*++
  1077. BOOLEAN
  1078. LsapValidateLsaCipherValue(
  1079. IN PLSAPR_UNICODE_STRING UnicodeString
  1080. );
  1081. Returns TRUE if the LSAPR_CR_CIPHER_KEY is valid. FALSE otherwise
  1082. --*/
  1083. #define LsapValidateLsaCipherValue( _us_ ) \
  1084. ( \
  1085. (_us_)->MaximumLength >= ( _us_ )->Length && \
  1086. ((_us_)->Length == 0 || (_us_)->Buffer != NULL ) \
  1087. ) \
  1088. ? TRUE : FALSE
  1089. NTSTATUS
  1090. LsapDbIsImpersonatedClientNetworkClient(
  1091. IN OUT PBOOLEAN IsNetworkClient
  1092. );
  1093. BOOLEAN
  1094. LsapSidPresentInGroups(
  1095. IN PTOKEN_GROUPS TokenGroups,
  1096. IN SID * Sid
  1097. );
  1098. NTSTATUS
  1099. LsapDomainRenameHandlerForLogonSessions(
  1100. IN PUNICODE_STRING OldNetbiosName,
  1101. IN PUNICODE_STRING OldDnsName,
  1102. IN PUNICODE_STRING NewNetbiosName,
  1103. IN PUNICODE_STRING NewDnsName
  1104. );
  1105. NTSTATUS
  1106. LsapRetrieveDnsDomainNameFromHive(
  1107. IN HKEY Hkey,
  1108. IN OUT DWORD * Length,
  1109. OUT WCHAR * Buffer
  1110. );
  1111. #ifdef __cplusplus
  1112. }
  1113. #endif // __cplusplus
  1114. #endif // _LSA_DB_