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
,
263 RtlLeaveCriticalSection(&PolicyHandleTableLock
);
265 if (NT_SUCCESS(Status
))
266 *PolicyHandle
= (LSAPR_HANDLE
)PolicyObject
;
268 TRACE("LsarOpenPolicy done!\n");
275 NTSTATUS WINAPI
LsarQueryInformationPolicy(
276 LSAPR_HANDLE PolicyHandle
,
277 POLICY_INFORMATION_CLASS InformationClass
,
278 PLSAPR_POLICY_INFORMATION
*PolicyInformation
)
280 PLSA_DB_OBJECT PolicyObject
;
281 ACCESS_MASK DesiredAccess
= 0;
284 TRACE("LsarQueryInformationPolicy(%p,0x%08x,%p)\n",
285 PolicyHandle
, InformationClass
, PolicyInformation
);
287 if (PolicyInformation
)
289 TRACE("*PolicyInformation %p\n", *PolicyInformation
);
292 switch (InformationClass
)
294 case PolicyAuditLogInformation
:
295 case PolicyAuditEventsInformation
:
296 case PolicyAuditFullQueryInformation
:
297 DesiredAccess
= POLICY_VIEW_AUDIT_INFORMATION
;
300 case PolicyPrimaryDomainInformation
:
301 case PolicyAccountDomainInformation
:
302 case PolicyLsaServerRoleInformation
:
303 case PolicyReplicaSourceInformation
:
304 case PolicyDefaultQuotaInformation
:
305 case PolicyModificationInformation
:
306 case PolicyDnsDomainInformation
:
307 case PolicyDnsDomainInformationInt
:
308 case PolicyLocalAccountDomainInformation
:
309 DesiredAccess
= POLICY_VIEW_LOCAL_INFORMATION
;
312 case PolicyPdAccountInformation
:
313 DesiredAccess
= POLICY_GET_PRIVATE_INFORMATION
;
317 ERR("Invalid InformationClass!\n");
318 return STATUS_INVALID_PARAMETER
;
321 Status
= LsapValidateDbObject(PolicyHandle
,
325 if (!NT_SUCCESS(Status
))
328 switch (InformationClass
)
330 case PolicyAuditLogInformation
: /* 1 */
331 Status
= LsarQueryAuditLog(PolicyObject
,
335 case PolicyAuditEventsInformation
: /* 2 */
336 Status
= LsarQueryAuditEvents(PolicyObject
,
340 case PolicyPrimaryDomainInformation
: /* 3 */
341 Status
= LsarQueryPrimaryDomain(PolicyObject
,
345 case PolicyPdAccountInformation
: /* 4 */
346 Status
= LsarQueryPdAccount(PolicyObject
,
350 case PolicyAccountDomainInformation
: /* 5 */
351 Status
= LsarQueryAccountDomain(PolicyObject
,
355 case PolicyLsaServerRoleInformation
: /* 6 */
356 Status
= LsarQueryServerRole(PolicyObject
,
360 case PolicyReplicaSourceInformation
: /* 7 */
361 Status
= LsarQueryReplicaSource(PolicyObject
,
365 case PolicyDefaultQuotaInformation
: /* 8 */
366 Status
= LsarQueryDefaultQuota(PolicyObject
,
370 case PolicyModificationInformation
: /* 9 */
371 Status
= LsarQueryModification(PolicyObject
,
375 case PolicyAuditFullQueryInformation
: /* 11 (0xB) */
376 Status
= LsarQueryAuditFull(PolicyObject
,
380 case PolicyDnsDomainInformation
: /* 12 (0xC) */
381 Status
= LsarQueryDnsDomain(PolicyObject
,
385 case PolicyDnsDomainInformationInt
: /* 13 (0xD) */
386 Status
= LsarQueryDnsDomainInt(PolicyObject
,
390 case PolicyLocalAccountDomainInformation
: /* 14 (0xE) */
391 Status
= LsarQueryLocalAccountDomain(PolicyObject
,
396 ERR("Invalid InformationClass!\n");
397 Status
= STATUS_INVALID_PARAMETER
;
405 NTSTATUS WINAPI
LsarSetInformationPolicy(
406 LSAPR_HANDLE PolicyHandle
,
407 POLICY_INFORMATION_CLASS InformationClass
,
408 PLSAPR_POLICY_INFORMATION PolicyInformation
)
410 PLSA_DB_OBJECT PolicyObject
;
411 ACCESS_MASK DesiredAccess
= 0;
414 TRACE("LsarSetInformationPolicy(%p,0x%08x,%p)\n",
415 PolicyHandle
, InformationClass
, PolicyInformation
);
417 if (PolicyInformation
)
419 TRACE("*PolicyInformation %p\n", *PolicyInformation
);
422 switch (InformationClass
)
424 case PolicyAuditLogInformation
:
425 case PolicyAuditFullSetInformation
:
426 DesiredAccess
= POLICY_AUDIT_LOG_ADMIN
;
429 case PolicyAuditEventsInformation
:
430 DesiredAccess
= POLICY_SET_AUDIT_REQUIREMENTS
;
433 case PolicyPrimaryDomainInformation
:
434 case PolicyAccountDomainInformation
:
435 case PolicyDnsDomainInformation
:
436 case PolicyDnsDomainInformationInt
:
437 case PolicyLocalAccountDomainInformation
:
438 DesiredAccess
= POLICY_TRUST_ADMIN
;
441 case PolicyLsaServerRoleInformation
:
442 case PolicyReplicaSourceInformation
:
443 DesiredAccess
= POLICY_SERVER_ADMIN
;
446 case PolicyDefaultQuotaInformation
:
447 DesiredAccess
= POLICY_SET_DEFAULT_QUOTA_LIMITS
;
451 ERR("Invalid InformationClass!\n");
452 return STATUS_INVALID_PARAMETER
;
455 Status
= LsapValidateDbObject(PolicyHandle
,
459 if (!NT_SUCCESS(Status
))
462 switch (InformationClass
)
464 case PolicyAuditLogInformation
: /* 1 */
465 Status
= LsarSetAuditLog(PolicyObject
,
466 (PPOLICY_AUDIT_LOG_INFO
)PolicyInformation
);
469 case PolicyAuditEventsInformation
: /* 2 */
470 Status
= LsarSetAuditEvents(PolicyObject
,
471 (PLSAPR_POLICY_AUDIT_EVENTS_INFO
)PolicyInformation
);
474 case PolicyPrimaryDomainInformation
: /* 3 */
475 Status
= LsarSetPrimaryDomain(PolicyObject
,
476 (PLSAPR_POLICY_PRIMARY_DOM_INFO
)PolicyInformation
);
479 case PolicyAccountDomainInformation
: /* 5 */
480 Status
= LsarSetAccountDomain(PolicyObject
,
481 (PLSAPR_POLICY_ACCOUNT_DOM_INFO
)PolicyInformation
);
484 case PolicyLsaServerRoleInformation
: /* 6 */
485 Status
= LsarSetServerRole(PolicyObject
,
486 (PPOLICY_LSA_SERVER_ROLE_INFO
)PolicyInformation
);
489 case PolicyReplicaSourceInformation
: /* 7 */
490 Status
= LsarSetReplicaSource(PolicyObject
,
491 (PPOLICY_LSA_REPLICA_SRCE_INFO
)PolicyInformation
);
494 case PolicyDefaultQuotaInformation
: /* 8 */
495 Status
= LsarSetDefaultQuota(PolicyObject
,
496 (PPOLICY_DEFAULT_QUOTA_INFO
)PolicyInformation
);
499 case PolicyModificationInformation
: /* 9 */
500 Status
= LsarSetModification(PolicyObject
,
501 (PPOLICY_MODIFICATION_INFO
)PolicyInformation
);
504 case PolicyAuditFullSetInformation
: /* 10 (0xA) */
505 Status
= LsarSetAuditFull(PolicyObject
,
506 (PPOLICY_AUDIT_FULL_QUERY_INFO
)PolicyInformation
);
509 case PolicyDnsDomainInformation
: /* 12 (0xC) */
510 Status
= LsarSetDnsDomain(PolicyObject
,
511 (PLSAPR_POLICY_DNS_DOMAIN_INFO
)PolicyInformation
);
514 case PolicyDnsDomainInformationInt
: /* 13 (0xD) */
515 Status
= LsarSetDnsDomainInt(PolicyObject
,
516 (PLSAPR_POLICY_DNS_DOMAIN_INFO
)PolicyInformation
);
519 case PolicyLocalAccountDomainInformation
: /* 14 (0xE) */
520 Status
= LsarSetLocalAccountDomain(PolicyObject
,
521 (PLSAPR_POLICY_ACCOUNT_DOM_INFO
)PolicyInformation
);
525 Status
= STATUS_INVALID_PARAMETER
;
534 NTSTATUS WINAPI
LsarClearAuditLog(
535 LSAPR_HANDLE ObjectHandle
)
538 return STATUS_NOT_IMPLEMENTED
;
543 NTSTATUS WINAPI
LsarCreateAccount(
544 LSAPR_HANDLE PolicyHandle
,
546 ACCESS_MASK DesiredAccess
,
547 LSAPR_HANDLE
*AccountHandle
)
549 PLSA_DB_OBJECT PolicyObject
;
550 PLSA_DB_OBJECT AccountObject
= NULL
;
551 LPWSTR SidString
= NULL
;
552 PSECURITY_DESCRIPTOR AccountSd
= NULL
;
554 NTSTATUS Status
= STATUS_SUCCESS
;
556 /* Validate the AccountSid */
557 if (!RtlValidSid(AccountSid
))
558 return STATUS_INVALID_PARAMETER
;
560 /* Validate the PolicyHandle */
561 Status
= LsapValidateDbObject(PolicyHandle
,
563 POLICY_CREATE_ACCOUNT
,
565 if (!NT_SUCCESS(Status
))
567 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
571 /* Create SID string */
572 if (!ConvertSidToStringSid((PSID
)AccountSid
,
575 ERR("ConvertSidToStringSid failed\n");
576 Status
= STATUS_INVALID_PARAMETER
;
580 /* Create a security descriptor for the account */
581 Status
= LsapCreateAccountSd(&AccountSd
,
583 if (!NT_SUCCESS(Status
))
585 ERR("LsapCreateAccountSd returned 0x%08lx\n", Status
);
589 /* Create the Account object */
590 Status
= LsapCreateDbObject(PolicyObject
,
596 if (!NT_SUCCESS(Status
))
598 ERR("LsapCreateDbObject failed (Status 0x%08lx)\n", Status
);
602 /* Set the Sid attribute */
603 Status
= LsapSetObjectAttribute(AccountObject
,
606 GetLengthSid(AccountSid
));
607 if (!NT_SUCCESS(Status
))
610 /* Set the SecDesc attribute */
611 Status
= LsapSetObjectAttribute(AccountObject
,
617 if (SidString
!= NULL
)
618 LocalFree(SidString
);
620 if (AccountSd
!= NULL
)
621 RtlFreeHeap(RtlGetProcessHeap(), 0, AccountSd
);
623 if (!NT_SUCCESS(Status
))
625 if (AccountObject
!= NULL
)
626 LsapCloseDbObject(AccountObject
);
630 *AccountHandle
= (LSAPR_HANDLE
)AccountObject
;
633 return STATUS_SUCCESS
;
638 NTSTATUS WINAPI
LsarEnumerateAccounts(
639 LSAPR_HANDLE PolicyHandle
,
640 DWORD
*EnumerationContext
,
641 PLSAPR_ACCOUNT_ENUM_BUFFER EnumerationBuffer
,
642 DWORD PreferedMaximumLength
)
644 LSAPR_ACCOUNT_ENUM_BUFFER EnumBuffer
= {0, NULL
};
645 PLSA_DB_OBJECT PolicyObject
= NULL
;
646 WCHAR AccountKeyName
[64];
647 HANDLE AccountsKeyHandle
= NULL
;
648 HANDLE AccountKeyHandle
;
652 ULONG RequiredLength
;
655 NTSTATUS Status
= STATUS_SUCCESS
;
657 TRACE("(%p %p %p %lu)\n", PolicyHandle
, EnumerationContext
,
658 EnumerationBuffer
, PreferedMaximumLength
);
660 if (EnumerationContext
== NULL
||
661 EnumerationBuffer
== NULL
)
662 return STATUS_INVALID_PARAMETER
;
664 EnumerationBuffer
->EntriesRead
= 0;
665 EnumerationBuffer
->Information
= NULL
;
667 /* Validate the PolicyHandle */
668 Status
= LsapValidateDbObject(PolicyHandle
,
670 POLICY_VIEW_LOCAL_INFORMATION
,
672 if (!NT_SUCCESS(Status
))
674 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
678 Status
= LsapRegOpenKey(PolicyObject
->KeyHandle
,
682 if (!NT_SUCCESS(Status
))
685 EnumIndex
= *EnumerationContext
;
691 Status
= LsapRegEnumerateSubKey(AccountsKeyHandle
,
695 if (!NT_SUCCESS(Status
))
698 TRACE("EnumIndex: %lu\n", EnumIndex
);
699 TRACE("Account key name: %S\n", AccountKeyName
);
701 Status
= LsapRegOpenKey(AccountsKeyHandle
,
705 TRACE("LsapRegOpenKey returned %08lX\n", Status
);
706 if (NT_SUCCESS(Status
))
708 Status
= LsapRegOpenKey(AccountKeyHandle
,
712 TRACE("LsapRegOpenKey returned %08lX\n", Status
);
713 if (NT_SUCCESS(Status
))
716 Status
= LsapRegQueryValue(SidKeyHandle
,
721 TRACE("LsapRegQueryValue returned %08lX\n", Status
);
722 if (NT_SUCCESS(Status
))
724 TRACE("Data length: %lu\n", DataLength
);
726 if ((RequiredLength
+ DataLength
+ sizeof(LSAPR_ACCOUNT_INFORMATION
)) > PreferedMaximumLength
)
729 RequiredLength
+= (DataLength
+ sizeof(LSAPR_ACCOUNT_INFORMATION
));
733 LsapRegCloseKey(SidKeyHandle
);
736 LsapRegCloseKey(AccountKeyHandle
);
742 TRACE("EnumCount: %lu\n", EnumCount
);
743 TRACE("RequiredLength: %lu\n", RequiredLength
);
745 EnumBuffer
.EntriesRead
= EnumCount
;
746 EnumBuffer
.Information
= midl_user_allocate(EnumCount
* sizeof(LSAPR_ACCOUNT_INFORMATION
));
747 if (EnumBuffer
.Information
== NULL
)
749 Status
= STATUS_INSUFFICIENT_RESOURCES
;
753 EnumIndex
= *EnumerationContext
;
754 for (i
= 0; i
< EnumCount
; i
++, EnumIndex
++)
756 Status
= LsapRegEnumerateSubKey(AccountsKeyHandle
,
760 if (!NT_SUCCESS(Status
))
763 TRACE("EnumIndex: %lu\n", EnumIndex
);
764 TRACE("Account key name: %S\n", AccountKeyName
);
766 Status
= LsapRegOpenKey(AccountsKeyHandle
,
770 TRACE("LsapRegOpenKey returned %08lX\n", Status
);
771 if (NT_SUCCESS(Status
))
773 Status
= LsapRegOpenKey(AccountKeyHandle
,
777 TRACE("LsapRegOpenKey returned %08lX\n", Status
);
778 if (NT_SUCCESS(Status
))
781 Status
= LsapRegQueryValue(SidKeyHandle
,
786 TRACE("LsapRegQueryValue returned %08lX\n", Status
);
787 if (NT_SUCCESS(Status
))
789 EnumBuffer
.Information
[i
].Sid
= midl_user_allocate(DataLength
);
790 if (EnumBuffer
.Information
[i
].Sid
== NULL
)
792 LsapRegCloseKey(AccountKeyHandle
);
793 Status
= STATUS_INSUFFICIENT_RESOURCES
;
797 Status
= LsapRegQueryValue(SidKeyHandle
,
800 EnumBuffer
.Information
[i
].Sid
,
802 TRACE("SampRegQueryValue returned %08lX\n", Status
);
805 LsapRegCloseKey(SidKeyHandle
);
808 LsapRegCloseKey(AccountKeyHandle
);
810 if (!NT_SUCCESS(Status
))
815 if (NT_SUCCESS(Status
))
817 *EnumerationContext
+= EnumCount
;
818 EnumerationBuffer
->EntriesRead
= EnumBuffer
.EntriesRead
;
819 EnumerationBuffer
->Information
= EnumBuffer
.Information
;
823 if (!NT_SUCCESS(Status
))
825 if (EnumBuffer
.Information
)
827 for (i
= 0; i
< EnumBuffer
.EntriesRead
; i
++)
829 if (EnumBuffer
.Information
[i
].Sid
!= NULL
)
830 midl_user_free(EnumBuffer
.Information
[i
].Sid
);
833 midl_user_free(EnumBuffer
.Information
);
837 if (AccountsKeyHandle
!= NULL
)
838 LsapRegCloseKey(AccountsKeyHandle
);
845 NTSTATUS WINAPI
LsarCreateTrustedDomain(
846 LSAPR_HANDLE PolicyHandle
,
847 PLSAPR_TRUST_INFORMATION TrustedDomainInformation
,
848 ACCESS_MASK DesiredAccess
,
849 LSAPR_HANDLE
*TrustedDomainHandle
)
852 return STATUS_NOT_IMPLEMENTED
;
857 NTSTATUS WINAPI
LsarEnumerateTrustedDomains(
858 LSAPR_HANDLE PolicyHandle
,
859 DWORD
*EnumerationContext
,
860 PLSAPR_TRUSTED_ENUM_BUFFER EnumerationBuffer
,
861 DWORD PreferedMaximumLength
)
864 return STATUS_NOT_IMPLEMENTED
;
869 NTSTATUS WINAPI
LsarLookupNames(
870 LSAPR_HANDLE PolicyHandle
,
872 PRPC_UNICODE_STRING Names
,
873 PLSAPR_REFERENCED_DOMAIN_LIST
*ReferencedDomains
,
874 PLSAPR_TRANSLATED_SIDS TranslatedSids
,
875 LSAP_LOOKUP_LEVEL LookupLevel
,
878 LSAPR_TRANSLATED_SIDS_EX2 TranslatedSidsEx2
;
882 TRACE("(%p %lu %p %p %p %d %p)\n",
883 PolicyHandle
, Count
, Names
, ReferencedDomains
, TranslatedSids
,
884 LookupLevel
, MappedCount
);
886 TranslatedSids
->Entries
= 0;
887 TranslatedSids
->Sids
= NULL
;
888 *ReferencedDomains
= NULL
;
891 return STATUS_NONE_MAPPED
;
893 TranslatedSidsEx2
.Entries
= 0;
894 TranslatedSidsEx2
.Sids
= NULL
;
896 Status
= LsapLookupNames(Count
,
904 if (!NT_SUCCESS(Status
))
907 TranslatedSids
->Entries
= TranslatedSidsEx2
.Entries
;
908 TranslatedSids
->Sids
= MIDL_user_allocate(TranslatedSids
->Entries
* sizeof(LSA_TRANSLATED_SID
));
909 if (TranslatedSids
->Sids
== NULL
)
911 MIDL_user_free(TranslatedSidsEx2
.Sids
);
912 MIDL_user_free(*ReferencedDomains
);
913 *ReferencedDomains
= NULL
;
914 return STATUS_INSUFFICIENT_RESOURCES
;
917 for (i
= 0; i
< TranslatedSidsEx2
.Entries
; i
++)
919 TranslatedSids
->Sids
[i
].Use
= TranslatedSidsEx2
.Sids
[i
].Use
;
920 TranslatedSids
->Sids
[i
].RelativeId
= LsapGetRelativeIdFromSid(TranslatedSidsEx2
.Sids
[i
].Sid
);
921 TranslatedSids
->Sids
[i
].DomainIndex
= TranslatedSidsEx2
.Sids
[i
].DomainIndex
;
924 MIDL_user_free(TranslatedSidsEx2
.Sids
);
926 return STATUS_SUCCESS
;
931 NTSTATUS WINAPI
LsarLookupSids(
932 LSAPR_HANDLE PolicyHandle
,
933 PLSAPR_SID_ENUM_BUFFER SidEnumBuffer
,
934 PLSAPR_REFERENCED_DOMAIN_LIST
*ReferencedDomains
,
935 PLSAPR_TRANSLATED_NAMES TranslatedNames
,
936 LSAP_LOOKUP_LEVEL LookupLevel
,
939 LSAPR_TRANSLATED_NAMES_EX TranslatedNamesEx
;
943 TRACE("(%p %p %p %p %d %p)\n",
944 PolicyHandle
, SidEnumBuffer
, ReferencedDomains
, TranslatedNames
,
945 LookupLevel
, MappedCount
);
947 /* FIXME: Fail, if there is an invalid SID in the SidEnumBuffer */
949 TranslatedNames
->Entries
= SidEnumBuffer
->Entries
;
950 TranslatedNames
->Names
= NULL
;
951 *ReferencedDomains
= NULL
;
953 TranslatedNamesEx
.Entries
= SidEnumBuffer
->Entries
;
954 TranslatedNamesEx
.Names
= NULL
;
956 Status
= LsapLookupSids(SidEnumBuffer
,
963 if (!NT_SUCCESS(Status
))
966 TranslatedNames
->Entries
= SidEnumBuffer
->Entries
;
967 TranslatedNames
->Names
= MIDL_user_allocate(SidEnumBuffer
->Entries
* sizeof(LSAPR_TRANSLATED_NAME
));
968 if (TranslatedNames
->Names
== NULL
)
970 MIDL_user_free(TranslatedNamesEx
.Names
);
971 MIDL_user_free(*ReferencedDomains
);
972 *ReferencedDomains
= NULL
;
973 return STATUS_INSUFFICIENT_RESOURCES
;
976 for (i
= 0; i
< TranslatedNamesEx
.Entries
; i
++)
978 TranslatedNames
->Names
[i
].Use
= TranslatedNamesEx
.Names
[i
].Use
;
979 TranslatedNames
->Names
[i
].Name
.Length
= TranslatedNamesEx
.Names
[i
].Name
.Length
;
980 TranslatedNames
->Names
[i
].Name
.MaximumLength
= TranslatedNamesEx
.Names
[i
].Name
.MaximumLength
;
981 TranslatedNames
->Names
[i
].Name
.Buffer
= TranslatedNamesEx
.Names
[i
].Name
.Buffer
;
982 TranslatedNames
->Names
[i
].DomainIndex
= TranslatedNamesEx
.Names
[i
].DomainIndex
;
985 MIDL_user_free(TranslatedNamesEx
.Names
);
992 NTSTATUS WINAPI
LsarCreateSecret(
993 LSAPR_HANDLE PolicyHandle
,
994 PRPC_UNICODE_STRING SecretName
,
995 ACCESS_MASK DesiredAccess
,
996 LSAPR_HANDLE
*SecretHandle
)
998 PLSA_DB_OBJECT PolicyObject
;
999 PLSA_DB_OBJECT SecretObject
= NULL
;
1001 PSECURITY_DESCRIPTOR SecretSd
= NULL
;
1003 NTSTATUS Status
= STATUS_SUCCESS
;
1005 /* Validate the PolicyHandle */
1006 Status
= LsapValidateDbObject(PolicyHandle
,
1008 POLICY_CREATE_SECRET
,
1010 if (!NT_SUCCESS(Status
))
1012 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
1016 /* Get the current time */
1017 Status
= NtQuerySystemTime(&Time
);
1018 if (!NT_SUCCESS(Status
))
1020 ERR("NtQuerySystemTime failed (Status 0x%08lx)\n", Status
);
1024 /* Create a security descriptor for the secret */
1025 Status
= LsapCreateSecretSd(&SecretSd
,
1027 if (!NT_SUCCESS(Status
))
1029 ERR("LsapCreateAccountSd returned 0x%08lx\n", Status
);
1033 /* Create the Secret object */
1034 Status
= LsapCreateDbObject(PolicyObject
,
1040 if (!NT_SUCCESS(Status
))
1042 ERR("LsapCreateDbObject failed (Status 0x%08lx)\n", Status
);
1046 /* Set the CurrentTime attribute */
1047 Status
= LsapSetObjectAttribute(SecretObject
,
1050 sizeof(LARGE_INTEGER
));
1051 if (!NT_SUCCESS(Status
))
1053 ERR("LsapSetObjectAttribute (CurrentTime) failed (Status 0x%08lx)\n", Status
);
1057 /* Set the OldTime attribute */
1058 Status
= LsapSetObjectAttribute(SecretObject
,
1061 sizeof(LARGE_INTEGER
));
1062 if (!NT_SUCCESS(Status
))
1064 ERR("LsapSetObjectAttribute (OldTime) failed (Status 0x%08lx)\n", Status
);
1068 /* Set the SecDesc attribute */
1069 Status
= LsapSetObjectAttribute(SecretObject
,
1075 if (SecretSd
!= NULL
)
1076 RtlFreeHeap(RtlGetProcessHeap(), 0, SecretSd
);
1078 if (!NT_SUCCESS(Status
))
1080 if (SecretObject
!= NULL
)
1081 LsapCloseDbObject(SecretObject
);
1085 *SecretHandle
= (LSAPR_HANDLE
)SecretObject
;
1088 return STATUS_SUCCESS
;
1093 NTSTATUS WINAPI
LsarOpenAccount(
1094 LSAPR_HANDLE PolicyHandle
,
1095 PRPC_SID AccountSid
,
1096 ACCESS_MASK DesiredAccess
,
1097 LSAPR_HANDLE
*AccountHandle
)
1099 PLSA_DB_OBJECT PolicyObject
;
1100 PLSA_DB_OBJECT AccountObject
= NULL
;
1101 LPWSTR SidString
= NULL
;
1102 NTSTATUS Status
= STATUS_SUCCESS
;
1104 /* Validate the AccountSid */
1105 if (!RtlValidSid(AccountSid
))
1106 return STATUS_INVALID_PARAMETER
;
1108 /* Validate the PolicyHandle */
1109 Status
= LsapValidateDbObject(PolicyHandle
,
1113 if (!NT_SUCCESS(Status
))
1115 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
1119 /* Create SID string */
1120 if (!ConvertSidToStringSid((PSID
)AccountSid
,
1123 ERR("ConvertSidToStringSid failed\n");
1124 Status
= STATUS_INVALID_PARAMETER
;
1128 /* Create the Account object */
1129 Status
= LsapOpenDbObject(PolicyObject
,
1135 if (!NT_SUCCESS(Status
))
1137 ERR("LsapOpenDbObject failed (Status 0x%08lx)\n", Status
);
1141 /* Set the Sid attribute */
1142 Status
= LsapSetObjectAttribute(AccountObject
,
1145 GetLengthSid(AccountSid
));
1148 if (SidString
!= NULL
)
1149 LocalFree(SidString
);
1151 if (!NT_SUCCESS(Status
))
1153 if (AccountObject
!= NULL
)
1154 LsapCloseDbObject(AccountObject
);
1158 *AccountHandle
= (LSAPR_HANDLE
)AccountObject
;
1166 NTSTATUS WINAPI
LsarEnumeratePrivilegesAccount(
1167 LSAPR_HANDLE AccountHandle
,
1168 PLSAPR_PRIVILEGE_SET
*Privileges
)
1170 PLSA_DB_OBJECT AccountObject
;
1171 ULONG PrivilegeSetSize
= 0;
1172 PLSAPR_PRIVILEGE_SET PrivilegeSet
= NULL
;
1177 /* Validate the AccountHandle */
1178 Status
= LsapValidateDbObject(AccountHandle
,
1182 if (!NT_SUCCESS(Status
))
1184 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
1188 /* Get the size of the privilege set */
1189 Status
= LsapGetObjectAttribute(AccountObject
,
1193 if (!NT_SUCCESS(Status
))
1196 /* Allocate a buffer for the privilege set */
1197 PrivilegeSet
= MIDL_user_allocate(PrivilegeSetSize
);
1198 if (PrivilegeSet
== NULL
)
1199 return STATUS_NO_MEMORY
;
1201 /* Get the privilege set */
1202 Status
= LsapGetObjectAttribute(AccountObject
,
1206 if (!NT_SUCCESS(Status
))
1208 MIDL_user_free(PrivilegeSet
);
1212 /* Return a pointer to the privilege set */
1213 *Privileges
= PrivilegeSet
;
1215 return STATUS_SUCCESS
;
1220 NTSTATUS WINAPI
LsarAddPrivilegesToAccount(
1221 LSAPR_HANDLE AccountHandle
,
1222 PLSAPR_PRIVILEGE_SET Privileges
)
1224 PLSA_DB_OBJECT AccountObject
;
1225 PPRIVILEGE_SET CurrentPrivileges
= NULL
;
1226 PPRIVILEGE_SET NewPrivileges
= NULL
;
1227 ULONG PrivilegeSetSize
= 0;
1228 ULONG PrivilegeCount
;
1233 /* Validate the AccountHandle */
1234 Status
= LsapValidateDbObject(AccountHandle
,
1236 ACCOUNT_ADJUST_PRIVILEGES
,
1238 if (!NT_SUCCESS(Status
))
1240 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
1244 Status
= LsapGetObjectAttribute(AccountObject
,
1248 if (!NT_SUCCESS(Status
) || PrivilegeSetSize
== 0)
1250 /* The Privilgs attribute does not exist */
1252 PrivilegeSetSize
= sizeof(PRIVILEGE_SET
) +
1253 (Privileges
->PrivilegeCount
- 1) * sizeof(LUID_AND_ATTRIBUTES
);
1254 Status
= LsapSetObjectAttribute(AccountObject
,
1261 /* The Privilgs attribute exists */
1263 /* Allocate memory for the stored privilege set */
1264 CurrentPrivileges
= MIDL_user_allocate(PrivilegeSetSize
);
1265 if (CurrentPrivileges
== NULL
)
1266 return STATUS_NO_MEMORY
;
1268 /* Get the current privilege set */
1269 Status
= LsapGetObjectAttribute(AccountObject
,
1273 if (!NT_SUCCESS(Status
))
1275 TRACE("LsapGetObjectAttribute() failed (Status 0x%08lx)\n", Status
);
1279 PrivilegeCount
= CurrentPrivileges
->PrivilegeCount
;
1280 TRACE("Current privilege count: %lu\n", PrivilegeCount
);
1282 /* Calculate the number privileges in the combined privilege set */
1283 for (i
= 0; i
< Privileges
->PrivilegeCount
; i
++)
1286 for (j
= 0; j
< CurrentPrivileges
->PrivilegeCount
; j
++)
1288 if (RtlEqualLuid(&(Privileges
->Privilege
[i
].Luid
),
1289 &(CurrentPrivileges
->Privilege
[i
].Luid
)))
1296 if (bFound
== FALSE
)
1298 TRACE("Found new privilege\n");
1302 TRACE("New privilege count: %lu\n", PrivilegeCount
);
1304 /* Calculate the size of the new privilege set and allocate it */
1305 PrivilegeSetSize
= sizeof(PRIVILEGE_SET
) +
1306 (PrivilegeCount
- 1) * sizeof(LUID_AND_ATTRIBUTES
);
1307 NewPrivileges
= MIDL_user_allocate(PrivilegeSetSize
);
1308 if (NewPrivileges
== NULL
)
1310 Status
= STATUS_NO_MEMORY
;
1314 /* Initialize the new privilege set */
1315 NewPrivileges
->PrivilegeCount
= PrivilegeCount
;
1316 NewPrivileges
->Control
= 0;
1318 /* Copy all privileges from the current privilege set */
1319 RtlCopyLuidAndAttributesArray(CurrentPrivileges
->PrivilegeCount
,
1320 &(CurrentPrivileges
->Privilege
[0]),
1321 &(NewPrivileges
->Privilege
[0]));
1323 /* Add new privileges to the new privilege set */
1324 PrivilegeCount
= CurrentPrivileges
->PrivilegeCount
;
1325 for (i
= 0; i
< Privileges
->PrivilegeCount
; i
++)
1328 for (j
= 0; j
< CurrentPrivileges
->PrivilegeCount
; j
++)
1330 if (RtlEqualLuid(&(Privileges
->Privilege
[i
].Luid
),
1331 &(CurrentPrivileges
->Privilege
[i
].Luid
)))
1333 /* Overwrite attributes if a matching privilege was found */
1334 NewPrivileges
->Privilege
[j
].Attributes
= Privileges
->Privilege
[i
].Attributes
;
1341 if (bFound
== FALSE
)
1343 /* Copy the new privilege */
1344 RtlCopyLuidAndAttributesArray(1,
1345 (PLUID_AND_ATTRIBUTES
)&(Privileges
->Privilege
[i
]),
1346 &(NewPrivileges
->Privilege
[PrivilegeCount
]));
1351 /* Set the new priivliege set */
1352 Status
= LsapSetObjectAttribute(AccountObject
,
1359 if (CurrentPrivileges
!= NULL
)
1360 MIDL_user_free(CurrentPrivileges
);
1362 if (NewPrivileges
!= NULL
)
1363 MIDL_user_free(NewPrivileges
);
1370 NTSTATUS WINAPI
LsarRemovePrivilegesFromAccount(
1371 LSAPR_HANDLE AccountHandle
,
1373 PLSAPR_PRIVILEGE_SET Privileges
)
1376 return STATUS_NOT_IMPLEMENTED
;
1381 NTSTATUS WINAPI
LsarGetQuotasForAccount(
1382 LSAPR_HANDLE AccountHandle
,
1383 PQUOTA_LIMITS QuotaLimits
)
1385 PLSA_DB_OBJECT AccountObject
;
1389 TRACE("(%p %p)\n", AccountHandle
, QuotaLimits
);
1391 /* Validate the account handle */
1392 Status
= LsapValidateDbObject(AccountHandle
,
1396 if (!NT_SUCCESS(Status
))
1398 ERR("Invalid handle (Status %lx)\n", Status
);
1402 /* Get the quota attribute */
1403 Status
= LsapGetObjectAttribute(AccountObject
,
1413 NTSTATUS WINAPI
LsarSetQuotasForAccount(
1414 LSAPR_HANDLE AccountHandle
,
1415 PQUOTA_LIMITS QuotaLimits
)
1417 PLSA_DB_OBJECT AccountObject
;
1418 QUOTA_LIMITS InternalQuotaLimits
;
1422 TRACE("(%p %p)\n", AccountHandle
, QuotaLimits
);
1424 /* Validate the account handle */
1425 Status
= LsapValidateDbObject(AccountHandle
,
1427 ACCOUNT_ADJUST_QUOTAS
,
1429 if (!NT_SUCCESS(Status
))
1431 ERR("Invalid handle (Status %lx)\n", Status
);
1435 /* Get the quota limits attribute */
1436 Size
= sizeof(QUOTA_LIMITS
);
1437 Status
= LsapGetObjectAttribute(AccountObject
,
1439 &InternalQuotaLimits
,
1441 if (!NT_SUCCESS(Status
))
1443 TRACE("LsapGetObjectAttribute() failed (Status 0x%08lx)\n", Status
);
1447 /* Update the quota limits */
1448 if (QuotaLimits
->PagedPoolLimit
!= 0)
1449 InternalQuotaLimits
.PagedPoolLimit
= QuotaLimits
->PagedPoolLimit
;
1451 if (QuotaLimits
->NonPagedPoolLimit
!= 0)
1452 InternalQuotaLimits
.NonPagedPoolLimit
= QuotaLimits
->NonPagedPoolLimit
;
1454 if (QuotaLimits
->MinimumWorkingSetSize
!= 0)
1455 InternalQuotaLimits
.MinimumWorkingSetSize
= QuotaLimits
->MinimumWorkingSetSize
;
1457 if (QuotaLimits
->MaximumWorkingSetSize
!= 0)
1458 InternalQuotaLimits
.MaximumWorkingSetSize
= QuotaLimits
->MaximumWorkingSetSize
;
1460 if (QuotaLimits
->PagefileLimit
!= 0)
1461 InternalQuotaLimits
.PagefileLimit
= QuotaLimits
->PagefileLimit
;
1463 /* Set the quota limits attribute */
1464 Status
= LsapSetObjectAttribute(AccountObject
,
1466 &InternalQuotaLimits
,
1467 sizeof(QUOTA_LIMITS
));
1474 NTSTATUS WINAPI
LsarGetSystemAccessAccount(
1475 LSAPR_HANDLE AccountHandle
,
1476 ACCESS_MASK
*SystemAccess
)
1478 PLSA_DB_OBJECT AccountObject
;
1482 /* Validate the account handle */
1483 Status
= LsapValidateDbObject(AccountHandle
,
1487 if (!NT_SUCCESS(Status
))
1489 ERR("Invalid handle (Status %lx)\n", Status
);
1493 /* Get the system access flags */
1494 Status
= LsapGetObjectAttribute(AccountObject
,
1504 NTSTATUS WINAPI
LsarSetSystemAccessAccount(
1505 LSAPR_HANDLE AccountHandle
,
1506 ACCESS_MASK SystemAccess
)
1508 PLSA_DB_OBJECT AccountObject
;
1511 /* Validate the account handle */
1512 Status
= LsapValidateDbObject(AccountHandle
,
1514 ACCOUNT_ADJUST_SYSTEM_ACCESS
,
1516 if (!NT_SUCCESS(Status
))
1518 ERR("Invalid handle (Status %lx)\n", Status
);
1522 /* Set the system access flags */
1523 Status
= LsapSetObjectAttribute(AccountObject
,
1526 sizeof(ACCESS_MASK
));
1533 NTSTATUS WINAPI
LsarOpenTrustedDomain(
1534 LSAPR_HANDLE PolicyHandle
,
1535 PRPC_SID TrustedDomainSid
,
1536 ACCESS_MASK DesiredAccess
,
1537 LSAPR_HANDLE
*TrustedDomainHandle
)
1540 return STATUS_NOT_IMPLEMENTED
;
1545 NTSTATUS WINAPI
LsarQueryInfoTrustedDomain(
1546 LSAPR_HANDLE TrustedDomainHandle
,
1547 TRUSTED_INFORMATION_CLASS InformationClass
,
1548 PLSAPR_TRUSTED_DOMAIN_INFO
*TrustedDomainInformation
)
1551 return STATUS_NOT_IMPLEMENTED
;
1556 NTSTATUS WINAPI
LsarSetInformationTrustedDomain(
1557 LSAPR_HANDLE TrustedDomainHandle
,
1558 TRUSTED_INFORMATION_CLASS InformationClass
,
1559 PLSAPR_TRUSTED_DOMAIN_INFO TrustedDomainInformation
)
1562 return STATUS_NOT_IMPLEMENTED
;
1567 NTSTATUS WINAPI
LsarOpenSecret(
1568 LSAPR_HANDLE PolicyHandle
,
1569 PRPC_UNICODE_STRING SecretName
,
1570 ACCESS_MASK DesiredAccess
,
1571 LSAPR_HANDLE
*SecretHandle
)
1573 PLSA_DB_OBJECT PolicyObject
;
1574 PLSA_DB_OBJECT SecretObject
= NULL
;
1575 NTSTATUS Status
= STATUS_SUCCESS
;
1577 /* Validate the PolicyHandle */
1578 Status
= LsapValidateDbObject(PolicyHandle
,
1582 if (!NT_SUCCESS(Status
))
1584 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
1588 /* Create the secret object */
1589 Status
= LsapOpenDbObject(PolicyObject
,
1595 if (!NT_SUCCESS(Status
))
1597 ERR("LsapOpenDbObject failed (Status 0x%08lx)\n", Status
);
1602 if (!NT_SUCCESS(Status
))
1604 if (SecretObject
!= NULL
)
1605 LsapCloseDbObject(SecretObject
);
1609 *SecretHandle
= (LSAPR_HANDLE
)SecretObject
;
1617 NTSTATUS WINAPI
LsarSetSecret(
1618 LSAPR_HANDLE SecretHandle
,
1619 PLSAPR_CR_CIPHER_VALUE EncryptedCurrentValue
,
1620 PLSAPR_CR_CIPHER_VALUE EncryptedOldValue
)
1622 PLSA_DB_OBJECT SecretObject
;
1623 PBYTE CurrentValue
= NULL
;
1624 PBYTE OldValue
= NULL
;
1625 ULONG CurrentValueLength
= 0;
1626 ULONG OldValueLength
= 0;
1630 TRACE("LsarSetSecret(%p %p %p)\n", SecretHandle
,
1631 EncryptedCurrentValue
, EncryptedOldValue
);
1633 /* Validate the SecretHandle */
1634 Status
= LsapValidateDbObject(SecretHandle
,
1638 if (!NT_SUCCESS(Status
))
1640 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
1644 if (EncryptedCurrentValue
!= NULL
)
1646 /* FIXME: Decrypt the current value */
1647 CurrentValue
= EncryptedCurrentValue
->Buffer
;
1648 CurrentValueLength
= EncryptedCurrentValue
->MaximumLength
;
1651 /* Set the current value */
1652 Status
= LsapSetObjectAttribute(SecretObject
,
1655 CurrentValueLength
);
1656 if (!NT_SUCCESS(Status
))
1658 ERR("LsapSetObjectAttribute failed (Status 0x%08lx)\n", Status
);
1662 /* Get the current time */
1663 Status
= NtQuerySystemTime(&Time
);
1664 if (!NT_SUCCESS(Status
))
1666 ERR("NtQuerySystemTime failed (Status 0x%08lx)\n", Status
);
1670 /* Set the current time */
1671 Status
= LsapSetObjectAttribute(SecretObject
,
1674 sizeof(LARGE_INTEGER
));
1675 if (!NT_SUCCESS(Status
))
1677 ERR("LsapSetObjectAttribute failed (Status 0x%08lx)\n", Status
);
1681 if (EncryptedOldValue
!= NULL
)
1683 /* FIXME: Decrypt the old value */
1684 OldValue
= EncryptedOldValue
->Buffer
;
1685 OldValueLength
= EncryptedOldValue
->MaximumLength
;
1688 /* Set the old value */
1689 Status
= LsapSetObjectAttribute(SecretObject
,
1693 if (!NT_SUCCESS(Status
))
1695 ERR("LsapSetObjectAttribute failed (Status 0x%08lx)\n", Status
);
1699 /* Set the old time */
1700 Status
= LsapSetObjectAttribute(SecretObject
,
1703 sizeof(LARGE_INTEGER
));
1704 if (!NT_SUCCESS(Status
))
1706 ERR("LsapSetObjectAttribute failed (Status 0x%08lx)\n", Status
);
1715 NTSTATUS WINAPI
LsarQuerySecret(
1716 LSAPR_HANDLE SecretHandle
,
1717 PLSAPR_CR_CIPHER_VALUE
*EncryptedCurrentValue
,
1718 PLARGE_INTEGER CurrentValueSetTime
,
1719 PLSAPR_CR_CIPHER_VALUE
*EncryptedOldValue
,
1720 PLARGE_INTEGER OldValueSetTime
)
1722 PLSA_DB_OBJECT SecretObject
;
1723 PLSAPR_CR_CIPHER_VALUE EncCurrentValue
= NULL
;
1724 PLSAPR_CR_CIPHER_VALUE EncOldValue
= NULL
;
1725 PBYTE CurrentValue
= NULL
;
1726 PBYTE OldValue
= NULL
;
1727 ULONG CurrentValueLength
= 0;
1728 ULONG OldValueLength
= 0;
1732 TRACE("LsarQuerySecret(%p %p %p %p %p)\n", SecretHandle
,
1733 EncryptedCurrentValue
, CurrentValueSetTime
,
1734 EncryptedOldValue
, OldValueSetTime
);
1736 /* Validate the SecretHandle */
1737 Status
= LsapValidateDbObject(SecretHandle
,
1741 if (!NT_SUCCESS(Status
))
1743 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
1747 if (EncryptedCurrentValue
!= NULL
)
1749 CurrentValueLength
= 0;
1751 /* Get the size of the current value */
1752 Status
= LsapGetObjectAttribute(SecretObject
,
1755 &CurrentValueLength
);
1756 if (!NT_SUCCESS(Status
))
1759 /* Allocate a buffer for the current value */
1760 CurrentValue
= midl_user_allocate(CurrentValueLength
);
1761 if (CurrentValue
== NULL
)
1763 Status
= STATUS_INSUFFICIENT_RESOURCES
;
1767 /* Get the current value */
1768 Status
= LsapGetObjectAttribute(SecretObject
,
1771 &CurrentValueLength
);
1772 if (!NT_SUCCESS(Status
))
1775 /* Allocate a buffer for the encrypted current value */
1776 EncCurrentValue
= midl_user_allocate(sizeof(LSAPR_CR_CIPHER_VALUE
));
1777 if (EncCurrentValue
== NULL
)
1779 Status
= STATUS_INSUFFICIENT_RESOURCES
;
1783 /* FIXME: Encrypt the current value */
1784 EncCurrentValue
->Length
= (USHORT
)(CurrentValueLength
- sizeof(WCHAR
));
1785 EncCurrentValue
->MaximumLength
= (USHORT
)CurrentValueLength
;
1786 EncCurrentValue
->Buffer
= (PBYTE
)CurrentValue
;
1789 if (CurrentValueSetTime
!= NULL
)
1791 BufferSize
= sizeof(LARGE_INTEGER
);
1793 /* Get the current value time */
1794 Status
= LsapGetObjectAttribute(SecretObject
,
1796 (PBYTE
)CurrentValueSetTime
,
1798 if (!NT_SUCCESS(Status
))
1802 if (EncryptedOldValue
!= NULL
)
1806 /* Get the size of the old value */
1807 Status
= LsapGetObjectAttribute(SecretObject
,
1811 if (!NT_SUCCESS(Status
))
1814 /* Allocate a buffer for the old value */
1815 OldValue
= midl_user_allocate(OldValueLength
);
1816 if (OldValue
== NULL
)
1818 Status
= STATUS_INSUFFICIENT_RESOURCES
;
1822 /* Get the old value */
1823 Status
= LsapGetObjectAttribute(SecretObject
,
1827 if (!NT_SUCCESS(Status
))
1830 /* Allocate a buffer for the encrypted old value */
1831 EncOldValue
= midl_user_allocate(sizeof(LSAPR_CR_CIPHER_VALUE
) + OldValueLength
);
1832 if (EncOldValue
== NULL
)
1834 Status
= STATUS_INSUFFICIENT_RESOURCES
;
1838 /* FIXME: Encrypt the old value */
1839 EncOldValue
->Length
= (USHORT
)(OldValueLength
- sizeof(WCHAR
));
1840 EncOldValue
->MaximumLength
= (USHORT
)OldValueLength
;
1841 EncOldValue
->Buffer
= (PBYTE
)OldValue
;
1844 if (OldValueSetTime
!= NULL
)
1846 BufferSize
= sizeof(LARGE_INTEGER
);
1848 /* Get the old value time */
1849 Status
= LsapGetObjectAttribute(SecretObject
,
1851 (PBYTE
)OldValueSetTime
,
1853 if (!NT_SUCCESS(Status
))
1859 if (NT_SUCCESS(Status
))
1861 if (EncryptedCurrentValue
!= NULL
)
1862 *EncryptedCurrentValue
= EncCurrentValue
;
1864 if (EncryptedOldValue
!= NULL
)
1865 *EncryptedOldValue
= EncOldValue
;
1869 if (EncryptedCurrentValue
!= NULL
)
1870 *EncryptedCurrentValue
= NULL
;
1872 if (EncryptedOldValue
!= NULL
)
1873 *EncryptedOldValue
= NULL
;
1875 if (EncCurrentValue
!= NULL
)
1876 midl_user_free(EncCurrentValue
);
1878 if (EncOldValue
!= NULL
)
1879 midl_user_free(EncOldValue
);
1881 if (CurrentValue
!= NULL
)
1882 midl_user_free(CurrentValue
);
1884 if (OldValue
!= NULL
)
1885 midl_user_free(OldValue
);
1888 TRACE("LsarQuerySecret done (Status 0x%08lx)\n", Status
);
1895 NTSTATUS WINAPI
LsarLookupPrivilegeValue(
1896 LSAPR_HANDLE PolicyHandle
,
1897 PRPC_UNICODE_STRING Name
,
1902 TRACE("LsarLookupPrivilegeValue(%p, %wZ, %p)\n",
1903 PolicyHandle
, Name
, Value
);
1905 Status
= LsapValidateDbObject(PolicyHandle
,
1907 POLICY_LOOKUP_NAMES
,
1909 if (!NT_SUCCESS(Status
))
1911 ERR("Invalid handle (Status %lx)\n", Status
);
1915 TRACE("Privilege: %wZ\n", Name
);
1917 Status
= LsarpLookupPrivilegeValue(Name
,
1925 NTSTATUS WINAPI
LsarLookupPrivilegeName(
1926 LSAPR_HANDLE PolicyHandle
,
1928 PRPC_UNICODE_STRING
*Name
)
1932 TRACE("LsarLookupPrivilegeName(%p, %p, %p)\n",
1933 PolicyHandle
, Value
, Name
);
1935 Status
= LsapValidateDbObject(PolicyHandle
,
1937 POLICY_LOOKUP_NAMES
,
1939 if (!NT_SUCCESS(Status
))
1941 ERR("Invalid handle\n");
1945 Status
= LsarpLookupPrivilegeName(Value
,
1953 NTSTATUS WINAPI
LsarLookupPrivilegeDisplayName(
1954 LSAPR_HANDLE PolicyHandle
,
1955 PRPC_UNICODE_STRING Name
,
1956 USHORT ClientLanguage
,
1957 USHORT ClientSystemDefaultLanguage
,
1958 PRPC_UNICODE_STRING
*DisplayName
,
1959 USHORT
*LanguageReturned
)
1962 return STATUS_NOT_IMPLEMENTED
;
1967 NTSTATUS WINAPI
LsarDeleteObject(
1968 LSAPR_HANDLE
*ObjectHandle
)
1970 PLSA_DB_OBJECT DbObject
;
1973 TRACE("(%p)\n", ObjectHandle
);
1975 if (ObjectHandle
== NULL
)
1976 return STATUS_INVALID_PARAMETER
;
1978 /* Validate the ObjectHandle */
1979 Status
= LsapValidateDbObject(*ObjectHandle
,
1983 if (!NT_SUCCESS(Status
))
1985 ERR("LsapValidateDbObject returned 0x%08lx\n", Status
);
1989 /* You cannot delete the policy object */
1990 if (DbObject
->ObjectType
== LsaDbPolicyObject
)
1991 return STATUS_INVALID_PARAMETER
;
1993 /* Delete the database object */
1994 Status
= LsapDeleteDbObject(DbObject
);
1995 if (!NT_SUCCESS(Status
))
1997 ERR("LsapDeleteDbObject returned 0x%08lx\n", Status
);
2001 /* Invalidate the object handle */
2002 *ObjectHandle
= NULL
;
2004 return STATUS_SUCCESS
;
2009 NTSTATUS WINAPI
LsarEnumerateAccountsWithUserRight(
2010 LSAPR_HANDLE PolicyHandle
,
2011 PRPC_UNICODE_STRING UserRight
,
2012 PLSAPR_ACCOUNT_ENUM_BUFFER EnumerationBuffer
)
2015 return STATUS_NOT_IMPLEMENTED
;
2020 NTSTATUS WINAPI
LsarEnumerateAccountRights(
2021 LSAPR_HANDLE PolicyHandle
,
2022 PRPC_SID AccountSid
,
2023 PLSAPR_USER_RIGHT_SET UserRights
)
2025 LSAPR_HANDLE AccountHandle
;
2026 PLSAPR_PRIVILEGE_SET PrivilegeSet
= NULL
;
2027 PRPC_UNICODE_STRING RightsBuffer
= NULL
;
2028 PRPC_UNICODE_STRING PrivilegeString
;
2029 ACCESS_MASK SystemAccess
;
2035 TRACE("LsarEnumerateAccountRights(%p %p %p)\n",
2036 PolicyHandle
, AccountSid
, UserRights
);
2038 /* Open the account */
2039 Status
= LsarOpenAccount(PolicyHandle
,
2043 if (!NT_SUCCESS(Status
))
2045 ERR("LsarOpenAccount returned 0x%08lx\n", Status
);
2049 /* Enumerate the privileges */
2050 Status
= LsarEnumeratePrivilegesAccount(AccountHandle
,
2052 if (!NT_SUCCESS(Status
))
2054 ERR("LsarEnumeratePrivilegesAccount returned 0x%08lx\n", Status
);
2058 /* Get account rights */
2059 Status
= LsarGetSystemAccessAccount(AccountHandle
,
2061 if (!NT_SUCCESS(Status
))
2063 ERR("LsarGetSystemAccessAccount returned 0x%08lx\n", Status
);
2067 RightsCount
= PrivilegeSet
->PrivilegeCount
;
2069 /* Count account rights */
2070 for (i
= 0; i
< sizeof(ACCESS_MASK
) * 8; i
++)
2072 if (SystemAccess
& (1 << i
))
2076 /* We are done if there are no rights to be enumerated */
2077 if (RightsCount
== 0)
2079 UserRights
->Entries
= 0;
2080 UserRights
->UserRights
= NULL
;
2081 Status
= STATUS_SUCCESS
;
2085 /* Allocate a buffer for the account rights */
2086 RightsBuffer
= MIDL_user_allocate(RightsCount
* sizeof(RPC_UNICODE_STRING
));
2087 if (RightsBuffer
== NULL
)
2089 Status
= STATUS_INSUFFICIENT_RESOURCES
;
2093 /* Copy the privileges into the buffer */
2095 for (i
= 0; i
< PrivilegeSet
->PrivilegeCount
; i
++)
2097 PrivilegeString
= NULL
;
2098 Status
= LsarLookupPrivilegeName(PolicyHandle
,
2099 (PLUID
)&PrivilegeSet
->Privilege
[i
].Luid
,
2101 if (!NT_SUCCESS(Status
))
2104 RightsBuffer
[i
].Length
= PrivilegeString
->Length
;
2105 RightsBuffer
[i
].MaximumLength
= PrivilegeString
->MaximumLength
;
2106 RightsBuffer
[i
].Buffer
= PrivilegeString
->Buffer
;
2108 MIDL_user_free(PrivilegeString
);
2112 /* Copy account rights into the buffer */
2113 for (i
= 0; i
< sizeof(ACCESS_MASK
) * 8; i
++)
2115 if (SystemAccess
& (1 << i
))
2117 Status
= LsapLookupAccountRightName(1 << i
,
2119 if (!NT_SUCCESS(Status
))
2122 RightsBuffer
[i
].Length
= PrivilegeString
->Length
;
2123 RightsBuffer
[i
].MaximumLength
= PrivilegeString
->MaximumLength
;
2124 RightsBuffer
[i
].Buffer
= PrivilegeString
->Buffer
;
2126 MIDL_user_free(PrivilegeString
);
2131 UserRights
->Entries
= RightsCount
;
2132 UserRights
->UserRights
= (PRPC_UNICODE_STRING
)RightsBuffer
;
2135 if (!NT_SUCCESS(Status
))
2137 if (RightsBuffer
!= NULL
)
2139 for (RightsIndex
= 0; RightsIndex
< RightsCount
; RightsIndex
++)
2141 if (RightsBuffer
[RightsIndex
].Buffer
!= NULL
)
2142 MIDL_user_free(RightsBuffer
[RightsIndex
].Buffer
);
2145 MIDL_user_free(RightsBuffer
);
2149 if (PrivilegeSet
!= NULL
)
2150 MIDL_user_free(PrivilegeSet
);
2152 LsarClose(&AccountHandle
);
2159 NTSTATUS WINAPI
LsarAddAccountRights(
2160 LSAPR_HANDLE PolicyHandle
,
2161 PRPC_SID AccountSid
,
2162 PLSAPR_USER_RIGHT_SET UserRights
)
2165 return STATUS_NOT_IMPLEMENTED
;
2170 NTSTATUS WINAPI
LsarRemoveAccountRights(
2171 LSAPR_HANDLE PolicyHandle
,
2172 PRPC_SID AccountSid
,
2174 PLSAPR_USER_RIGHT_SET UserRights
)
2177 return STATUS_NOT_IMPLEMENTED
;
2182 NTSTATUS WINAPI
LsarQueryTrustedDomainInfo(
2183 LSAPR_HANDLE PolicyHandle
,
2184 PRPC_SID TrustedDomainSid
,
2185 TRUSTED_INFORMATION_CLASS InformationClass
,
2186 PLSAPR_TRUSTED_DOMAIN_INFO
*TrustedDomainInformation
)
2189 return STATUS_NOT_IMPLEMENTED
;
2194 NTSTATUS WINAPI
LsarSetTrustedDomainInfo(
2195 LSAPR_HANDLE PolicyHandle
,
2196 PRPC_SID TrustedDomainSid
,
2197 TRUSTED_INFORMATION_CLASS InformationClass
,
2198 PLSAPR_TRUSTED_DOMAIN_INFO TrustedDomainInformation
)
2201 return STATUS_NOT_IMPLEMENTED
;
2206 NTSTATUS WINAPI
LsarDeleteTrustedDomain(
2207 LSAPR_HANDLE PolicyHandle
,
2208 PRPC_SID TrustedDomainSid
)
2211 return STATUS_NOT_IMPLEMENTED
;
2216 NTSTATUS WINAPI
LsarStorePrivateData(
2217 LSAPR_HANDLE PolicyHandle
,
2218 PRPC_UNICODE_STRING KeyName
,
2219 PLSAPR_CR_CIPHER_VALUE EncryptedData
)
2222 return STATUS_NOT_IMPLEMENTED
;
2227 NTSTATUS WINAPI
LsarRetrievePrivateData(
2228 LSAPR_HANDLE PolicyHandle
,
2229 PRPC_UNICODE_STRING KeyName
,
2230 PLSAPR_CR_CIPHER_VALUE
*EncryptedData
)
2233 return STATUS_NOT_IMPLEMENTED
;
2238 NTSTATUS WINAPI
LsarOpenPolicy2(
2240 PLSAPR_OBJECT_ATTRIBUTES ObjectAttributes
,
2241 ACCESS_MASK DesiredAccess
,
2242 LSAPR_HANDLE
*PolicyHandle
)
2245 return STATUS_NOT_IMPLEMENTED
;
2250 NTSTATUS WINAPI
LsarGetUserName(
2252 PRPC_UNICODE_STRING
*UserName
,
2253 PRPC_UNICODE_STRING
*DomainName
)
2256 return STATUS_NOT_IMPLEMENTED
;
2261 NTSTATUS WINAPI
LsarQueryInformationPolicy2(
2262 LSAPR_HANDLE PolicyHandle
,
2263 POLICY_INFORMATION_CLASS InformationClass
,
2264 PLSAPR_POLICY_INFORMATION
*PolicyInformation
)
2266 return LsarQueryInformationPolicy(PolicyHandle
,
2273 NTSTATUS WINAPI
LsarSetInformationPolicy2(
2274 LSAPR_HANDLE PolicyHandle
,
2275 POLICY_INFORMATION_CLASS InformationClass
,
2276 PLSAPR_POLICY_INFORMATION PolicyInformation
)
2278 return LsarSetInformationPolicy(PolicyHandle
,
2285 NTSTATUS WINAPI
LsarQueryTrustedDomainInfoByName(
2286 LSAPR_HANDLE PolicyHandle
,
2287 PRPC_UNICODE_STRING TrustedDomainName
,
2288 POLICY_INFORMATION_CLASS InformationClass
,
2289 PLSAPR_TRUSTED_DOMAIN_INFO
*PolicyInformation
)
2292 return STATUS_NOT_IMPLEMENTED
;
2297 NTSTATUS WINAPI
LsarSetTrustedDomainInfoByName(
2298 LSAPR_HANDLE PolicyHandle
,
2299 PRPC_UNICODE_STRING TrustedDomainName
,
2300 POLICY_INFORMATION_CLASS InformationClass
,
2301 PLSAPR_TRUSTED_DOMAIN_INFO PolicyInformation
)
2304 return STATUS_NOT_IMPLEMENTED
;
2309 NTSTATUS WINAPI
LsarEnumerateTrustedDomainsEx(
2310 LSAPR_HANDLE PolicyHandle
,
2311 DWORD
*EnumerationContext
,
2312 PLSAPR_TRUSTED_ENUM_BUFFER_EX EnumerationBuffer
,
2313 DWORD PreferedMaximumLength
)
2316 return STATUS_NOT_IMPLEMENTED
;
2321 NTSTATUS WINAPI
LsarCreateTrustedDomainEx(
2322 LSAPR_HANDLE PolicyHandle
,
2323 PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX TrustedDomainInformation
,
2324 PLSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION AuthentificationInformation
,
2325 ACCESS_MASK DesiredAccess
,
2326 LSAPR_HANDLE
*TrustedDomainHandle
)
2329 return STATUS_NOT_IMPLEMENTED
;
2334 NTSTATUS WINAPI
LsarSetPolicyReplicationHandle(
2335 PLSAPR_HANDLE PolicyHandle
)
2338 return STATUS_NOT_IMPLEMENTED
;
2343 NTSTATUS WINAPI
LsarQueryDomainInformationPolicy(
2344 LSAPR_HANDLE PolicyHandle
,
2345 POLICY_INFORMATION_CLASS InformationClass
,
2346 PLSAPR_POLICY_DOMAIN_INFORMATION
*PolicyInformation
)
2349 return STATUS_NOT_IMPLEMENTED
;
2354 NTSTATUS WINAPI
LsarSetDomainInformationPolicy(
2355 LSAPR_HANDLE PolicyHandle
,
2356 POLICY_INFORMATION_CLASS InformationClass
,
2357 PLSAPR_POLICY_DOMAIN_INFORMATION PolicyInformation
)
2360 return STATUS_NOT_IMPLEMENTED
;
2365 NTSTATUS WINAPI
LsarOpenTrustedDomainByName(
2366 LSAPR_HANDLE PolicyHandle
,
2367 PRPC_UNICODE_STRING TrustedDomainName
,
2368 ACCESS_MASK DesiredAccess
,
2369 LSAPR_HANDLE
*TrustedDomainHandle
)
2372 return STATUS_NOT_IMPLEMENTED
;
2377 NTSTATUS WINAPI
LsarTestCall(
2381 return STATUS_NOT_IMPLEMENTED
;
2386 NTSTATUS WINAPI
LsarLookupSids2(
2387 LSAPR_HANDLE PolicyHandle
,
2388 PLSAPR_SID_ENUM_BUFFER SidEnumBuffer
,
2389 PLSAPR_REFERENCED_DOMAIN_LIST
*ReferencedDomains
,
2390 PLSAPR_TRANSLATED_NAMES_EX TranslatedNames
,
2391 LSAP_LOOKUP_LEVEL LookupLevel
,
2393 DWORD LookupOptions
,
2394 DWORD ClientRevision
)
2398 TRACE("(%p %p %p %p %d %p %lu %lu)\n",
2399 PolicyHandle
, SidEnumBuffer
, ReferencedDomains
, TranslatedNames
,
2400 LookupLevel
, MappedCount
, LookupOptions
, ClientRevision
);
2402 TranslatedNames
->Entries
= SidEnumBuffer
->Entries
;
2403 TranslatedNames
->Names
= NULL
;
2404 *ReferencedDomains
= NULL
;
2406 /* FIXME: Fail, if there is an invalid SID in the SidEnumBuffer */
2408 Status
= LsapLookupSids(SidEnumBuffer
,
2421 NTSTATUS WINAPI
LsarLookupNames2(
2422 LSAPR_HANDLE PolicyHandle
,
2424 PRPC_UNICODE_STRING Names
,
2425 PLSAPR_REFERENCED_DOMAIN_LIST
*ReferencedDomains
,
2426 PLSAPR_TRANSLATED_SIDS_EX TranslatedSids
,
2427 LSAP_LOOKUP_LEVEL LookupLevel
,
2429 DWORD LookupOptions
,
2430 DWORD ClientRevision
)
2432 LSAPR_TRANSLATED_SIDS_EX2 TranslatedSidsEx2
;
2436 TRACE("(%p %lu %p %p %p %d %p %lu %lu)\n",
2437 PolicyHandle
, Count
, Names
, ReferencedDomains
, TranslatedSids
,
2438 LookupLevel
, MappedCount
, LookupOptions
, ClientRevision
);
2440 TranslatedSids
->Entries
= 0;
2441 TranslatedSids
->Sids
= NULL
;
2442 *ReferencedDomains
= NULL
;
2445 return STATUS_NONE_MAPPED
;
2447 TranslatedSidsEx2
.Entries
= 0;
2448 TranslatedSidsEx2
.Sids
= NULL
;
2450 Status
= LsapLookupNames(Count
,
2458 if (!NT_SUCCESS(Status
))
2461 TranslatedSids
->Entries
= TranslatedSidsEx2
.Entries
;
2462 TranslatedSids
->Sids
= MIDL_user_allocate(TranslatedSids
->Entries
* sizeof(LSA_TRANSLATED_SID
));
2463 if (TranslatedSids
->Sids
== NULL
)
2465 MIDL_user_free(TranslatedSidsEx2
.Sids
);
2466 MIDL_user_free(*ReferencedDomains
);
2467 *ReferencedDomains
= NULL
;
2468 return STATUS_INSUFFICIENT_RESOURCES
;
2471 for (i
= 0; i
< TranslatedSidsEx2
.Entries
; i
++)
2473 TranslatedSids
->Sids
[i
].Use
= TranslatedSidsEx2
.Sids
[i
].Use
;
2474 TranslatedSids
->Sids
[i
].RelativeId
= LsapGetRelativeIdFromSid(TranslatedSidsEx2
.Sids
[i
].Sid
);
2475 TranslatedSids
->Sids
[i
].DomainIndex
= TranslatedSidsEx2
.Sids
[i
].DomainIndex
;
2476 TranslatedSids
->Sids
[i
].Flags
= TranslatedSidsEx2
.Sids
[i
].Flags
;
2479 MIDL_user_free(TranslatedSidsEx2
.Sids
);
2481 return STATUS_SUCCESS
;
2486 NTSTATUS WINAPI
LsarCreateTrustedDomainEx2(
2487 LSAPR_HANDLE PolicyHandle
,
2488 PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX TrustedDomainInformation
,
2489 PLSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION_INTERNAL AuthentificationInformation
,
2490 ACCESS_MASK DesiredAccess
,
2491 LSAPR_HANDLE
*TrustedDomainHandle
)
2494 return STATUS_NOT_IMPLEMENTED
;
2499 NTSTATUS WINAPI
CredrWrite(
2503 return STATUS_NOT_IMPLEMENTED
;
2508 NTSTATUS WINAPI
CredrRead(
2512 return STATUS_NOT_IMPLEMENTED
;
2517 NTSTATUS WINAPI
CredrEnumerate(
2521 return STATUS_NOT_IMPLEMENTED
;
2526 NTSTATUS WINAPI
CredrWriteDomainCredentials(
2530 return STATUS_NOT_IMPLEMENTED
;
2535 NTSTATUS WINAPI
CredrReadDomainCredentials(
2539 return STATUS_NOT_IMPLEMENTED
;
2544 NTSTATUS WINAPI
CredrDelete(
2548 return STATUS_NOT_IMPLEMENTED
;
2553 NTSTATUS WINAPI
CredrGetTargetInfo(
2557 return STATUS_NOT_IMPLEMENTED
;
2562 NTSTATUS WINAPI
CredrProfileLoaded(
2566 return STATUS_NOT_IMPLEMENTED
;
2571 NTSTATUS WINAPI
LsarLookupNames3(
2572 LSAPR_HANDLE PolicyHandle
,
2574 PRPC_UNICODE_STRING Names
,
2575 PLSAPR_REFERENCED_DOMAIN_LIST
*ReferencedDomains
,
2576 PLSAPR_TRANSLATED_SIDS_EX2 TranslatedSids
,
2577 LSAP_LOOKUP_LEVEL LookupLevel
,
2579 DWORD LookupOptions
,
2580 DWORD ClientRevision
)
2584 TRACE("(%p %lu %p %p %p %d %p %lu %lu)\n",
2585 PolicyHandle
, Count
, Names
, ReferencedDomains
, TranslatedSids
,
2586 LookupLevel
, MappedCount
, LookupOptions
, ClientRevision
);
2588 TranslatedSids
->Entries
= 0;
2589 TranslatedSids
->Sids
= NULL
;
2590 *ReferencedDomains
= NULL
;
2593 return STATUS_NONE_MAPPED
;
2595 Status
= LsapLookupNames(Count
,
2609 NTSTATUS WINAPI
CredrGetSessionTypes(
2613 return STATUS_NOT_IMPLEMENTED
;
2618 NTSTATUS WINAPI
LsarRegisterAuditEvent(
2622 return STATUS_NOT_IMPLEMENTED
;
2627 NTSTATUS WINAPI
LsarGenAuditEvent(
2631 return STATUS_NOT_IMPLEMENTED
;
2636 NTSTATUS WINAPI
LsarUnregisterAuditEvent(
2640 return STATUS_NOT_IMPLEMENTED
;
2645 NTSTATUS WINAPI
LsarQueryForestTrustInformation(
2646 LSAPR_HANDLE PolicyHandle
,
2647 PLSA_UNICODE_STRING TrustedDomainName
,
2648 LSA_FOREST_TRUST_RECORD_TYPE HighestRecordType
,
2649 PLSA_FOREST_TRUST_INFORMATION
*ForestTrustInfo
)
2652 return STATUS_NOT_IMPLEMENTED
;
2657 NTSTATUS WINAPI
LsarSetForestTrustInformation(
2658 LSAPR_HANDLE PolicyHandle
,
2659 PLSA_UNICODE_STRING TrustedDomainName
,
2660 LSA_FOREST_TRUST_RECORD_TYPE HighestRecordType
,
2661 PLSA_FOREST_TRUST_INFORMATION ForestTrustInfo
,
2663 PLSA_FOREST_TRUST_COLLISION_INFORMATION
*CollisionInfo
)
2666 return STATUS_NOT_IMPLEMENTED
;
2671 NTSTATUS WINAPI
CredrRename(
2675 return STATUS_NOT_IMPLEMENTED
;
2680 NTSTATUS WINAPI
LsarLookupSids3(
2681 LSAPR_HANDLE PolicyHandle
,
2682 PLSAPR_SID_ENUM_BUFFER SidEnumBuffer
,
2683 PLSAPR_REFERENCED_DOMAIN_LIST
*ReferencedDomains
,
2684 PLSAPR_TRANSLATED_NAMES_EX TranslatedNames
,
2685 LSAP_LOOKUP_LEVEL LookupLevel
,
2687 DWORD LookupOptions
,
2688 DWORD ClientRevision
)
2692 TRACE("(%p %p %p %p %d %p %lu %lu)\n",
2693 PolicyHandle
, SidEnumBuffer
, ReferencedDomains
, TranslatedNames
,
2694 LookupLevel
, MappedCount
, LookupOptions
, ClientRevision
);
2696 TranslatedNames
->Entries
= SidEnumBuffer
->Entries
;
2697 TranslatedNames
->Names
= NULL
;
2698 *ReferencedDomains
= NULL
;
2700 /* FIXME: Fail, if there is an invalid SID in the SidEnumBuffer */
2702 Status
= LsapLookupSids(SidEnumBuffer
,
2715 NTSTATUS WINAPI
LsarLookupNames4(
2718 PRPC_UNICODE_STRING Names
,
2719 PLSAPR_REFERENCED_DOMAIN_LIST
*ReferencedDomains
,
2720 PLSAPR_TRANSLATED_SIDS_EX2 TranslatedSids
,
2721 LSAP_LOOKUP_LEVEL LookupLevel
,
2723 DWORD LookupOptions
,
2724 DWORD ClientRevision
)
2728 TRACE("(%p %lu %p %p %p %d %p %lu %lu)\n",
2729 RpcHandle
, Count
, Names
, ReferencedDomains
, TranslatedSids
,
2730 LookupLevel
, MappedCount
, LookupOptions
, ClientRevision
);
2732 TranslatedSids
->Entries
= 0;
2733 TranslatedSids
->Sids
= NULL
;
2734 *ReferencedDomains
= NULL
;
2737 return STATUS_NONE_MAPPED
;
2739 Status
= LsapLookupNames(Count
,
2753 NTSTATUS WINAPI
LsarOpenPolicySce(
2757 return STATUS_NOT_IMPLEMENTED
;
2762 NTSTATUS WINAPI
LsarAdtRegisterSecurityEventSource(
2766 return STATUS_NOT_IMPLEMENTED
;
2771 NTSTATUS WINAPI
LsarAdtUnregisterSecurityEventSource(
2775 return STATUS_NOT_IMPLEMENTED
;
2780 NTSTATUS WINAPI
LsarAdtReportSecurityEvent(
2784 return STATUS_NOT_IMPLEMENTED
;
2789 NTSTATUS WINAPI
CredrFindBestCredential(
2793 return STATUS_NOT_IMPLEMENTED
;
2798 NTSTATUS WINAPI
LsarSetAuditPolicy(
2802 return STATUS_NOT_IMPLEMENTED
;
2807 NTSTATUS WINAPI
LsarQueryAuditPolicy(
2811 return STATUS_NOT_IMPLEMENTED
;
2816 NTSTATUS WINAPI
LsarEnumerateAuditPolicy(
2820 return STATUS_NOT_IMPLEMENTED
;
2825 NTSTATUS WINAPI
LsarEnumerateAuditCategories(
2829 return STATUS_NOT_IMPLEMENTED
;
2834 NTSTATUS WINAPI
LsarEnumerateAuditSubCategories(
2838 return STATUS_NOT_IMPLEMENTED
;
2843 NTSTATUS WINAPI
LsarLookupAuditCategoryName(
2847 return STATUS_NOT_IMPLEMENTED
;
2852 NTSTATUS WINAPI
LsarLookupAuditSubCategoryName(
2856 return STATUS_NOT_IMPLEMENTED
;
2861 NTSTATUS WINAPI
LsarSetAuditSecurity(
2865 return STATUS_NOT_IMPLEMENTED
;
2870 NTSTATUS WINAPI
LsarQueryAuditSecurity(
2874 return STATUS_NOT_IMPLEMENTED
;
2879 NTSTATUS WINAPI
CredReadByTokenHandle(
2883 return STATUS_NOT_IMPLEMENTED
;
2888 NTSTATUS WINAPI
CredrRestoreCredentials(
2892 return STATUS_NOT_IMPLEMENTED
;
2897 NTSTATUS WINAPI
CredrBackupCredentials(
2901 return STATUS_NOT_IMPLEMENTED
;