4 lsa interface definition
7 [ uuid("12345778-1234-abcd-ef00-0123456789ab"),
9 endpoint("ncacn_np:[\\pipe\\lsarpc]","ncacn_np:[\\pipe\\lsass]", "ncacn_ip_tcp:", "ncalrpc:"),
10 pointer_default(unique),
11 helpstring("Local Security Authority"),
18 [in,out,ref] policy_handle *handle
25 [in,ref] policy_handle *handle
33 [value(2*strlen_m(r->string))] uint16 length;
34 [value(r->length)] uint16 size;
35 unistr_noterm *string;
50 [size_is(count)] lsa_PrivEntry *privs;
53 NTSTATUS lsa_EnumPrivs (
54 [in,ref] policy_handle *handle,
55 [in,out,ref] uint32 *resume_handle,
56 [in] uint32 max_count,
57 [out,ref] lsa_PrivArray *privs
63 NTSTATUS lsa_QuerySecurity (
64 [in,ref] policy_handle *handle,
66 [out] sec_desc_buf *sdbuf
72 NTSTATUS lsa_SetSecObj ();
77 NTSTATUS lsa_ChangePassword ();
83 uint32 len; /* ignored */
84 uint16 impersonation_level;
90 uint32 len; /* ignored */
94 security_descriptor *sec_desc;
96 } lsa_ObjectAttribute;
98 /* notice the screwup with the system_name - thats why MS created
100 NTSTATUS lsa_OpenPolicy (
101 [in] uint16 *system_name,
102 [in,ref] lsa_ObjectAttribute *attr,
103 [in] uint32 access_mask,
104 [out,ref] policy_handle *handle
115 NTTIME retention_time;
116 uint8 shutdown_in_progress;
117 NTTIME time_to_shutdown;
118 uint32 next_audit_record;
123 uint32 auditing_mode;
124 [size_is(count)] uint32 *settings;
126 } lsa_AuditEventsInfo;
138 uint16 unknown; /* an midl padding bug? */
145 } lsa_ReplicaSourceInfo;
149 uint32 non_paged_pool;
154 } lsa_DefaultQuotaInfo;
158 NTTIME db_create_time;
159 } lsa_ModificationInfo;
162 uint8 shutdown_on_full;
163 } lsa_AuditFullSetInfo;
166 uint16 unknown; /* an midl padding bug? */
167 uint8 shutdown_on_full;
169 } lsa_AuditFullQueryInfo;
173 lsa_String dns_domain;
174 lsa_String dns_forest;
180 LSA_POLICY_INFO_AUDIT_LOG=1,
181 LSA_POLICY_INFO_AUDIT_EVENTS=2,
182 LSA_POLICY_INFO_DOMAIN=3,
183 LSA_POLICY_INFO_PD=4,
184 LSA_POLICY_INFO_ACCOUNT_DOMAIN=5,
185 LSA_POLICY_INFO_ROLE=6,
186 LSA_POLICY_INFO_REPLICA=7,
187 LSA_POLICY_INFO_QUOTA=8,
188 LSA_POLICY_INFO_DB=9,
189 LSA_POLICY_INFO_AUDIT_FULL_SET=10,
190 LSA_POLICY_INFO_AUDIT_FULL_QUERY=11,
191 LSA_POLICY_INFO_DNS=12
195 [case(LSA_POLICY_INFO_AUDIT_LOG)] lsa_AuditLogInfo audit_log;
196 [case(LSA_POLICY_INFO_AUDIT_EVENTS)] lsa_AuditEventsInfo audit_events;
197 [case(LSA_POLICY_INFO_DOMAIN)] lsa_DomainInfo domain;
198 [case(LSA_POLICY_INFO_PD)] lsa_PDAccountInfo pd;
199 [case(LSA_POLICY_INFO_ACCOUNT_DOMAIN)] lsa_DomainInfo account_domain;
200 [case(LSA_POLICY_INFO_ROLE)] lsa_ServerRole role;
201 [case(LSA_POLICY_INFO_REPLICA)] lsa_ReplicaSourceInfo replica;
202 [case(LSA_POLICY_INFO_QUOTA)] lsa_DefaultQuotaInfo quota;
203 [case(LSA_POLICY_INFO_DB)] lsa_ModificationInfo db;
204 [case(LSA_POLICY_INFO_AUDIT_FULL_SET)] lsa_AuditFullSetInfo auditfullset;
205 [case(LSA_POLICY_INFO_AUDIT_FULL_QUERY)] lsa_AuditFullQueryInfo auditfullquery;
206 [case(LSA_POLICY_INFO_DNS)] lsa_DnsDomainInfo dns;
207 } lsa_PolicyInformation;
209 NTSTATUS lsa_QueryInfoPolicy (
210 [in,ref] policy_handle *handle,
212 [out,switch_is(level)] lsa_PolicyInformation *info
217 NTSTATUS lsa_SetInfoPolicy ();
221 NTSTATUS lsa_ClearAuditLog ();
225 NTSTATUS lsa_CreateAccount (
226 [in,ref] policy_handle *handle,
227 [in,ref] dom_sid2 *sid,
228 [in] uint32 access_mask,
229 [out,ref] policy_handle *acct_handle
233 /* NOTE: This only returns accounts that have at least
241 typedef [public] struct {
242 [range(0,1000)] uint32 num_sids;
243 [size_is(num_sids)] lsa_SidPtr *sids;
246 NTSTATUS lsa_EnumAccounts (
247 [in,ref] policy_handle *handle,
248 [in,out,ref] uint32 *resume_handle,
249 [in,range(0,8192)] uint32 num_entries,
250 [out,ref] lsa_SidArray *sids
254 /*************************************************/
260 } lsa_TrustInformation;
262 NTSTATUS lsa_CreateTrustedDomain(
263 [in,ref] policy_handle *handle,
264 [in,ref] lsa_TrustInformation *info,
265 [in] uint32 access_mask,
266 [out,ref] policy_handle *trustdom_handle
273 /* w2k3 treats max_size as max_domains*60 */
274 const int LSA_ENUM_TRUST_DOMAIN_MULTIPLIER = 60;
279 } lsa_DomainInformation;
283 [size_is(count)] lsa_DomainInformation *domains;
286 NTSTATUS lsa_EnumTrustDom (
287 [in,ref] policy_handle *handle,
288 [in,out,ref] uint32 *resume_handle,
289 [in,range(0,1000)] uint32 max_size,
290 [out,ref] lsa_DomainList *domains
297 SID_NAME_USE_NONE = 0,/* NOTUSED */
298 SID_NAME_USER = 1, /* user */
299 SID_NAME_DOM_GRP = 2, /* domain group */
300 SID_NAME_DOMAIN = 3, /* domain: don't know what this is */
301 SID_NAME_ALIAS = 4, /* local group */
302 SID_NAME_WKN_GRP = 5, /* well-known group */
303 SID_NAME_DELETED = 6, /* deleted account: needed for c2 rating */
304 SID_NAME_INVALID = 7, /* invalid account */
305 SID_NAME_UNKNOWN = 8 /* oops. */
309 lsa_SidType sid_type;
315 [range(0,1000)] uint32 count;
316 [size_is(count)] lsa_TranslatedSid *sids;
320 [range(0,1000)] uint32 count;
321 [size_is(count)] lsa_TrustInformation *domains;
325 NTSTATUS lsa_LookupNames (
326 [in,ref] policy_handle *handle,
327 [in,range(0,1000)] uint32 num_names,
328 [in,ref,size_is(num_names)] lsa_String *names,
329 [out] lsa_RefDomainList *domains,
330 [in,out,ref] lsa_TransSidArray *sids,
332 [in,out,ref] uint32 *count
340 lsa_SidType sid_type;
343 } lsa_TranslatedName;
346 [range(0,1000)] uint32 count;
347 [size_is(count)] lsa_TranslatedName *names;
348 } lsa_TransNameArray;
350 NTSTATUS lsa_LookupSids (
351 [in,ref] policy_handle *handle,
352 [in,ref] lsa_SidArray *sids,
353 [out] lsa_RefDomainList *domains,
354 [in,out,ref] lsa_TransNameArray *names,
356 [in,out,ref] uint32 *count
361 NTSTATUS lsa_CreateSecret(
362 [in,ref] policy_handle *handle,
363 [in] lsa_String name,
364 [in] uint32 access_mask,
365 [out,ref] policy_handle *sec_handle
369 /*****************************************/
371 NTSTATUS lsa_OpenAccount (
372 [in,ref] policy_handle *handle,
373 [in,ref] dom_sid2 *sid,
374 [in] uint32 access_mask,
375 [out,ref] policy_handle *acct_handle
379 /****************************************/
388 [range(0,1000)] uint32 count;
390 [size_is(count)] lsa_LUIDAttribute set[*];
393 NTSTATUS lsa_EnumPrivsAccount (
394 [in,ref] policy_handle *handle,
395 [out] lsa_PrivilegeSet *privs
399 /****************************************/
401 NTSTATUS lsa_AddPrivilegesToAccount(
402 [in,ref] policy_handle *handle,
403 [in,ref] lsa_PrivilegeSet *privs
407 /****************************************/
409 NTSTATUS lsa_RemovePrivilegesFromAccount(
410 [in,ref] policy_handle *handle,
411 [in] uint8 remove_all,
412 [in] lsa_PrivilegeSet *privs
416 NTSTATUS lsa_GetQuotasForAccount();
419 NTSTATUS lsa_SetQuotasForAccount();
422 NTSTATUS lsa_GetSystemAccessAccount();
424 NTSTATUS lsa_SetSystemAccessAccount();
427 NTSTATUS lsa_OpenTrustedDomain(
428 [in,ref] policy_handle *handle,
429 [in,ref] dom_sid2 *sid,
430 [in] uint32 access_mask,
431 [out,ref] policy_handle *trustdom_handle
434 typedef [flag(NDR_PAHEX)] struct {
437 [size_is(size),length_is(length)] uint8 *data;
440 typedef [flag(NDR_PAHEX)] struct {
442 [size_is(size)] uint8 *data;
446 LSA_TRUSTED_DOMAIN_INFO_NAME=1,
447 LSA_TRUSTED_DOMAIN_INFO_2=2,
448 LSA_TRUSTED_DOMAIN_INFO_FLAGS=3,
449 LSA_TRUSTED_DOMAIN_INFO_PASSWORD=4,
450 LSA_TRUSTED_DOMAIN_INFO_5=5,
451 LSA_TRUSTED_DOMAIN_INFO_INFO_EX=6,
452 LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO=7,
453 LSA_TRUSTED_DOMAIN_INFO_FULL_INFO=8,
454 LSA_TRUSTED_DOMAIN_INFO_INFO_ALL=12
455 } lsa_TrustDomInfoEnum;
458 lsa_String netbios_name;
459 } lsa_TrustDomainInfoName;
463 } lsa_TrustDomainInfoFlags;
466 lsa_DATA_BUF *password;
467 lsa_DATA_BUF *old_password;
468 } lsa_TrustDomainInfoPassword;
471 lsa_String netbios_name;
473 } lsa_TrustDomainInfo5;
476 lsa_String domain_name;
477 lsa_String netbios_name;
482 } lsa_TrustDomainInfoInfoEx;
488 } lsa_TrustDomainInfoBuffer;
492 lsa_TrustDomainInfoBuffer *buff1;
493 lsa_TrustDomainInfoBuffer *buff2;
495 lsa_TrustDomainInfoBuffer *buff3;
496 lsa_TrustDomainInfoBuffer *buff4;
497 } lsa_TrustDomainInfoAuthInfo;
500 lsa_TrustDomainInfoInfoEx info_ex;
501 lsa_TrustDomainInfoFlags flags;
502 lsa_TrustDomainInfoAuthInfo auth_info;
503 } lsa_TrustDomainInfoFullInfo;
506 lsa_TrustDomainInfoInfoEx info_ex;
508 } lsa_TrustDomainInfo11;
511 lsa_TrustDomainInfoInfoEx info_ex;
513 lsa_TrustDomainInfoFlags flags;
514 lsa_TrustDomainInfoAuthInfo auth_info;
515 } lsa_TrustDomainInfoInfoAll;
518 [case(LSA_TRUSTED_DOMAIN_INFO_NAME)] lsa_TrustDomainInfoName name;
519 [case(LSA_TRUSTED_DOMAIN_INFO_FLAGS)] lsa_TrustDomainInfoFlags flags;
520 [case(LSA_TRUSTED_DOMAIN_INFO_PASSWORD)] lsa_TrustDomainInfoPassword password;
521 [case(LSA_TRUSTED_DOMAIN_INFO_5)] lsa_TrustDomainInfo5 info5;
522 [case(LSA_TRUSTED_DOMAIN_INFO_INFO_EX)] lsa_TrustDomainInfoInfoEx info_ex;
523 [case(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO)] lsa_TrustDomainInfoAuthInfo auth_info;
524 [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO)] lsa_TrustDomainInfoFullInfo full_info;
525 [case(11)] lsa_TrustDomainInfo11 info11;
526 [case(LSA_TRUSTED_DOMAIN_INFO_INFO_ALL)] lsa_TrustDomainInfoInfoAll info_all;
527 } lsa_TrustedDomainInfo;
530 NTSTATUS lsa_QueryTrustedDomainInfo(
531 [in,ref] policy_handle *trustdom_handle,
533 [out,switch_is(level)] lsa_TrustedDomainInfo *info
537 NTSTATUS lsa_SetInformationTrustedDomain();
540 NTSTATUS lsa_OpenSecret(
541 [in,ref] policy_handle *handle,
542 [in] lsa_String name,
543 [in] uint32 access_mask,
544 [out,ref] policy_handle *sec_handle
549 NTSTATUS lsa_SetSecret(
550 [in,ref] policy_handle *sec_handle,
551 [in] lsa_DATA_BUF *new_val,
552 [in] lsa_DATA_BUF *old_val
560 NTSTATUS lsa_QuerySecret (
561 [in,ref] policy_handle *sec_handle,
562 [in,out] lsa_DATA_BUF_PTR *new_val,
563 [in,out] NTTIME_hyper *new_mtime,
564 [in,out] lsa_DATA_BUF_PTR *old_val,
565 [in,out] NTTIME_hyper *old_mtime
569 NTSTATUS lsa_LookupPrivValue(
570 [in,ref] policy_handle *handle,
571 [in,ref] lsa_String *name,
572 [out,ref] lsa_LUID *luid
577 NTSTATUS lsa_LookupPrivName (
578 [in,ref] policy_handle *handle,
579 [in,ref] lsa_LUID *luid,
580 [out] lsa_String *name
584 /*******************/
586 NTSTATUS lsa_LookupPrivDisplayName (
587 [in,ref] policy_handle *handle,
588 [in,ref] lsa_String *name,
589 [out] lsa_String *disp_name,
590 /* see http://www.microsoft.com/globaldev/nlsweb/ for
591 language definitions */
592 [in,out,ref] uint16 *language_id,
597 NTSTATUS lsa_DeleteObject();
600 /*******************/
602 NTSTATUS lsa_EnumAccountsWithUserRight (
603 [in,ref] policy_handle *handle,
604 [in] lsa_String *name,
605 [out,ref] lsa_SidArray *sids
611 } lsa_RightAttribute;
615 [size_is(count)] lsa_String *names;
618 NTSTATUS lsa_EnumAccountRights (
619 [in,ref] policy_handle *handle,
620 [in,ref] dom_sid2 *sid,
621 [out,ref] lsa_RightSet *rights
625 /**********************/
627 NTSTATUS lsa_AddAccountRights (
628 [in,ref] policy_handle *handle,
629 [in,ref] dom_sid2 *sid,
630 [in,ref] lsa_RightSet *rights
633 /**********************/
635 NTSTATUS lsa_RemoveAccountRights (
636 [in,ref] policy_handle *handle,
637 [in,ref] dom_sid2 *sid,
639 [in,ref] lsa_RightSet *rights
643 NTSTATUS lsa_QueryTrustedDomainInfoBySid(
644 [in,ref] policy_handle *handle,
645 [in,ref] dom_sid2 *dom_sid,
647 [out,switch_is(level)] lsa_TrustedDomainInfo *info
651 NTSTATUS lsa_SetTrustDomainInfo();
653 NTSTATUS lsa_DeleteTrustDomain();
655 NTSTATUS lsa_StorePrivateData();
657 NTSTATUS lsa_RetrievePrivateData();
660 /**********************/
662 NTSTATUS lsa_OpenPolicy2 (
663 [in] unistr *system_name,
664 [in,ref] lsa_ObjectAttribute *attr,
665 [in] uint32 access_mask,
666 [out,ref] policy_handle *handle
669 /**********************/
675 NTSTATUS lsa_GetUserName(
676 [in] unistr *system_name,
677 [in,out] lsa_String *account_name,
678 [in,out] lsa_StringPointer *authority_name
681 /**********************/
684 NTSTATUS lsa_QueryInfoPolicy2(
685 [in,ref] policy_handle *handle,
687 [out,switch_is(level)] lsa_PolicyInformation *info
691 NTSTATUS lsa_SetInfoPolicy2();
693 /**********************/
695 NTSTATUS lsa_QueryTrustedDomainInfoByName(
696 [in,ref] policy_handle *handle,
697 [in] lsa_String trusted_domain,
699 [out,switch_is(level)] lsa_TrustedDomainInfo *info
703 NTSTATUS lsa_SetTrustedDomainInfoByName();
706 NTSTATUS lsa_EnumTrustedDomainsEx();
709 NTSTATUS lsa_CreateTrustedDomainEx();
712 NTSTATUS lsa_CloseTrustedDomainEx();
715 NTSTATUS lsa_QueryDomainInformationPolicy();
718 NTSTATUS lsa_SetDomInfoPolicy();
720 /**********************/
722 NTSTATUS lsa_OpenTrustedDomainByName(
723 [in,ref] policy_handle *handle,
724 [in] lsa_String name,
725 [in] uint32 access_mask,
726 [out,ref] policy_handle *trustdom_handle
730 NTSTATUS lsa_TestCall();
732 /**********************/
736 lsa_SidType sid_type;
740 } lsa_TranslatedName2;
743 [range(0,1000)] uint32 count;
744 [size_is(count)] lsa_TranslatedName2 *names;
745 } lsa_TransNameArray2;
747 NTSTATUS lsa_LookupSids2(
748 [in,ref] policy_handle *handle,
749 [in,ref] lsa_SidArray *sids,
750 [out] lsa_RefDomainList *domains,
751 [in,out,ref] lsa_TransNameArray2 *names,
753 [in,out,ref] uint32 *count,
754 [in] uint32 unknown1,
758 /**********************/
762 lsa_SidType sid_type;
766 } lsa_TranslatedSid2;
769 [range(0,1000)] uint32 count;
770 [size_is(count)] lsa_TranslatedSid2 *sids;
771 } lsa_TransSidArray2;
773 NTSTATUS lsa_LookupNames2 (
774 [in,ref] policy_handle *handle,
775 [in,range(0,1000)] uint32 num_names,
776 [in,ref,size_is(num_names)] lsa_String *names,
777 [out] lsa_RefDomainList *domains,
778 [in,out,ref] lsa_TransSidArray2 *sids,
780 [in,out,ref] uint32 *count,
781 [in] uint32 unknown1,
786 NTSTATUS lsa_CreateTrustedDomainEx2();
789 NTSTATUS lsa_CREDRWRITE();
792 NTSTATUS lsa_CREDRREAD();
795 NTSTATUS lsa_CREDRENUMERATE();
798 NTSTATUS lsa_CREDRWRITEDOMAINCREDENTIALS();
801 NTSTATUS lsa_CREDRREADDOMAINCREDENTIALS();
804 NTSTATUS lsa_CREDRDELETE();
807 NTSTATUS lsa_CREDRGETTARGETINFO();
810 NTSTATUS lsa_CREDRPROFILELOADED();
812 /**********************/
815 lsa_SidType sid_type;
819 } lsa_TranslatedSid3;
822 [range(0,1000)] uint32 count;
823 [size_is(count)] lsa_TranslatedSid3 *sids;
824 } lsa_TransSidArray3;
826 NTSTATUS lsa_LookupNames3 (
827 [in,ref] policy_handle *handle,
828 [in,range(0,1000)] uint32 num_names,
829 [in,ref,size_is(num_names)] lsa_String *names,
830 [out] lsa_RefDomainList *domains,
831 [in,out,ref] lsa_TransSidArray3 *sids,
833 [in,out,ref] uint32 *count,
834 [in] uint32 unknown1,
839 NTSTATUS lsa_CREDRGETSESSIONTYPES();
842 NTSTATUS lsa_LSARREGISTERAUDITEVENT();
845 NTSTATUS lsa_LSARGENAUDITEVENT();
848 NTSTATUS lsa_LSARUNREGISTERAUDITEVENT();
851 NTSTATUS lsa_LSARQUERYFORESTTRUSTINFORMATION();
854 NTSTATUS lsa_LSARSETFORESTTRUSTINFORMATION();
857 NTSTATUS lsa_CREDRRENAME();
862 NTSTATUS lsa_LookupSids3(
863 [in,ref] lsa_SidArray *sids,
864 [out] lsa_RefDomainList *domains,
865 [in,out,ref] lsa_TransNameArray2 *names,
867 [in,out,ref] uint32 *count,
868 [in] uint32 unknown1,
873 NTSTATUS lsa_LSARLOOKUPNAMES4();
876 NTSTATUS lsa_LSAROPENPOLICYSCE();
879 NTSTATUS lsa_LSARADTREGISTERSECURITYEVENTSOURCE();
882 NTSTATUS lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE();
885 NTSTATUS lsa_LSARADTREPORTSECURITYEVENT();