[LSASRV]
[reactos.git] / reactos / dll / win32 / lsasrv / lsarpc.c
1 /*
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
6 *
7 * PROGRAMMERS: Eric Kohl
8 */
9
10 /* INCLUDES ****************************************************************/
11
12 #include "lsasrv.h"
13
14 WINE_DEFAULT_DEBUG_CHANNEL(lsasrv);
15
16
17 /* GLOBALS *****************************************************************/
18
19 static RTL_CRITICAL_SECTION PolicyHandleTableLock;
20
21
22 /* FUNCTIONS ***************************************************************/
23
24 VOID
25 LsarStartRpcServer(VOID)
26 {
27 RPC_STATUS Status;
28
29 RtlInitializeCriticalSection(&PolicyHandleTableLock);
30
31 TRACE("LsarStartRpcServer() called\n");
32
33 Status = RpcServerUseProtseqEpW(L"ncacn_np",
34 10,
35 L"\\pipe\\lsarpc",
36 NULL);
37 if (Status != RPC_S_OK)
38 {
39 WARN("RpcServerUseProtseqEpW() failed (Status %lx)\n", Status);
40 return;
41 }
42
43 Status = RpcServerRegisterIf(lsarpc_v0_0_s_ifspec,
44 NULL,
45 NULL);
46 if (Status != RPC_S_OK)
47 {
48 WARN("RpcServerRegisterIf() failed (Status %lx)\n", Status);
49 return;
50 }
51
52 Status = RpcServerListen(1, 20, TRUE);
53 if (Status != RPC_S_OK)
54 {
55 WARN("RpcServerListen() failed (Status %lx)\n", Status);
56 return;
57 }
58
59 TRACE("LsarStartRpcServer() done\n");
60 }
61
62
63 void __RPC_USER LSAPR_HANDLE_rundown(LSAPR_HANDLE hHandle)
64 {
65
66 }
67
68
69 /* Function 0 */
70 NTSTATUS WINAPI LsarClose(
71 LSAPR_HANDLE *ObjectHandle)
72 {
73 PLSA_DB_OBJECT DbObject;
74 NTSTATUS Status = STATUS_SUCCESS;
75
76 TRACE("0x%p\n", ObjectHandle);
77
78 // RtlEnterCriticalSection(&PolicyHandleTableLock);
79
80 Status = LsapValidateDbObject(*ObjectHandle,
81 LsaDbIgnoreObject,
82 0,
83 &DbObject);
84 if (Status == STATUS_SUCCESS)
85 {
86 Status = LsapCloseDbObject(DbObject);
87 *ObjectHandle = NULL;
88 }
89
90 // RtlLeaveCriticalSection(&PolicyHandleTableLock);
91
92 return Status;
93 }
94
95
96 /* Function 1 */
97 NTSTATUS WINAPI LsarDelete(
98 LSAPR_HANDLE ObjectHandle)
99 {
100 /* Deprecated */
101 return STATUS_NOT_SUPPORTED;
102 }
103
104
105 /* Function 2 */
106 NTSTATUS WINAPI LsarEnumeratePrivileges(
107 LSAPR_HANDLE PolicyHandle,
108 DWORD *EnumerationContext,
109 PLSAPR_PRIVILEGE_ENUM_BUFFER EnumerationBuffer,
110 DWORD PreferedMaximumLength)
111 {
112 PLSA_DB_OBJECT PolicyObject;
113 NTSTATUS Status;
114
115 TRACE("LsarEnumeratePrivileges(%p %p %p %lu)\n",
116 PolicyHandle, EnumerationContext, EnumerationBuffer,
117 PreferedMaximumLength);
118
119 Status = LsapValidateDbObject(PolicyHandle,
120 LsaDbPolicyObject,
121 POLICY_VIEW_LOCAL_INFORMATION,
122 &PolicyObject);
123 if (!NT_SUCCESS(Status))
124 return Status;
125
126 if (EnumerationContext == NULL)
127 return STATUS_INVALID_PARAMETER;
128
129 return LsarpEnumeratePrivileges(EnumerationContext,
130 EnumerationBuffer,
131 PreferedMaximumLength);
132 }
133
134
135 /* Function 3 */
136 NTSTATUS WINAPI LsarQuerySecurityObject(
137 LSAPR_HANDLE ObjectHandle,
138 SECURITY_INFORMATION SecurityInformation,
139 PLSAPR_SR_SECURITY_DESCRIPTOR *SecurityDescriptor)
140 {
141 UNIMPLEMENTED;
142 return STATUS_NOT_IMPLEMENTED;
143 }
144
145
146 /* Function 4 */
147 NTSTATUS WINAPI LsarSetSecurityObject(
148 LSAPR_HANDLE ObjectHandle,
149 SECURITY_INFORMATION SecurityInformation,
150 PLSAPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor)
151 {
152 UNIMPLEMENTED;
153 return STATUS_NOT_IMPLEMENTED;
154 }
155
156
157 /* Function 5 */
158 NTSTATUS WINAPI LsarChangePassword(
159 handle_t IDL_handle,
160 PRPC_UNICODE_STRING String1,
161 PRPC_UNICODE_STRING String2,
162 PRPC_UNICODE_STRING String3,
163 PRPC_UNICODE_STRING String4,
164 PRPC_UNICODE_STRING String5)
165 {
166 /* Deprecated */
167 return STATUS_NOT_IMPLEMENTED;
168 }
169
170
171 /* Function 6 */
172 NTSTATUS WINAPI LsarOpenPolicy(
173 LPWSTR SystemName,
174 PLSAPR_OBJECT_ATTRIBUTES ObjectAttributes,
175 ACCESS_MASK DesiredAccess,
176 LSAPR_HANDLE *PolicyHandle)
177 {
178 PLSA_DB_OBJECT PolicyObject;
179 NTSTATUS Status;
180
181 TRACE("LsarOpenPolicy called!\n");
182
183 RtlEnterCriticalSection(&PolicyHandleTableLock);
184
185 Status = LsapOpenDbObject(NULL,
186 NULL,
187 L"Policy",
188 LsaDbPolicyObject,
189 DesiredAccess,
190 &PolicyObject);
191
192 RtlLeaveCriticalSection(&PolicyHandleTableLock);
193
194 if (NT_SUCCESS(Status))
195 *PolicyHandle = (LSAPR_HANDLE)PolicyObject;
196
197 TRACE("LsarOpenPolicy done!\n");
198
199 return Status;
200 }
201
202
203 /* Function 7 */
204 NTSTATUS WINAPI LsarQueryInformationPolicy(
205 LSAPR_HANDLE PolicyHandle,
206 POLICY_INFORMATION_CLASS InformationClass,
207 PLSAPR_POLICY_INFORMATION *PolicyInformation)
208 {
209 PLSA_DB_OBJECT DbObject;
210 ACCESS_MASK DesiredAccess = 0;
211 NTSTATUS Status;
212
213 TRACE("LsarQueryInformationPolicy(%p,0x%08x,%p)\n",
214 PolicyHandle, InformationClass, PolicyInformation);
215
216 if (PolicyInformation)
217 {
218 TRACE("*PolicyInformation %p\n", *PolicyInformation);
219 }
220
221 switch (InformationClass)
222 {
223 case PolicyAuditLogInformation:
224 case PolicyAuditEventsInformation:
225 case PolicyAuditFullQueryInformation:
226 DesiredAccess = POLICY_VIEW_AUDIT_INFORMATION;
227 break;
228
229 case PolicyPrimaryDomainInformation:
230 case PolicyAccountDomainInformation:
231 case PolicyLsaServerRoleInformation:
232 case PolicyReplicaSourceInformation:
233 case PolicyDefaultQuotaInformation:
234 case PolicyModificationInformation:
235 case PolicyDnsDomainInformation:
236 case PolicyDnsDomainInformationInt:
237 case PolicyLocalAccountDomainInformation:
238 DesiredAccess = POLICY_VIEW_LOCAL_INFORMATION;
239 break;
240
241 case PolicyPdAccountInformation:
242 DesiredAccess = POLICY_GET_PRIVATE_INFORMATION;
243 break;
244
245 default:
246 ERR("Invalid InformationClass!\n");
247 return STATUS_INVALID_PARAMETER;
248 }
249
250 Status = LsapValidateDbObject(PolicyHandle,
251 LsaDbPolicyObject,
252 DesiredAccess,
253 &DbObject);
254 if (!NT_SUCCESS(Status))
255 return Status;
256
257 switch (InformationClass)
258 {
259 case PolicyAuditLogInformation: /* 1 */
260 Status = LsarQueryAuditLog(PolicyHandle,
261 PolicyInformation);
262 break;
263
264 case PolicyAuditEventsInformation: /* 2 */
265 Status = LsarQueryAuditEvents(PolicyHandle,
266 PolicyInformation);
267 break;
268
269 case PolicyPrimaryDomainInformation: /* 3 */
270 Status = LsarQueryPrimaryDomain(PolicyHandle,
271 PolicyInformation);
272 break;
273
274 case PolicyPdAccountInformation: /* 4 */
275 Status = LsarQueryPdAccount(PolicyHandle,
276 PolicyInformation);
277 break;
278
279 case PolicyAccountDomainInformation: /* 5 */
280 Status = LsarQueryAccountDomain(PolicyHandle,
281 PolicyInformation);
282 break;
283
284 case PolicyLsaServerRoleInformation: /* 6 */
285 Status = LsarQueryServerRole(PolicyHandle,
286 PolicyInformation);
287 break;
288
289 case PolicyReplicaSourceInformation: /* 7 */
290 Status = LsarQueryReplicaSource(PolicyHandle,
291 PolicyInformation);
292 break;
293
294 case PolicyDefaultQuotaInformation: /* 8 */
295 Status = LsarQueryDefaultQuota(PolicyHandle,
296 PolicyInformation);
297 break;
298
299 case PolicyModificationInformation: /* 9 */
300 Status = LsarQueryModification(PolicyHandle,
301 PolicyInformation);
302 break;
303
304 case PolicyAuditFullQueryInformation: /* 11 (0xB) */
305 Status = LsarQueryAuditFull(PolicyHandle,
306 PolicyInformation);
307 break;
308
309 case PolicyDnsDomainInformation: /* 12 (0xC) */
310 Status = LsarQueryDnsDomain(PolicyHandle,
311 PolicyInformation);
312 break;
313
314 case PolicyDnsDomainInformationInt: /* 13 (0xD) */
315 Status = LsarQueryDnsDomainInt(PolicyHandle,
316 PolicyInformation);
317 break;
318
319 case PolicyLocalAccountDomainInformation: /* 14 (0xE) */
320 Status = LsarQueryLocalAccountDomain(PolicyHandle,
321 PolicyInformation);
322 break;
323
324 default:
325 ERR("Invalid InformationClass!\n");
326 Status = STATUS_INVALID_PARAMETER;
327 }
328
329 return Status;
330 }
331
332
333 /* Function 8 */
334 NTSTATUS WINAPI LsarSetInformationPolicy(
335 LSAPR_HANDLE PolicyHandle,
336 POLICY_INFORMATION_CLASS InformationClass,
337 PLSAPR_POLICY_INFORMATION PolicyInformation)
338 {
339 PLSA_DB_OBJECT DbObject;
340 ACCESS_MASK DesiredAccess = 0;
341 NTSTATUS Status;
342
343 TRACE("LsarSetInformationPolicy(%p,0x%08x,%p)\n",
344 PolicyHandle, InformationClass, PolicyInformation);
345
346 if (PolicyInformation)
347 {
348 TRACE("*PolicyInformation %p\n", *PolicyInformation);
349 }
350
351 switch (InformationClass)
352 {
353 case PolicyAuditLogInformation:
354 case PolicyAuditFullSetInformation:
355 DesiredAccess = POLICY_AUDIT_LOG_ADMIN;
356 break;
357
358 case PolicyAuditEventsInformation:
359 DesiredAccess = POLICY_SET_AUDIT_REQUIREMENTS;
360 break;
361
362 case PolicyPrimaryDomainInformation:
363 case PolicyAccountDomainInformation:
364 case PolicyDnsDomainInformation:
365 case PolicyDnsDomainInformationInt:
366 case PolicyLocalAccountDomainInformation:
367 DesiredAccess = POLICY_TRUST_ADMIN;
368 break;
369
370 case PolicyLsaServerRoleInformation:
371 case PolicyReplicaSourceInformation:
372 DesiredAccess = POLICY_SERVER_ADMIN;
373 break;
374
375 case PolicyDefaultQuotaInformation:
376 DesiredAccess = POLICY_SET_DEFAULT_QUOTA_LIMITS;
377 break;
378
379 default:
380 ERR("Invalid InformationClass!\n");
381 return STATUS_INVALID_PARAMETER;
382 }
383
384 Status = LsapValidateDbObject(PolicyHandle,
385 LsaDbPolicyObject,
386 DesiredAccess,
387 &DbObject);
388 if (!NT_SUCCESS(Status))
389 return Status;
390
391 switch (InformationClass)
392 {
393 case PolicyAuditEventsInformation:
394 Status = STATUS_NOT_IMPLEMENTED;
395 break;
396
397 case PolicyPrimaryDomainInformation:
398 Status = LsarSetPrimaryDomain(PolicyHandle,
399 (PLSAPR_POLICY_PRIMARY_DOM_INFO)PolicyInformation);
400 break;
401
402 case PolicyAccountDomainInformation:
403 Status = LsarSetAccountDomain(PolicyHandle,
404 (PLSAPR_POLICY_ACCOUNT_DOM_INFO)PolicyInformation);
405 break;
406
407 case PolicyDnsDomainInformation:
408 Status = LsarSetDnsDomain(PolicyHandle,
409 (PLSAPR_POLICY_DNS_DOMAIN_INFO)PolicyInformation);
410 break;
411
412 case PolicyLsaServerRoleInformation:
413 Status = STATUS_NOT_IMPLEMENTED;
414 break;
415
416 default:
417 Status = STATUS_INVALID_PARAMETER;
418 break;
419 }
420
421 return Status;
422 }
423
424
425 /* Function 9 */
426 NTSTATUS WINAPI LsarClearAuditLog(
427 LSAPR_HANDLE ObjectHandle)
428 {
429 /* Deprecated */
430 return STATUS_NOT_IMPLEMENTED;
431 }
432
433
434 /* Function 10 */
435 NTSTATUS WINAPI LsarCreateAccount(
436 LSAPR_HANDLE PolicyHandle,
437 PRPC_SID AccountSid,
438 ACCESS_MASK DesiredAccess,
439 LSAPR_HANDLE *AccountHandle)
440 {
441 PLSA_DB_OBJECT PolicyObject;
442 PLSA_DB_OBJECT AccountObject = NULL;
443 LPWSTR SidString = NULL;
444 NTSTATUS Status = STATUS_SUCCESS;
445
446 /* Validate the AccountSid */
447 if (!RtlValidSid(AccountSid))
448 return STATUS_INVALID_PARAMETER;
449
450 /* Validate the PolicyHandle */
451 Status = LsapValidateDbObject(PolicyHandle,
452 LsaDbPolicyObject,
453 POLICY_CREATE_ACCOUNT,
454 &PolicyObject);
455 if (!NT_SUCCESS(Status))
456 {
457 ERR("LsapValidateDbObject returned 0x%08lx\n", Status);
458 return Status;
459 }
460
461 /* Create SID string */
462 if (!ConvertSidToStringSid((PSID)AccountSid,
463 &SidString))
464 {
465 ERR("ConvertSidToStringSid failed\n");
466 Status = STATUS_INVALID_PARAMETER;
467 goto done;
468 }
469
470 /* Create the Account object */
471 Status = LsapCreateDbObject(PolicyObject,
472 L"Accounts",
473 SidString,
474 LsaDbAccountObject,
475 DesiredAccess,
476 &AccountObject);
477 if (!NT_SUCCESS(Status))
478 {
479 ERR("LsapCreateDbObject failed (Status 0x%08lx)\n", Status);
480 goto done;
481 }
482
483 /* Set the Sid attribute */
484 Status = LsapSetObjectAttribute(AccountObject,
485 L"Sid",
486 (PVOID)AccountSid,
487 GetLengthSid(AccountSid));
488
489 done:
490 if (SidString != NULL)
491 LocalFree(SidString);
492
493 if (!NT_SUCCESS(Status))
494 {
495 if (AccountObject != NULL)
496 LsapCloseDbObject(AccountObject);
497 }
498 else
499 {
500 *AccountHandle = (LSAPR_HANDLE)AccountObject;
501 }
502
503 return STATUS_SUCCESS;
504 }
505
506
507 /* Function 11 */
508 NTSTATUS WINAPI LsarEnumerateAccounts(
509 LSAPR_HANDLE PolicyHandle,
510 DWORD *EnumerationContext,
511 PLSAPR_ACCOUNT_ENUM_BUFFER EnumerationBuffer,
512 DWORD PreferedMaximumLength)
513 {
514 UNIMPLEMENTED;
515 return STATUS_NOT_IMPLEMENTED;
516 }
517
518
519 /* Function 12 */
520 NTSTATUS WINAPI LsarCreateTrustedDomain(
521 LSAPR_HANDLE PolicyHandle,
522 PLSAPR_TRUST_INFORMATION TrustedDomainInformation,
523 ACCESS_MASK DesiredAccess,
524 LSAPR_HANDLE *TrustedDomainHandle)
525 {
526 UNIMPLEMENTED;
527 return STATUS_NOT_IMPLEMENTED;
528 }
529
530
531 /* Function 13 */
532 NTSTATUS WINAPI LsarEnumerateTrustedDomains(
533 LSAPR_HANDLE PolicyHandle,
534 DWORD *EnumerationContext,
535 PLSAPR_TRUSTED_ENUM_BUFFER EnumerationBuffer,
536 DWORD PreferedMaximumLength)
537 {
538 UNIMPLEMENTED;
539 return STATUS_NOT_IMPLEMENTED;
540 }
541
542
543 /* Function 14 */
544 NTSTATUS WINAPI LsarLookupNames(
545 LSAPR_HANDLE PolicyHandle,
546 DWORD Count,
547 PRPC_UNICODE_STRING Names,
548 PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
549 PLSAPR_TRANSLATED_SIDS TranslatedSids,
550 LSAP_LOOKUP_LEVEL LookupLevel,
551 DWORD *MappedCount)
552 {
553 SID_IDENTIFIER_AUTHORITY IdentifierAuthority = {SECURITY_NT_AUTHORITY};
554 static const UNICODE_STRING DomainName = RTL_CONSTANT_STRING(L"DOMAIN");
555 PLSAPR_REFERENCED_DOMAIN_LIST OutputDomains = NULL;
556 PLSA_TRANSLATED_SID OutputSids = NULL;
557 ULONG OutputSidsLength;
558 ULONG i;
559 PSID Sid;
560 ULONG SidLength;
561 NTSTATUS Status;
562
563 TRACE("LsarLookupNames(%p, %lu, %p, %p, %p, %d, %p)\n",
564 PolicyHandle, Count, Names, ReferencedDomains, TranslatedSids,
565 LookupLevel, MappedCount);
566
567 TranslatedSids->Entries = Count;
568 TranslatedSids->Sids = NULL;
569 *ReferencedDomains = NULL;
570
571 OutputSidsLength = Count * sizeof(LSA_TRANSLATED_SID);
572 OutputSids = MIDL_user_allocate(OutputSidsLength);
573 if (OutputSids == NULL)
574 {
575 return STATUS_INSUFFICIENT_RESOURCES;
576 }
577
578 RtlZeroMemory(OutputSids, OutputSidsLength);
579
580 OutputDomains = MIDL_user_allocate(sizeof(LSAPR_REFERENCED_DOMAIN_LIST));
581 if (OutputDomains == NULL)
582 {
583 MIDL_user_free(OutputSids);
584 return STATUS_INSUFFICIENT_RESOURCES;
585 }
586
587 OutputDomains->Entries = Count;
588 OutputDomains->Domains = MIDL_user_allocate(Count * sizeof(LSA_TRUST_INFORMATION));
589 if (OutputDomains->Domains == NULL)
590 {
591 MIDL_user_free(OutputDomains);
592 MIDL_user_free(OutputSids);
593 return STATUS_INSUFFICIENT_RESOURCES;
594 }
595
596 Status = RtlAllocateAndInitializeSid(&IdentifierAuthority,
597 2,
598 SECURITY_BUILTIN_DOMAIN_RID,
599 DOMAIN_ALIAS_RID_ADMINS,
600 0, 0, 0, 0, 0, 0,
601 &Sid);
602 if (!NT_SUCCESS(Status))
603 {
604 MIDL_user_free(OutputDomains->Domains);
605 MIDL_user_free(OutputDomains);
606 MIDL_user_free(OutputSids);
607 return Status;
608 }
609
610 SidLength = RtlLengthSid(Sid);
611
612 for (i = 0; i < Count; i++)
613 {
614 OutputDomains->Domains[i].Sid = MIDL_user_allocate(SidLength);
615 RtlCopyMemory(OutputDomains->Domains[i].Sid, Sid, SidLength);
616
617 OutputDomains->Domains[i].Name.Buffer = MIDL_user_allocate(DomainName.MaximumLength);
618 OutputDomains->Domains[i].Name.Length = DomainName.Length;
619 OutputDomains->Domains[i].Name.MaximumLength = DomainName.MaximumLength;
620 RtlCopyMemory(OutputDomains->Domains[i].Name.Buffer, DomainName.Buffer, DomainName.MaximumLength);
621 }
622
623 for (i = 0; i < Count; i++)
624 {
625 OutputSids[i].Use = SidTypeWellKnownGroup;
626 OutputSids[i].RelativeId = DOMAIN_USER_RID_ADMIN; //DOMAIN_ALIAS_RID_ADMINS;
627 OutputSids[i].DomainIndex = i;
628 }
629
630 *ReferencedDomains = OutputDomains;
631
632 *MappedCount = Count;
633
634 TranslatedSids->Entries = Count;
635 TranslatedSids->Sids = OutputSids;
636
637 return STATUS_SUCCESS;
638 }
639
640
641 /* Function 15 */
642 NTSTATUS WINAPI LsarLookupSids(
643 LSAPR_HANDLE PolicyHandle,
644 PLSAPR_SID_ENUM_BUFFER SidEnumBuffer,
645 PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
646 PLSAPR_TRANSLATED_NAMES TranslatedNames,
647 LSAP_LOOKUP_LEVEL LookupLevel,
648 DWORD *MappedCount)
649 {
650 SID_IDENTIFIER_AUTHORITY IdentifierAuthority = {SECURITY_NT_AUTHORITY};
651 static const UNICODE_STRING DomainName = RTL_CONSTANT_STRING(L"DOMAIN");
652 PLSAPR_REFERENCED_DOMAIN_LIST OutputDomains = NULL;
653 PLSAPR_TRANSLATED_NAME OutputNames = NULL;
654 ULONG OutputNamesLength;
655 ULONG i;
656 PSID Sid;
657 ULONG SidLength;
658 NTSTATUS Status;
659
660 TRACE("LsarLookupSids(%p, %p, %p, %p, %d, %p)\n",
661 PolicyHandle, SidEnumBuffer, ReferencedDomains, TranslatedNames,
662 LookupLevel, MappedCount);
663
664 TranslatedNames->Entries = SidEnumBuffer->Entries;
665 TranslatedNames->Names = NULL;
666 *ReferencedDomains = NULL;
667
668 OutputNamesLength = SidEnumBuffer->Entries * sizeof(LSA_TRANSLATED_NAME);
669 OutputNames = MIDL_user_allocate(OutputNamesLength);
670 if (OutputNames == NULL)
671 {
672 return STATUS_INSUFFICIENT_RESOURCES;
673 }
674
675 RtlZeroMemory(OutputNames, OutputNamesLength);
676
677 OutputDomains = MIDL_user_allocate(sizeof(LSAPR_REFERENCED_DOMAIN_LIST));
678 if (OutputDomains == NULL)
679 {
680 MIDL_user_free(OutputNames);
681 return STATUS_INSUFFICIENT_RESOURCES;
682 }
683
684 OutputDomains->Entries = SidEnumBuffer->Entries;
685 OutputDomains->Domains = MIDL_user_allocate(SidEnumBuffer->Entries * sizeof(LSA_TRUST_INFORMATION));
686 if (OutputDomains->Domains == NULL)
687 {
688 MIDL_user_free(OutputDomains);
689 MIDL_user_free(OutputNames);
690 return STATUS_INSUFFICIENT_RESOURCES;
691 }
692
693 Status = RtlAllocateAndInitializeSid(&IdentifierAuthority,
694 2,
695 SECURITY_BUILTIN_DOMAIN_RID,
696 DOMAIN_ALIAS_RID_ADMINS,
697 0, 0, 0, 0, 0, 0,
698 &Sid);
699 if (!NT_SUCCESS(Status))
700 {
701 MIDL_user_free(OutputDomains->Domains);
702 MIDL_user_free(OutputDomains);
703 MIDL_user_free(OutputNames);
704 return Status;
705 }
706
707 SidLength = RtlLengthSid(Sid);
708
709 for (i = 0; i < SidEnumBuffer->Entries; i++)
710 {
711 OutputDomains->Domains[i].Sid = MIDL_user_allocate(SidLength);
712 RtlCopyMemory(OutputDomains->Domains[i].Sid, Sid, SidLength);
713
714 OutputDomains->Domains[i].Name.Buffer = MIDL_user_allocate(DomainName.MaximumLength);
715 OutputDomains->Domains[i].Name.Length = DomainName.Length;
716 OutputDomains->Domains[i].Name.MaximumLength = DomainName.MaximumLength;
717 RtlCopyMemory(OutputDomains->Domains[i].Name.Buffer, DomainName.Buffer, DomainName.MaximumLength);
718 }
719
720 Status = LsapLookupSids(SidEnumBuffer,
721 OutputNames);
722
723 *ReferencedDomains = OutputDomains;
724
725 *MappedCount = SidEnumBuffer->Entries;
726
727 TranslatedNames->Entries = SidEnumBuffer->Entries;
728 TranslatedNames->Names = OutputNames;
729
730 return Status;
731 }
732
733
734 /* Function 16 */
735 NTSTATUS WINAPI LsarCreateSecret(
736 LSAPR_HANDLE PolicyHandle,
737 PRPC_UNICODE_STRING SecretName,
738 ACCESS_MASK DesiredAccess,
739 LSAPR_HANDLE *SecretHandle)
740 {
741 PLSA_DB_OBJECT PolicyObject;
742 PLSA_DB_OBJECT SecretObject = NULL;
743 LARGE_INTEGER Time;
744 NTSTATUS Status = STATUS_SUCCESS;
745
746 /* Validate the PolicyHandle */
747 Status = LsapValidateDbObject(PolicyHandle,
748 LsaDbPolicyObject,
749 POLICY_CREATE_SECRET,
750 &PolicyObject);
751 if (!NT_SUCCESS(Status))
752 {
753 ERR("LsapValidateDbObject returned 0x%08lx\n", Status);
754 return Status;
755 }
756
757 /* Get the current time */
758 Status = NtQuerySystemTime(&Time);
759 if (!NT_SUCCESS(Status))
760 {
761 ERR("NtQuerySystemTime failed (Status 0x%08lx)\n", Status);
762 goto done;
763 }
764
765 /* Create the Secret object */
766 Status = LsapCreateDbObject(PolicyObject,
767 L"Secrets",
768 SecretName->Buffer,
769 LsaDbSecretObject,
770 DesiredAccess,
771 &SecretObject);
772 if (!NT_SUCCESS(Status))
773 {
774 ERR("LsapCreateDbObject failed (Status 0x%08lx)\n", Status);
775 goto done;
776 }
777
778 /* Set the CurrentTime attribute */
779 Status = LsapSetObjectAttribute(SecretObject,
780 L"CurrentTime",
781 (PVOID)&Time,
782 sizeof(LARGE_INTEGER));
783 if (!NT_SUCCESS(Status))
784 {
785 ERR("LsapSetObjectAttribute (CurrentTime) failed (Status 0x%08lx)\n", Status);
786 goto done;
787 }
788
789 /* Set the OldTime attribute */
790 Status = LsapSetObjectAttribute(SecretObject,
791 L"OldTime",
792 (PVOID)&Time,
793 sizeof(LARGE_INTEGER));
794
795 done:
796 if (!NT_SUCCESS(Status))
797 {
798 if (SecretObject != NULL)
799 LsapCloseDbObject(SecretObject);
800 }
801 else
802 {
803 *SecretHandle = (LSAPR_HANDLE)SecretObject;
804 }
805
806 return STATUS_SUCCESS;
807 }
808
809
810 /* Function 17 */
811 NTSTATUS WINAPI LsarOpenAccount(
812 LSAPR_HANDLE PolicyHandle,
813 PRPC_SID AccountSid,
814 ACCESS_MASK DesiredAccess,
815 LSAPR_HANDLE *AccountHandle)
816 {
817 PLSA_DB_OBJECT PolicyObject;
818 PLSA_DB_OBJECT AccountObject = NULL;
819 LPWSTR SidString = NULL;
820 NTSTATUS Status = STATUS_SUCCESS;
821
822 /* Validate the AccountSid */
823 if (!RtlValidSid(AccountSid))
824 return STATUS_INVALID_PARAMETER;
825
826 /* Validate the PolicyHandle */
827 Status = LsapValidateDbObject(PolicyHandle,
828 LsaDbPolicyObject,
829 0,
830 &PolicyObject);
831 if (!NT_SUCCESS(Status))
832 {
833 ERR("LsapValidateDbObject returned 0x%08lx\n", Status);
834 return Status;
835 }
836
837 /* Create SID string */
838 if (!ConvertSidToStringSid((PSID)AccountSid,
839 &SidString))
840 {
841 ERR("ConvertSidToStringSid failed\n");
842 Status = STATUS_INVALID_PARAMETER;
843 goto done;
844 }
845
846 /* Create the Account object */
847 Status = LsapOpenDbObject(PolicyObject,
848 L"Accounts",
849 SidString,
850 LsaDbAccountObject,
851 DesiredAccess,
852 &AccountObject);
853 if (!NT_SUCCESS(Status))
854 {
855 ERR("LsapOpenDbObject failed (Status 0x%08lx)\n", Status);
856 goto done;
857 }
858
859 /* Set the Sid attribute */
860 Status = LsapSetObjectAttribute(AccountObject,
861 L"Sid",
862 (PVOID)AccountSid,
863 GetLengthSid(AccountSid));
864
865 done:
866 if (SidString != NULL)
867 LocalFree(SidString);
868
869 if (!NT_SUCCESS(Status))
870 {
871 if (AccountObject != NULL)
872 LsapCloseDbObject(AccountObject);
873 }
874 else
875 {
876 *AccountHandle = (LSAPR_HANDLE)AccountObject;
877 }
878
879 return Status;
880 }
881
882
883 /* Function 18 */
884 NTSTATUS WINAPI LsarEnumeratePrivilegesAccount(
885 LSAPR_HANDLE AccountHandle,
886 PLSAPR_PRIVILEGE_SET *Privileges)
887 {
888 PLSA_DB_OBJECT AccountObject;
889 ULONG PrivilegeSetSize = 0;
890 PLSAPR_PRIVILEGE_SET PrivilegeSet = NULL;
891 NTSTATUS Status;
892
893 *Privileges = NULL;
894
895 /* Validate the AccountHandle */
896 Status = LsapValidateDbObject(AccountHandle,
897 LsaDbAccountObject,
898 ACCOUNT_VIEW,
899 &AccountObject);
900 if (!NT_SUCCESS(Status))
901 {
902 ERR("LsapValidateDbObject returned 0x%08lx\n", Status);
903 return Status;
904 }
905
906 /* Get the size of the privilege set */
907 Status = LsapGetObjectAttribute(AccountObject,
908 L"Privilgs",
909 NULL,
910 &PrivilegeSetSize);
911 if (!NT_SUCCESS(Status))
912 return Status;
913
914 /* Allocate a buffer for the privilege set */
915 PrivilegeSet = MIDL_user_allocate(PrivilegeSetSize);
916 if (PrivilegeSet == NULL)
917 return STATUS_NO_MEMORY;
918
919 /* Get the privilege set */
920 Status = LsapGetObjectAttribute(AccountObject,
921 L"Privilgs",
922 PrivilegeSet,
923 &PrivilegeSetSize);
924 if (!NT_SUCCESS(Status))
925 {
926 MIDL_user_free(PrivilegeSet);
927 return Status;
928 }
929
930 /* Return a pointer to the privilege set */
931 *Privileges = PrivilegeSet;
932
933 return STATUS_SUCCESS;
934 }
935
936
937 /* Function 19 */
938 NTSTATUS WINAPI LsarAddPrivilegesToAccount(
939 LSAPR_HANDLE AccountHandle,
940 PLSAPR_PRIVILEGE_SET Privileges)
941 {
942 PLSA_DB_OBJECT AccountObject;
943 PPRIVILEGE_SET CurrentPrivileges = NULL;
944 PPRIVILEGE_SET NewPrivileges = NULL;
945 ULONG PrivilegeSetSize = 0;
946 ULONG PrivilegeCount;
947 ULONG i, j;
948 BOOL bFound;
949 NTSTATUS Status;
950
951 /* Validate the AccountHandle */
952 Status = LsapValidateDbObject(AccountHandle,
953 LsaDbAccountObject,
954 ACCOUNT_ADJUST_PRIVILEGES,
955 &AccountObject);
956 if (!NT_SUCCESS(Status))
957 {
958 ERR("LsapValidateDbObject returned 0x%08lx\n", Status);
959 return Status;
960 }
961
962 Status = LsapGetObjectAttribute(AccountObject,
963 L"Privilgs",
964 NULL,
965 &PrivilegeSetSize);
966 if (!NT_SUCCESS(Status) || PrivilegeSetSize == 0)
967 {
968 /* The Privilgs attribute does not exist */
969
970 PrivilegeSetSize = sizeof(PRIVILEGE_SET) +
971 (Privileges->PrivilegeCount - 1) * sizeof(LUID_AND_ATTRIBUTES);
972 Status = LsapSetObjectAttribute(AccountObject,
973 L"Privilgs",
974 Privileges,
975 PrivilegeSetSize);
976 }
977 else
978 {
979 /* The Privilgs attribute exists */
980
981 /* Allocate memory for the stored privilege set */
982 CurrentPrivileges = MIDL_user_allocate(PrivilegeSetSize);
983 if (CurrentPrivileges == NULL)
984 return STATUS_NO_MEMORY;
985
986 /* Get the current privilege set */
987 Status = LsapGetObjectAttribute(AccountObject,
988 L"Privilgs",
989 CurrentPrivileges,
990 &PrivilegeSetSize);
991 if (!NT_SUCCESS(Status))
992 {
993 TRACE("LsapGetObjectAttribute() failed (Status 0x%08lx)\n", Status);
994 goto done;
995 }
996
997 PrivilegeCount = CurrentPrivileges->PrivilegeCount;
998 TRACE("Current privilege count: %lu\n", PrivilegeCount);
999
1000 /* Calculate the number privileges in the combined privilege set */
1001 for (i = 0; i < Privileges->PrivilegeCount; i++)
1002 {
1003 bFound = FALSE;
1004 for (j = 0; j < CurrentPrivileges->PrivilegeCount; j++)
1005 {
1006 if (RtlEqualLuid(&(Privileges->Privilege[i].Luid),
1007 &(CurrentPrivileges->Privilege[i].Luid)))
1008 {
1009 bFound = TRUE;
1010 break;
1011 }
1012 }
1013
1014 if (bFound == FALSE)
1015 {
1016 TRACE("Found new privilege\n");
1017 PrivilegeCount++;
1018 }
1019 }
1020 TRACE("New privilege count: %lu\n", PrivilegeCount);
1021
1022 /* Calculate the size of the new privilege set and allocate it */
1023 PrivilegeSetSize = sizeof(PRIVILEGE_SET) +
1024 (PrivilegeCount - 1) * sizeof(LUID_AND_ATTRIBUTES);
1025 NewPrivileges = MIDL_user_allocate(PrivilegeSetSize);
1026 if (NewPrivileges == NULL)
1027 {
1028 Status = STATUS_NO_MEMORY;
1029 goto done;
1030 }
1031
1032 /* Initialize the new privilege set */
1033 NewPrivileges->PrivilegeCount = PrivilegeCount;
1034 NewPrivileges->Control = 0;
1035
1036 /* Copy all privileges from the current privilege set */
1037 RtlCopyLuidAndAttributesArray(CurrentPrivileges->PrivilegeCount,
1038 &(CurrentPrivileges->Privilege[0]),
1039 &(NewPrivileges->Privilege[0]));
1040
1041 /* Add new privileges to the new privilege set */
1042 PrivilegeCount = CurrentPrivileges->PrivilegeCount;
1043 for (i = 0; i < Privileges->PrivilegeCount; i++)
1044 {
1045 bFound = FALSE;
1046 for (j = 0; j < CurrentPrivileges->PrivilegeCount; j++)
1047 {
1048 if (RtlEqualLuid(&(Privileges->Privilege[i].Luid),
1049 &(CurrentPrivileges->Privilege[i].Luid)))
1050 {
1051 /* Overwrite attributes if a matching privilege was found */
1052 NewPrivileges->Privilege[j].Attributes = Privileges->Privilege[i].Attributes;
1053
1054 bFound = TRUE;
1055 break;
1056 }
1057 }
1058
1059 if (bFound == FALSE)
1060 {
1061 /* Copy the new privilege */
1062 RtlCopyLuidAndAttributesArray(1,
1063 (PLUID_AND_ATTRIBUTES)&(Privileges->Privilege[i]),
1064 &(NewPrivileges->Privilege[PrivilegeCount]));
1065 PrivilegeCount++;
1066 }
1067 }
1068
1069 /* Set the new priivliege set */
1070 Status = LsapSetObjectAttribute(AccountObject,
1071 L"Privilgs",
1072 NewPrivileges,
1073 PrivilegeSetSize);
1074 }
1075
1076 done:
1077 if (CurrentPrivileges != NULL)
1078 MIDL_user_free(CurrentPrivileges);
1079
1080 if (NewPrivileges != NULL)
1081 MIDL_user_free(NewPrivileges);
1082
1083 return Status;
1084 }
1085
1086
1087 /* Function 20 */
1088 NTSTATUS WINAPI LsarRemovePrivilegesFromAccount(
1089 LSAPR_HANDLE AccountHandle,
1090 BOOL AllPrivileges,
1091 PLSAPR_PRIVILEGE_SET Privileges)
1092 {
1093 UNIMPLEMENTED;
1094 return STATUS_NOT_IMPLEMENTED;
1095 }
1096
1097
1098 /* Function 21 */
1099 NTSTATUS WINAPI LsarGetQuotasForAccount(
1100 LSAPR_HANDLE AccountHandle,
1101 PQUOTA_LIMITS QuotaLimits)
1102 {
1103 UNIMPLEMENTED;
1104 return STATUS_NOT_IMPLEMENTED;
1105 }
1106
1107
1108 /* Function 22 */
1109 NTSTATUS WINAPI LsarSetQuotasForAccount(
1110 LSAPR_HANDLE AccountHandle,
1111 PQUOTA_LIMITS QuotaLimits)
1112 {
1113 UNIMPLEMENTED;
1114 return STATUS_NOT_IMPLEMENTED;
1115 }
1116
1117
1118 /* Function 23 */
1119 NTSTATUS WINAPI LsarGetSystemAccessAccount(
1120 LSAPR_HANDLE AccountHandle,
1121 ACCESS_MASK *SystemAccess)
1122 {
1123 PLSA_DB_OBJECT AccountObject;
1124 ULONG Size;
1125 NTSTATUS Status;
1126
1127 /* Validate the account handle */
1128 Status = LsapValidateDbObject(AccountHandle,
1129 LsaDbAccountObject,
1130 ACCOUNT_VIEW,
1131 &AccountObject);
1132 if (!NT_SUCCESS(Status))
1133 {
1134 ERR("Invalid handle (Status %lx)\n", Status);
1135 return Status;
1136 }
1137
1138 /* Get the system access flags */
1139 Status = LsapGetObjectAttribute(AccountObject,
1140 L"ActSysAc",
1141 SystemAccess,
1142 &Size);
1143
1144 return Status;
1145 }
1146
1147
1148 /* Function 24 */
1149 NTSTATUS WINAPI LsarSetSystemAccessAccount(
1150 LSAPR_HANDLE AccountHandle,
1151 ACCESS_MASK SystemAccess)
1152 {
1153 PLSA_DB_OBJECT AccountObject;
1154 NTSTATUS Status;
1155
1156 /* Validate the account handle */
1157 Status = LsapValidateDbObject(AccountHandle,
1158 LsaDbAccountObject,
1159 ACCOUNT_ADJUST_SYSTEM_ACCESS,
1160 &AccountObject);
1161 if (!NT_SUCCESS(Status))
1162 {
1163 ERR("Invalid handle (Status %lx)\n", Status);
1164 return Status;
1165 }
1166
1167 /* Set the system access flags */
1168 Status = LsapSetObjectAttribute(AccountObject,
1169 L"ActSysAc",
1170 &SystemAccess,
1171 sizeof(ACCESS_MASK));
1172
1173 return Status;
1174 }
1175
1176
1177 /* Function 25 */
1178 NTSTATUS WINAPI LsarOpenTrustedDomain(
1179 LSAPR_HANDLE PolicyHandle,
1180 PRPC_SID TrustedDomainSid,
1181 ACCESS_MASK DesiredAccess,
1182 LSAPR_HANDLE *TrustedDomainHandle)
1183 {
1184 UNIMPLEMENTED;
1185 return STATUS_NOT_IMPLEMENTED;
1186 }
1187
1188
1189 /* Function 26 */
1190 NTSTATUS WINAPI LsarQueryInfoTrustedDomain(
1191 LSAPR_HANDLE TrustedDomainHandle,
1192 TRUSTED_INFORMATION_CLASS InformationClass,
1193 PLSAPR_TRUSTED_DOMAIN_INFO *TrustedDomainInformation)
1194 {
1195 UNIMPLEMENTED;
1196 return STATUS_NOT_IMPLEMENTED;
1197 }
1198
1199
1200 /* Function 27 */
1201 NTSTATUS WINAPI LsarSetInformationTrustedDomain(
1202 LSAPR_HANDLE TrustedDomainHandle,
1203 TRUSTED_INFORMATION_CLASS InformationClass,
1204 PLSAPR_TRUSTED_DOMAIN_INFO TrustedDomainInformation)
1205 {
1206 UNIMPLEMENTED;
1207 return STATUS_NOT_IMPLEMENTED;
1208 }
1209
1210
1211 /* Function 28 */
1212 NTSTATUS WINAPI LsarOpenSecret(
1213 LSAPR_HANDLE PolicyHandle,
1214 PRPC_UNICODE_STRING SecretName,
1215 ACCESS_MASK DesiredAccess,
1216 LSAPR_HANDLE *SecretHandle)
1217 {
1218 PLSA_DB_OBJECT PolicyObject;
1219 PLSA_DB_OBJECT SecretObject = NULL;
1220 NTSTATUS Status = STATUS_SUCCESS;
1221
1222 /* Validate the PolicyHandle */
1223 Status = LsapValidateDbObject(PolicyHandle,
1224 LsaDbPolicyObject,
1225 0,
1226 &PolicyObject);
1227 if (!NT_SUCCESS(Status))
1228 {
1229 ERR("LsapValidateDbObject returned 0x%08lx\n", Status);
1230 return Status;
1231 }
1232
1233 /* Create the secret object */
1234 Status = LsapOpenDbObject(PolicyObject,
1235 L"Secrets",
1236 SecretName->Buffer,
1237 LsaDbSecretObject,
1238 DesiredAccess,
1239 &SecretObject);
1240 if (!NT_SUCCESS(Status))
1241 {
1242 ERR("LsapOpenDbObject failed (Status 0x%08lx)\n", Status);
1243 goto done;
1244 }
1245
1246 done:
1247 if (!NT_SUCCESS(Status))
1248 {
1249 if (SecretObject != NULL)
1250 LsapCloseDbObject(SecretObject);
1251 }
1252 else
1253 {
1254 *SecretHandle = (LSAPR_HANDLE)SecretObject;
1255 }
1256
1257 return Status;
1258 }
1259
1260
1261 /* Function 29 */
1262 NTSTATUS WINAPI LsarSetSecret(
1263 LSAPR_HANDLE SecretHandle,
1264 PLSAPR_CR_CIPHER_VALUE EncryptedCurrentValue,
1265 PLSAPR_CR_CIPHER_VALUE EncryptedOldValue)
1266 {
1267 PLSA_DB_OBJECT SecretObject;
1268 PBYTE CurrentValue = NULL;
1269 PBYTE OldValue = NULL;
1270 ULONG CurrentValueLength = 0;
1271 ULONG OldValueLength = 0;
1272 LARGE_INTEGER Time;
1273 NTSTATUS Status;
1274
1275 TRACE("LsarSetSecret(%p %p %p)\n", SecretHandle,
1276 EncryptedCurrentValue, EncryptedOldValue);
1277
1278 /* Validate the SecretHandle */
1279 Status = LsapValidateDbObject(SecretHandle,
1280 LsaDbSecretObject,
1281 SECRET_SET_VALUE,
1282 &SecretObject);
1283 if (!NT_SUCCESS(Status))
1284 {
1285 ERR("LsapValidateDbObject returned 0x%08lx\n", Status);
1286 return Status;
1287 }
1288
1289 if (EncryptedCurrentValue != NULL)
1290 {
1291 /* FIXME: Decrypt the current value */
1292 CurrentValue = EncryptedCurrentValue->Buffer;
1293 CurrentValueLength = EncryptedCurrentValue->MaximumLength;
1294 }
1295
1296 /* Set the current value */
1297 Status = LsapSetObjectAttribute(SecretObject,
1298 L"CurrentValue",
1299 CurrentValue,
1300 CurrentValueLength);
1301 if (!NT_SUCCESS(Status))
1302 {
1303 ERR("LsapSetObjectAttribute failed (Status 0x%08lx)\n", Status);
1304 goto done;
1305 }
1306
1307 /* Get the current time */
1308 Status = NtQuerySystemTime(&Time);
1309 if (!NT_SUCCESS(Status))
1310 {
1311 ERR("NtQuerySystemTime failed (Status 0x%08lx)\n", Status);
1312 goto done;
1313 }
1314
1315 /* Set the current time */
1316 Status = LsapSetObjectAttribute(SecretObject,
1317 L"CurrentTime",
1318 &Time,
1319 sizeof(LARGE_INTEGER));
1320 if (!NT_SUCCESS(Status))
1321 {
1322 ERR("LsapSetObjectAttribute failed (Status 0x%08lx)\n", Status);
1323 goto done;
1324 }
1325
1326 if (EncryptedOldValue != NULL)
1327 {
1328 /* FIXME: Decrypt the old value */
1329 OldValue = EncryptedOldValue->Buffer;
1330 OldValueLength = EncryptedOldValue->MaximumLength;
1331 }
1332
1333 /* Set the old value */
1334 Status = LsapSetObjectAttribute(SecretObject,
1335 L"OldValue",
1336 OldValue,
1337 OldValueLength);
1338 if (!NT_SUCCESS(Status))
1339 {
1340 ERR("LsapSetObjectAttribute failed (Status 0x%08lx)\n", Status);
1341 goto done;
1342 }
1343
1344 /* Set the old time */
1345 Status = LsapSetObjectAttribute(SecretObject,
1346 L"OldTime",
1347 &Time,
1348 sizeof(LARGE_INTEGER));
1349 if (!NT_SUCCESS(Status))
1350 {
1351 ERR("LsapSetObjectAttribute failed (Status 0x%08lx)\n", Status);
1352 }
1353
1354 done:
1355 return Status;
1356 }
1357
1358
1359 /* Function 30 */
1360 NTSTATUS WINAPI LsarQuerySecret(
1361 LSAPR_HANDLE SecretHandle,
1362 PLSAPR_CR_CIPHER_VALUE *EncryptedCurrentValue,
1363 PLARGE_INTEGER CurrentValueSetTime,
1364 PLSAPR_CR_CIPHER_VALUE *EncryptedOldValue,
1365 PLARGE_INTEGER OldValueSetTime)
1366 {
1367 PLSA_DB_OBJECT SecretObject;
1368 PLSAPR_CR_CIPHER_VALUE EncCurrentValue = NULL;
1369 PLSAPR_CR_CIPHER_VALUE EncOldValue = NULL;
1370 PBYTE CurrentValue = NULL;
1371 PBYTE OldValue = NULL;
1372 ULONG CurrentValueLength = 0;
1373 ULONG OldValueLength = 0;
1374 ULONG BufferSize;
1375 NTSTATUS Status;
1376
1377 TRACE("LsarQuerySecret(%p %p %p %p %p)\n", SecretHandle,
1378 EncryptedCurrentValue, CurrentValueSetTime,
1379 EncryptedOldValue, OldValueSetTime);
1380
1381 /* Validate the SecretHandle */
1382 Status = LsapValidateDbObject(SecretHandle,
1383 LsaDbSecretObject,
1384 SECRET_QUERY_VALUE,
1385 &SecretObject);
1386 if (!NT_SUCCESS(Status))
1387 {
1388 ERR("LsapValidateDbObject returned 0x%08lx\n", Status);
1389 return Status;
1390 }
1391
1392 if (EncryptedCurrentValue != NULL)
1393 {
1394 CurrentValueLength = 0;
1395
1396 /* Get the size of the current value */
1397 Status = LsapGetObjectAttribute(SecretObject,
1398 L"CurrentValue",
1399 NULL,
1400 &CurrentValueLength);
1401 if (!NT_SUCCESS(Status))
1402 goto done;
1403
1404 /* Allocate a buffer for the current value */
1405 CurrentValue = midl_user_allocate(CurrentValueLength);
1406 if (CurrentValue == NULL)
1407 {
1408 Status = STATUS_INSUFFICIENT_RESOURCES;
1409 goto done;
1410 }
1411
1412 /* Get the current value */
1413 Status = LsapGetObjectAttribute(SecretObject,
1414 L"CurrentValue",
1415 CurrentValue,
1416 &CurrentValueLength);
1417 if (!NT_SUCCESS(Status))
1418 goto done;
1419
1420 /* Allocate a buffer for the encrypted current value */
1421 EncCurrentValue = midl_user_allocate(sizeof(LSAPR_CR_CIPHER_VALUE));
1422 if (EncCurrentValue == NULL)
1423 {
1424 Status = STATUS_INSUFFICIENT_RESOURCES;
1425 goto done;
1426 }
1427
1428 /* FIXME: Encrypt the current value */
1429 EncCurrentValue->Length = (USHORT)(CurrentValueLength - sizeof(WCHAR));
1430 EncCurrentValue->MaximumLength = (USHORT)CurrentValueLength;
1431 EncCurrentValue->Buffer = (PBYTE)CurrentValue;
1432 }
1433
1434 if (CurrentValueSetTime != NULL)
1435 {
1436 BufferSize = sizeof(LARGE_INTEGER);
1437
1438 /* Get the current value time */
1439 Status = LsapGetObjectAttribute(SecretObject,
1440 L"CurrentTime",
1441 (PBYTE)CurrentValueSetTime,
1442 &BufferSize);
1443 if (!NT_SUCCESS(Status))
1444 goto done;
1445 }
1446
1447 if (EncryptedOldValue != NULL)
1448 {
1449 OldValueLength = 0;
1450
1451 /* Get the size of the old value */
1452 Status = LsapGetObjectAttribute(SecretObject,
1453 L"OldValue",
1454 NULL,
1455 &OldValueLength);
1456 if (!NT_SUCCESS(Status))
1457 goto done;
1458
1459 /* Allocate a buffer for the old value */
1460 OldValue = midl_user_allocate(OldValueLength);
1461 if (OldValue == NULL)
1462 {
1463 Status = STATUS_INSUFFICIENT_RESOURCES;
1464 goto done;
1465 }
1466
1467 /* Get the old value */
1468 Status = LsapGetObjectAttribute(SecretObject,
1469 L"OldValue",
1470 OldValue,
1471 &OldValueLength);
1472 if (!NT_SUCCESS(Status))
1473 goto done;
1474
1475 /* Allocate a buffer for the encrypted old value */
1476 EncOldValue = midl_user_allocate(sizeof(LSAPR_CR_CIPHER_VALUE) + OldValueLength);
1477 if (EncOldValue == NULL)
1478 {
1479 Status = STATUS_INSUFFICIENT_RESOURCES;
1480 goto done;
1481 }
1482
1483 /* FIXME: Encrypt the old value */
1484 EncOldValue->Length = (USHORT)(OldValueLength - sizeof(WCHAR));
1485 EncOldValue->MaximumLength = (USHORT)OldValueLength;
1486 EncOldValue->Buffer = (PBYTE)OldValue;
1487 }
1488
1489 if (OldValueSetTime != NULL)
1490 {
1491 BufferSize = sizeof(LARGE_INTEGER);
1492
1493 /* Get the old value time */
1494 Status = LsapGetObjectAttribute(SecretObject,
1495 L"OldTime",
1496 (PBYTE)OldValueSetTime,
1497 &BufferSize);
1498 if (!NT_SUCCESS(Status))
1499 goto done;
1500 }
1501
1502
1503 done:
1504 if (NT_SUCCESS(Status))
1505 {
1506 if (EncryptedCurrentValue != NULL)
1507 *EncryptedCurrentValue = EncCurrentValue;
1508
1509 if (EncryptedOldValue != NULL)
1510 *EncryptedOldValue = EncOldValue;
1511 }
1512 else
1513 {
1514 if (EncryptedCurrentValue != NULL)
1515 *EncryptedCurrentValue = NULL;
1516
1517 if (EncryptedOldValue != NULL)
1518 *EncryptedOldValue = NULL;
1519
1520 if (EncCurrentValue != NULL)
1521 midl_user_free(EncCurrentValue);
1522
1523 if (EncOldValue != NULL)
1524 midl_user_free(EncOldValue);
1525
1526 if (CurrentValue != NULL)
1527 midl_user_free(CurrentValue);
1528
1529 if (OldValue != NULL)
1530 midl_user_free(OldValue);
1531 }
1532
1533 TRACE("LsarQuerySecret done (Status 0x%08lx)\n", Status);
1534
1535 return Status;
1536 }
1537
1538
1539 /* Function 31 */
1540 NTSTATUS WINAPI LsarLookupPrivilegeValue(
1541 LSAPR_HANDLE PolicyHandle,
1542 PRPC_UNICODE_STRING Name,
1543 PLUID Value)
1544 {
1545 NTSTATUS Status;
1546
1547 TRACE("LsarLookupPrivilegeValue(%p, %wZ, %p)\n",
1548 PolicyHandle, Name, Value);
1549
1550 Status = LsapValidateDbObject(PolicyHandle,
1551 LsaDbPolicyObject,
1552 POLICY_LOOKUP_NAMES,
1553 NULL);
1554 if (!NT_SUCCESS(Status))
1555 {
1556 ERR("Invalid handle (Status %lx)\n", Status);
1557 return Status;
1558 }
1559
1560 TRACE("Privilege: %wZ\n", Name);
1561
1562 Status = LsarpLookupPrivilegeValue((PUNICODE_STRING)Name,
1563 Value);
1564
1565 return Status;
1566 }
1567
1568
1569 /* Function 32 */
1570 NTSTATUS WINAPI LsarLookupPrivilegeName(
1571 LSAPR_HANDLE PolicyHandle,
1572 PLUID Value,
1573 PRPC_UNICODE_STRING *Name)
1574 {
1575 NTSTATUS Status;
1576
1577 TRACE("LsarLookupPrivilegeName(%p, %p, %p)\n",
1578 PolicyHandle, Value, Name);
1579
1580 Status = LsapValidateDbObject(PolicyHandle,
1581 LsaDbPolicyObject,
1582 POLICY_LOOKUP_NAMES,
1583 NULL);
1584 if (!NT_SUCCESS(Status))
1585 {
1586 ERR("Invalid handle\n");
1587 return Status;
1588 }
1589
1590 Status = LsarpLookupPrivilegeName(Value, (PUNICODE_STRING*)Name);
1591
1592 return Status;
1593 }
1594
1595
1596 /* Function 33 */
1597 NTSTATUS WINAPI LsarLookupPrivilegeDisplayName(
1598 LSAPR_HANDLE PolicyHandle,
1599 PRPC_UNICODE_STRING Name,
1600 USHORT ClientLanguage,
1601 USHORT ClientSystemDefaultLanguage,
1602 PRPC_UNICODE_STRING *DisplayName,
1603 USHORT *LanguageReturned)
1604 {
1605 UNIMPLEMENTED;
1606 return STATUS_NOT_IMPLEMENTED;
1607 }
1608
1609
1610 /* Function 34 */
1611 NTSTATUS WINAPI LsarDeleteObject(
1612 LSAPR_HANDLE *ObjectHandle)
1613 {
1614 UNIMPLEMENTED;
1615 return STATUS_NOT_IMPLEMENTED;
1616 }
1617
1618
1619 /* Function 35 */
1620 NTSTATUS WINAPI LsarEnumerateAccountsWithUserRight(
1621 LSAPR_HANDLE PolicyHandle,
1622 PRPC_UNICODE_STRING UserRight,
1623 PLSAPR_ACCOUNT_ENUM_BUFFER EnumerationBuffer)
1624 {
1625 UNIMPLEMENTED;
1626 return STATUS_NOT_IMPLEMENTED;
1627 }
1628
1629
1630 /* Function 36 */
1631 NTSTATUS WINAPI LsarEnumerateAccountRights(
1632 LSAPR_HANDLE PolicyHandle,
1633 PRPC_SID AccountSid,
1634 PLSAPR_USER_RIGHT_SET UserRights)
1635 {
1636 PLSA_DB_OBJECT PolicyObject;
1637 NTSTATUS Status;
1638
1639 TRACE("LsarEnumerateAccountRights(%p %p %p)\n",
1640 PolicyHandle, AccountSid, UserRights);
1641
1642 Status = LsapValidateDbObject(PolicyHandle,
1643 LsaDbPolicyObject,
1644 ACCOUNT_VIEW,
1645 &PolicyObject);
1646 if (!NT_SUCCESS(Status))
1647 return Status;
1648
1649 UserRights->Entries = 0;
1650 UserRights->UserRights = NULL;
1651 return STATUS_OBJECT_NAME_NOT_FOUND;
1652 }
1653
1654
1655 /* Function 37 */
1656 NTSTATUS WINAPI LsarAddAccountRights(
1657 LSAPR_HANDLE PolicyHandle,
1658 PRPC_SID AccountSid,
1659 PLSAPR_USER_RIGHT_SET UserRights)
1660 {
1661 UNIMPLEMENTED;
1662 return STATUS_NOT_IMPLEMENTED;
1663 }
1664
1665
1666 /* Function 38 */
1667 NTSTATUS WINAPI LsarRemoveAccountRights(
1668 LSAPR_HANDLE PolicyHandle,
1669 PRPC_SID AccountSid,
1670 BOOL AllRights,
1671 PLSAPR_USER_RIGHT_SET UserRights)
1672 {
1673 UNIMPLEMENTED;
1674 return STATUS_NOT_IMPLEMENTED;
1675 }
1676
1677
1678 /* Function 39 */
1679 NTSTATUS WINAPI LsarQueryTrustedDomainInfo(
1680 LSAPR_HANDLE PolicyHandle,
1681 PRPC_SID TrustedDomainSid,
1682 TRUSTED_INFORMATION_CLASS InformationClass,
1683 PLSAPR_TRUSTED_DOMAIN_INFO *TrustedDomainInformation)
1684 {
1685 UNIMPLEMENTED;
1686 return STATUS_NOT_IMPLEMENTED;
1687 }
1688
1689
1690 /* Function 40 */
1691 NTSTATUS WINAPI LsarSetTrustedDomainInfo(
1692 LSAPR_HANDLE PolicyHandle,
1693 PRPC_SID TrustedDomainSid,
1694 TRUSTED_INFORMATION_CLASS InformationClass,
1695 PLSAPR_TRUSTED_DOMAIN_INFO TrustedDomainInformation)
1696 {
1697 UNIMPLEMENTED;
1698 return STATUS_NOT_IMPLEMENTED;
1699 }
1700
1701
1702 /* Function 41 */
1703 NTSTATUS WINAPI LsarDeleteTrustedDomain(
1704 LSAPR_HANDLE PolicyHandle,
1705 PRPC_SID TrustedDomainSid)
1706 {
1707 UNIMPLEMENTED;
1708 return STATUS_NOT_IMPLEMENTED;
1709 }
1710
1711
1712 /* Function 42 */
1713 NTSTATUS WINAPI LsarStorePrivateData(
1714 LSAPR_HANDLE PolicyHandle,
1715 PRPC_UNICODE_STRING KeyName,
1716 PLSAPR_CR_CIPHER_VALUE EncryptedData)
1717 {
1718 UNIMPLEMENTED;
1719 return STATUS_NOT_IMPLEMENTED;
1720 }
1721
1722
1723 /* Function 43 */
1724 NTSTATUS WINAPI LsarRetrievePrivateData(
1725 LSAPR_HANDLE PolicyHandle,
1726 PRPC_UNICODE_STRING KeyName,
1727 PLSAPR_CR_CIPHER_VALUE *EncryptedData)
1728 {
1729 UNIMPLEMENTED;
1730 return STATUS_NOT_IMPLEMENTED;
1731 }
1732
1733
1734 /* Function 44 */
1735 NTSTATUS WINAPI LsarOpenPolicy2(
1736 LPWSTR SystemName,
1737 PLSAPR_OBJECT_ATTRIBUTES ObjectAttributes,
1738 ACCESS_MASK DesiredAccess,
1739 LSAPR_HANDLE *PolicyHandle)
1740 {
1741 UNIMPLEMENTED;
1742 return STATUS_NOT_IMPLEMENTED;
1743 }
1744
1745
1746 /* Function 45 */
1747 NTSTATUS WINAPI LsarGetUserName(
1748 LPWSTR SystemName,
1749 PRPC_UNICODE_STRING *UserName,
1750 PRPC_UNICODE_STRING *DomainName)
1751 {
1752 UNIMPLEMENTED;
1753 return STATUS_NOT_IMPLEMENTED;
1754 }
1755
1756
1757 /* Function 46 */
1758 NTSTATUS WINAPI LsarQueryInformationPolicy2(
1759 LSAPR_HANDLE PolicyHandle,
1760 POLICY_INFORMATION_CLASS InformationClass,
1761 PLSAPR_POLICY_INFORMATION *PolicyInformation)
1762 {
1763 return LsarQueryInformationPolicy(PolicyHandle,
1764 InformationClass,
1765 PolicyInformation);
1766 }
1767
1768
1769 /* Function 47 */
1770 NTSTATUS WINAPI LsarSetInformationPolicy2(
1771 LSAPR_HANDLE PolicyHandle,
1772 POLICY_INFORMATION_CLASS InformationClass,
1773 PLSAPR_POLICY_INFORMATION PolicyInformation)
1774 {
1775 return LsarSetInformationPolicy(PolicyHandle,
1776 InformationClass,
1777 PolicyInformation);
1778 }
1779
1780
1781 /* Function 48 */
1782 NTSTATUS WINAPI LsarQueryTrustedDomainInfoByName(
1783 LSAPR_HANDLE PolicyHandle,
1784 PRPC_UNICODE_STRING TrustedDomainName,
1785 POLICY_INFORMATION_CLASS InformationClass,
1786 PLSAPR_TRUSTED_DOMAIN_INFO *PolicyInformation)
1787 {
1788 UNIMPLEMENTED;
1789 return STATUS_NOT_IMPLEMENTED;
1790 }
1791
1792
1793 /* Function 49 */
1794 NTSTATUS WINAPI LsarSetTrustedDomainInfoByName(
1795 LSAPR_HANDLE PolicyHandle,
1796 PRPC_UNICODE_STRING TrustedDomainName,
1797 POLICY_INFORMATION_CLASS InformationClass,
1798 PLSAPR_TRUSTED_DOMAIN_INFO PolicyInformation)
1799 {
1800 UNIMPLEMENTED;
1801 return STATUS_NOT_IMPLEMENTED;
1802 }
1803
1804
1805 /* Function 50 */
1806 NTSTATUS WINAPI LsarEnumerateTrustedDomainsEx(
1807 LSAPR_HANDLE PolicyHandle,
1808 DWORD *EnumerationContext,
1809 PLSAPR_TRUSTED_ENUM_BUFFER_EX EnumerationBuffer,
1810 DWORD PreferedMaximumLength)
1811 {
1812 UNIMPLEMENTED;
1813 return STATUS_NOT_IMPLEMENTED;
1814 }
1815
1816
1817 /* Function 51 */
1818 NTSTATUS WINAPI LsarCreateTrustedDomainEx(
1819 LSAPR_HANDLE PolicyHandle,
1820 PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX TrustedDomainInformation,
1821 PLSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION AuthentificationInformation,
1822 ACCESS_MASK DesiredAccess,
1823 LSAPR_HANDLE *TrustedDomainHandle)
1824 {
1825 UNIMPLEMENTED;
1826 return STATUS_NOT_IMPLEMENTED;
1827 }
1828
1829
1830 /* Function 52 */
1831 NTSTATUS WINAPI LsarSetPolicyReplicationHandle(
1832 PLSAPR_HANDLE PolicyHandle)
1833 {
1834 /* Deprecated */
1835 return STATUS_NOT_IMPLEMENTED;
1836 }
1837
1838
1839 /* Function 53 */
1840 NTSTATUS WINAPI LsarQueryDomainInformationPolicy(
1841 LSAPR_HANDLE PolicyHandle,
1842 POLICY_INFORMATION_CLASS InformationClass,
1843 PLSAPR_POLICY_DOMAIN_INFORMATION *PolicyInformation)
1844 {
1845 UNIMPLEMENTED;
1846 return STATUS_NOT_IMPLEMENTED;
1847 }
1848
1849
1850 /* Function 54 */
1851 NTSTATUS WINAPI LsarSetDomainInformationPolicy(
1852 LSAPR_HANDLE PolicyHandle,
1853 POLICY_INFORMATION_CLASS InformationClass,
1854 PLSAPR_POLICY_DOMAIN_INFORMATION PolicyInformation)
1855 {
1856 UNIMPLEMENTED;
1857 return STATUS_NOT_IMPLEMENTED;
1858 }
1859
1860
1861 /* Function 55 */
1862 NTSTATUS WINAPI LsarOpenTrustedDomainByName(
1863 LSAPR_HANDLE PolicyHandle,
1864 PRPC_UNICODE_STRING TrustedDomainName,
1865 ACCESS_MASK DesiredAccess,
1866 LSAPR_HANDLE *TrustedDomainHandle)
1867 {
1868 UNIMPLEMENTED;
1869 return STATUS_NOT_IMPLEMENTED;
1870 }
1871
1872
1873 /* Function 56 */
1874 NTSTATUS WINAPI LsarTestCall(
1875 handle_t hBinding)
1876 {
1877 UNIMPLEMENTED;
1878 return STATUS_NOT_IMPLEMENTED;
1879 }
1880
1881
1882 /* Function 57 */
1883 NTSTATUS WINAPI LsarLookupSids2(
1884 LSAPR_HANDLE PolicyHandle,
1885 PLSAPR_SID_ENUM_BUFFER SidEnumBuffer,
1886 PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
1887 PLSAPR_TRANSLATED_NAMES_EX TranslatedNames,
1888 LSAP_LOOKUP_LEVEL LookupLevel,
1889 DWORD *MappedCount,
1890 DWORD LookupOptions,
1891 DWORD ClientRevision)
1892 {
1893 UNIMPLEMENTED;
1894 return STATUS_NOT_IMPLEMENTED;
1895 }
1896
1897
1898 /* Function 58 */
1899 NTSTATUS WINAPI LsarLookupNames2(
1900 LSAPR_HANDLE PolicyHandle,
1901 DWORD Count,
1902 PRPC_UNICODE_STRING Names,
1903 PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
1904 PLSAPR_TRANSLATED_SIDS_EX TranslatedSids,
1905 LSAP_LOOKUP_LEVEL LookupLevel,
1906 DWORD *MappedCount,
1907 DWORD LookupOptions,
1908 DWORD ClientRevision)
1909 {
1910 UNIMPLEMENTED;
1911 return STATUS_NOT_IMPLEMENTED;
1912 }
1913
1914
1915 /* Function 59 */
1916 NTSTATUS WINAPI LsarCreateTrustedDomainEx2(
1917 LSAPR_HANDLE PolicyHandle,
1918 PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX TrustedDomainInformation,
1919 PLSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION_INTERNAL AuthentificationInformation,
1920 ACCESS_MASK DesiredAccess,
1921 LSAPR_HANDLE *TrustedDomainHandle)
1922 {
1923 UNIMPLEMENTED;
1924 return STATUS_NOT_IMPLEMENTED;
1925 }
1926
1927
1928 /* Function 60 */
1929 NTSTATUS WINAPI CredrWrite(
1930 handle_t hBinding)
1931 {
1932 UNIMPLEMENTED;
1933 return STATUS_NOT_IMPLEMENTED;
1934 }
1935
1936
1937 /* Function 61 */
1938 NTSTATUS WINAPI CredrRead(
1939 handle_t hBinding)
1940 {
1941 UNIMPLEMENTED;
1942 return STATUS_NOT_IMPLEMENTED;
1943 }
1944
1945
1946 /* Function 62 */
1947 NTSTATUS WINAPI CredrEnumerate(
1948 handle_t hBinding)
1949 {
1950 UNIMPLEMENTED;
1951 return STATUS_NOT_IMPLEMENTED;
1952 }
1953
1954
1955 /* Function 63 */
1956 NTSTATUS WINAPI CredrWriteDomainCredentials(
1957 handle_t hBinding)
1958 {
1959 UNIMPLEMENTED;
1960 return STATUS_NOT_IMPLEMENTED;
1961 }
1962
1963
1964 /* Function 64 */
1965 NTSTATUS WINAPI CredrReadDomainCredentials(
1966 handle_t hBinding)
1967 {
1968 UNIMPLEMENTED;
1969 return STATUS_NOT_IMPLEMENTED;
1970 }
1971
1972
1973 /* Function 65 */
1974 NTSTATUS WINAPI CredrDelete(
1975 handle_t hBinding)
1976 {
1977 UNIMPLEMENTED;
1978 return STATUS_NOT_IMPLEMENTED;
1979 }
1980
1981
1982 /* Function 66 */
1983 NTSTATUS WINAPI CredrGetTargetInfo(
1984 handle_t hBinding)
1985 {
1986 UNIMPLEMENTED;
1987 return STATUS_NOT_IMPLEMENTED;
1988 }
1989
1990
1991 /* Function 67 */
1992 NTSTATUS WINAPI CredrProfileLoaded(
1993 handle_t hBinding)
1994 {
1995 UNIMPLEMENTED;
1996 return STATUS_NOT_IMPLEMENTED;
1997 }
1998
1999
2000 /* Function 68 */
2001 NTSTATUS WINAPI LsarLookupNames3(
2002 LSAPR_HANDLE PolicyHandle,
2003 DWORD Count,
2004 PRPC_UNICODE_STRING Names,
2005 PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
2006 PLSAPR_TRANSLATED_SIDS_EX2 TranslatedSids,
2007 LSAP_LOOKUP_LEVEL LookupLevel,
2008 DWORD *MappedCount,
2009 DWORD LookupOptions,
2010 DWORD ClientRevision)
2011 {
2012 NTSTATUS Status;
2013
2014 TRACE("LsarLookupNames3(%p, %lu, %p, %p, %p, %d, %p, %lu, %lu)\n",
2015 PolicyHandle, Count, Names, ReferencedDomains, TranslatedSids,
2016 LookupLevel, MappedCount, LookupOptions, ClientRevision);
2017
2018 TranslatedSids->Entries = 0;
2019 TranslatedSids->Sids = NULL;
2020 *ReferencedDomains = NULL;
2021
2022 if (Count == 0)
2023 return STATUS_NONE_MAPPED;
2024
2025 Status = LsapLookupNames(Count,
2026 Names,
2027 ReferencedDomains,
2028 TranslatedSids,
2029 LookupLevel,
2030 MappedCount,
2031 LookupOptions,
2032 ClientRevision);
2033
2034 return Status;
2035 }
2036
2037
2038 /* Function 69 */
2039 NTSTATUS WINAPI CredrGetSessionTypes(
2040 handle_t hBinding)
2041 {
2042 UNIMPLEMENTED;
2043 return STATUS_NOT_IMPLEMENTED;
2044 }
2045
2046
2047 /* Function 70 */
2048 NTSTATUS WINAPI LsarRegisterAuditEvent(
2049 handle_t hBinding)
2050 {
2051 UNIMPLEMENTED;
2052 return STATUS_NOT_IMPLEMENTED;
2053 }
2054
2055
2056 /* Function 71 */
2057 NTSTATUS WINAPI LsarGenAuditEvent(
2058 handle_t hBinding)
2059 {
2060 UNIMPLEMENTED;
2061 return STATUS_NOT_IMPLEMENTED;
2062 }
2063
2064
2065 /* Function 72 */
2066 NTSTATUS WINAPI LsarUnregisterAuditEvent(
2067 handle_t hBinding)
2068 {
2069 UNIMPLEMENTED;
2070 return STATUS_NOT_IMPLEMENTED;
2071 }
2072
2073
2074 /* Function 73 */
2075 NTSTATUS WINAPI LsarQueryForestTrustInformation(
2076 LSAPR_HANDLE PolicyHandle,
2077 PLSA_UNICODE_STRING TrustedDomainName,
2078 LSA_FOREST_TRUST_RECORD_TYPE HighestRecordType,
2079 PLSA_FOREST_TRUST_INFORMATION *ForestTrustInfo)
2080 {
2081 UNIMPLEMENTED;
2082 return STATUS_NOT_IMPLEMENTED;
2083 }
2084
2085
2086 /* Function 74 */
2087 NTSTATUS WINAPI LsarSetForestTrustInformation(
2088 LSAPR_HANDLE PolicyHandle,
2089 PLSA_UNICODE_STRING TrustedDomainName,
2090 LSA_FOREST_TRUST_RECORD_TYPE HighestRecordType,
2091 PLSA_FOREST_TRUST_INFORMATION ForestTrustInfo,
2092 BOOL CheckOnly,
2093 PLSA_FOREST_TRUST_COLLISION_INFORMATION *CollisionInfo)
2094 {
2095 UNIMPLEMENTED;
2096 return STATUS_NOT_IMPLEMENTED;
2097 }
2098
2099
2100 /* Function 75 */
2101 NTSTATUS WINAPI CredrRename(
2102 handle_t hBinding)
2103 {
2104 UNIMPLEMENTED;
2105 return STATUS_NOT_IMPLEMENTED;
2106 }
2107
2108
2109 /* Function 76 */
2110 NTSTATUS WINAPI LsarLookupSids3(
2111 LSAPR_HANDLE PolicyHandle,
2112 PLSAPR_SID_ENUM_BUFFER SidEnumBuffer,
2113 PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
2114 PLSAPR_TRANSLATED_NAMES_EX TranslatedNames,
2115 LSAP_LOOKUP_LEVEL LookupLevel,
2116 DWORD *MappedCount,
2117 DWORD LookupOptions,
2118 DWORD ClientRevision)
2119 {
2120 UNIMPLEMENTED;
2121 return STATUS_NOT_IMPLEMENTED;
2122 }
2123
2124
2125 /* Function 77 */
2126 NTSTATUS WINAPI LsarLookupNames4(
2127 handle_t RpcHandle,
2128 DWORD Count,
2129 PRPC_UNICODE_STRING Names,
2130 PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
2131 PLSAPR_TRANSLATED_SIDS_EX2 TranslatedSids,
2132 LSAP_LOOKUP_LEVEL LookupLevel,
2133 DWORD *MappedCount,
2134 DWORD LookupOptions,
2135 DWORD ClientRevision)
2136 {
2137 UNIMPLEMENTED;
2138 return STATUS_NOT_IMPLEMENTED;
2139 }
2140
2141
2142 /* Function 78 */
2143 NTSTATUS WINAPI LsarOpenPolicySce(
2144 handle_t hBinding)
2145 {
2146 UNIMPLEMENTED;
2147 return STATUS_NOT_IMPLEMENTED;
2148 }
2149
2150
2151 /* Function 79 */
2152 NTSTATUS WINAPI LsarAdtRegisterSecurityEventSource(
2153 handle_t hBinding)
2154 {
2155 UNIMPLEMENTED;
2156 return STATUS_NOT_IMPLEMENTED;
2157 }
2158
2159
2160 /* Function 80 */
2161 NTSTATUS WINAPI LsarAdtUnregisterSecurityEventSource(
2162 handle_t hBinding)
2163 {
2164 UNIMPLEMENTED;
2165 return STATUS_NOT_IMPLEMENTED;
2166 }
2167
2168
2169 /* Function 81 */
2170 NTSTATUS WINAPI LsarAdtReportSecurityEvent(
2171 handle_t hBinding)
2172 {
2173 UNIMPLEMENTED;
2174 return STATUS_NOT_IMPLEMENTED;
2175 }
2176
2177
2178 /* Function 82 */
2179 NTSTATUS WINAPI CredrFindBestCredential(
2180 handle_t hBinding)
2181 {
2182 UNIMPLEMENTED;
2183 return STATUS_NOT_IMPLEMENTED;
2184 }
2185
2186
2187 /* Function 83 */
2188 NTSTATUS WINAPI LsarSetAuditPolicy(
2189 handle_t hBinding)
2190 {
2191 UNIMPLEMENTED;
2192 return STATUS_NOT_IMPLEMENTED;
2193 }
2194
2195
2196 /* Function 84 */
2197 NTSTATUS WINAPI LsarQueryAuditPolicy(
2198 handle_t hBinding)
2199 {
2200 UNIMPLEMENTED;
2201 return STATUS_NOT_IMPLEMENTED;
2202 }
2203
2204
2205 /* Function 85 */
2206 NTSTATUS WINAPI LsarEnumerateAuditPolicy(
2207 handle_t hBinding)
2208 {
2209 UNIMPLEMENTED;
2210 return STATUS_NOT_IMPLEMENTED;
2211 }
2212
2213
2214 /* Function 86 */
2215 NTSTATUS WINAPI LsarEnumerateAuditCategories(
2216 handle_t hBinding)
2217 {
2218 UNIMPLEMENTED;
2219 return STATUS_NOT_IMPLEMENTED;
2220 }
2221
2222
2223 /* Function 87 */
2224 NTSTATUS WINAPI LsarEnumerateAuditSubCategories(
2225 handle_t hBinding)
2226 {
2227 UNIMPLEMENTED;
2228 return STATUS_NOT_IMPLEMENTED;
2229 }
2230
2231
2232 /* Function 88 */
2233 NTSTATUS WINAPI LsarLookupAuditCategoryName(
2234 handle_t hBinding)
2235 {
2236 UNIMPLEMENTED;
2237 return STATUS_NOT_IMPLEMENTED;
2238 }
2239
2240
2241 /* Function 89 */
2242 NTSTATUS WINAPI LsarLookupAuditSubCategoryName(
2243 handle_t hBinding)
2244 {
2245 UNIMPLEMENTED;
2246 return STATUS_NOT_IMPLEMENTED;
2247 }
2248
2249
2250 /* Function 90 */
2251 NTSTATUS WINAPI LsarSetAuditSecurity(
2252 handle_t hBinding)
2253 {
2254 UNIMPLEMENTED;
2255 return STATUS_NOT_IMPLEMENTED;
2256 }
2257
2258
2259 /* Function 91 */
2260 NTSTATUS WINAPI LsarQueryAuditSecurity(
2261 handle_t hBinding)
2262 {
2263 UNIMPLEMENTED;
2264 return STATUS_NOT_IMPLEMENTED;
2265 }
2266
2267
2268 /* Function 92 */
2269 NTSTATUS WINAPI CredReadByTokenHandle(
2270 handle_t hBinding)
2271 {
2272 UNIMPLEMENTED;
2273 return STATUS_NOT_IMPLEMENTED;
2274 }
2275
2276
2277 /* Function 93 */
2278 NTSTATUS WINAPI CredrRestoreCredentials(
2279 handle_t hBinding)
2280 {
2281 UNIMPLEMENTED;
2282 return STATUS_NOT_IMPLEMENTED;
2283 }
2284
2285
2286 /* Function 94 */
2287 NTSTATUS WINAPI CredrBackupCredentials(
2288 handle_t hBinding)
2289 {
2290 UNIMPLEMENTED;
2291 return STATUS_NOT_IMPLEMENTED;
2292 }
2293
2294 /* EOF */