2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: Local Security Authority (LSA) Server
4 * FILE: reactos/dll/win32/lsasrv/lsarpc.h
5 * PURPOSE: RPC interface functions
7 * PROGRAMMERS: Eric Kohl
10 /* INCLUDES ****************************************************************/
14 WINE_DEFAULT_DEBUG_CHANNEL(lsasrv
);
17 /* GLOBALS *****************************************************************/
19 static RTL_CRITICAL_SECTION PolicyHandleTableLock
;
22 /* FUNCTIONS ***************************************************************/
25 LsarStartRpcServer(VOID
)
29 RtlInitializeCriticalSection(&PolicyHandleTableLock
);
31 TRACE("LsarStartRpcServer() called\n");
33 Status
= RpcServerUseProtseqEpW(L
"ncacn_np",
37 if (Status
!= RPC_S_OK
)
39 WARN("RpcServerUseProtseqEpW() failed (Status %lx)\n", Status
);
43 Status
= RpcServerRegisterIf(lsarpc_v0_0_s_ifspec
,
46 if (Status
!= RPC_S_OK
)
48 WARN("RpcServerRegisterIf() failed (Status %lx)\n", Status
);
52 Status
= RpcServerListen(1, 20, TRUE
);
53 if (Status
!= RPC_S_OK
)
55 WARN("RpcServerListen() failed (Status %lx)\n", Status
);
59 TRACE("LsarStartRpcServer() done\n");
63 void __RPC_USER
LSAPR_HANDLE_rundown(LSAPR_HANDLE hHandle
)
70 NTSTATUS WINAPI
LsarClose(
71 LSAPR_HANDLE
*ObjectHandle
)
73 PLSA_DB_OBJECT DbObject
;
74 NTSTATUS Status
= STATUS_SUCCESS
;
76 TRACE("0x%p\n", ObjectHandle
);
78 // RtlEnterCriticalSection(&PolicyHandleTableLock);
80 Status
= LsapValidateDbObject(*ObjectHandle
,
84 if (Status
== STATUS_SUCCESS
)
86 Status
= LsapCloseDbObject(DbObject
);
90 // RtlLeaveCriticalSection(&PolicyHandleTableLock);
97 NTSTATUS WINAPI
LsarDelete(
98 LSAPR_HANDLE ObjectHandle
)
100 return LsarDeleteObject(&ObjectHandle
);
105 NTSTATUS WINAPI
LsarEnumeratePrivileges(
106 LSAPR_HANDLE PolicyHandle
,
107 DWORD
*EnumerationContext
,
108 PLSAPR_PRIVILEGE_ENUM_BUFFER EnumerationBuffer
,
109 DWORD PreferedMaximumLength
)
111 PLSA_DB_OBJECT PolicyObject
;
114 TRACE("LsarEnumeratePrivileges(%p %p %p %lu)\n",
115 PolicyHandle
, EnumerationContext
, EnumerationBuffer
,
116 PreferedMaximumLength
);
118 Status
= LsapValidateDbObject(PolicyHandle
,
120 POLICY_VIEW_LOCAL_INFORMATION
,
122 if (!NT_SUCCESS(Status
))
125 if (EnumerationContext
== NULL
)
126 return STATUS_INVALID_PARAMETER
;
128 return LsarpEnumeratePrivileges(EnumerationContext
,
130 PreferedMaximumLength
);
135 NTSTATUS WINAPI
LsarQuerySecurityObject(
136 LSAPR_HANDLE ObjectHandle
,
137 SECURITY_INFORMATION SecurityInformation
,
138 PLSAPR_SR_SECURITY_DESCRIPTOR
*SecurityDescriptor
)
140 PLSA_DB_OBJECT DbObject
= NULL
;
141 PSECURITY_DESCRIPTOR RelativeSd
= NULL
;
142 PLSAPR_SR_SECURITY_DESCRIPTOR SdData
= NULL
;
143 ACCESS_MASK DesiredAccess
= 0;
144 ULONG RelativeSdSize
= 0;
147 if (SecurityDescriptor
== NULL
)
148 return STATUS_INVALID_PARAMETER
;
150 if ((SecurityInformation
& OWNER_SECURITY_INFORMATION
) ||
151 (SecurityInformation
& GROUP_SECURITY_INFORMATION
) ||
152 (SecurityInformation
& DACL_SECURITY_INFORMATION
))
153 DesiredAccess
|= READ_CONTROL
;
155 if (SecurityInformation
& SACL_SECURITY_INFORMATION
)
156 DesiredAccess
|= ACCESS_SYSTEM_SECURITY
;
158 /* Validate the ObjectHandle */
159 Status
= LsapValidateDbObject(ObjectHandle
,
163 if (!NT_SUCCESS(Status
))
166 /* Get the size of the SD */
167 Status
= LsapGetObjectAttribute(DbObject
,
171 if (!NT_SUCCESS(Status
))
174 /* Allocate a buffer for the SD */
175 RelativeSd
= MIDL_user_allocate(RelativeSdSize
);
176 if (RelativeSd
== NULL
)
177 return STATUS_INSUFFICIENT_RESOURCES
;
180 Status
= LsapGetObjectAttribute(DbObject
,
184 if (!NT_SUCCESS(Status
))
188 * FIXME: Invalidate the SD information that was not requested.
189 * (see SecurityInformation)
192 /* Allocate the SD data buffer */
193 SdData
= MIDL_user_allocate(sizeof(LSAPR_SR_SECURITY_DESCRIPTOR
));
196 Status
= STATUS_INSUFFICIENT_RESOURCES
;
200 /* Fill the SD data buffer and return it to the caller */
201 SdData
->Length
= RelativeSdSize
;
202 SdData
->SecurityDescriptor
= (PBYTE
)RelativeSd
;
204 *SecurityDescriptor
= SdData
;
207 if (!NT_SUCCESS(Status
))
209 if (RelativeSd
!= NULL
)
210 MIDL_user_free(RelativeSd
);
218 NTSTATUS WINAPI
LsarSetSecurityObject(
219 LSAPR_HANDLE ObjectHandle
,
220 SECURITY_INFORMATION SecurityInformation
,
221 PLSAPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor
)
224 return STATUS_NOT_IMPLEMENTED
;
229 NTSTATUS WINAPI
LsarChangePassword(
231 PRPC_UNICODE_STRING String1
,
232 PRPC_UNICODE_STRING String2
,
233 PRPC_UNICODE_STRING String3
,
234 PRPC_UNICODE_STRING String4
,
235 PRPC_UNICODE_STRING String5
)
238 return STATUS_NOT_IMPLEMENTED
;
243 NTSTATUS WINAPI
LsarOpenPolicy(
245 PLSAPR_OBJECT_ATTRIBUTES ObjectAttributes
,
246 ACCESS_MASK DesiredAccess
,
247 LSAPR_HANDLE
*PolicyHandle
)
249 PLSA_DB_OBJECT PolicyObject
;
252 TRACE("LsarOpenPolicy called!\n");
254 RtlEnterCriticalSection(&PolicyHandleTableLock
);
256 Status
= LsapOpenDbObject(NULL
,
264 RtlLeaveCriticalSection(&PolicyHandleTableLock
);
266 if (NT_SUCCESS(Status
))
267 *PolicyHandle
= (LSAPR_HANDLE
)PolicyObject
;
269 TRACE("LsarOpenPolicy done!\n");
276 NTSTATUS WINAPI
LsarQueryInformationPolicy(
277 LSAPR_HANDLE PolicyHandle
,
278 POLICY_INFORMATION_CLASS InformationClass
,
279 PLSAPR_POLICY_INFORMATION
*PolicyInformation
)
281 PLSA_DB_OBJECT PolicyObject
;
282 ACCESS_MASK DesiredAccess
= 0;
285 TRACE("LsarQueryInformationPolicy(%p,0x%08x,%p)\n",
286 PolicyHandle
, InformationClass
, PolicyInformation
);
288 if (PolicyInformation
)
290 TRACE("*PolicyInformation %p\n", *PolicyInformation
);
293 switch (InformationClass
)
295 case PolicyAuditLogInformation
:
296 case PolicyAuditEventsInformation
:
297 case PolicyAuditFullQueryInformation
:
298 DesiredAccess
= POLICY_VIEW_AUDIT_INFORMATION
;
301 case PolicyPrimaryDomainInformation
:
302 case PolicyAccountDomainInformation
:
303 case PolicyLsaServerRoleInformation
:
304 case PolicyReplicaSourceInformation
:
305 case PolicyDefaultQuotaInformation
:
306 case PolicyModificationInformation
:
307 case PolicyDnsDomainInformation
:
308 case PolicyDnsDomainInformationInt
:
309 case PolicyLocalAccountDomainInformation
:
310 DesiredAccess
= POLICY_VIEW_LOCAL_INFORMATION
;
313 case PolicyPdAccountInformation
:
314 DesiredAccess
= POLICY_GET_PRIVATE_INFORMATION
;
318 ERR("Invalid InformationClass!\n");
319 return STATUS_INVALID_PARAMETER
;
322 Status
= LsapValidateDbObject(PolicyHandle
,
326 if (!NT_SUCCESS(Status
))
329 switch (InformationClass
)
331 case PolicyAuditLogInformation
: /* 1 */
332 Status
= LsarQueryAuditLog(PolicyObject
,
336 case PolicyAuditEventsInformation
: /* 2 */
337 Status
= LsarQueryAuditEvents(PolicyObject
,
341 case PolicyPrimaryDomainInformation
: /* 3 */
342 Status
= LsarQueryPrimaryDomain(PolicyObject
,
346 case PolicyPdAccountInformation
: /* 4 */
347 Status
= LsarQueryPdAccount(PolicyObject
,
351 case PolicyAccountDomainInformation
: /* 5 */
352 Status
= LsarQueryAccountDomain(PolicyObject
,
356 case PolicyLsaServerRoleInformation
: /* 6 */
357 Status
= LsarQueryServerRole(PolicyObject
,
361 case PolicyReplicaSourceInformation
: /* 7 */
362 Status
= LsarQueryReplicaSource(PolicyObject
,
366 case PolicyDefaultQuotaInformation
: /* 8 */
367 Status
= LsarQueryDefaultQuota(PolicyObject
,
371 case PolicyModificationInformation
: /* 9 */
372 Status
= LsarQueryModification(PolicyObject
,
376 case PolicyAuditFullQueryInformation
: /* 11 (0xB) */
377 Status
= LsarQueryAuditFull(PolicyObject
,
381 case PolicyDnsDomainInformation
: /* 12 (0xC) */
382 Status
= LsarQueryDnsDomain(PolicyObject
,
386 case PolicyDnsDomainInformationInt
: /* 13 (0xD) */
387 Status
= LsarQueryDnsDomainInt(PolicyObject
,
391 case PolicyLocalAccountDomainInformation
: /* 14 (0xE) */
392 Status
= LsarQueryLocalAccountDomain(PolicyObject
,
397 ERR("Invalid InformationClass!\n");
398 Status
= STATUS_INVALID_PARAMETER
;
406 NTSTATUS WINAPI
LsarSetInformationPolicy(
407 LSAPR_HANDLE PolicyHandle
,
408 POLICY_INFORMATION_CLASS InformationClass
,
409 PLSAPR_POLICY_INFORMATION PolicyInformation
)
411 PLSA_DB_OBJECT PolicyObject
;
412 ACCESS_MASK DesiredAccess
= 0;
415 TRACE("LsarSetInformationPolicy(%p,0x%08x,%p)\n",
416 PolicyHandle
, InformationClass
, PolicyInformation
);
418 if (PolicyInformation
)
420 TRACE("*PolicyInformation %p\n", *PolicyInformation
);
423 switch (InformationClass
)
425 case PolicyAuditLogInformation
:
426 case PolicyAuditFullSetInformation
:
427 DesiredAccess
= POLICY_AUDIT_LOG_ADMIN
;
430 case PolicyAuditEventsInformation
:
431 DesiredAccess
= POLICY_SET_AUDIT_REQUIREMENTS
;
434 case PolicyPrimaryDomainInformation
:
435 case PolicyAccountDomainInformation
:
436 case PolicyDnsDomainInformation
:
437 case PolicyDnsDomainInformationInt
:
438 case PolicyLocalAccountDomainInformation
:
439 DesiredAccess
= POLICY_TRUST_ADMIN
;
442 case PolicyLsaServerRoleInformation
:
443 case PolicyReplicaSourceInformation
:
444 DesiredAccess
= POLICY_SERVER_ADMIN
;
447 case PolicyDefaultQuotaInformation
:
448 DesiredAccess
= POLICY_SET_DEFAULT_QUOTA_LIMITS
;
452 ERR("Invalid InformationClass!\n");
453 return STATUS_INVALID_PARAMETER
;
456 Status
= LsapValidateDbObject(PolicyHandle
,
460 if (!NT_SUCCESS(Status
))
463 switch (InformationClass
)
465 case PolicyAuditLogInformation
: /* 1 */
466 Status
= LsarSetAuditLog(PolicyObject
,
467 (PPOLICY_AUDIT_LOG_INFO
)PolicyInformation
);
470 case PolicyAuditEventsInformation
: /* 2 */
471 Status
= LsarSetAuditEvents(PolicyObject
,
472 (PLSAPR_POLICY_AUDIT_EVENTS_INFO
)PolicyInformation
);
475 case PolicyPrimaryDomainInformation
: /* 3 */
476 Status
= LsarSetPrimaryDomain(PolicyObject
,
477 (PLSAPR_POLICY_PRIMARY_DOM_INFO
)PolicyInformation
);
480 case PolicyAccountDomainInformation
: /* 5 */
481 Status
= LsarSetAccountDomain(PolicyObject
,
482 (PLSAPR_POLICY_ACCOUNT_DOM_INFO
)PolicyInformation
);
485 case PolicyLsaServerRoleInformation
: /* 6 */
486 Status
= LsarSetServerRole(PolicyObject
,
487 (PPOLICY_LSA_SERVER_ROLE_INFO
)PolicyInformation
);
490 case PolicyReplicaSourceInformation
: /* 7 */
491 Status
= LsarSetReplicaSource(PolicyObject
,
492 (PPOLICY_LSA_REPLICA_SRCE_INFO
)PolicyInformation
);
495 case PolicyDefaultQuotaInformation
: /* 8 */
496 Status
= LsarSetDefaultQuota(PolicyObject
,
497 (PPOLICY_DEFAULT_QUOTA_INFO
)PolicyInformation
);
500 case PolicyModificationInformation
: /* 9 */
501 Status
= LsarSetModification(PolicyObject
,
502 (PPOLICY_MODIFICATION_INFO
)PolicyInformation
);
505 case PolicyAuditFullSetInformation
: /* 10 (0xA) */
506 Status
= LsarSetAuditFull(PolicyObject
,
507 (PPOLICY_AUDIT_FULL_QUERY_INFO
)PolicyInformation
);
510 case PolicyDnsDomainInformation
: /* 12 (0xC) */
511 Status
= LsarSetDnsDomain(PolicyObject
,
512 (PLSAPR_POLICY_DNS_DOMAIN_INFO
)PolicyInformation
);
515 case PolicyDnsDomainInformationInt
: /* 13 (0xD) */
516 Status
= LsarSetDnsDomainInt(PolicyObject
,
517 (PLSAPR_POLICY_DNS_DOMAIN_INFO
)PolicyInformation
);
520 case PolicyLocalAccountDomainInformation
: /* 14 (0xE) */
521 Status
= LsarSetLocalAccountDomain(PolicyObject
,
522 (PLSAPR_POLICY_ACCOUNT_DOM_INFO
)PolicyInformation
);
526 Status
= STATUS_INVALID_PARAMETER
;
535 NTSTATUS WINAPI
LsarClearAuditLog(
536 LSAPR_HANDLE ObjectHandle
)
539 return STATUS_NOT_IMPLEMENTED
;
544 NTSTATUS WINAPI
LsarCreateAccount(
545 LSAPR_HANDLE PolicyHandle
,
547 ACCESS_MASK DesiredAccess
,
548 LSAPR_HANDLE
*AccountHandle
)
550 PLSA_DB_OBJECT PolicyObject
;
551 PLSA_DB_OBJECT AccountObject
= NULL
;
552 LPWSTR SidString
= NULL
;
553 PSECURITY_DESCRIPTOR AccountSd
= NULL
;
555 NTSTATUS Status
= STATUS_SUCCESS
;
557 /* Validate the AccountSid */
558 if (!RtlValidSid(AccountSid
))
559 return STATUS_INVALID_PARAMETER
;
561 /* Validate the PolicyHandle */
562 Status
= LsapValidateDbObject(PolicyHandle
,
564 POLICY_CREATE_ACCOUNT
,
566 if (!NT_SUCCESS(Status
))
568 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
572 /* Create SID string */
573 if (!ConvertSidToStringSid((PSID
)AccountSid
,
576 ERR("ConvertSidToStringSid failed\n");
577 Status
= STATUS_INVALID_PARAMETER
;
581 /* Create a security descriptor for the account */
582 Status
= LsapCreateAccountSd(&AccountSd
,
584 if (!NT_SUCCESS(Status
))
586 ERR("LsapCreateAccountSd returned 0x%08lx\n", Status
);
590 /* Create the Account object */
591 Status
= LsapCreateDbObject(PolicyObject
,
596 PolicyObject
->Trusted
,
598 if (!NT_SUCCESS(Status
))
600 ERR("LsapCreateDbObject failed (Status 0x%08lx)\n", Status
);
604 /* Set the Sid attribute */
605 Status
= LsapSetObjectAttribute(AccountObject
,
608 GetLengthSid(AccountSid
));
609 if (!NT_SUCCESS(Status
))
612 /* Set the SecDesc attribute */
613 Status
= LsapSetObjectAttribute(AccountObject
,
619 if (SidString
!= NULL
)
620 LocalFree(SidString
);
622 if (AccountSd
!= NULL
)
623 RtlFreeHeap(RtlGetProcessHeap(), 0, AccountSd
);
625 if (!NT_SUCCESS(Status
))
627 if (AccountObject
!= NULL
)
628 LsapCloseDbObject(AccountObject
);
632 *AccountHandle
= (LSAPR_HANDLE
)AccountObject
;
635 return STATUS_SUCCESS
;
640 NTSTATUS WINAPI
LsarEnumerateAccounts(
641 LSAPR_HANDLE PolicyHandle
,
642 DWORD
*EnumerationContext
,
643 PLSAPR_ACCOUNT_ENUM_BUFFER EnumerationBuffer
,
644 DWORD PreferedMaximumLength
)
646 LSAPR_ACCOUNT_ENUM_BUFFER EnumBuffer
= {0, NULL
};
647 PLSA_DB_OBJECT PolicyObject
= NULL
;
648 WCHAR AccountKeyName
[64];
649 HANDLE AccountsKeyHandle
= NULL
;
650 HANDLE AccountKeyHandle
;
654 ULONG RequiredLength
;
657 NTSTATUS Status
= STATUS_SUCCESS
;
659 TRACE("(%p %p %p %lu)\n", PolicyHandle
, EnumerationContext
,
660 EnumerationBuffer
, PreferedMaximumLength
);
662 if (EnumerationContext
== NULL
||
663 EnumerationBuffer
== NULL
)
664 return STATUS_INVALID_PARAMETER
;
666 EnumerationBuffer
->EntriesRead
= 0;
667 EnumerationBuffer
->Information
= NULL
;
669 /* Validate the PolicyHandle */
670 Status
= LsapValidateDbObject(PolicyHandle
,
672 POLICY_VIEW_LOCAL_INFORMATION
,
674 if (!NT_SUCCESS(Status
))
676 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
680 Status
= LsapRegOpenKey(PolicyObject
->KeyHandle
,
684 if (!NT_SUCCESS(Status
))
687 EnumIndex
= *EnumerationContext
;
693 Status
= LsapRegEnumerateSubKey(AccountsKeyHandle
,
697 if (!NT_SUCCESS(Status
))
700 TRACE("EnumIndex: %lu\n", EnumIndex
);
701 TRACE("Account key name: %S\n", AccountKeyName
);
703 Status
= LsapRegOpenKey(AccountsKeyHandle
,
707 TRACE("LsapRegOpenKey returned %08lX\n", Status
);
708 if (NT_SUCCESS(Status
))
710 Status
= LsapRegOpenKey(AccountKeyHandle
,
714 TRACE("LsapRegOpenKey returned %08lX\n", Status
);
715 if (NT_SUCCESS(Status
))
718 Status
= LsapRegQueryValue(SidKeyHandle
,
723 TRACE("LsapRegQueryValue returned %08lX\n", Status
);
724 if (NT_SUCCESS(Status
))
726 TRACE("Data length: %lu\n", DataLength
);
728 if ((RequiredLength
+ DataLength
+ sizeof(LSAPR_ACCOUNT_INFORMATION
)) > PreferedMaximumLength
)
731 RequiredLength
+= (DataLength
+ sizeof(LSAPR_ACCOUNT_INFORMATION
));
735 LsapRegCloseKey(SidKeyHandle
);
738 LsapRegCloseKey(AccountKeyHandle
);
744 TRACE("EnumCount: %lu\n", EnumCount
);
745 TRACE("RequiredLength: %lu\n", RequiredLength
);
747 EnumBuffer
.EntriesRead
= EnumCount
;
748 EnumBuffer
.Information
= midl_user_allocate(EnumCount
* sizeof(LSAPR_ACCOUNT_INFORMATION
));
749 if (EnumBuffer
.Information
== NULL
)
751 Status
= STATUS_INSUFFICIENT_RESOURCES
;
755 EnumIndex
= *EnumerationContext
;
756 for (i
= 0; i
< EnumCount
; i
++, EnumIndex
++)
758 Status
= LsapRegEnumerateSubKey(AccountsKeyHandle
,
762 if (!NT_SUCCESS(Status
))
765 TRACE("EnumIndex: %lu\n", EnumIndex
);
766 TRACE("Account key name: %S\n", AccountKeyName
);
768 Status
= LsapRegOpenKey(AccountsKeyHandle
,
772 TRACE("LsapRegOpenKey returned %08lX\n", Status
);
773 if (NT_SUCCESS(Status
))
775 Status
= LsapRegOpenKey(AccountKeyHandle
,
779 TRACE("LsapRegOpenKey returned %08lX\n", Status
);
780 if (NT_SUCCESS(Status
))
783 Status
= LsapRegQueryValue(SidKeyHandle
,
788 TRACE("LsapRegQueryValue returned %08lX\n", Status
);
789 if (NT_SUCCESS(Status
))
791 EnumBuffer
.Information
[i
].Sid
= midl_user_allocate(DataLength
);
792 if (EnumBuffer
.Information
[i
].Sid
== NULL
)
794 LsapRegCloseKey(AccountKeyHandle
);
795 Status
= STATUS_INSUFFICIENT_RESOURCES
;
799 Status
= LsapRegQueryValue(SidKeyHandle
,
802 EnumBuffer
.Information
[i
].Sid
,
804 TRACE("SampRegQueryValue returned %08lX\n", Status
);
807 LsapRegCloseKey(SidKeyHandle
);
810 LsapRegCloseKey(AccountKeyHandle
);
812 if (!NT_SUCCESS(Status
))
817 if (NT_SUCCESS(Status
))
819 *EnumerationContext
+= EnumCount
;
820 EnumerationBuffer
->EntriesRead
= EnumBuffer
.EntriesRead
;
821 EnumerationBuffer
->Information
= EnumBuffer
.Information
;
825 if (!NT_SUCCESS(Status
))
827 if (EnumBuffer
.Information
)
829 for (i
= 0; i
< EnumBuffer
.EntriesRead
; i
++)
831 if (EnumBuffer
.Information
[i
].Sid
!= NULL
)
832 midl_user_free(EnumBuffer
.Information
[i
].Sid
);
835 midl_user_free(EnumBuffer
.Information
);
839 if (AccountsKeyHandle
!= NULL
)
840 LsapRegCloseKey(AccountsKeyHandle
);
847 NTSTATUS WINAPI
LsarCreateTrustedDomain(
848 LSAPR_HANDLE PolicyHandle
,
849 PLSAPR_TRUST_INFORMATION TrustedDomainInformation
,
850 ACCESS_MASK DesiredAccess
,
851 LSAPR_HANDLE
*TrustedDomainHandle
)
854 return STATUS_NOT_IMPLEMENTED
;
859 NTSTATUS WINAPI
LsarEnumerateTrustedDomains(
860 LSAPR_HANDLE PolicyHandle
,
861 DWORD
*EnumerationContext
,
862 PLSAPR_TRUSTED_ENUM_BUFFER EnumerationBuffer
,
863 DWORD PreferedMaximumLength
)
866 return STATUS_NOT_IMPLEMENTED
;
871 NTSTATUS WINAPI
LsarLookupNames(
872 LSAPR_HANDLE PolicyHandle
,
874 PRPC_UNICODE_STRING Names
,
875 PLSAPR_REFERENCED_DOMAIN_LIST
*ReferencedDomains
,
876 PLSAPR_TRANSLATED_SIDS TranslatedSids
,
877 LSAP_LOOKUP_LEVEL LookupLevel
,
880 LSAPR_TRANSLATED_SIDS_EX2 TranslatedSidsEx2
;
884 TRACE("(%p %lu %p %p %p %d %p)\n",
885 PolicyHandle
, Count
, Names
, ReferencedDomains
, TranslatedSids
,
886 LookupLevel
, MappedCount
);
888 TranslatedSids
->Entries
= 0;
889 TranslatedSids
->Sids
= NULL
;
890 *ReferencedDomains
= NULL
;
893 return STATUS_NONE_MAPPED
;
895 TranslatedSidsEx2
.Entries
= 0;
896 TranslatedSidsEx2
.Sids
= NULL
;
898 Status
= LsapLookupNames(Count
,
906 if (!NT_SUCCESS(Status
))
909 TranslatedSids
->Entries
= TranslatedSidsEx2
.Entries
;
910 TranslatedSids
->Sids
= MIDL_user_allocate(TranslatedSids
->Entries
* sizeof(LSA_TRANSLATED_SID
));
911 if (TranslatedSids
->Sids
== NULL
)
913 MIDL_user_free(TranslatedSidsEx2
.Sids
);
914 MIDL_user_free(*ReferencedDomains
);
915 *ReferencedDomains
= NULL
;
916 return STATUS_INSUFFICIENT_RESOURCES
;
919 for (i
= 0; i
< TranslatedSidsEx2
.Entries
; i
++)
921 TranslatedSids
->Sids
[i
].Use
= TranslatedSidsEx2
.Sids
[i
].Use
;
922 TranslatedSids
->Sids
[i
].RelativeId
= LsapGetRelativeIdFromSid(TranslatedSidsEx2
.Sids
[i
].Sid
);
923 TranslatedSids
->Sids
[i
].DomainIndex
= TranslatedSidsEx2
.Sids
[i
].DomainIndex
;
926 MIDL_user_free(TranslatedSidsEx2
.Sids
);
928 return STATUS_SUCCESS
;
933 NTSTATUS WINAPI
LsarLookupSids(
934 LSAPR_HANDLE PolicyHandle
,
935 PLSAPR_SID_ENUM_BUFFER SidEnumBuffer
,
936 PLSAPR_REFERENCED_DOMAIN_LIST
*ReferencedDomains
,
937 PLSAPR_TRANSLATED_NAMES TranslatedNames
,
938 LSAP_LOOKUP_LEVEL LookupLevel
,
941 LSAPR_TRANSLATED_NAMES_EX TranslatedNamesEx
;
945 TRACE("(%p %p %p %p %d %p)\n",
946 PolicyHandle
, SidEnumBuffer
, ReferencedDomains
, TranslatedNames
,
947 LookupLevel
, MappedCount
);
949 /* FIXME: Fail, if there is an invalid SID in the SidEnumBuffer */
951 TranslatedNames
->Entries
= SidEnumBuffer
->Entries
;
952 TranslatedNames
->Names
= NULL
;
953 *ReferencedDomains
= NULL
;
955 TranslatedNamesEx
.Entries
= SidEnumBuffer
->Entries
;
956 TranslatedNamesEx
.Names
= NULL
;
958 Status
= LsapLookupSids(SidEnumBuffer
,
965 if (!NT_SUCCESS(Status
))
968 TranslatedNames
->Entries
= SidEnumBuffer
->Entries
;
969 TranslatedNames
->Names
= MIDL_user_allocate(SidEnumBuffer
->Entries
* sizeof(LSAPR_TRANSLATED_NAME
));
970 if (TranslatedNames
->Names
== NULL
)
972 MIDL_user_free(TranslatedNamesEx
.Names
);
973 MIDL_user_free(*ReferencedDomains
);
974 *ReferencedDomains
= NULL
;
975 return STATUS_INSUFFICIENT_RESOURCES
;
978 for (i
= 0; i
< TranslatedNamesEx
.Entries
; i
++)
980 TranslatedNames
->Names
[i
].Use
= TranslatedNamesEx
.Names
[i
].Use
;
981 TranslatedNames
->Names
[i
].Name
.Length
= TranslatedNamesEx
.Names
[i
].Name
.Length
;
982 TranslatedNames
->Names
[i
].Name
.MaximumLength
= TranslatedNamesEx
.Names
[i
].Name
.MaximumLength
;
983 TranslatedNames
->Names
[i
].Name
.Buffer
= TranslatedNamesEx
.Names
[i
].Name
.Buffer
;
984 TranslatedNames
->Names
[i
].DomainIndex
= TranslatedNamesEx
.Names
[i
].DomainIndex
;
987 MIDL_user_free(TranslatedNamesEx
.Names
);
994 NTSTATUS WINAPI
LsarCreateSecret(
995 LSAPR_HANDLE PolicyHandle
,
996 PRPC_UNICODE_STRING SecretName
,
997 ACCESS_MASK DesiredAccess
,
998 LSAPR_HANDLE
*SecretHandle
)
1000 PLSA_DB_OBJECT PolicyObject
;
1001 PLSA_DB_OBJECT SecretObject
= NULL
;
1003 PSECURITY_DESCRIPTOR SecretSd
= NULL
;
1005 NTSTATUS Status
= STATUS_SUCCESS
;
1007 /* Validate the PolicyHandle */
1008 Status
= LsapValidateDbObject(PolicyHandle
,
1010 POLICY_CREATE_SECRET
,
1012 if (!NT_SUCCESS(Status
))
1014 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
1018 /* Get the current time */
1019 Status
= NtQuerySystemTime(&Time
);
1020 if (!NT_SUCCESS(Status
))
1022 ERR("NtQuerySystemTime failed (Status 0x%08lx)\n", Status
);
1026 /* Create a security descriptor for the secret */
1027 Status
= LsapCreateSecretSd(&SecretSd
,
1029 if (!NT_SUCCESS(Status
))
1031 ERR("LsapCreateAccountSd returned 0x%08lx\n", Status
);
1035 /* Create the Secret object */
1036 Status
= LsapCreateDbObject(PolicyObject
,
1041 PolicyObject
->Trusted
,
1043 if (!NT_SUCCESS(Status
))
1045 ERR("LsapCreateDbObject failed (Status 0x%08lx)\n", Status
);
1049 /* Set the CurrentTime attribute */
1050 Status
= LsapSetObjectAttribute(SecretObject
,
1053 sizeof(LARGE_INTEGER
));
1054 if (!NT_SUCCESS(Status
))
1056 ERR("LsapSetObjectAttribute (CurrentTime) failed (Status 0x%08lx)\n", Status
);
1060 /* Set the OldTime attribute */
1061 Status
= LsapSetObjectAttribute(SecretObject
,
1064 sizeof(LARGE_INTEGER
));
1065 if (!NT_SUCCESS(Status
))
1067 ERR("LsapSetObjectAttribute (OldTime) failed (Status 0x%08lx)\n", Status
);
1071 /* Set the SecDesc attribute */
1072 Status
= LsapSetObjectAttribute(SecretObject
,
1078 if (SecretSd
!= NULL
)
1079 RtlFreeHeap(RtlGetProcessHeap(), 0, SecretSd
);
1081 if (!NT_SUCCESS(Status
))
1083 if (SecretObject
!= NULL
)
1084 LsapCloseDbObject(SecretObject
);
1088 *SecretHandle
= (LSAPR_HANDLE
)SecretObject
;
1091 return STATUS_SUCCESS
;
1096 NTSTATUS WINAPI
LsarOpenAccount(
1097 LSAPR_HANDLE PolicyHandle
,
1098 PRPC_SID AccountSid
,
1099 ACCESS_MASK DesiredAccess
,
1100 LSAPR_HANDLE
*AccountHandle
)
1102 PLSA_DB_OBJECT PolicyObject
;
1103 PLSA_DB_OBJECT AccountObject
= NULL
;
1104 LPWSTR SidString
= NULL
;
1105 NTSTATUS Status
= STATUS_SUCCESS
;
1107 /* Validate the AccountSid */
1108 if (!RtlValidSid(AccountSid
))
1109 return STATUS_INVALID_PARAMETER
;
1111 /* Validate the PolicyHandle */
1112 Status
= LsapValidateDbObject(PolicyHandle
,
1116 if (!NT_SUCCESS(Status
))
1118 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
1122 /* Create SID string */
1123 if (!ConvertSidToStringSid((PSID
)AccountSid
,
1126 ERR("ConvertSidToStringSid failed\n");
1127 Status
= STATUS_INVALID_PARAMETER
;
1131 /* Create the Account object */
1132 Status
= LsapOpenDbObject(PolicyObject
,
1137 PolicyObject
->Trusted
,
1139 if (!NT_SUCCESS(Status
))
1141 ERR("LsapOpenDbObject failed (Status 0x%08lx)\n", Status
);
1145 /* Set the Sid attribute */
1146 Status
= LsapSetObjectAttribute(AccountObject
,
1149 GetLengthSid(AccountSid
));
1152 if (SidString
!= NULL
)
1153 LocalFree(SidString
);
1155 if (!NT_SUCCESS(Status
))
1157 if (AccountObject
!= NULL
)
1158 LsapCloseDbObject(AccountObject
);
1162 *AccountHandle
= (LSAPR_HANDLE
)AccountObject
;
1170 NTSTATUS WINAPI
LsarEnumeratePrivilegesAccount(
1171 LSAPR_HANDLE AccountHandle
,
1172 PLSAPR_PRIVILEGE_SET
*Privileges
)
1174 PLSA_DB_OBJECT AccountObject
;
1175 ULONG PrivilegeSetSize
= 0;
1176 PLSAPR_PRIVILEGE_SET PrivilegeSet
= NULL
;
1181 /* Validate the AccountHandle */
1182 Status
= LsapValidateDbObject(AccountHandle
,
1186 if (!NT_SUCCESS(Status
))
1188 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
1192 /* Get the size of the privilege set */
1193 Status
= LsapGetObjectAttribute(AccountObject
,
1197 if (!NT_SUCCESS(Status
))
1200 /* Allocate a buffer for the privilege set */
1201 PrivilegeSet
= MIDL_user_allocate(PrivilegeSetSize
);
1202 if (PrivilegeSet
== NULL
)
1203 return STATUS_NO_MEMORY
;
1205 /* Get the privilege set */
1206 Status
= LsapGetObjectAttribute(AccountObject
,
1210 if (!NT_SUCCESS(Status
))
1212 MIDL_user_free(PrivilegeSet
);
1216 /* Return a pointer to the privilege set */
1217 *Privileges
= PrivilegeSet
;
1219 return STATUS_SUCCESS
;
1224 NTSTATUS WINAPI
LsarAddPrivilegesToAccount(
1225 LSAPR_HANDLE AccountHandle
,
1226 PLSAPR_PRIVILEGE_SET Privileges
)
1228 PLSA_DB_OBJECT AccountObject
;
1229 PPRIVILEGE_SET CurrentPrivileges
= NULL
;
1230 PPRIVILEGE_SET NewPrivileges
= NULL
;
1231 ULONG PrivilegeSetSize
= 0;
1232 ULONG PrivilegeCount
;
1237 /* Validate the AccountHandle */
1238 Status
= LsapValidateDbObject(AccountHandle
,
1240 ACCOUNT_ADJUST_PRIVILEGES
,
1242 if (!NT_SUCCESS(Status
))
1244 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
1248 /* Get the size of the Privilgs attribute */
1249 Status
= LsapGetObjectAttribute(AccountObject
,
1253 if (!NT_SUCCESS(Status
) || PrivilegeSetSize
== 0)
1255 /* The Privilgs attribute does not exist */
1257 PrivilegeSetSize
= sizeof(PRIVILEGE_SET
) +
1258 (Privileges
->PrivilegeCount
- 1) * sizeof(LUID_AND_ATTRIBUTES
);
1259 Status
= LsapSetObjectAttribute(AccountObject
,
1266 /* The Privilgs attribute exists */
1268 /* Allocate memory for the stored privilege set */
1269 CurrentPrivileges
= MIDL_user_allocate(PrivilegeSetSize
);
1270 if (CurrentPrivileges
== NULL
)
1271 return STATUS_NO_MEMORY
;
1273 /* Get the current privilege set */
1274 Status
= LsapGetObjectAttribute(AccountObject
,
1278 if (!NT_SUCCESS(Status
))
1280 TRACE("LsapGetObjectAttribute() failed (Status 0x%08lx)\n", Status
);
1284 PrivilegeCount
= CurrentPrivileges
->PrivilegeCount
;
1285 TRACE("Current privilege count: %lu\n", PrivilegeCount
);
1287 /* Calculate the number privileges in the combined privilege set */
1288 for (i
= 0; i
< Privileges
->PrivilegeCount
; i
++)
1291 for (j
= 0; j
< CurrentPrivileges
->PrivilegeCount
; j
++)
1293 if (RtlEqualLuid(&(Privileges
->Privilege
[i
].Luid
),
1294 &(CurrentPrivileges
->Privilege
[i
].Luid
)))
1301 if (bFound
== FALSE
)
1303 TRACE("Found new privilege\n");
1307 TRACE("New privilege count: %lu\n", PrivilegeCount
);
1309 /* Calculate the size of the new privilege set and allocate it */
1310 PrivilegeSetSize
= sizeof(PRIVILEGE_SET
) +
1311 (PrivilegeCount
- 1) * sizeof(LUID_AND_ATTRIBUTES
);
1312 NewPrivileges
= MIDL_user_allocate(PrivilegeSetSize
);
1313 if (NewPrivileges
== NULL
)
1315 Status
= STATUS_NO_MEMORY
;
1319 /* Initialize the new privilege set */
1320 NewPrivileges
->PrivilegeCount
= PrivilegeCount
;
1321 NewPrivileges
->Control
= 0;
1323 /* Copy all privileges from the current privilege set */
1324 RtlCopyLuidAndAttributesArray(CurrentPrivileges
->PrivilegeCount
,
1325 &(CurrentPrivileges
->Privilege
[0]),
1326 &(NewPrivileges
->Privilege
[0]));
1328 /* Add new privileges to the new privilege set */
1329 PrivilegeCount
= CurrentPrivileges
->PrivilegeCount
;
1330 for (i
= 0; i
< Privileges
->PrivilegeCount
; i
++)
1333 for (j
= 0; j
< CurrentPrivileges
->PrivilegeCount
; j
++)
1335 if (RtlEqualLuid(&(Privileges
->Privilege
[i
].Luid
),
1336 &(CurrentPrivileges
->Privilege
[i
].Luid
)))
1338 /* Overwrite attributes if a matching privilege was found */
1339 NewPrivileges
->Privilege
[j
].Attributes
= Privileges
->Privilege
[i
].Attributes
;
1346 if (bFound
== FALSE
)
1348 /* Copy the new privilege */
1349 RtlCopyLuidAndAttributesArray(1,
1350 (PLUID_AND_ATTRIBUTES
)&(Privileges
->Privilege
[i
]),
1351 &(NewPrivileges
->Privilege
[PrivilegeCount
]));
1356 /* Set the new privilege set */
1357 Status
= LsapSetObjectAttribute(AccountObject
,
1364 if (CurrentPrivileges
!= NULL
)
1365 MIDL_user_free(CurrentPrivileges
);
1367 if (NewPrivileges
!= NULL
)
1368 MIDL_user_free(NewPrivileges
);
1375 NTSTATUS WINAPI
LsarRemovePrivilegesFromAccount(
1376 LSAPR_HANDLE AccountHandle
,
1378 PLSAPR_PRIVILEGE_SET Privileges
)
1381 return STATUS_NOT_IMPLEMENTED
;
1386 NTSTATUS WINAPI
LsarGetQuotasForAccount(
1387 LSAPR_HANDLE AccountHandle
,
1388 PQUOTA_LIMITS QuotaLimits
)
1390 PLSA_DB_OBJECT AccountObject
;
1394 TRACE("(%p %p)\n", AccountHandle
, QuotaLimits
);
1396 /* Validate the account handle */
1397 Status
= LsapValidateDbObject(AccountHandle
,
1401 if (!NT_SUCCESS(Status
))
1403 ERR("Invalid handle (Status %lx)\n", Status
);
1407 /* Get the quota attribute */
1408 Status
= LsapGetObjectAttribute(AccountObject
,
1418 NTSTATUS WINAPI
LsarSetQuotasForAccount(
1419 LSAPR_HANDLE AccountHandle
,
1420 PQUOTA_LIMITS QuotaLimits
)
1422 PLSA_DB_OBJECT AccountObject
;
1423 QUOTA_LIMITS InternalQuotaLimits
;
1427 TRACE("(%p %p)\n", AccountHandle
, QuotaLimits
);
1429 /* Validate the account handle */
1430 Status
= LsapValidateDbObject(AccountHandle
,
1432 ACCOUNT_ADJUST_QUOTAS
,
1434 if (!NT_SUCCESS(Status
))
1436 ERR("Invalid handle (Status %lx)\n", Status
);
1440 /* Get the quota limits attribute */
1441 Size
= sizeof(QUOTA_LIMITS
);
1442 Status
= LsapGetObjectAttribute(AccountObject
,
1444 &InternalQuotaLimits
,
1446 if (!NT_SUCCESS(Status
))
1448 TRACE("LsapGetObjectAttribute() failed (Status 0x%08lx)\n", Status
);
1452 /* Update the quota limits */
1453 if (QuotaLimits
->PagedPoolLimit
!= 0)
1454 InternalQuotaLimits
.PagedPoolLimit
= QuotaLimits
->PagedPoolLimit
;
1456 if (QuotaLimits
->NonPagedPoolLimit
!= 0)
1457 InternalQuotaLimits
.NonPagedPoolLimit
= QuotaLimits
->NonPagedPoolLimit
;
1459 if (QuotaLimits
->MinimumWorkingSetSize
!= 0)
1460 InternalQuotaLimits
.MinimumWorkingSetSize
= QuotaLimits
->MinimumWorkingSetSize
;
1462 if (QuotaLimits
->MaximumWorkingSetSize
!= 0)
1463 InternalQuotaLimits
.MaximumWorkingSetSize
= QuotaLimits
->MaximumWorkingSetSize
;
1465 if (QuotaLimits
->PagefileLimit
!= 0)
1466 InternalQuotaLimits
.PagefileLimit
= QuotaLimits
->PagefileLimit
;
1468 /* Set the quota limits attribute */
1469 Status
= LsapSetObjectAttribute(AccountObject
,
1471 &InternalQuotaLimits
,
1472 sizeof(QUOTA_LIMITS
));
1479 NTSTATUS WINAPI
LsarGetSystemAccessAccount(
1480 LSAPR_HANDLE AccountHandle
,
1481 ACCESS_MASK
*SystemAccess
)
1483 PLSA_DB_OBJECT AccountObject
;
1487 /* Validate the account handle */
1488 Status
= LsapValidateDbObject(AccountHandle
,
1492 if (!NT_SUCCESS(Status
))
1494 ERR("Invalid handle (Status %lx)\n", Status
);
1498 /* Get the system access flags */
1499 Status
= LsapGetObjectAttribute(AccountObject
,
1509 NTSTATUS WINAPI
LsarSetSystemAccessAccount(
1510 LSAPR_HANDLE AccountHandle
,
1511 ACCESS_MASK SystemAccess
)
1513 PLSA_DB_OBJECT AccountObject
;
1516 /* Validate the account handle */
1517 Status
= LsapValidateDbObject(AccountHandle
,
1519 ACCOUNT_ADJUST_SYSTEM_ACCESS
,
1521 if (!NT_SUCCESS(Status
))
1523 ERR("Invalid handle (Status %lx)\n", Status
);
1527 /* Set the system access flags */
1528 Status
= LsapSetObjectAttribute(AccountObject
,
1531 sizeof(ACCESS_MASK
));
1538 NTSTATUS WINAPI
LsarOpenTrustedDomain(
1539 LSAPR_HANDLE PolicyHandle
,
1540 PRPC_SID TrustedDomainSid
,
1541 ACCESS_MASK DesiredAccess
,
1542 LSAPR_HANDLE
*TrustedDomainHandle
)
1545 return STATUS_NOT_IMPLEMENTED
;
1550 NTSTATUS WINAPI
LsarQueryInfoTrustedDomain(
1551 LSAPR_HANDLE TrustedDomainHandle
,
1552 TRUSTED_INFORMATION_CLASS InformationClass
,
1553 PLSAPR_TRUSTED_DOMAIN_INFO
*TrustedDomainInformation
)
1556 return STATUS_NOT_IMPLEMENTED
;
1561 NTSTATUS WINAPI
LsarSetInformationTrustedDomain(
1562 LSAPR_HANDLE TrustedDomainHandle
,
1563 TRUSTED_INFORMATION_CLASS InformationClass
,
1564 PLSAPR_TRUSTED_DOMAIN_INFO TrustedDomainInformation
)
1567 return STATUS_NOT_IMPLEMENTED
;
1572 NTSTATUS WINAPI
LsarOpenSecret(
1573 LSAPR_HANDLE PolicyHandle
,
1574 PRPC_UNICODE_STRING SecretName
,
1575 ACCESS_MASK DesiredAccess
,
1576 LSAPR_HANDLE
*SecretHandle
)
1578 PLSA_DB_OBJECT PolicyObject
;
1579 PLSA_DB_OBJECT SecretObject
= NULL
;
1580 NTSTATUS Status
= STATUS_SUCCESS
;
1582 /* Validate the PolicyHandle */
1583 Status
= LsapValidateDbObject(PolicyHandle
,
1587 if (!NT_SUCCESS(Status
))
1589 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
1593 /* Create the secret object */
1594 Status
= LsapOpenDbObject(PolicyObject
,
1599 PolicyObject
->Trusted
,
1601 if (!NT_SUCCESS(Status
))
1603 ERR("LsapOpenDbObject failed (Status 0x%08lx)\n", Status
);
1608 if (!NT_SUCCESS(Status
))
1610 if (SecretObject
!= NULL
)
1611 LsapCloseDbObject(SecretObject
);
1615 *SecretHandle
= (LSAPR_HANDLE
)SecretObject
;
1623 NTSTATUS WINAPI
LsarSetSecret(
1624 LSAPR_HANDLE SecretHandle
,
1625 PLSAPR_CR_CIPHER_VALUE EncryptedCurrentValue
,
1626 PLSAPR_CR_CIPHER_VALUE EncryptedOldValue
)
1628 PLSA_DB_OBJECT SecretObject
;
1629 PBYTE CurrentValue
= NULL
;
1630 PBYTE OldValue
= NULL
;
1631 ULONG CurrentValueLength
= 0;
1632 ULONG OldValueLength
= 0;
1636 TRACE("LsarSetSecret(%p %p %p)\n", SecretHandle
,
1637 EncryptedCurrentValue
, EncryptedOldValue
);
1639 /* Validate the SecretHandle */
1640 Status
= LsapValidateDbObject(SecretHandle
,
1644 if (!NT_SUCCESS(Status
))
1646 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
1650 if (EncryptedCurrentValue
!= NULL
)
1652 /* FIXME: Decrypt the current value */
1653 CurrentValue
= EncryptedCurrentValue
->Buffer
;
1654 CurrentValueLength
= EncryptedCurrentValue
->MaximumLength
;
1657 /* Set the current value */
1658 Status
= LsapSetObjectAttribute(SecretObject
,
1661 CurrentValueLength
);
1662 if (!NT_SUCCESS(Status
))
1664 ERR("LsapSetObjectAttribute failed (Status 0x%08lx)\n", Status
);
1668 /* Get the current time */
1669 Status
= NtQuerySystemTime(&Time
);
1670 if (!NT_SUCCESS(Status
))
1672 ERR("NtQuerySystemTime failed (Status 0x%08lx)\n", Status
);
1676 /* Set the current time */
1677 Status
= LsapSetObjectAttribute(SecretObject
,
1680 sizeof(LARGE_INTEGER
));
1681 if (!NT_SUCCESS(Status
))
1683 ERR("LsapSetObjectAttribute failed (Status 0x%08lx)\n", Status
);
1687 if (EncryptedOldValue
!= NULL
)
1689 /* FIXME: Decrypt the old value */
1690 OldValue
= EncryptedOldValue
->Buffer
;
1691 OldValueLength
= EncryptedOldValue
->MaximumLength
;
1694 /* Set the old value */
1695 Status
= LsapSetObjectAttribute(SecretObject
,
1699 if (!NT_SUCCESS(Status
))
1701 ERR("LsapSetObjectAttribute failed (Status 0x%08lx)\n", Status
);
1705 /* Set the old time */
1706 Status
= LsapSetObjectAttribute(SecretObject
,
1709 sizeof(LARGE_INTEGER
));
1710 if (!NT_SUCCESS(Status
))
1712 ERR("LsapSetObjectAttribute failed (Status 0x%08lx)\n", Status
);
1721 NTSTATUS WINAPI
LsarQuerySecret(
1722 LSAPR_HANDLE SecretHandle
,
1723 PLSAPR_CR_CIPHER_VALUE
*EncryptedCurrentValue
,
1724 PLARGE_INTEGER CurrentValueSetTime
,
1725 PLSAPR_CR_CIPHER_VALUE
*EncryptedOldValue
,
1726 PLARGE_INTEGER OldValueSetTime
)
1728 PLSA_DB_OBJECT SecretObject
;
1729 PLSAPR_CR_CIPHER_VALUE EncCurrentValue
= NULL
;
1730 PLSAPR_CR_CIPHER_VALUE EncOldValue
= NULL
;
1731 PBYTE CurrentValue
= NULL
;
1732 PBYTE OldValue
= NULL
;
1733 ULONG CurrentValueLength
= 0;
1734 ULONG OldValueLength
= 0;
1738 TRACE("LsarQuerySecret(%p %p %p %p %p)\n", SecretHandle
,
1739 EncryptedCurrentValue
, CurrentValueSetTime
,
1740 EncryptedOldValue
, OldValueSetTime
);
1742 /* Validate the SecretHandle */
1743 Status
= LsapValidateDbObject(SecretHandle
,
1747 if (!NT_SUCCESS(Status
))
1749 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
1753 if (EncryptedCurrentValue
!= NULL
)
1755 CurrentValueLength
= 0;
1757 /* Get the size of the current value */
1758 Status
= LsapGetObjectAttribute(SecretObject
,
1761 &CurrentValueLength
);
1762 if (!NT_SUCCESS(Status
))
1765 /* Allocate a buffer for the current value */
1766 CurrentValue
= midl_user_allocate(CurrentValueLength
);
1767 if (CurrentValue
== NULL
)
1769 Status
= STATUS_INSUFFICIENT_RESOURCES
;
1773 /* Get the current value */
1774 Status
= LsapGetObjectAttribute(SecretObject
,
1777 &CurrentValueLength
);
1778 if (!NT_SUCCESS(Status
))
1781 /* Allocate a buffer for the encrypted current value */
1782 EncCurrentValue
= midl_user_allocate(sizeof(LSAPR_CR_CIPHER_VALUE
));
1783 if (EncCurrentValue
== NULL
)
1785 Status
= STATUS_INSUFFICIENT_RESOURCES
;
1789 /* FIXME: Encrypt the current value */
1790 EncCurrentValue
->Length
= (USHORT
)(CurrentValueLength
- sizeof(WCHAR
));
1791 EncCurrentValue
->MaximumLength
= (USHORT
)CurrentValueLength
;
1792 EncCurrentValue
->Buffer
= (PBYTE
)CurrentValue
;
1795 if (CurrentValueSetTime
!= NULL
)
1797 BufferSize
= sizeof(LARGE_INTEGER
);
1799 /* Get the current value time */
1800 Status
= LsapGetObjectAttribute(SecretObject
,
1802 (PBYTE
)CurrentValueSetTime
,
1804 if (!NT_SUCCESS(Status
))
1808 if (EncryptedOldValue
!= NULL
)
1812 /* Get the size of the old value */
1813 Status
= LsapGetObjectAttribute(SecretObject
,
1817 if (!NT_SUCCESS(Status
))
1820 /* Allocate a buffer for the old value */
1821 OldValue
= midl_user_allocate(OldValueLength
);
1822 if (OldValue
== NULL
)
1824 Status
= STATUS_INSUFFICIENT_RESOURCES
;
1828 /* Get the old value */
1829 Status
= LsapGetObjectAttribute(SecretObject
,
1833 if (!NT_SUCCESS(Status
))
1836 /* Allocate a buffer for the encrypted old value */
1837 EncOldValue
= midl_user_allocate(sizeof(LSAPR_CR_CIPHER_VALUE
) + OldValueLength
);
1838 if (EncOldValue
== NULL
)
1840 Status
= STATUS_INSUFFICIENT_RESOURCES
;
1844 /* FIXME: Encrypt the old value */
1845 EncOldValue
->Length
= (USHORT
)(OldValueLength
- sizeof(WCHAR
));
1846 EncOldValue
->MaximumLength
= (USHORT
)OldValueLength
;
1847 EncOldValue
->Buffer
= (PBYTE
)OldValue
;
1850 if (OldValueSetTime
!= NULL
)
1852 BufferSize
= sizeof(LARGE_INTEGER
);
1854 /* Get the old value time */
1855 Status
= LsapGetObjectAttribute(SecretObject
,
1857 (PBYTE
)OldValueSetTime
,
1859 if (!NT_SUCCESS(Status
))
1865 if (NT_SUCCESS(Status
))
1867 if (EncryptedCurrentValue
!= NULL
)
1868 *EncryptedCurrentValue
= EncCurrentValue
;
1870 if (EncryptedOldValue
!= NULL
)
1871 *EncryptedOldValue
= EncOldValue
;
1875 if (EncryptedCurrentValue
!= NULL
)
1876 *EncryptedCurrentValue
= NULL
;
1878 if (EncryptedOldValue
!= NULL
)
1879 *EncryptedOldValue
= NULL
;
1881 if (EncCurrentValue
!= NULL
)
1882 midl_user_free(EncCurrentValue
);
1884 if (EncOldValue
!= NULL
)
1885 midl_user_free(EncOldValue
);
1887 if (CurrentValue
!= NULL
)
1888 midl_user_free(CurrentValue
);
1890 if (OldValue
!= NULL
)
1891 midl_user_free(OldValue
);
1894 TRACE("LsarQuerySecret done (Status 0x%08lx)\n", Status
);
1901 NTSTATUS WINAPI
LsarLookupPrivilegeValue(
1902 LSAPR_HANDLE PolicyHandle
,
1903 PRPC_UNICODE_STRING Name
,
1908 TRACE("LsarLookupPrivilegeValue(%p, %wZ, %p)\n",
1909 PolicyHandle
, Name
, Value
);
1911 Status
= LsapValidateDbObject(PolicyHandle
,
1913 POLICY_LOOKUP_NAMES
,
1915 if (!NT_SUCCESS(Status
))
1917 ERR("Invalid handle (Status %lx)\n", Status
);
1921 TRACE("Privilege: %wZ\n", Name
);
1923 Status
= LsarpLookupPrivilegeValue(Name
,
1931 NTSTATUS WINAPI
LsarLookupPrivilegeName(
1932 LSAPR_HANDLE PolicyHandle
,
1934 PRPC_UNICODE_STRING
*Name
)
1938 TRACE("LsarLookupPrivilegeName(%p, %p, %p)\n",
1939 PolicyHandle
, Value
, Name
);
1941 Status
= LsapValidateDbObject(PolicyHandle
,
1943 POLICY_LOOKUP_NAMES
,
1945 if (!NT_SUCCESS(Status
))
1947 ERR("Invalid handle\n");
1951 Status
= LsarpLookupPrivilegeName(Value
,
1959 NTSTATUS WINAPI
LsarLookupPrivilegeDisplayName(
1960 LSAPR_HANDLE PolicyHandle
,
1961 PRPC_UNICODE_STRING Name
,
1962 USHORT ClientLanguage
,
1963 USHORT ClientSystemDefaultLanguage
,
1964 PRPC_UNICODE_STRING
*DisplayName
,
1965 USHORT
*LanguageReturned
)
1968 return STATUS_NOT_IMPLEMENTED
;
1973 NTSTATUS WINAPI
LsarDeleteObject(
1974 LSAPR_HANDLE
*ObjectHandle
)
1976 PLSA_DB_OBJECT DbObject
;
1979 TRACE("(%p)\n", ObjectHandle
);
1981 if (ObjectHandle
== NULL
)
1982 return STATUS_INVALID_PARAMETER
;
1984 /* Validate the ObjectHandle */
1985 Status
= LsapValidateDbObject(*ObjectHandle
,
1989 if (!NT_SUCCESS(Status
))
1991 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
1995 /* You cannot delete the policy object */
1996 if (DbObject
->ObjectType
== LsaDbPolicyObject
)
1997 return STATUS_INVALID_PARAMETER
;
1999 /* Delete the database object */
2000 Status
= LsapDeleteDbObject(DbObject
);
2001 if (!NT_SUCCESS(Status
))
2003 ERR("LsapDeleteDbObject returned 0x%08lx\n", Status
);
2007 /* Invalidate the object handle */
2008 *ObjectHandle
= NULL
;
2010 return STATUS_SUCCESS
;
2015 NTSTATUS WINAPI
LsarEnumerateAccountsWithUserRight(
2016 LSAPR_HANDLE PolicyHandle
,
2017 PRPC_UNICODE_STRING UserRight
,
2018 PLSAPR_ACCOUNT_ENUM_BUFFER EnumerationBuffer
)
2021 return STATUS_NOT_IMPLEMENTED
;
2026 NTSTATUS WINAPI
LsarEnumerateAccountRights(
2027 LSAPR_HANDLE PolicyHandle
,
2028 PRPC_SID AccountSid
,
2029 PLSAPR_USER_RIGHT_SET UserRights
)
2031 LSAPR_HANDLE AccountHandle
;
2032 PLSAPR_PRIVILEGE_SET PrivilegeSet
= NULL
;
2033 PRPC_UNICODE_STRING RightsBuffer
= NULL
;
2034 PRPC_UNICODE_STRING PrivilegeString
;
2035 ACCESS_MASK SystemAccess
;
2041 TRACE("LsarEnumerateAccountRights(%p %p %p)\n",
2042 PolicyHandle
, AccountSid
, UserRights
);
2044 /* Open the account */
2045 Status
= LsarOpenAccount(PolicyHandle
,
2049 if (!NT_SUCCESS(Status
))
2051 ERR("LsarOpenAccount returned 0x%08lx\n", Status
);
2055 /* Enumerate the privileges */
2056 Status
= LsarEnumeratePrivilegesAccount(AccountHandle
,
2058 if (!NT_SUCCESS(Status
))
2060 ERR("LsarEnumeratePrivilegesAccount returned 0x%08lx\n", Status
);
2064 /* Get account rights */
2065 Status
= LsarGetSystemAccessAccount(AccountHandle
,
2067 if (!NT_SUCCESS(Status
))
2069 ERR("LsarGetSystemAccessAccount returned 0x%08lx\n", Status
);
2073 RightsCount
= PrivilegeSet
->PrivilegeCount
;
2075 /* Count account rights */
2076 for (i
= 0; i
< sizeof(ACCESS_MASK
) * 8; i
++)
2078 if (SystemAccess
& (1 << i
))
2082 /* We are done if there are no rights to be enumerated */
2083 if (RightsCount
== 0)
2085 UserRights
->Entries
= 0;
2086 UserRights
->UserRights
= NULL
;
2087 Status
= STATUS_SUCCESS
;
2091 /* Allocate a buffer for the account rights */
2092 RightsBuffer
= MIDL_user_allocate(RightsCount
* sizeof(RPC_UNICODE_STRING
));
2093 if (RightsBuffer
== NULL
)
2095 Status
= STATUS_INSUFFICIENT_RESOURCES
;
2099 /* Copy the privileges into the buffer */
2101 for (i
= 0; i
< PrivilegeSet
->PrivilegeCount
; i
++)
2103 PrivilegeString
= NULL
;
2104 Status
= LsarLookupPrivilegeName(PolicyHandle
,
2105 (PLUID
)&PrivilegeSet
->Privilege
[i
].Luid
,
2107 if (!NT_SUCCESS(Status
))
2110 RightsBuffer
[i
].Length
= PrivilegeString
->Length
;
2111 RightsBuffer
[i
].MaximumLength
= PrivilegeString
->MaximumLength
;
2112 RightsBuffer
[i
].Buffer
= PrivilegeString
->Buffer
;
2114 MIDL_user_free(PrivilegeString
);
2118 /* Copy account rights into the buffer */
2119 for (i
= 0; i
< sizeof(ACCESS_MASK
) * 8; i
++)
2121 if (SystemAccess
& (1 << i
))
2123 Status
= LsapLookupAccountRightName(1 << i
,
2125 if (!NT_SUCCESS(Status
))
2128 RightsBuffer
[i
].Length
= PrivilegeString
->Length
;
2129 RightsBuffer
[i
].MaximumLength
= PrivilegeString
->MaximumLength
;
2130 RightsBuffer
[i
].Buffer
= PrivilegeString
->Buffer
;
2132 MIDL_user_free(PrivilegeString
);
2137 UserRights
->Entries
= RightsCount
;
2138 UserRights
->UserRights
= (PRPC_UNICODE_STRING
)RightsBuffer
;
2141 if (!NT_SUCCESS(Status
))
2143 if (RightsBuffer
!= NULL
)
2145 for (RightsIndex
= 0; RightsIndex
< RightsCount
; RightsIndex
++)
2147 if (RightsBuffer
[RightsIndex
].Buffer
!= NULL
)
2148 MIDL_user_free(RightsBuffer
[RightsIndex
].Buffer
);
2151 MIDL_user_free(RightsBuffer
);
2155 if (PrivilegeSet
!= NULL
)
2156 MIDL_user_free(PrivilegeSet
);
2158 LsarClose(&AccountHandle
);
2165 NTSTATUS WINAPI
LsarAddAccountRights(
2166 LSAPR_HANDLE PolicyHandle
,
2167 PRPC_SID AccountSid
,
2168 PLSAPR_USER_RIGHT_SET UserRights
)
2171 return STATUS_NOT_IMPLEMENTED
;
2176 NTSTATUS WINAPI
LsarRemoveAccountRights(
2177 LSAPR_HANDLE PolicyHandle
,
2178 PRPC_SID AccountSid
,
2180 PLSAPR_USER_RIGHT_SET UserRights
)
2183 return STATUS_NOT_IMPLEMENTED
;
2188 NTSTATUS WINAPI
LsarQueryTrustedDomainInfo(
2189 LSAPR_HANDLE PolicyHandle
,
2190 PRPC_SID TrustedDomainSid
,
2191 TRUSTED_INFORMATION_CLASS InformationClass
,
2192 PLSAPR_TRUSTED_DOMAIN_INFO
*TrustedDomainInformation
)
2195 return STATUS_NOT_IMPLEMENTED
;
2200 NTSTATUS WINAPI
LsarSetTrustedDomainInfo(
2201 LSAPR_HANDLE PolicyHandle
,
2202 PRPC_SID TrustedDomainSid
,
2203 TRUSTED_INFORMATION_CLASS InformationClass
,
2204 PLSAPR_TRUSTED_DOMAIN_INFO TrustedDomainInformation
)
2207 return STATUS_NOT_IMPLEMENTED
;
2212 NTSTATUS WINAPI
LsarDeleteTrustedDomain(
2213 LSAPR_HANDLE PolicyHandle
,
2214 PRPC_SID TrustedDomainSid
)
2217 return STATUS_NOT_IMPLEMENTED
;
2222 NTSTATUS WINAPI
LsarStorePrivateData(
2223 LSAPR_HANDLE PolicyHandle
,
2224 PRPC_UNICODE_STRING KeyName
,
2225 PLSAPR_CR_CIPHER_VALUE EncryptedData
)
2228 return STATUS_NOT_IMPLEMENTED
;
2233 NTSTATUS WINAPI
LsarRetrievePrivateData(
2234 LSAPR_HANDLE PolicyHandle
,
2235 PRPC_UNICODE_STRING KeyName
,
2236 PLSAPR_CR_CIPHER_VALUE
*EncryptedData
)
2239 return STATUS_NOT_IMPLEMENTED
;
2244 NTSTATUS WINAPI
LsarOpenPolicy2(
2246 PLSAPR_OBJECT_ATTRIBUTES ObjectAttributes
,
2247 ACCESS_MASK DesiredAccess
,
2248 LSAPR_HANDLE
*PolicyHandle
)
2251 return STATUS_NOT_IMPLEMENTED
;
2256 NTSTATUS WINAPI
LsarGetUserName(
2258 PRPC_UNICODE_STRING
*UserName
,
2259 PRPC_UNICODE_STRING
*DomainName
)
2262 return STATUS_NOT_IMPLEMENTED
;
2267 NTSTATUS WINAPI
LsarQueryInformationPolicy2(
2268 LSAPR_HANDLE PolicyHandle
,
2269 POLICY_INFORMATION_CLASS InformationClass
,
2270 PLSAPR_POLICY_INFORMATION
*PolicyInformation
)
2272 return LsarQueryInformationPolicy(PolicyHandle
,
2279 NTSTATUS WINAPI
LsarSetInformationPolicy2(
2280 LSAPR_HANDLE PolicyHandle
,
2281 POLICY_INFORMATION_CLASS InformationClass
,
2282 PLSAPR_POLICY_INFORMATION PolicyInformation
)
2284 return LsarSetInformationPolicy(PolicyHandle
,
2291 NTSTATUS WINAPI
LsarQueryTrustedDomainInfoByName(
2292 LSAPR_HANDLE PolicyHandle
,
2293 PRPC_UNICODE_STRING TrustedDomainName
,
2294 POLICY_INFORMATION_CLASS InformationClass
,
2295 PLSAPR_TRUSTED_DOMAIN_INFO
*PolicyInformation
)
2298 return STATUS_NOT_IMPLEMENTED
;
2303 NTSTATUS WINAPI
LsarSetTrustedDomainInfoByName(
2304 LSAPR_HANDLE PolicyHandle
,
2305 PRPC_UNICODE_STRING TrustedDomainName
,
2306 POLICY_INFORMATION_CLASS InformationClass
,
2307 PLSAPR_TRUSTED_DOMAIN_INFO PolicyInformation
)
2310 return STATUS_NOT_IMPLEMENTED
;
2315 NTSTATUS WINAPI
LsarEnumerateTrustedDomainsEx(
2316 LSAPR_HANDLE PolicyHandle
,
2317 DWORD
*EnumerationContext
,
2318 PLSAPR_TRUSTED_ENUM_BUFFER_EX EnumerationBuffer
,
2319 DWORD PreferedMaximumLength
)
2322 return STATUS_NOT_IMPLEMENTED
;
2327 NTSTATUS WINAPI
LsarCreateTrustedDomainEx(
2328 LSAPR_HANDLE PolicyHandle
,
2329 PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX TrustedDomainInformation
,
2330 PLSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION AuthentificationInformation
,
2331 ACCESS_MASK DesiredAccess
,
2332 LSAPR_HANDLE
*TrustedDomainHandle
)
2335 return STATUS_NOT_IMPLEMENTED
;
2340 NTSTATUS WINAPI
LsarSetPolicyReplicationHandle(
2341 PLSAPR_HANDLE PolicyHandle
)
2344 return STATUS_NOT_IMPLEMENTED
;
2349 NTSTATUS WINAPI
LsarQueryDomainInformationPolicy(
2350 LSAPR_HANDLE PolicyHandle
,
2351 POLICY_INFORMATION_CLASS InformationClass
,
2352 PLSAPR_POLICY_DOMAIN_INFORMATION
*PolicyInformation
)
2355 return STATUS_NOT_IMPLEMENTED
;
2360 NTSTATUS WINAPI
LsarSetDomainInformationPolicy(
2361 LSAPR_HANDLE PolicyHandle
,
2362 POLICY_INFORMATION_CLASS InformationClass
,
2363 PLSAPR_POLICY_DOMAIN_INFORMATION PolicyInformation
)
2366 return STATUS_NOT_IMPLEMENTED
;
2371 NTSTATUS WINAPI
LsarOpenTrustedDomainByName(
2372 LSAPR_HANDLE PolicyHandle
,
2373 PRPC_UNICODE_STRING TrustedDomainName
,
2374 ACCESS_MASK DesiredAccess
,
2375 LSAPR_HANDLE
*TrustedDomainHandle
)
2378 return STATUS_NOT_IMPLEMENTED
;
2383 NTSTATUS WINAPI
LsarTestCall(
2387 return STATUS_NOT_IMPLEMENTED
;
2392 NTSTATUS WINAPI
LsarLookupSids2(
2393 LSAPR_HANDLE PolicyHandle
,
2394 PLSAPR_SID_ENUM_BUFFER SidEnumBuffer
,
2395 PLSAPR_REFERENCED_DOMAIN_LIST
*ReferencedDomains
,
2396 PLSAPR_TRANSLATED_NAMES_EX TranslatedNames
,
2397 LSAP_LOOKUP_LEVEL LookupLevel
,
2399 DWORD LookupOptions
,
2400 DWORD ClientRevision
)
2404 TRACE("(%p %p %p %p %d %p %lu %lu)\n",
2405 PolicyHandle
, SidEnumBuffer
, ReferencedDomains
, TranslatedNames
,
2406 LookupLevel
, MappedCount
, LookupOptions
, ClientRevision
);
2408 TranslatedNames
->Entries
= SidEnumBuffer
->Entries
;
2409 TranslatedNames
->Names
= NULL
;
2410 *ReferencedDomains
= NULL
;
2412 /* FIXME: Fail, if there is an invalid SID in the SidEnumBuffer */
2414 Status
= LsapLookupSids(SidEnumBuffer
,
2427 NTSTATUS WINAPI
LsarLookupNames2(
2428 LSAPR_HANDLE PolicyHandle
,
2430 PRPC_UNICODE_STRING Names
,
2431 PLSAPR_REFERENCED_DOMAIN_LIST
*ReferencedDomains
,
2432 PLSAPR_TRANSLATED_SIDS_EX TranslatedSids
,
2433 LSAP_LOOKUP_LEVEL LookupLevel
,
2435 DWORD LookupOptions
,
2436 DWORD ClientRevision
)
2438 LSAPR_TRANSLATED_SIDS_EX2 TranslatedSidsEx2
;
2442 TRACE("(%p %lu %p %p %p %d %p %lu %lu)\n",
2443 PolicyHandle
, Count
, Names
, ReferencedDomains
, TranslatedSids
,
2444 LookupLevel
, MappedCount
, LookupOptions
, ClientRevision
);
2446 TranslatedSids
->Entries
= 0;
2447 TranslatedSids
->Sids
= NULL
;
2448 *ReferencedDomains
= NULL
;
2451 return STATUS_NONE_MAPPED
;
2453 TranslatedSidsEx2
.Entries
= 0;
2454 TranslatedSidsEx2
.Sids
= NULL
;
2456 Status
= LsapLookupNames(Count
,
2464 if (!NT_SUCCESS(Status
))
2467 TranslatedSids
->Entries
= TranslatedSidsEx2
.Entries
;
2468 TranslatedSids
->Sids
= MIDL_user_allocate(TranslatedSids
->Entries
* sizeof(LSA_TRANSLATED_SID
));
2469 if (TranslatedSids
->Sids
== NULL
)
2471 MIDL_user_free(TranslatedSidsEx2
.Sids
);
2472 MIDL_user_free(*ReferencedDomains
);
2473 *ReferencedDomains
= NULL
;
2474 return STATUS_INSUFFICIENT_RESOURCES
;
2477 for (i
= 0; i
< TranslatedSidsEx2
.Entries
; i
++)
2479 TranslatedSids
->Sids
[i
].Use
= TranslatedSidsEx2
.Sids
[i
].Use
;
2480 TranslatedSids
->Sids
[i
].RelativeId
= LsapGetRelativeIdFromSid(TranslatedSidsEx2
.Sids
[i
].Sid
);
2481 TranslatedSids
->Sids
[i
].DomainIndex
= TranslatedSidsEx2
.Sids
[i
].DomainIndex
;
2482 TranslatedSids
->Sids
[i
].Flags
= TranslatedSidsEx2
.Sids
[i
].Flags
;
2485 MIDL_user_free(TranslatedSidsEx2
.Sids
);
2487 return STATUS_SUCCESS
;
2492 NTSTATUS WINAPI
LsarCreateTrustedDomainEx2(
2493 LSAPR_HANDLE PolicyHandle
,
2494 PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX TrustedDomainInformation
,
2495 PLSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION_INTERNAL AuthentificationInformation
,
2496 ACCESS_MASK DesiredAccess
,
2497 LSAPR_HANDLE
*TrustedDomainHandle
)
2500 return STATUS_NOT_IMPLEMENTED
;
2505 NTSTATUS WINAPI
CredrWrite(
2509 return STATUS_NOT_IMPLEMENTED
;
2514 NTSTATUS WINAPI
CredrRead(
2518 return STATUS_NOT_IMPLEMENTED
;
2523 NTSTATUS WINAPI
CredrEnumerate(
2527 return STATUS_NOT_IMPLEMENTED
;
2532 NTSTATUS WINAPI
CredrWriteDomainCredentials(
2536 return STATUS_NOT_IMPLEMENTED
;
2541 NTSTATUS WINAPI
CredrReadDomainCredentials(
2545 return STATUS_NOT_IMPLEMENTED
;
2550 NTSTATUS WINAPI
CredrDelete(
2554 return STATUS_NOT_IMPLEMENTED
;
2559 NTSTATUS WINAPI
CredrGetTargetInfo(
2563 return STATUS_NOT_IMPLEMENTED
;
2568 NTSTATUS WINAPI
CredrProfileLoaded(
2572 return STATUS_NOT_IMPLEMENTED
;
2577 NTSTATUS WINAPI
LsarLookupNames3(
2578 LSAPR_HANDLE PolicyHandle
,
2580 PRPC_UNICODE_STRING Names
,
2581 PLSAPR_REFERENCED_DOMAIN_LIST
*ReferencedDomains
,
2582 PLSAPR_TRANSLATED_SIDS_EX2 TranslatedSids
,
2583 LSAP_LOOKUP_LEVEL LookupLevel
,
2585 DWORD LookupOptions
,
2586 DWORD ClientRevision
)
2590 TRACE("(%p %lu %p %p %p %d %p %lu %lu)\n",
2591 PolicyHandle
, Count
, Names
, ReferencedDomains
, TranslatedSids
,
2592 LookupLevel
, MappedCount
, LookupOptions
, ClientRevision
);
2594 TranslatedSids
->Entries
= 0;
2595 TranslatedSids
->Sids
= NULL
;
2596 *ReferencedDomains
= NULL
;
2599 return STATUS_NONE_MAPPED
;
2601 Status
= LsapLookupNames(Count
,
2615 NTSTATUS WINAPI
CredrGetSessionTypes(
2619 return STATUS_NOT_IMPLEMENTED
;
2624 NTSTATUS WINAPI
LsarRegisterAuditEvent(
2628 return STATUS_NOT_IMPLEMENTED
;
2633 NTSTATUS WINAPI
LsarGenAuditEvent(
2637 return STATUS_NOT_IMPLEMENTED
;
2642 NTSTATUS WINAPI
LsarUnregisterAuditEvent(
2646 return STATUS_NOT_IMPLEMENTED
;
2651 NTSTATUS WINAPI
LsarQueryForestTrustInformation(
2652 LSAPR_HANDLE PolicyHandle
,
2653 PLSA_UNICODE_STRING TrustedDomainName
,
2654 LSA_FOREST_TRUST_RECORD_TYPE HighestRecordType
,
2655 PLSA_FOREST_TRUST_INFORMATION
*ForestTrustInfo
)
2658 return STATUS_NOT_IMPLEMENTED
;
2663 NTSTATUS WINAPI
LsarSetForestTrustInformation(
2664 LSAPR_HANDLE PolicyHandle
,
2665 PLSA_UNICODE_STRING TrustedDomainName
,
2666 LSA_FOREST_TRUST_RECORD_TYPE HighestRecordType
,
2667 PLSA_FOREST_TRUST_INFORMATION ForestTrustInfo
,
2669 PLSA_FOREST_TRUST_COLLISION_INFORMATION
*CollisionInfo
)
2672 return STATUS_NOT_IMPLEMENTED
;
2677 NTSTATUS WINAPI
CredrRename(
2681 return STATUS_NOT_IMPLEMENTED
;
2686 NTSTATUS WINAPI
LsarLookupSids3(
2687 LSAPR_HANDLE PolicyHandle
,
2688 PLSAPR_SID_ENUM_BUFFER SidEnumBuffer
,
2689 PLSAPR_REFERENCED_DOMAIN_LIST
*ReferencedDomains
,
2690 PLSAPR_TRANSLATED_NAMES_EX TranslatedNames
,
2691 LSAP_LOOKUP_LEVEL LookupLevel
,
2693 DWORD LookupOptions
,
2694 DWORD ClientRevision
)
2698 TRACE("(%p %p %p %p %d %p %lu %lu)\n",
2699 PolicyHandle
, SidEnumBuffer
, ReferencedDomains
, TranslatedNames
,
2700 LookupLevel
, MappedCount
, LookupOptions
, ClientRevision
);
2702 TranslatedNames
->Entries
= SidEnumBuffer
->Entries
;
2703 TranslatedNames
->Names
= NULL
;
2704 *ReferencedDomains
= NULL
;
2706 /* FIXME: Fail, if there is an invalid SID in the SidEnumBuffer */
2708 Status
= LsapLookupSids(SidEnumBuffer
,
2721 NTSTATUS WINAPI
LsarLookupNames4(
2724 PRPC_UNICODE_STRING Names
,
2725 PLSAPR_REFERENCED_DOMAIN_LIST
*ReferencedDomains
,
2726 PLSAPR_TRANSLATED_SIDS_EX2 TranslatedSids
,
2727 LSAP_LOOKUP_LEVEL LookupLevel
,
2729 DWORD LookupOptions
,
2730 DWORD ClientRevision
)
2734 TRACE("(%p %lu %p %p %p %d %p %lu %lu)\n",
2735 RpcHandle
, Count
, Names
, ReferencedDomains
, TranslatedSids
,
2736 LookupLevel
, MappedCount
, LookupOptions
, ClientRevision
);
2738 TranslatedSids
->Entries
= 0;
2739 TranslatedSids
->Sids
= NULL
;
2740 *ReferencedDomains
= NULL
;
2743 return STATUS_NONE_MAPPED
;
2745 Status
= LsapLookupNames(Count
,
2759 NTSTATUS WINAPI
LsarOpenPolicySce(
2763 return STATUS_NOT_IMPLEMENTED
;
2768 NTSTATUS WINAPI
LsarAdtRegisterSecurityEventSource(
2772 return STATUS_NOT_IMPLEMENTED
;
2777 NTSTATUS WINAPI
LsarAdtUnregisterSecurityEventSource(
2781 return STATUS_NOT_IMPLEMENTED
;
2786 NTSTATUS WINAPI
LsarAdtReportSecurityEvent(
2790 return STATUS_NOT_IMPLEMENTED
;
2795 NTSTATUS WINAPI
CredrFindBestCredential(
2799 return STATUS_NOT_IMPLEMENTED
;
2804 NTSTATUS WINAPI
LsarSetAuditPolicy(
2808 return STATUS_NOT_IMPLEMENTED
;
2813 NTSTATUS WINAPI
LsarQueryAuditPolicy(
2817 return STATUS_NOT_IMPLEMENTED
;
2822 NTSTATUS WINAPI
LsarEnumerateAuditPolicy(
2826 return STATUS_NOT_IMPLEMENTED
;
2831 NTSTATUS WINAPI
LsarEnumerateAuditCategories(
2835 return STATUS_NOT_IMPLEMENTED
;
2840 NTSTATUS WINAPI
LsarEnumerateAuditSubCategories(
2844 return STATUS_NOT_IMPLEMENTED
;
2849 NTSTATUS WINAPI
LsarLookupAuditCategoryName(
2853 return STATUS_NOT_IMPLEMENTED
;
2858 NTSTATUS WINAPI
LsarLookupAuditSubCategoryName(
2862 return STATUS_NOT_IMPLEMENTED
;
2867 NTSTATUS WINAPI
LsarSetAuditSecurity(
2871 return STATUS_NOT_IMPLEMENTED
;
2876 NTSTATUS WINAPI
LsarQueryAuditSecurity(
2880 return STATUS_NOT_IMPLEMENTED
;
2885 NTSTATUS WINAPI
CredReadByTokenHandle(
2889 return STATUS_NOT_IMPLEMENTED
;
2894 NTSTATUS WINAPI
CredrRestoreCredentials(
2898 return STATUS_NOT_IMPLEMENTED
;
2903 NTSTATUS WINAPI
CredrBackupCredentials(
2907 return STATUS_NOT_IMPLEMENTED
;