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.

1776 lines
50 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. lsarpc.idl
  5. Abstract:
  6. Local Security Authority RPC Interface Definition File
  7. This file contains the RPC Interface Definition Language file for
  8. the LSA. This file includes all of the prototypes for the LSA functions
  9. that are callable via RPC. These functions are internal versions of API
  10. and are NOT visible to clients of the LSA. An LSA client calls the LSA
  11. API defined in file ntlsa.h. These API are wrappers which call client
  12. RPC stubs generated from this idl file by the RPC compiler.
  13. Author:
  14. Scott Birrell (ScottBi) April 23, 1991
  15. Environment:
  16. User Mode
  17. Revision History:
  18. --*/
  19. [
  20. uuid(12345778-1234-ABCD-EF00-0123456789AB),
  21. version(0.0),
  22. #ifdef __midl
  23. ms_union,
  24. #endif // __midl
  25. pointer_default(unique)
  26. ]
  27. interface lsarpc
  28. {
  29. //
  30. // Import a dummy interface containing #includes for public .h files. This
  31. // trick is necessary so that midl will only generate marshalling routines
  32. // for subtypes that are relevant to the parameters specified on the RPC
  33. // interface. midl also ignores function prototypes contained therein.
  34. //
  35. import "lsaimp.idl" ;
  36. cpp_quote("#define LSA_LOOKUP_REVISION_1 0x1")
  37. cpp_quote("#define LSA_LOOKUP_REVISION_2 0x2")
  38. cpp_quote("#define LSA_LOOKUP_REVISION_LATEST LSA_LOOKUP_REVISION_2")
  39. //
  40. // Lsa Client version identifiers -- don't use see above
  41. //
  42. cpp_quote("#define LSA_CLIENT_PRE_NT5 0x1")
  43. cpp_quote("#define LSA_CLIENT_NT5 0x2")
  44. cpp_quote("#define LSA_CLIENT_LATEST 0x2")
  45. //
  46. // BUGBUG ScottBi - The parens have to be omitted from the operand
  47. // because midl grammar does not support them.
  48. //
  49. #define LSAPR_DB_AUDIT_EVENT_COUNT SeMaxAuditType + 1
  50. //
  51. // LSA Generic Handle used to bind from client to server.
  52. // This handle is used for both LOCAL and REMOTE services.
  53. //
  54. typedef [handle] LPWSTR PLSAPR_SERVER_NAME, *PPLSAPR_SERVER_NAME;
  55. //
  56. // LSA RPC Context Handle (Internal definition of LSAPR_HANDLE)
  57. //
  58. typedef [context_handle] PVOID LSAPR_HANDLE;
  59. typedef LSAPR_HANDLE *PLSAPR_HANDLE;
  60. //
  61. // RPC definition of the SID structure. Note the use of the [size_is()]
  62. // qualifier to specify the number of elements in the variable size
  63. // imbedded SubAuthorityCount array at runtime.
  64. //
  65. //
  66. #pragma warning(disable:4200)
  67. typedef struct _LSAPR_SID {
  68. UCHAR Revision;
  69. UCHAR SubAuthorityCount;
  70. SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
  71. [size_is(SubAuthorityCount)] ULONG SubAuthority[*];
  72. } LSAPR_SID, *PLSAPR_SID, **PPLSAPR_SID;
  73. #pragma warning(default:4200)
  74. //
  75. // The following structure is used to identify an Account Object.
  76. //
  77. typedef struct _LSAPR_SID_INFORMATION {
  78. PLSAPR_SID Sid;
  79. } LSAPR_SID_INFORMATION, *PLSAPR_SID_INFORMATION;
  80. //
  81. // The following structure is used to hold an array of Sids.
  82. //
  83. typedef struct _LSAPR_SID_ENUM_BUFFER {
  84. ULONG Entries;
  85. [size_is(Entries)] PLSAPR_SID_INFORMATION SidInfo;
  86. } LSAPR_SID_ENUM_BUFFER, *PLSAPR_SID_ENUM_BUFFER;
  87. //
  88. // The following structure is used to identify an Account Object.
  89. //
  90. typedef struct _LSAPR_ACCOUNT_INFORMATION {
  91. PLSAPR_SID Sid;
  92. } LSAPR_ACCOUNT_INFORMATION, *PLSAPR_ACCOUNT_INFORMATION;
  93. //
  94. //
  95. // Account Object Enumeration Buffer
  96. //
  97. typedef struct _LSAPR_ACCOUNT_ENUM_BUFFER {
  98. ULONG EntriesRead;
  99. [size_is(EntriesRead)] PLSAPR_ACCOUNT_INFORMATION Information;
  100. } LSAPR_ACCOUNT_ENUM_BUFFER, *PLSAPR_ACCOUNT_ENUM_BUFFER;
  101. //
  102. // BUGBUG ScottBi - Someday these should be an imported interface.
  103. //
  104. // Unicode strings are counted 16-bit character strings.
  105. // The Length field and MaximumLength fields specify number of bytes,
  106. // (not wide-characters) in the string. So, this definition differs
  107. // a bit from the real unicode string type.
  108. //
  109. typedef struct _LSAPR_UNICODE_STRING {
  110. USHORT Length;
  111. USHORT MaximumLength;
  112. // BUGBUG - ScottBi - MIDL will raise an exception if Length is 0.
  113. // Wrappers passing UNICODE STRINGS must pass NULL if string is length
  114. // zero
  115. [size_is(MaximumLength/2), length_is(Length/2)] PWSTR Buffer;
  116. } LSAPR_UNICODE_STRING, *PLSAPR_UNICODE_STRING;
  117. //
  118. // ANSI counted string
  119. //
  120. typedef struct _LSAPR_STRING {
  121. USHORT Length;
  122. USHORT MaximumLength;
  123. // [size_is(MaximumLength), length_is(Length)] PCHAR Buffer;
  124. [size_is(MaximumLength)] PCHAR Buffer;
  125. } LSAPR_STRING, *PLSAPR_STRING, LSAPR_ANSI_STRING, *PLSAPR_ANSI_STRING;
  126. //
  127. // RPC definition of an ACL. This must be manually maintained to be the same
  128. // as the real ACL definition in ntseapi.h
  129. //
  130. #pragma warning(disable:4200)
  131. typedef struct _LSAPR_ACL {
  132. UCHAR AclRevision;
  133. UCHAR Sbz1;
  134. USHORT AclSize;
  135. [size_is(AclSize - 4)] UCHAR Dummy1[*];
  136. } LSAPR_ACL, *PLSAPR_ACL;
  137. #pragma warning(default:4200)
  138. //
  139. // RPC'able security descriptor definition.
  140. //
  141. typedef struct _LSAPR_SECURITY_DESCRIPTOR {
  142. UCHAR Revision;
  143. UCHAR Sbz1;
  144. SECURITY_DESCRIPTOR_CONTROL Control;
  145. PLSAPR_SID Owner;
  146. PLSAPR_SID Group;
  147. PLSAPR_ACL Sacl;
  148. PLSAPR_ACL Dacl;
  149. } LSAPR_SECURITY_DESCRIPTOR, *PLSAPR_SECURITY_DESCRIPTOR;
  150. //
  151. // RPC'able Self-Relative Security Descriptor Definition.
  152. //
  153. typedef struct _LSAPR_SR_SECURITY_DESCRIPTOR {
  154. ULONG Length;
  155. [size_is(Length)] PUCHAR SecurityDescriptor;
  156. } LSAPR_SR_SECURITY_DESCRIPTOR, *PLSAPR_SR_SECURITY_DESCRIPTOR;
  157. typedef struct _LSAPR_LUID_AND_ATTRIBUTES {
  158. OLD_LARGE_INTEGER Luid;
  159. ULONG Attributes;
  160. } LSAPR_LUID_AND_ATTRIBUTES, * PLSAPR_LUID_AND_ATTRIBUTES;
  161. //
  162. // Privilege Set - This is defined for a privilege set of one.
  163. // If more than one privilege is needed, then this structure
  164. // will need to be allocated with more space.
  165. //
  166. // Note: don't change this structure without fixing the INITIAL_PRIVILEGE_SET
  167. // structure (defined in se.h)
  168. //
  169. #pragma warning(disable:4200)
  170. typedef struct _LSAPR_PRIVILEGE_SET {
  171. ULONG PrivilegeCount;
  172. ULONG Control;
  173. [size_is(PrivilegeCount)] LSAPR_LUID_AND_ATTRIBUTES Privilege[*];
  174. } LSAPR_PRIVILEGE_SET, *PLSAPR_PRIVILEGE_SET, **PPLSAPR_PRIVILEGE_SET;
  175. #pragma warning(default:4200)
  176. //
  177. // The following data type is used to return information about privileges
  178. // defined on a system.
  179. //
  180. typedef struct _LSAPR_POLICY_PRIVILEGE_DEF {
  181. LSAPR_UNICODE_STRING Name;
  182. LUID LocalValue;
  183. } LSAPR_POLICY_PRIVILEGE_DEF, *PLSAPR_POLICY_PRIVILEGE_DEF;
  184. // where the members have the following usage:
  185. //
  186. // Name - Is the architected name of the privilege. This is the
  187. // primary key of the privilege and the only value that is
  188. // transportable between systems.
  189. //
  190. // Luid - is a LUID value assigned locally for efficient representation
  191. // of the privilege. Ths value is meaningful only on the system it
  192. // was assigned on and is not transportable in any way.
  193. //
  194. //
  195. // The following structure is used to hold an array of returned Privileges.
  196. //
  197. typedef struct _LSAPR_PRIVILEGE_ENUM_BUFFER {
  198. ULONG Entries;
  199. [size_is(Entries)] PLSAPR_POLICY_PRIVILEGE_DEF Privileges;
  200. } LSAPR_PRIVILEGE_ENUM_BUFFER, *PLSAPR_PRIVILEGE_ENUM_BUFFER;
  201. //
  202. // RPC'able Object Attributes structure for LSA use. Note that the
  203. // OBJECT_ATTRIBUTES structure is LSA-specific in that the RootDirectory
  204. // field is a handle of the specific type LSAPR_HANDLE.
  205. //
  206. // WARNING! This MUST be kept in sync with the corresponding structure in
  207. // ntdef.h! Structure should be moved to an imported interface when
  208. // possible.
  209. //
  210. typedef struct _LSAPR_OBJECT_ATTRIBUTES {
  211. ULONG Length;
  212. PUCHAR RootDirectory; // This field is not used
  213. PSTRING ObjectName;
  214. ULONG Attributes;
  215. PLSAPR_SECURITY_DESCRIPTOR SecurityDescriptor;
  216. PSECURITY_QUALITY_OF_SERVICE SecurityQualityOfService;
  217. } LSAPR_OBJECT_ATTRIBUTES, *PLSAPR_OBJECT_ATTRIBUTES;
  218. //
  219. // Clear value structure
  220. //
  221. typedef struct _LSAPR_CR_CLEAR_VALUE {
  222. ULONG Length;
  223. ULONG MaximumLength;
  224. [size_is(MaximumLength), length_is(Length)] PUCHAR Buffer;
  225. } LSAPR_CR_CLEAR_VALUE, *PLSAPR_CR_CLEAR_VALUE;
  226. //
  227. // Two-way encrypted value structure in Self-relative form. This
  228. // is just like a String.
  229. //
  230. typedef struct _LSAPR_CR_CIPHER_VALUE {
  231. ULONG Length;
  232. ULONG MaximumLength;
  233. [size_is(MaximumLength), length_is(Length)] PUCHAR Buffer;
  234. } LSAPR_CR_CIPHER_VALUE, *PLSAPR_CR_CIPHER_VALUE;
  235. //
  236. // LSA API Internal Function prototypes for RPC interface. Each function
  237. // takes similar (but not always identical) parameters to its corresponding
  238. // exported API. Client and server stubs are generated for the functions
  239. // specified here. The client stubs are called by the wrapper functions
  240. // in file rpcapi.c in the lsa\client directory.
  241. //
  242. //
  243. // The following data type is used to identify a domain
  244. //
  245. typedef struct _LSAPR_TRUST_INFORMATION {
  246. LSAPR_UNICODE_STRING Name;
  247. PLSAPR_SID Sid;
  248. } LSAPR_TRUST_INFORMATION, *PLSAPR_TRUST_INFORMATION;
  249. // where members have the following usage:
  250. //
  251. // Name - The name of the domain.
  252. //
  253. // Sid - A pointer to the Sid of the Domain
  254. //
  255. //
  256. // The following data type is used to fully identify a domain
  257. // Only used internally
  258. //
  259. typedef struct _LSAPR_TRUST_INFORMATION_EX {
  260. LSAPR_UNICODE_STRING DomainName;
  261. LSAPR_UNICODE_STRING FlatName;
  262. PLSAPR_SID Sid;
  263. BOOLEAN DomainNamesDiffer;
  264. ULONG TrustAttributes;
  265. } LSAPR_TRUST_INFORMATION_EX, *PLSAPR_TRUST_INFORMATION_EX;
  266. // where members have the following usage:
  267. //
  268. // DomainName - The name of the domain. Most likely the Dns domain name,
  269. // if DNS is active
  270. //
  271. // FlatName - Flat (NetBIOS) domain name
  272. //
  273. // Sid - A pointer to the Sid of the Domain
  274. //
  275. //
  276. //
  277. // Trusted Domain Object Enumeration Buffer
  278. //
  279. typedef struct _LSAPR_TRUSTED_ENUM_BUFFER {
  280. ULONG EntriesRead;
  281. [size_is(EntriesRead)] PLSAPR_TRUST_INFORMATION Information;
  282. } LSAPR_TRUSTED_ENUM_BUFFER, *PLSAPR_TRUSTED_ENUM_BUFFER;
  283. //
  284. // The following data type is used in name and SID lookup services to
  285. // describe the domains referenced in the lookup operation.
  286. //
  287. typedef struct _LSAPR_REFERENCED_DOMAIN_LIST {
  288. ULONG Entries;
  289. [size_is(Entries)] PLSAPR_TRUST_INFORMATION Domains;
  290. ULONG MaxEntries;
  291. } LSAPR_REFERENCED_DOMAIN_LIST, *PLSAPR_REFERENCED_DOMAIN_LIST;
  292. // where members have the following usage:
  293. //
  294. // Entries - Is a count of the number of domains described in the
  295. // Domains array.
  296. //
  297. // Domains - Is a pointer to an array of Entries LSA_TRUST_INFORMATION data
  298. // structures.
  299. //
  300. //
  301. // This returned flag indicates that the SID was resolved by SID history
  302. //
  303. cpp_quote("#define LSA_LOOKUP_SID_FOUND_BY_HISTORY 0x00000001")
  304. //
  305. // This returned flag indicates that the SID was not resolved but belongs
  306. // to an external trusted forest
  307. //
  308. cpp_quote("#define LSA_LOOKUP_SID_XFOREST_REF 0x00000002")
  309. typedef struct _LSAPR_TRANSLATED_SID_EX {
  310. SID_NAME_USE Use;
  311. ULONG RelativeId;
  312. LONG DomainIndex;
  313. ULONG Flags;
  314. } LSAPR_TRANSLATED_SID_EX, *PLSAPR_TRANSLATED_SID_EX;
  315. typedef struct _LSAPR_TRANSLATED_SID_EX2 {
  316. SID_NAME_USE Use;
  317. PLSAPR_SID Sid;
  318. // ULONG RelativeId;
  319. LONG DomainIndex;
  320. ULONG Flags;
  321. } LSAPR_TRANSLATED_SID_EX2, *PLSAPR_TRANSLATED_SID_EX2;
  322. //
  323. // The following data type is used in Sid to name lookup services to
  324. // reference the list of domains referenced in the lookup operation
  325. //
  326. // BUGBUG - ScottBi - When midl supports the size_is operand in its
  327. // full form with more than one operand, this intermediate structure
  328. // can be eliminated.
  329. //
  330. typedef struct _LSAPR_TRANSLATED_SIDS {
  331. ULONG Entries;
  332. [size_is(Entries)] PLSA_TRANSLATED_SID Sids;
  333. } LSAPR_TRANSLATED_SIDS, *PLSAPR_TRANSLATED_SIDS;
  334. typedef struct _LSAPR_TRANSLATED_SIDS_EX {
  335. ULONG Entries;
  336. [size_is(Entries)] PLSAPR_TRANSLATED_SID_EX Sids;
  337. } LSAPR_TRANSLATED_SIDS_EX, *PLSAPR_TRANSLATED_SIDS_EX;
  338. typedef struct _LSAPR_TRANSLATED_SIDS_EX2 {
  339. ULONG Entries;
  340. [size_is(Entries)] PLSAPR_TRANSLATED_SID_EX2 Sids;
  341. } LSAPR_TRANSLATED_SIDS_EX2, *PLSAPR_TRANSLATED_SIDS_EX2;
  342. //
  343. // The following data type is used in SID to name lookup services to
  344. // describe the domains referenced in the lookup operation.
  345. //
  346. typedef struct _LSAPR_TRANSLATED_NAME {
  347. SID_NAME_USE Use;
  348. LSAPR_UNICODE_STRING Name;
  349. LONG DomainIndex;
  350. } LSAPR_TRANSLATED_NAME, *PLSAPR_TRANSLATED_NAME;
  351. //
  352. // This returned flag indicates that the name passed is not a SAM account name
  353. // (that is, it is someother format).
  354. //
  355. cpp_quote("#define LSA_LOOKUP_NAME_NOT_SAM_ACCOUNT_NAME 0x00000001")
  356. //
  357. // This returned flag indicates that the name passed in was not resolved
  358. // but does belong to a trusted forest.
  359. //
  360. cpp_quote("#define LSA_LOOKUP_NAME_XFOREST_REF 0x00000002")
  361. typedef struct _LSAPR_TRANSLATED_NAME_EX {
  362. SID_NAME_USE Use;
  363. LSAPR_UNICODE_STRING Name;
  364. LONG DomainIndex;
  365. ULONG Flags;
  366. } LSAPR_TRANSLATED_NAME_EX, *PLSAPR_TRANSLATED_NAME_EX;
  367. // where the members have the following usage:
  368. //
  369. // Use - Identifies the use of the name. If this value is SidUnknown
  370. // or SidInvalid, then the remainder of the record is not set and
  371. // should be ignored. If this value is SidWellKnownGroup then the
  372. // Name field is invalid, but the DomainIndex field is not.
  373. //
  374. // Name - Contains the isolated name of the translated SID.
  375. //
  376. // DomainIndex - Is the index of an entry in a related
  377. // LSA_REFERENCED_DOMAIN_LIST data structure describing the domain
  378. // in which the account was found.
  379. //
  380. // If there is no corresponding reference domain for an entry, then
  381. // this field will contain a negative value.
  382. //
  383. //
  384. // The following data type is used in Sid to name lookup services to
  385. // reference the list of domains referenced in the lookup operation
  386. //
  387. // BUGBUG - ScottBi - When midl supports the size_is operand in its
  388. // full form with more than one operand, this intermediate structure
  389. // can be eliminated.
  390. //
  391. typedef struct _LSAPR_TRANSLATED_NAMES {
  392. ULONG Entries;
  393. [size_is(Entries)] PLSAPR_TRANSLATED_NAME Names;
  394. } LSAPR_TRANSLATED_NAMES, *PLSAPR_TRANSLATED_NAMES;
  395. typedef struct _LSAPR_TRANSLATED_NAMES_EX {
  396. ULONG Entries;
  397. [size_is(Entries)] PLSAPR_TRANSLATED_NAME_EX Names;
  398. } LSAPR_TRANSLATED_NAMES_EX, *PLSAPR_TRANSLATED_NAMES_EX;
  399. //
  400. // The following structure corresponds to the PolicyAccountDomainInformation
  401. // information class.
  402. //
  403. typedef struct _LSAPR_POLICY_ACCOUNT_DOM_INFO {
  404. LSAPR_UNICODE_STRING DomainName;
  405. PLSAPR_SID DomainSid;
  406. } LSAPR_POLICY_ACCOUNT_DOM_INFO, *PLSAPR_POLICY_ACCOUNT_DOM_INFO;
  407. // where the members have the following usage:
  408. //
  409. // DomainName - Is the name of the domain
  410. //
  411. // DomainSid - Is the Sid of the domain
  412. //
  413. //
  414. // The following structure corresponds to the PolicyPrimaryDomainInformation
  415. // information class.
  416. //
  417. typedef struct _LSAPR_POLICY_PRIMARY_DOM_INFO {
  418. LSAPR_UNICODE_STRING Name;
  419. PLSAPR_SID Sid;
  420. } LSAPR_POLICY_PRIMARY_DOM_INFO, *PLSAPR_POLICY_PRIMARY_DOM_INFO;
  421. // where the members have the following usage:
  422. //
  423. // Name - Is the name of the domain
  424. //
  425. // Sid - Is the Sid of the domain
  426. //
  427. //
  428. // The following structure corresponds to the PolicyDnsDomainInformation
  429. // information class
  430. //
  431. typedef struct _LSAPR_POLICY_DNS_DOMAIN_INFO {
  432. LSAPR_UNICODE_STRING Name;
  433. LSAPR_UNICODE_STRING DnsDomainName;
  434. LSAPR_UNICODE_STRING DnsForestName;
  435. GUID DomainGuid;
  436. PLSAPR_SID Sid;
  437. } LSAPR_POLICY_DNS_DOMAIN_INFO, *PLSAPR_POLICY_DNS_DOMAIN_INFO;
  438. // where the members have the following usage:
  439. //
  440. // Name - Is the name of the Domain
  441. //
  442. // DnsDomainName - Is the DNS name of the domain
  443. //
  444. // DnsForestName - Is the DNS forest name of the domain
  445. //
  446. // DomainGuid - Is the GUID of the domain
  447. //
  448. // Sid - Is the Sid of the domain
  449. //
  450. // The following structure corresponds to the PolicyPdAccountInformation
  451. // information class. This structure may be used in Query operations
  452. // only.
  453. //
  454. typedef struct _LSAPR_POLICY_PD_ACCOUNT_INFO {
  455. LSAPR_UNICODE_STRING Name;
  456. } LSAPR_POLICY_PD_ACCOUNT_INFO, *PLSAPR_POLICY_PD_ACCOUNT_INFO;
  457. // where the members have the following usage:
  458. //
  459. // Name - Is the name of an account in the domain that should be used
  460. // for authentication and name/ID lookup requests.
  461. //
  462. //
  463. // The following structure corresponds to the PolicyReplicaSourceInformation
  464. // information class.
  465. //
  466. typedef struct _LSAPR_POLICY_REPLICA_SRCE_INFO {
  467. LSAPR_UNICODE_STRING ReplicaSource;
  468. LSAPR_UNICODE_STRING ReplicaAccountName;
  469. } LSAPR_POLICY_REPLICA_SRCE_INFO, *PLSAPR_POLICY_REPLICA_SRCE_INFO;
  470. typedef struct _LSAPR_POLICY_AUDIT_EVENTS_INFO {
  471. BOOLEAN AuditingMode;
  472. [size_is(MaximumAuditEventCount)] PPOLICY_AUDIT_EVENT_OPTIONS EventAuditingOptions;
  473. ULONG MaximumAuditEventCount;
  474. } LSAPR_POLICY_AUDIT_EVENTS_INFO, *PLSAPR_POLICY_AUDIT_EVENTS_INFO;
  475. //
  476. // The following data type is used to hold Policy Information
  477. // of a given class.
  478. //
  479. typedef [switch_type(POLICY_INFORMATION_CLASS)] union
  480. _LSAPR_POLICY_INFORMATION {
  481. [case(PolicyAuditLogInformation)] POLICY_AUDIT_LOG_INFO PolicyAuditLogInfo;
  482. [case(PolicyAuditEventsInformation)] LSAPR_POLICY_AUDIT_EVENTS_INFO PolicyAuditEventsInfo;
  483. [case(PolicyPrimaryDomainInformation)] LSAPR_POLICY_PRIMARY_DOM_INFO PolicyPrimaryDomainInfo;
  484. [case(PolicyAccountDomainInformation)] LSAPR_POLICY_ACCOUNT_DOM_INFO PolicyAccountDomainInfo;
  485. [case(PolicyPdAccountInformation)] LSAPR_POLICY_PD_ACCOUNT_INFO PolicyPdAccountInfo;
  486. [case(PolicyLsaServerRoleInformation)] POLICY_LSA_SERVER_ROLE_INFO PolicyServerRoleInfo;
  487. [case(PolicyReplicaSourceInformation)] LSAPR_POLICY_REPLICA_SRCE_INFO PolicyReplicaSourceInfo;
  488. [case(PolicyDefaultQuotaInformation)] POLICY_DEFAULT_QUOTA_INFO PolicyDefaultQuotaInfo;
  489. [case(PolicyModificationInformation)] POLICY_MODIFICATION_INFO PolicyModificationInfo;
  490. [case(PolicyAuditFullSetInformation)] POLICY_AUDIT_FULL_SET_INFO PolicyAuditFullSetInfo;
  491. [case(PolicyAuditFullQueryInformation)] POLICY_AUDIT_FULL_QUERY_INFO PolicyAuditFullQueryInfo;
  492. [case(PolicyDnsDomainInformation)] LSAPR_POLICY_DNS_DOMAIN_INFO PolicyDnsDomainInfo;
  493. [case(PolicyDnsDomainInformationInt)] LSAPR_POLICY_DNS_DOMAIN_INFO PolicyDnsDomainInfoInt;
  494. } LSAPR_POLICY_INFORMATION;
  495. typedef LSAPR_POLICY_INFORMATION *PLSAPR_POLICY_INFORMATION;
  496. //***********************************************************************************************
  497. //
  498. // NT5 level policy information.
  499. //
  500. //
  501. // The following structure corresponds to the PolicyDomainEfsInformation
  502. // information class
  503. //
  504. typedef struct _LSAPR_POLICY_DOMAIN_EFS_INFO {
  505. ULONG InfoLength;
  506. [size_is(InfoLength)] PUCHAR EfsBlob;
  507. } LSAPR_POLICY_DOMAIN_EFS_INFO, *PLSAPR_POLICY_DOMAIN_EFS_INFO;
  508. // where the members have the following usage:
  509. //
  510. // InfoLength - Length of the EFS Information blob
  511. //
  512. // EfsBlob - Efs blob data
  513. //
  514. typedef [switch_type(POLICY_DOMAIN_INFORMATION_CLASS)] union
  515. _LSAPR_POLICY_DOMAIN_INFORMATION {
  516. [case(PolicyDomainEfsInformation)] LSAPR_POLICY_DOMAIN_EFS_INFO PolicyDomainEfsInfo;
  517. [case(PolicyDomainKerberosTicketInformation)] POLICY_DOMAIN_KERBEROS_TICKET_INFO PolicyDomainKerbTicketInfo;
  518. } LSAPR_POLICY_DOMAIN_INFORMATION;
  519. typedef LSAPR_POLICY_DOMAIN_INFORMATION *PLSAPR_POLICY_DOMAIN_INFORMATION;
  520. //
  521. // Account object type-specific Access Types
  522. //
  523. #define LSA_ACCOUNT_VIEW 0x00000001L
  524. #define LSA_ACCOUNT_ADJUST_PRIVILEGES 0x00000002L
  525. #define LSA_ACCOUNT_ADJUST_QUOTAS 0x00000004L
  526. #define LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS 0x00000008L
  527. #define LSA_ACCOUNT_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED | \
  528. LSA_ACCOUNT_VIEW | \
  529. LSA_ACCOUNT_ADJUST_PRIVILEGES | \
  530. LSA_ACCOUNT_ADJUST_QUOTAS | \
  531. LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS )
  532. //
  533. // The following data type corresponds to the TrustedDomainNameInformation
  534. // information class.
  535. //
  536. typedef struct _LSAPR_TRUSTED_DOMAIN_NAME_INFO {
  537. LSAPR_UNICODE_STRING Name;
  538. } LSAPR_TRUSTED_DOMAIN_NAME_INFO, *PLSAPR_TRUSTED_DOMAIN_NAME_INFO;
  539. //
  540. // The following data type corresponds to the TrustedControllersInformation
  541. // information class.
  542. //
  543. typedef struct _LSAPR_TRUSTED_CONTROLLERS_INFO {
  544. ULONG Entries;
  545. [size_is(Entries)] PLSAPR_UNICODE_STRING Names;
  546. } LSAPR_TRUSTED_CONTROLLERS_INFO, *PLSAPR_TRUSTED_CONTROLLERS_INFO;
  547. // where members have the following meaning:
  548. //
  549. // Entries - Indicate how mamy entries there are in the Names array.
  550. //
  551. // Names - Pointer to an array of UNICODE_STRING structures containing the
  552. // names of domain controllers of the domain. This information may not
  553. // be accurate and should be used only as a hint. The order of this
  554. // list is considered significant and will be maintained.
  555. //
  556. // By convention, the first name in this list is assumed to be the
  557. // Primary Domain Controller of the domain. If the Primary Domain
  558. // Controller is not known, the first name should be set to the NULL
  559. // string.
  560. //
  561. //
  562. // The following data type corresponds to the TrustedPasswordInformation
  563. // information class.
  564. //
  565. typedef struct _LSAPR_TRUSTED_PASSWORD_INFO {
  566. PLSAPR_CR_CIPHER_VALUE Password;
  567. PLSAPR_CR_CIPHER_VALUE OldPassword;
  568. } LSAPR_TRUSTED_PASSWORD_INFO, *PLSAPR_TRUSTED_PASSWORD_INFO;
  569. // where members have the following meaning:
  570. //
  571. // Password - Contains new password for the trusted domain
  572. //
  573. // OldPassword - Optionally contains the old password for the trusted
  574. // domain.
  575. //
  576. typedef struct _LSAPR_TRUSTED_DOMAIN_INFORMATION_EX {
  577. LSAPR_UNICODE_STRING Name;
  578. LSAPR_UNICODE_STRING FlatName;
  579. PLSAPR_SID Sid;
  580. ULONG TrustDirection;
  581. ULONG TrustType;
  582. ULONG TrustAttributes;
  583. } LSAPR_TRUSTED_DOMAIN_INFORMATION_EX, *PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX;
  584. //
  585. // Type of authentication information
  586. //
  587. #define TRUST_AUTH_TYPE_NONE 0 // Ignore this entry
  588. #define TRUST_AUTH_TYPE_SECRET 1 // This is the equivalent to secret data
  589. #define TRUST_AUTY_TYPE_CLEAR 2 // Cleartext password
  590. typedef struct _LSAPR_AUTH_INFORMATION {
  591. LARGE_INTEGER LastUpdateTime;
  592. ULONG AuthType;
  593. ULONG AuthInfoLength;
  594. [size_is(AuthInfoLength)] PUCHAR AuthInfo;
  595. } LSAPR_AUTH_INFORMATION, *PLSAPR_AUTH_INFORMATION;
  596. typedef struct _LSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION {
  597. ULONG IncomingAuthInfos;
  598. PLSAPR_AUTH_INFORMATION IncomingAuthenticationInformation;
  599. PLSAPR_AUTH_INFORMATION IncomingPreviousAuthenticationInformation;
  600. ULONG OutgoingAuthInfos;
  601. PLSAPR_AUTH_INFORMATION OutgoingAuthenticationInformation;
  602. PLSAPR_AUTH_INFORMATION OutgoingPreviousAuthenticationInformation;
  603. } LSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION, *PLSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION;
  604. typedef struct _LSAPR_TRUSTED_DOMAIN_FULL_INFORMATION {
  605. LSAPR_TRUSTED_DOMAIN_INFORMATION_EX Information;
  606. TRUSTED_POSIX_OFFSET_INFO PosixOffset;
  607. LSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION AuthInformation;
  608. } LSAPR_TRUSTED_DOMAIN_FULL_INFORMATION, *PLSAPR_TRUSTED_DOMAIN_FULL_INFORMATION;
  609. typedef LSAPR_TRUST_INFORMATION LSAPR_TRUSTED_DOMAIN_INFORMATION_BASIC;
  610. typedef PLSAPR_TRUST_INFORMATION PLSAPR_TRUSTED_DOMAIN_INFORMATION_BASIC;
  611. //
  612. // This structure indicates the auth data as read from a Ds object as a blob. It is
  613. // INTERNAL ONLY. The resultant blob is still encrypted
  614. //
  615. typedef struct _LSAPR_TRUSTED_DOMAIN_AUTH_BLOB {
  616. ULONG AuthSize;
  617. [size_is( AuthSize )] PUCHAR AuthBlob;
  618. } LSAPR_TRUSTED_DOMAIN_AUTH_BLOB, *PLSAPR_TRUSTED_DOMAIN_AUTH_BLOB;
  619. //
  620. // This structure represent the LSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION structure on
  621. // the wire.
  622. //
  623. typedef struct _LSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION_INTERNAL {
  624. LSAPR_TRUSTED_DOMAIN_AUTH_BLOB AuthBlob;
  625. } LSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION_INTERNAL, *PLSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION_INTERNAL;
  626. //
  627. // This structure represent the LSAPR_TRUSTED_DOMAIN_FULL_INFORMATION structure on
  628. // the wire.
  629. //
  630. typedef struct _LSAPR_TRUSTED_DOMAIN_FULL_INFORMATION_INTERNAL {
  631. LSAPR_TRUSTED_DOMAIN_INFORMATION_EX Information;
  632. TRUSTED_POSIX_OFFSET_INFO PosixOffset;
  633. LSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION_INTERNAL AuthInformation;
  634. } LSAPR_TRUSTED_DOMAIN_FULL_INFORMATION_INTERNAL, *PLSAPR_TRUSTED_DOMAIN_FULL_INFORMATION_INTERNAL;
  635. typedef struct _LSAPR_TRUSTED_DOMAIN_INFORMATION_EX2 {
  636. LSAPR_UNICODE_STRING Name;
  637. LSAPR_UNICODE_STRING FlatName;
  638. PLSAPR_SID Sid;
  639. ULONG TrustDirection;
  640. ULONG TrustType;
  641. ULONG TrustAttributes;
  642. ULONG ForestTrustLength;
  643. [size_is(ForestTrustLength)] PUCHAR ForestTrustInfo;
  644. } LSAPR_TRUSTED_DOMAIN_INFORMATION_EX2, *PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX2;
  645. typedef struct _LSAPR_TRUSTED_DOMAIN_FULL_INFORMATION2 {
  646. LSAPR_TRUSTED_DOMAIN_INFORMATION_EX2 Information;
  647. TRUSTED_POSIX_OFFSET_INFO PosixOffset;
  648. LSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION AuthInformation;
  649. } LSAPR_TRUSTED_DOMAIN_FULL_INFORMATION2, *PLSAPR_TRUSTED_DOMAIN_FULL_INFORMATION2;
  650. //
  651. // The following data type is used to hold Trusted Domain Information
  652. // of a given class.
  653. //
  654. typedef [switch_type(TRUSTED_INFORMATION_CLASS)] union
  655. _LSAPR_TRUSTED_DOMAIN_INFO {
  656. [case(TrustedDomainNameInformation)] LSAPR_TRUSTED_DOMAIN_NAME_INFO TrustedDomainNameInfo;
  657. [case(TrustedControllersInformation)] LSAPR_TRUSTED_CONTROLLERS_INFO TrustedControllersInfo;
  658. [case(TrustedPosixOffsetInformation)] TRUSTED_POSIX_OFFSET_INFO TrustedPosixOffsetInfo;
  659. [case(TrustedPasswordInformation)] LSAPR_TRUSTED_PASSWORD_INFO TrustedPasswordInfo;
  660. [case(TrustedDomainInformationBasic)] LSAPR_TRUSTED_DOMAIN_INFORMATION_BASIC TrustedDomainInfoBasic;
  661. [case(TrustedDomainInformationEx)] LSAPR_TRUSTED_DOMAIN_INFORMATION_EX TrustedDomainInfoEx;
  662. [case(TrustedDomainAuthInformation)] LSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION TrustedAuthInfo;
  663. [case(TrustedDomainFullInformation)] LSAPR_TRUSTED_DOMAIN_FULL_INFORMATION TrustedFullInfo;
  664. [case(TrustedDomainAuthInformationInternal)] LSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION_INTERNAL TrustedAuthInfoInternal;
  665. [case(TrustedDomainFullInformationInternal)] LSAPR_TRUSTED_DOMAIN_FULL_INFORMATION_INTERNAL TrustedFullInfoInternal;
  666. [case(TrustedDomainInformationEx2Internal)] LSAPR_TRUSTED_DOMAIN_INFORMATION_EX2 TrustedDomainInfoEx2;
  667. [case(TrustedDomainFullInformation2Internal)] LSAPR_TRUSTED_DOMAIN_FULL_INFORMATION2 TrustedFullInfo2;
  668. } LSAPR_TRUSTED_DOMAIN_INFO;
  669. typedef LSAPR_TRUSTED_DOMAIN_INFO *PLSAPR_TRUSTED_DOMAIN_INFO;
  670. //
  671. // New types for NT3.51 - PPC release
  672. //
  673. typedef PLSAPR_UNICODE_STRING PLSAPR_UNICODE_STRING_ARRAY;
  674. typedef struct _LSAPR_USER_RIGHT_SET {
  675. ULONG Entries;
  676. [size_is(Entries)] PLSAPR_UNICODE_STRING_ARRAY UserRights;
  677. } LSAPR_USER_RIGHT_SET, *PLSAPR_USER_RIGHT_SET;
  678. typedef struct _LSAPR_TRUSTED_ENUM_BUFFER_EX {
  679. ULONG EntriesRead;
  680. [size_is(EntriesRead)] PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX EnumerationBuffer;
  681. } LSAPR_TRUSTED_ENUM_BUFFER_EX, *PLSAPR_TRUSTED_ENUM_BUFFER_EX;
  682. ////////////////////////////////////////////////////////////////////////////
  683. // //
  684. // BEGIN INTERNAL TEST ROUTINES ONLY - These are used for testing the //
  685. // LsaI* APIs. DO NOT EXPORT. They can be moved around at will //
  686. // //
  687. ////////////////////////////////////////////////////////////////////////////
  688. typedef struct _LSAPR_TEST_INTERNAL_PARAMETER_BLOB {
  689. ULONG Size;
  690. [size_is( Size )]PUCHAR Argument;
  691. } LSAPR_TEST_INTERNAL_PARAMETER_BLOB, *PLSAPR_TEST_INTERNAL_PARAMETER_BLOB;
  692. typedef struct _LSAPR_TEST_INTERNAL_ARG_LIST {
  693. ULONG Items;
  694. [size_is( Items )] PLSAPR_TEST_INTERNAL_PARAMETER_BLOB Arg;
  695. } LSAPR_TEST_INTERNAL_ARG_LIST, *PLSAPR_TEST_INTERNAL_ARG_LIST;
  696. //
  697. // Internally tested routines
  698. //
  699. typedef enum _LSAPR_TEST_INTERNAL_ROUTINES {
  700. LsaTest_IEnumerateSecrets,
  701. LsaTest_IQueryDomainOrgInfo,
  702. LsaTest_ISetTrustedDomainAuthBlobs,
  703. LsaTest_IUpgradeRegistryToDs,
  704. LsaTest_ISamSetDomainObjectProperties,
  705. LsaTest_ISamSetDomainBuiltinGroupMembership,
  706. LsaTest_ISamSetInterdomainTrustPassword,
  707. LsaTest_IRegisterPolicyChangeNotificationCallback,
  708. LsaTest_IUnregisterPolicyChangeNotificationCallback,
  709. LsaTest_IUnregisterAllPolicyChangeNotificationCallback,
  710. LsaTest_IStartTransaction,
  711. LsaTest_IApplyTransaction,
  712. LsaTest_ITrustDomFixup,
  713. LsaTest_ISetServerRoleForBoot,
  714. LsaTest_IQueryForestTrustInfo,
  715. LsaTest_IBreak,
  716. LsaTest_IQueryTrustedDomainAuthBlobs,
  717. LsaTest_IQueryNt4Owf
  718. } LSAPR_TEST_INTERNAL_ROUTINES;
  719. ////////////////////////////////////////////////////////////////////////////
  720. // //
  721. // END INTERNAL TEST ROUTINES ONLY //
  722. // //
  723. ////////////////////////////////////////////////////////////////////////////
  724. ////////////////////////////////////////////////////////////////////////////
  725. // //
  726. // Local Security Policy - Miscellaneous API function prototypes //
  727. // //
  728. ////////////////////////////////////////////////////////////////////////////
  729. NTSTATUS
  730. LsarClose(
  731. [in,out] LSAPR_HANDLE *ObjectHandle
  732. );
  733. //
  734. // This routine is being superseded by LsarDeleteObject. The reason is
  735. // that a pointer to a handle rather than a handle is essential so that
  736. // RPC on the server side can clean up. Because of the need for RPC
  737. // interface comaptibility, the new routine has been added at the end
  738. // of the interface,
  739. //
  740. NTSTATUS
  741. LsarDelete(
  742. [in] LSAPR_HANDLE ObjectHandle
  743. );
  744. NTSTATUS
  745. LsarEnumeratePrivileges(
  746. [in] LSAPR_HANDLE PolicyHandle,
  747. [in, out] PLSA_ENUMERATION_HANDLE EnumerationContext,
  748. [out] PLSAPR_PRIVILEGE_ENUM_BUFFER EnumerationBuffer,
  749. [in] ULONG PreferedMaximumLength
  750. );
  751. NTSTATUS
  752. LsarQuerySecurityObject(
  753. [in] LSAPR_HANDLE ObjectHandle,
  754. [in] SECURITY_INFORMATION SecurityInformation,
  755. [out] PLSAPR_SR_SECURITY_DESCRIPTOR *SecurityDescriptor
  756. );
  757. NTSTATUS
  758. LsarSetSecurityObject(
  759. [in] LSAPR_HANDLE ObjectHandle,
  760. [in] SECURITY_INFORMATION SecurityInformation,
  761. [in] PLSAPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor
  762. );
  763. NTSTATUS
  764. LsarChangePassword(
  765. [in] PLSAPR_UNICODE_STRING ServerName,
  766. [in] PLSAPR_UNICODE_STRING DomainName,
  767. [in] PLSAPR_UNICODE_STRING AccountName,
  768. [in] PLSAPR_UNICODE_STRING OldPassword,
  769. [in] PLSAPR_UNICODE_STRING NewPassword
  770. );
  771. ///////////////////////////////////////////////////////////////////////////////
  772. // //
  773. // Local Security Policy - Policy Object API function prototypes //
  774. // //
  775. ///////////////////////////////////////////////////////////////////////////////
  776. NTSTATUS
  777. LsarOpenPolicy(
  778. [in,unique] PLSAPR_SERVER_NAME SystemName,
  779. [in] PLSAPR_OBJECT_ATTRIBUTES ObjectAttributes,
  780. [in] ACCESS_MASK DesiredAccess,
  781. [out] LSAPR_HANDLE *PolicyHandle
  782. );
  783. NTSTATUS
  784. LsarQueryInformationPolicy(
  785. [in] LSAPR_HANDLE PolicyHandle,
  786. [in] POLICY_INFORMATION_CLASS InformationClass,
  787. [out, switch_is(InformationClass)]
  788. PLSAPR_POLICY_INFORMATION *PolicyInformation
  789. );
  790. NTSTATUS
  791. LsarSetInformationPolicy(
  792. [in] LSAPR_HANDLE PolicyHandle,
  793. [in] POLICY_INFORMATION_CLASS InformationClass,
  794. [in, switch_is(InformationClass)]
  795. PLSAPR_POLICY_INFORMATION PolicyInformation
  796. );
  797. NTSTATUS
  798. LsarClearAuditLog(
  799. [in] LSAPR_HANDLE PolicyHandle
  800. );
  801. NTSTATUS
  802. LsarCreateAccount(
  803. [in] LSAPR_HANDLE PolicyHandle,
  804. [in] PLSAPR_SID AccountSid,
  805. [in] ACCESS_MASK DesiredAccess,
  806. [out] LSAPR_HANDLE *AccountHandle
  807. );
  808. NTSTATUS
  809. LsarEnumerateAccounts(
  810. [in] LSAPR_HANDLE PolicyHandle,
  811. [in] [out] PLSA_ENUMERATION_HANDLE EnumerationContext,
  812. [out] PLSAPR_ACCOUNT_ENUM_BUFFER EnumerationBuffer,
  813. [in] ULONG PreferedMaximumLength
  814. );
  815. NTSTATUS
  816. LsarCreateTrustedDomain(
  817. [in] LSAPR_HANDLE PolicyHandle,
  818. [in] PLSAPR_TRUST_INFORMATION TrustedDomainInformation,
  819. [in] ACCESS_MASK DesiredAccess,
  820. [out] LSAPR_HANDLE *TrustedDomainHandle
  821. );
  822. NTSTATUS
  823. LsarEnumerateTrustedDomains(
  824. [in] LSAPR_HANDLE PolicyHandle,
  825. [in] [out] PLSA_ENUMERATION_HANDLE EnumerationContext,
  826. [out] PLSAPR_TRUSTED_ENUM_BUFFER EnumerationBuffer,
  827. [in] ULONG PreferedMaximumLength
  828. );
  829. NTSTATUS
  830. LsarLookupNames(
  831. [in] LSAPR_HANDLE PolicyHandle,
  832. [in] ULONG Count,
  833. [in, size_is(Count)] PLSAPR_UNICODE_STRING Names,
  834. [out] PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
  835. [in, out] PLSAPR_TRANSLATED_SIDS TranslatedSids,
  836. [in] LSAP_LOOKUP_LEVEL LookupLevel,
  837. [in, out] PULONG MappedCount
  838. );
  839. NTSTATUS
  840. LsarLookupSids(
  841. [in] LSAPR_HANDLE PolicyHandle,
  842. [in] PLSAPR_SID_ENUM_BUFFER SidEnumBuffer,
  843. [out] PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
  844. [in, out] PLSAPR_TRANSLATED_NAMES TranslatedNames,
  845. [in] LSAP_LOOKUP_LEVEL LookupLevel,
  846. [in, out] PULONG MappedCount
  847. );
  848. NTSTATUS
  849. LsarCreateSecret(
  850. [in] LSAPR_HANDLE PolicyHandle,
  851. [in] PLSAPR_UNICODE_STRING SecretName,
  852. [in] ACCESS_MASK DesiredAccess,
  853. [out] LSAPR_HANDLE *SecretHandle
  854. );
  855. ///////////////////////////////////////////////////////////////////////////////
  856. // //
  857. // Local Security Policy - Account Object API function prototypes //
  858. // //
  859. ///////////////////////////////////////////////////////////////////////////////
  860. NTSTATUS
  861. LsarOpenAccount(
  862. [in] LSAPR_HANDLE PolicyHandle,
  863. [in] PLSAPR_SID AccountSid,
  864. [in] ACCESS_MASK DesiredAccess,
  865. [out] LSAPR_HANDLE *AccountHandle
  866. );
  867. NTSTATUS
  868. LsarEnumeratePrivilegesAccount(
  869. [in] LSAPR_HANDLE AccountHandle,
  870. [out] PLSAPR_PRIVILEGE_SET *Privileges
  871. );
  872. NTSTATUS
  873. LsarAddPrivilegesToAccount(
  874. [in] LSAPR_HANDLE AccountHandle,
  875. [in] PLSAPR_PRIVILEGE_SET Privileges
  876. );
  877. NTSTATUS
  878. LsarRemovePrivilegesFromAccount(
  879. [in] LSAPR_HANDLE AccountHandle,
  880. [in] BOOLEAN AllPrivileges,
  881. [in, unique] PLSAPR_PRIVILEGE_SET Privileges
  882. );
  883. NTSTATUS
  884. LsarGetQuotasForAccount(
  885. [in] LSAPR_HANDLE AccountHandle,
  886. [out] PQUOTA_LIMITS QuotaLimits
  887. );
  888. NTSTATUS
  889. LsarSetQuotasForAccount(
  890. [in] LSAPR_HANDLE AccountHandle,
  891. [in] PQUOTA_LIMITS QuotaLimits
  892. );
  893. NTSTATUS
  894. LsarGetSystemAccessAccount(
  895. [in] LSAPR_HANDLE AccountHandle,
  896. [out] PULONG SystemAccess
  897. );
  898. NTSTATUS
  899. LsarSetSystemAccessAccount(
  900. [in] LSAPR_HANDLE AccountHandle,
  901. [in] ULONG SystemAccess
  902. );
  903. ///////////////////////////////////////////////////////////////////////////////
  904. // //
  905. // Local Security Policy - Trusted Domain Object API function prototypes //
  906. // //
  907. ///////////////////////////////////////////////////////////////////////////////
  908. NTSTATUS
  909. LsarOpenTrustedDomain(
  910. [in] LSAPR_HANDLE PolicyHandle,
  911. [in] PLSAPR_SID TrustedDomainSid,
  912. [in] ACCESS_MASK DesiredAccess,
  913. [out] LSAPR_HANDLE *TrustedDomainHandle
  914. );
  915. NTSTATUS
  916. LsarQueryInfoTrustedDomain(
  917. [in] LSAPR_HANDLE TrustedDomainHandle,
  918. [in] TRUSTED_INFORMATION_CLASS InformationClass,
  919. [out, switch_is(InformationClass)]
  920. PLSAPR_TRUSTED_DOMAIN_INFO *TrustedDomainInformation
  921. );
  922. NTSTATUS
  923. LsarSetInformationTrustedDomain(
  924. [in] LSAPR_HANDLE TrustedDomainHandle,
  925. [in] TRUSTED_INFORMATION_CLASS InformationClass,
  926. [in, switch_is(InformationClass)]
  927. PLSAPR_TRUSTED_DOMAIN_INFO TrustedDomainInformation
  928. );
  929. ///////////////////////////////////////////////////////////////////////////////
  930. // //
  931. // Local Security Policy - Secret Object API function prototypes //
  932. // //
  933. ///////////////////////////////////////////////////////////////////////////////
  934. NTSTATUS
  935. LsarOpenSecret(
  936. [in] LSAPR_HANDLE PolicyHandle,
  937. [in] PLSAPR_UNICODE_STRING SecretName,
  938. [in] ACCESS_MASK DesiredAccess,
  939. [out] LSAPR_HANDLE *SecretHandle
  940. );
  941. NTSTATUS
  942. LsarSetSecret(
  943. [in] LSAPR_HANDLE SecretHandle,
  944. [in, unique] PLSAPR_CR_CIPHER_VALUE EncryptedCurrentValue,
  945. [in, unique] PLSAPR_CR_CIPHER_VALUE EncryptedOldValue
  946. );
  947. NTSTATUS
  948. LsarQuerySecret(
  949. [in] LSAPR_HANDLE SecretHandle,
  950. [in, out, unique] PLSAPR_CR_CIPHER_VALUE *EncryptedCurrentValue,
  951. [in, out, unique] PLARGE_INTEGER CurrentValueSetTime,
  952. [in, out, unique] PLSAPR_CR_CIPHER_VALUE *EncryptedOldValue,
  953. [in, out, unique] PLARGE_INTEGER OldValueSetTime
  954. );
  955. /////////////////////////////////////////////////////////////////////////
  956. // //
  957. // Local Security Policy - Privilege Object API Prototypes //
  958. // //
  959. /////////////////////////////////////////////////////////////////////////
  960. NTSTATUS
  961. LsarLookupPrivilegeValue(
  962. [in] LSAPR_HANDLE PolicyHandle,
  963. [in] PLSAPR_UNICODE_STRING Name,
  964. [out] PLUID Value
  965. );
  966. NTSTATUS
  967. LsarLookupPrivilegeName(
  968. [in] LSAPR_HANDLE PolicyHandle,
  969. [in] PLUID Value,
  970. [out] PLSAPR_UNICODE_STRING *Name
  971. );
  972. NTSTATUS
  973. LsarLookupPrivilegeDisplayName(
  974. [in] LSAPR_HANDLE PolicyHandle,
  975. [in] PLSAPR_UNICODE_STRING Name,
  976. [in] SHORT ClientLanguage,
  977. [in] SHORT ClientSystemDefaultLanguage,
  978. [out] PLSAPR_UNICODE_STRING *DisplayName,
  979. [out] PWORD LanguageReturned
  980. );
  981. //
  982. // Important note:
  983. //
  984. // This routine will supersede LsarDelete. The difference is that, as on
  985. // LsarClose a pointer to a handle is required rather than a handle so that
  986. // LsarDeleteObject() can inform the RPC server calling stub that the handle
  987. // has been deleted by returning NULL.
  988. //
  989. NTSTATUS
  990. LsarDeleteObject(
  991. [in,out] LSAPR_HANDLE *ObjectHandle
  992. );
  993. //
  994. // These APIs are new for nt 3.51 (PPC release) and will be emulated when
  995. // talking to old servers.
  996. //
  997. NTSTATUS
  998. LsarEnumerateAccountsWithUserRight(
  999. [in] LSAPR_HANDLE PolicyHandle,
  1000. [in,unique] PLSAPR_UNICODE_STRING UserRight,
  1001. [out] PLSAPR_ACCOUNT_ENUM_BUFFER EnumerationBuffer
  1002. );
  1003. NTSTATUS
  1004. LsarEnumerateAccountRights(
  1005. [in] LSAPR_HANDLE PolicyHandle,
  1006. [in] PLSAPR_SID AccountSid,
  1007. [out] PLSAPR_USER_RIGHT_SET UserRights
  1008. );
  1009. NTSTATUS
  1010. LsarAddAccountRights(
  1011. [in] LSAPR_HANDLE PolicyHandle,
  1012. [in] PLSAPR_SID AccountSid,
  1013. [in] PLSAPR_USER_RIGHT_SET UserRights
  1014. );
  1015. NTSTATUS
  1016. LsarRemoveAccountRights(
  1017. [in] LSAPR_HANDLE PolicyHandle,
  1018. [in] PLSAPR_SID AccountSid,
  1019. [in] BOOLEAN AllRights,
  1020. [in] PLSAPR_USER_RIGHT_SET UserRights
  1021. );
  1022. NTSTATUS
  1023. LsarQueryTrustedDomainInfo(
  1024. [in] LSAPR_HANDLE PolicyHandle,
  1025. [in] PLSAPR_SID TrustedDomainSid,
  1026. [in] TRUSTED_INFORMATION_CLASS InformationClass,
  1027. [out, switch_is(InformationClass)]
  1028. PLSAPR_TRUSTED_DOMAIN_INFO * TrustedDomainInformation
  1029. );
  1030. NTSTATUS
  1031. LsarSetTrustedDomainInfo(
  1032. [in] LSAPR_HANDLE PolicyHandle,
  1033. [in] PLSAPR_SID TrustedDomainSid,
  1034. [in] TRUSTED_INFORMATION_CLASS InformationClass,
  1035. [in, switch_is(InformationClass)]
  1036. PLSAPR_TRUSTED_DOMAIN_INFO TrustedDomainInformation
  1037. );
  1038. NTSTATUS
  1039. LsarDeleteTrustedDomain(
  1040. [in] LSAPR_HANDLE PolicyHandle,
  1041. [in] PLSAPR_SID TrustedDomainSid
  1042. );
  1043. NTSTATUS
  1044. LsarStorePrivateData(
  1045. [in] LSAPR_HANDLE PolicyHandle,
  1046. [in] PLSAPR_UNICODE_STRING KeyName,
  1047. [in,unique] PLSAPR_CR_CIPHER_VALUE EncryptedData
  1048. );
  1049. NTSTATUS
  1050. LsarRetrievePrivateData(
  1051. [in] LSAPR_HANDLE PolicyHandle,
  1052. [in] PLSAPR_UNICODE_STRING KeyName,
  1053. [in, out] PLSAPR_CR_CIPHER_VALUE *EncryptedData
  1054. );
  1055. NTSTATUS
  1056. LsarOpenPolicy2(
  1057. [in,unique,string] PLSAPR_SERVER_NAME SystemName,
  1058. [in] PLSAPR_OBJECT_ATTRIBUTES ObjectAttributes,
  1059. [in] ACCESS_MASK DesiredAccess,
  1060. [out] LSAPR_HANDLE *PolicyHandle
  1061. );
  1062. NTSTATUS
  1063. LsarGetUserName(
  1064. [in,unique,string] PLSAPR_SERVER_NAME SystemName,
  1065. [in,out] PLSAPR_UNICODE_STRING * UserName,
  1066. [in,out,unique] PLSAPR_UNICODE_STRING * DomainName
  1067. );
  1068. NTSTATUS
  1069. LsarQueryInformationPolicy2(
  1070. [in] LSAPR_HANDLE PolicyHandle,
  1071. [in] POLICY_INFORMATION_CLASS InformationClass,
  1072. [out, switch_is(InformationClass)]
  1073. PLSAPR_POLICY_INFORMATION *PolicyInformation
  1074. );
  1075. NTSTATUS
  1076. LsarSetInformationPolicy2(
  1077. [in] LSAPR_HANDLE PolicyHandle,
  1078. [in] POLICY_INFORMATION_CLASS InformationClass,
  1079. [in, switch_is(InformationClass)]
  1080. PLSAPR_POLICY_INFORMATION PolicyInformation
  1081. );
  1082. NTSTATUS
  1083. LsarQueryTrustedDomainInfoByName(
  1084. [in] LSAPR_HANDLE PolicyHandle,
  1085. [in] PLSAPR_UNICODE_STRING TrustedDomainName,
  1086. [in] TRUSTED_INFORMATION_CLASS InformationClass,
  1087. [out, switch_is(InformationClass)]
  1088. PLSAPR_TRUSTED_DOMAIN_INFO *TrustedDomainInformation
  1089. );
  1090. NTSTATUS
  1091. LsarSetTrustedDomainInfoByName(
  1092. [in] LSAPR_HANDLE PolicyHandle,
  1093. [in] PLSAPR_UNICODE_STRING TrustedDomainName,
  1094. [in] TRUSTED_INFORMATION_CLASS InformationClass,
  1095. [in, switch_is(InformationClass)]
  1096. PLSAPR_TRUSTED_DOMAIN_INFO TrustedDomainInformation
  1097. );
  1098. NTSTATUS
  1099. LsarEnumerateTrustedDomainsEx(
  1100. [in] LSAPR_HANDLE PolicyHandle,
  1101. [in, out] PLSA_ENUMERATION_HANDLE EnumerationContext,
  1102. [out] PLSAPR_TRUSTED_ENUM_BUFFER_EX EnumerationBuffer,
  1103. [in] ULONG PreferedMaximumLength
  1104. );
  1105. NTSTATUS
  1106. LsarCreateTrustedDomainEx(
  1107. [in] LSAPR_HANDLE PolicyHandle,
  1108. [in] PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX TrustedDomainInformation,
  1109. [in] PLSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION AuthenticationInformation,
  1110. [in] ACCESS_MASK DesiredAccess,
  1111. [out] LSAPR_HANDLE *TrustedDomainHandle
  1112. );
  1113. NTSTATUS
  1114. LsarSetPolicyReplicationHandle(
  1115. [in, out] PLSAPR_HANDLE PolicyHandle
  1116. );
  1117. NTSTATUS
  1118. LsarQueryDomainInformationPolicy(
  1119. [in] LSAPR_HANDLE PolicyHandle,
  1120. [in] POLICY_DOMAIN_INFORMATION_CLASS InformationClass,
  1121. [out, switch_is(InformationClass)]
  1122. PLSAPR_POLICY_DOMAIN_INFORMATION *PolicyDomainInformation
  1123. );
  1124. NTSTATUS
  1125. LsarSetDomainInformationPolicy(
  1126. [in] LSAPR_HANDLE PolicyHandle,
  1127. [in] POLICY_DOMAIN_INFORMATION_CLASS InformationClass,
  1128. [in, unique, switch_is(InformationClass)]
  1129. PLSAPR_POLICY_DOMAIN_INFORMATION PolicyDomainInformation
  1130. );
  1131. NTSTATUS
  1132. LsarOpenTrustedDomainByName(
  1133. [in] LSAPR_HANDLE PolicyHandle,
  1134. [in] PLSAPR_UNICODE_STRING TrustedDomainName,
  1135. [in] ACCESS_MASK DesiredAccess,
  1136. [out] LSAPR_HANDLE *TrustedDomainHandle
  1137. );
  1138. ////////////////////////////////////////////////////////////////////////////
  1139. // //
  1140. // BEGIN INTERNAL TEST ROUTINES ONLY - These are used for testing the //
  1141. // LsaI* APIs. DO NOT EXPORT. They can be moved around at will //
  1142. // //
  1143. ////////////////////////////////////////////////////////////////////////////
  1144. NTSTATUS
  1145. LsaITestCall(
  1146. [in] LSAPR_HANDLE PolicyHandle,
  1147. [in] LSAPR_TEST_INTERNAL_ROUTINES Call,
  1148. [in] PLSAPR_TEST_INTERNAL_ARG_LIST InputArgs,
  1149. [out] PLSAPR_TEST_INTERNAL_ARG_LIST *OuputArgs
  1150. );
  1151. ////////////////////////////////////////////////////////////////////////////
  1152. // //
  1153. // END INTERNAL TEST ROUTINES ONLY //
  1154. // //
  1155. ////////////////////////////////////////////////////////////////////////////
  1156. NTSTATUS
  1157. LsarLookupSids2(
  1158. [in] LSAPR_HANDLE PolicyHandle,
  1159. [in] PLSAPR_SID_ENUM_BUFFER SidEnumBuffer,
  1160. [out] PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
  1161. [in, out] PLSAPR_TRANSLATED_NAMES_EX TranslatedNames,
  1162. [in] LSAP_LOOKUP_LEVEL LookupLevel,
  1163. [in, out] PULONG MappedCount,
  1164. [in] ULONG LookupOptions,
  1165. [in] ULONG ClientRevision
  1166. );
  1167. NTSTATUS
  1168. LsarLookupNames2(
  1169. [in] LSAPR_HANDLE PolicyHandle,
  1170. [in] ULONG Count,
  1171. [in, size_is(Count)] PLSAPR_UNICODE_STRING Names,
  1172. [out] PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
  1173. [in, out] PLSAPR_TRANSLATED_SIDS_EX TranslatedSids,
  1174. [in] LSAP_LOOKUP_LEVEL LookupLevel,
  1175. [in, out] PULONG MappedCount,
  1176. [in] ULONG LookupOptions,
  1177. [in] ULONG ClientRevision
  1178. );
  1179. NTSTATUS
  1180. LsarCreateTrustedDomainEx2(
  1181. [in] LSAPR_HANDLE PolicyHandle,
  1182. [in] PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX TrustedDomainInformation,
  1183. [in] PLSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION_INTERNAL AuthenticationInformation,
  1184. [in] ACCESS_MASK DesiredAccess,
  1185. [out] LSAPR_HANDLE *TrustedDomainHandle
  1186. );
  1187. //
  1188. // Credential Management API
  1189. //
  1190. NTSTATUS
  1191. CredrWrite(
  1192. [in,unique,string] PLSAPR_SERVER_NAME ServerName,
  1193. [in] PENCRYPTED_CREDENTIALW Credential,
  1194. [in] ULONG Flags
  1195. );
  1196. NTSTATUS
  1197. CredrRead(
  1198. [in,unique,string] PLSAPR_SERVER_NAME ServerName,
  1199. [in, string] wchar_t * TargetName,
  1200. [in] ULONG Type,
  1201. [in] ULONG Flags,
  1202. [out] PENCRYPTED_CREDENTIALW *Credential
  1203. );
  1204. typedef PENCRYPTED_CREDENTIALW *PPENCRYPTED_CREDENTIALW;
  1205. typedef struct _CREDENTIAL_ARRAY {
  1206. ULONG CredentialCount;
  1207. [unique, size_is(CredentialCount)] PPENCRYPTED_CREDENTIALW Credentials;
  1208. } CREDENTIAL_ARRAY, *PCREDENTIAL_ARRAY;
  1209. NTSTATUS
  1210. CredrEnumerate(
  1211. [in,unique,string] PLSAPR_SERVER_NAME ServerName,
  1212. [in, unique, string] wchar_t * Filter,
  1213. [in] ULONG Flags,
  1214. [out] PCREDENTIAL_ARRAY CredentialArray
  1215. );
  1216. NTSTATUS
  1217. CredrWriteDomainCredentials(
  1218. [in,unique,string] PLSAPR_SERVER_NAME ServerName,
  1219. [in] PCREDENTIAL_TARGET_INFORMATIONW TargetInfo,
  1220. [in] PENCRYPTED_CREDENTIALW Credential,
  1221. [in] ULONG Flags
  1222. );
  1223. NTSTATUS
  1224. CredrReadDomainCredentials(
  1225. [in,unique,string] PLSAPR_SERVER_NAME ServerName,
  1226. [in] PCREDENTIAL_TARGET_INFORMATIONW TargetInfo,
  1227. [in] ULONG Flags,
  1228. [out] PCREDENTIAL_ARRAY CredentialArray
  1229. );
  1230. NTSTATUS
  1231. CredrDelete(
  1232. [in,unique,string] PLSAPR_SERVER_NAME ServerName,
  1233. [in, string] wchar_t * TargetName,
  1234. [in] ULONG Type,
  1235. [in] ULONG Flags
  1236. );
  1237. NTSTATUS
  1238. CredrGetTargetInfo(
  1239. [in,unique,string] PLSAPR_SERVER_NAME ServerName,
  1240. [in, string] wchar_t * TargetName,
  1241. [in] ULONG Flags,
  1242. [out] PCREDENTIAL_TARGET_INFORMATIONW *TargetInfo
  1243. );
  1244. NTSTATUS
  1245. CredrProfileLoaded(
  1246. [in,unique,string] PLSAPR_SERVER_NAME ServerName
  1247. );
  1248. //
  1249. // New lookup API to support returning SIDs
  1250. //
  1251. NTSTATUS
  1252. LsarLookupNames3(
  1253. [in] LSAPR_HANDLE PolicyHandle,
  1254. [in] ULONG Count,
  1255. [in, size_is(Count)] PLSAPR_UNICODE_STRING Names,
  1256. [out] PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
  1257. [in, out] PLSAPR_TRANSLATED_SIDS_EX2 TranslatedSids,
  1258. [in] LSAP_LOOKUP_LEVEL LookupLevel,
  1259. [in, out] PULONG MappedCount,
  1260. [in] ULONG LookupOptions,
  1261. [in] ULONG ClientRevision
  1262. );
  1263. NTSTATUS
  1264. CredrGetSessionTypes(
  1265. [in,unique,string] PLSAPR_SERVER_NAME ServerName,
  1266. [in] ULONG MaximumPersistCount,
  1267. [out,size_is(MaximumPersistCount)] ULONG *MaximumPersist
  1268. );
  1269. ////////////////////////////////////////////////////////////////////////////
  1270. //
  1271. // Generic Auditing Support
  1272. //
  1273. ////////////////////////////////////////////////////////////////////////////
  1274. NTSTATUS
  1275. LsarRegisterAuditEvent(
  1276. [in] PAUTHZ_AUDIT_EVENT_TYPE_OLD pAuditEventType,
  1277. [out] AUDIT_HANDLE* phAuditContext
  1278. );
  1279. NTSTATUS
  1280. LsarGenAuditEvent(
  1281. [in] AUDIT_HANDLE hAuditContext,
  1282. [in] DWORD Flags,
  1283. [in] AUDIT_PARAMS* pAuditParams
  1284. );
  1285. NTSTATUS
  1286. LsarUnregisterAuditEvent(
  1287. [in,out] AUDIT_HANDLE* phAuditContext
  1288. );
  1289. ////////////////////////////////////////////////////////////////////////////
  1290. //
  1291. // End of Generic Auditing Support
  1292. //
  1293. ////////////////////////////////////////////////////////////////////////////
  1294. ////////////////////////////////////////////////////////////////////////////
  1295. //
  1296. // Forest trust support
  1297. //
  1298. ////////////////////////////////////////////////////////////////////////////
  1299. NTSTATUS
  1300. LsarQueryForestTrustInformation(
  1301. [in] LSAPR_HANDLE PolicyHandle,
  1302. [in] PLSA_UNICODE_STRING TrustedDomainName,
  1303. [in] LSA_FOREST_TRUST_RECORD_TYPE HighestRecordType,
  1304. [out] PLSA_FOREST_TRUST_INFORMATION * ForestTrustInfo
  1305. );
  1306. NTSTATUS
  1307. LsarSetForestTrustInformation(
  1308. [in] LSAPR_HANDLE PolicyHandle,
  1309. [in] PLSA_UNICODE_STRING TrustedDomainName,
  1310. [in] LSA_FOREST_TRUST_RECORD_TYPE HighestRecordType,
  1311. [in] PLSA_FOREST_TRUST_INFORMATION ForestTrustInfo,
  1312. [in] BOOLEAN CheckOnly,
  1313. [out] PLSA_FOREST_TRUST_COLLISION_INFORMATION * CollisionInfo
  1314. );
  1315. ////////////////////////////////////////////////////////////////////////////
  1316. //
  1317. // End of forest trust support
  1318. //
  1319. ////////////////////////////////////////////////////////////////////////////
  1320. NTSTATUS
  1321. CredrRename(
  1322. [in,unique,string] PLSAPR_SERVER_NAME ServerName,
  1323. [in, string] wchar_t * OldTargetName,
  1324. [in, string] wchar_t * NewTargetName,
  1325. [in] ULONG Type,
  1326. [in] ULONG Flags
  1327. );
  1328. NTSTATUS
  1329. LsarLookupSids3(
  1330. [in] handle_t RpcHandle,
  1331. [in] PLSAPR_SID_ENUM_BUFFER SidEnumBuffer,
  1332. [out] PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
  1333. [in, out] PLSAPR_TRANSLATED_NAMES_EX TranslatedNames,
  1334. [in] LSAP_LOOKUP_LEVEL LookupLevel,
  1335. [in, out] PULONG MappedCount,
  1336. [in] ULONG LookupOptions,
  1337. [in] ULONG ClientRevision
  1338. );
  1339. NTSTATUS
  1340. LsarLookupNames4(
  1341. [in] handle_t RpcHandle,
  1342. [in] ULONG Count,
  1343. [in, size_is(Count)] PLSAPR_UNICODE_STRING Names,
  1344. [out] PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
  1345. [in, out] PLSAPR_TRANSLATED_SIDS_EX2 TranslatedSids,
  1346. [in] LSAP_LOOKUP_LEVEL LookupLevel,
  1347. [in, out] PULONG MappedCount,
  1348. [in] ULONG LookupOptions,
  1349. [in] ULONG ClientRevision
  1350. );
  1351. ////////////////////////////////////////////////////////////////////////////
  1352. //
  1353. // LSA/SCE synchronization support
  1354. //
  1355. ////////////////////////////////////////////////////////////////////////////
  1356. NTSTATUS
  1357. LsarOpenPolicySce(
  1358. [in,unique] PLSAPR_SERVER_NAME SystemName,
  1359. [in] PLSAPR_OBJECT_ATTRIBUTES ObjectAttributes,
  1360. [in] ACCESS_MASK DesiredAccess,
  1361. [out] LSAPR_HANDLE *PolicyHandle
  1362. );
  1363. //
  1364. // Insert new RPC interfaces before this line,
  1365. // so LsarForestTrustFindMatch can be re-enabled
  1366. // in private builds at later times
  1367. //
  1368. // #define TESTING_MATCHING_ROUTINE
  1369. #ifdef TESTING_MATCHING_ROUTINE
  1370. NTSTATUS
  1371. LsarForestTrustFindMatch(
  1372. [in] LSAPR_HANDLE PolicyHandle,
  1373. [in] ULONG Type,
  1374. [in] PLSA_UNICODE_STRING Name,
  1375. [out] PLSA_UNICODE_STRING *Match
  1376. );
  1377. #endif
  1378. }