Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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