[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 PLSA_DB_OBJECT DbObject = NULL;
142 PSECURITY_DESCRIPTOR RelativeSd = NULL;
143 PLSAPR_SR_SECURITY_DESCRIPTOR SdData = NULL;
144 ACCESS_MASK DesiredAccess = 0;
145 ULONG RelativeSdSize = 0;
146 NTSTATUS Status;
147
148 if (SecurityDescriptor == NULL)
149 return STATUS_INVALID_PARAMETER;
150
151 if ((SecurityInformation & OWNER_SECURITY_INFORMATION) ||
152 (SecurityInformation & GROUP_SECURITY_INFORMATION) ||
153 (SecurityInformation & DACL_SECURITY_INFORMATION))
154 DesiredAccess |= READ_CONTROL;
155
156 if (SecurityInformation & SACL_SECURITY_INFORMATION)
157 DesiredAccess |= ACCESS_SYSTEM_SECURITY;
158
159 /* Validate the ObjectHandle */
160 Status = LsapValidateDbObject(ObjectHandle,
161 LsaDbIgnoreObject,
162 DesiredAccess,
163 &DbObject);
164 if (!NT_SUCCESS(Status))
165 return Status;
166
167 /* Get the size of the SD */
168 Status = LsapGetObjectAttribute(DbObject,
169 L"SecDesc",
170 NULL,
171 &RelativeSdSize);
172 if (!NT_SUCCESS(Status))
173 return Status;
174
175 /* Allocate a buffer for the SD */
176 RelativeSd = MIDL_user_allocate(RelativeSdSize);
177 if (RelativeSd == NULL)
178 return STATUS_INSUFFICIENT_RESOURCES;
179
180 /* Get the SD */
181 Status = LsapGetObjectAttribute(DbObject,
182 L"SecDesc",
183 RelativeSd,
184 &RelativeSdSize);
185 if (!NT_SUCCESS(Status))
186 goto done;
187
188 /*
189 * FIXME: Invalidate the SD information that was not requested.
190 * (see SecurityInformation)
191 */
192
193 /* Allocate the SD data buffer */
194 SdData = MIDL_user_allocate(sizeof(LSAPR_SR_SECURITY_DESCRIPTOR));
195 if (SdData == NULL)
196 {
197 Status = STATUS_INSUFFICIENT_RESOURCES;
198 goto done;
199 }
200
201 /* Fill the SD data buffer and return it to the caller */
202 SdData->Length = RelativeSdSize;
203 SdData->SecurityDescriptor = (PBYTE)RelativeSd;
204
205 *SecurityDescriptor = SdData;
206
207 done:
208 if (!NT_SUCCESS(Status))
209 {
210 if (RelativeSd != NULL)
211 MIDL_user_free(RelativeSd);
212 }
213
214 return Status;
215 }
216
217
218 /* Function 4 */
219 NTSTATUS WINAPI LsarSetSecurityObject(
220 LSAPR_HANDLE ObjectHandle,
221 SECURITY_INFORMATION SecurityInformation,
222 PLSAPR_SR_SECURITY_DESCRIPTOR SecurityDescriptor)
223 {
224 UNIMPLEMENTED;
225 return STATUS_NOT_IMPLEMENTED;
226 }
227
228
229 /* Function 5 */
230 NTSTATUS WINAPI LsarChangePassword(
231 handle_t IDL_handle,
232 PRPC_UNICODE_STRING String1,
233 PRPC_UNICODE_STRING String2,
234 PRPC_UNICODE_STRING String3,
235 PRPC_UNICODE_STRING String4,
236 PRPC_UNICODE_STRING String5)
237 {
238 /* Deprecated */
239 return STATUS_NOT_IMPLEMENTED;
240 }
241
242
243 /* Function 6 */
244 NTSTATUS WINAPI LsarOpenPolicy(
245 LPWSTR SystemName,
246 PLSAPR_OBJECT_ATTRIBUTES ObjectAttributes,
247 ACCESS_MASK DesiredAccess,
248 LSAPR_HANDLE *PolicyHandle)
249 {
250 PLSA_DB_OBJECT PolicyObject;
251 NTSTATUS Status;
252
253 TRACE("LsarOpenPolicy called!\n");
254
255 RtlEnterCriticalSection(&PolicyHandleTableLock);
256
257 Status = LsapOpenDbObject(NULL,
258 NULL,
259 L"Policy",
260 LsaDbPolicyObject,
261 DesiredAccess,
262 &PolicyObject);
263
264 RtlLeaveCriticalSection(&PolicyHandleTableLock);
265
266 if (NT_SUCCESS(Status))
267 *PolicyHandle = (LSAPR_HANDLE)PolicyObject;
268
269 TRACE("LsarOpenPolicy done!\n");
270
271 return Status;
272 }
273
274
275 /* Function 7 */
276 NTSTATUS WINAPI LsarQueryInformationPolicy(
277 LSAPR_HANDLE PolicyHandle,
278 POLICY_INFORMATION_CLASS InformationClass,
279 PLSAPR_POLICY_INFORMATION *PolicyInformation)
280 {
281 PLSA_DB_OBJECT PolicyObject;
282 ACCESS_MASK DesiredAccess = 0;
283 NTSTATUS Status;
284
285 TRACE("LsarQueryInformationPolicy(%p,0x%08x,%p)\n",
286 PolicyHandle, InformationClass, PolicyInformation);
287
288 if (PolicyInformation)
289 {
290 TRACE("*PolicyInformation %p\n", *PolicyInformation);
291 }
292
293 switch (InformationClass)
294 {
295 case PolicyAuditLogInformation:
296 case PolicyAuditEventsInformation:
297 case PolicyAuditFullQueryInformation:
298 DesiredAccess = POLICY_VIEW_AUDIT_INFORMATION;
299 break;
300
301 case PolicyPrimaryDomainInformation:
302 case PolicyAccountDomainInformation:
303 case PolicyLsaServerRoleInformation:
304 case PolicyReplicaSourceInformation:
305 case PolicyDefaultQuotaInformation:
306 case PolicyModificationInformation:
307 case PolicyDnsDomainInformation:
308 case PolicyDnsDomainInformationInt:
309 case PolicyLocalAccountDomainInformation:
310 DesiredAccess = POLICY_VIEW_LOCAL_INFORMATION;
311 break;
312
313 case PolicyPdAccountInformation:
314 DesiredAccess = POLICY_GET_PRIVATE_INFORMATION;
315 break;
316
317 default:
318 ERR("Invalid InformationClass!\n");
319 return STATUS_INVALID_PARAMETER;
320 }
321
322 Status = LsapValidateDbObject(PolicyHandle,
323 LsaDbPolicyObject,
324 DesiredAccess,
325 &PolicyObject);
326 if (!NT_SUCCESS(Status))
327 return Status;
328
329 switch (InformationClass)
330 {
331 case PolicyAuditLogInformation: /* 1 */
332 Status = LsarQueryAuditLog(PolicyObject,
333 PolicyInformation);
334 break;
335
336 case PolicyAuditEventsInformation: /* 2 */
337 Status = LsarQueryAuditEvents(PolicyObject,
338 PolicyInformation);
339 break;
340
341 case PolicyPrimaryDomainInformation: /* 3 */
342 Status = LsarQueryPrimaryDomain(PolicyObject,
343 PolicyInformation);
344 break;
345
346 case PolicyPdAccountInformation: /* 4 */
347 Status = LsarQueryPdAccount(PolicyObject,
348 PolicyInformation);
349 break;
350
351 case PolicyAccountDomainInformation: /* 5 */
352 Status = LsarQueryAccountDomain(PolicyObject,
353 PolicyInformation);
354 break;
355
356 case PolicyLsaServerRoleInformation: /* 6 */
357 Status = LsarQueryServerRole(PolicyObject,
358 PolicyInformation);
359 break;
360
361 case PolicyReplicaSourceInformation: /* 7 */
362 Status = LsarQueryReplicaSource(PolicyObject,
363 PolicyInformation);
364 break;
365
366 case PolicyDefaultQuotaInformation: /* 8 */
367 Status = LsarQueryDefaultQuota(PolicyObject,
368 PolicyInformation);
369 break;
370
371 case PolicyModificationInformation: /* 9 */
372 Status = LsarQueryModification(PolicyObject,
373 PolicyInformation);
374 break;
375
376 case PolicyAuditFullQueryInformation: /* 11 (0xB) */
377 Status = LsarQueryAuditFull(PolicyObject,
378 PolicyInformation);
379 break;
380
381 case PolicyDnsDomainInformation: /* 12 (0xC) */
382 Status = LsarQueryDnsDomain(PolicyObject,
383 PolicyInformation);
384 break;
385
386 case PolicyDnsDomainInformationInt: /* 13 (0xD) */
387 Status = LsarQueryDnsDomainInt(PolicyObject,
388 PolicyInformation);
389 break;
390
391 case PolicyLocalAccountDomainInformation: /* 14 (0xE) */
392 Status = LsarQueryLocalAccountDomain(PolicyObject,
393 PolicyInformation);
394 break;
395
396 default:
397 ERR("Invalid InformationClass!\n");
398 Status = STATUS_INVALID_PARAMETER;
399 }
400
401 return Status;
402 }
403
404
405 /* Function 8 */
406 NTSTATUS WINAPI LsarSetInformationPolicy(
407 LSAPR_HANDLE PolicyHandle,
408 POLICY_INFORMATION_CLASS InformationClass,
409 PLSAPR_POLICY_INFORMATION PolicyInformation)
410 {
411 PLSA_DB_OBJECT PolicyObject;
412 ACCESS_MASK DesiredAccess = 0;
413 NTSTATUS Status;
414
415 TRACE("LsarSetInformationPolicy(%p,0x%08x,%p)\n",
416 PolicyHandle, InformationClass, PolicyInformation);
417
418 if (PolicyInformation)
419 {
420 TRACE("*PolicyInformation %p\n", *PolicyInformation);
421 }
422
423 switch (InformationClass)
424 {
425 case PolicyAuditLogInformation:
426 case PolicyAuditFullSetInformation:
427 DesiredAccess = POLICY_AUDIT_LOG_ADMIN;
428 break;
429
430 case PolicyAuditEventsInformation:
431 DesiredAccess = POLICY_SET_AUDIT_REQUIREMENTS;
432 break;
433
434 case PolicyPrimaryDomainInformation:
435 case PolicyAccountDomainInformation:
436 case PolicyDnsDomainInformation:
437 case PolicyDnsDomainInformationInt:
438 case PolicyLocalAccountDomainInformation:
439 DesiredAccess = POLICY_TRUST_ADMIN;
440 break;
441
442 case PolicyLsaServerRoleInformation:
443 case PolicyReplicaSourceInformation:
444 DesiredAccess = POLICY_SERVER_ADMIN;
445 break;
446
447 case PolicyDefaultQuotaInformation:
448 DesiredAccess = POLICY_SET_DEFAULT_QUOTA_LIMITS;
449 break;
450
451 default:
452 ERR("Invalid InformationClass!\n");
453 return STATUS_INVALID_PARAMETER;
454 }
455
456 Status = LsapValidateDbObject(PolicyHandle,
457 LsaDbPolicyObject,
458 DesiredAccess,
459 &PolicyObject);
460 if (!NT_SUCCESS(Status))
461 return Status;
462
463 switch (InformationClass)
464 {
465 case PolicyAuditLogInformation: /* 1 */
466 Status = LsarSetAuditLog(PolicyObject,
467 (PPOLICY_AUDIT_LOG_INFO)PolicyInformation);
468 break;
469
470 case PolicyAuditEventsInformation: /* 2 */
471 Status = LsarSetAuditEvents(PolicyObject,
472 (PLSAPR_POLICY_AUDIT_EVENTS_INFO)PolicyInformation);
473 break;
474
475 case PolicyPrimaryDomainInformation: /* 3 */
476 Status = LsarSetPrimaryDomain(PolicyObject,
477 (PLSAPR_POLICY_PRIMARY_DOM_INFO)PolicyInformation);
478 break;
479
480 case PolicyAccountDomainInformation: /* 5 */
481 Status = LsarSetAccountDomain(PolicyObject,
482 (PLSAPR_POLICY_ACCOUNT_DOM_INFO)PolicyInformation);
483 break;
484
485 case PolicyLsaServerRoleInformation: /* 6 */
486 Status = LsarSetServerRole(PolicyObject,
487 (PPOLICY_LSA_SERVER_ROLE_INFO)PolicyInformation);
488 break;
489
490 case PolicyReplicaSourceInformation: /* 7 */
491 Status = LsarSetReplicaSource(PolicyObject,
492 (PPOLICY_LSA_REPLICA_SRCE_INFO)PolicyInformation);
493 break;
494
495 case PolicyDefaultQuotaInformation: /* 8 */
496 Status = LsarSetDefaultQuota(PolicyObject,
497 (PPOLICY_DEFAULT_QUOTA_INFO)PolicyInformation);
498 break;
499
500 case PolicyModificationInformation: /* 9 */
501 Status = LsarSetModification(PolicyObject,
502 (PPOLICY_MODIFICATION_INFO)PolicyInformation);
503 break;
504
505 case PolicyAuditFullSetInformation: /* 10 (0xA) */
506 Status = LsarSetAuditFull(PolicyObject,
507 (PPOLICY_AUDIT_FULL_QUERY_INFO)PolicyInformation);
508 break;
509
510 case PolicyDnsDomainInformation: /* 12 (0xC) */
511 Status = LsarSetDnsDomain(PolicyObject,
512 (PLSAPR_POLICY_DNS_DOMAIN_INFO)PolicyInformation);
513 break;
514
515 case PolicyDnsDomainInformationInt: /* 13 (0xD) */
516 Status = LsarSetDnsDomainInt(PolicyObject,
517 (PLSAPR_POLICY_DNS_DOMAIN_INFO)PolicyInformation);
518 break;
519
520 case PolicyLocalAccountDomainInformation: /* 14 (0xE) */
521 Status = LsarSetLocalAccountDomain(PolicyObject,
522 (PLSAPR_POLICY_ACCOUNT_DOM_INFO)PolicyInformation);
523 break;
524
525 default:
526 Status = STATUS_INVALID_PARAMETER;
527 break;
528 }
529
530 return Status;
531 }
532
533
534 /* Function 9 */
535 NTSTATUS WINAPI LsarClearAuditLog(
536 LSAPR_HANDLE ObjectHandle)
537 {
538 /* Deprecated */
539 return STATUS_NOT_IMPLEMENTED;
540 }
541
542
543 /* Function 10 */
544 NTSTATUS WINAPI LsarCreateAccount(
545 LSAPR_HANDLE PolicyHandle,
546 PRPC_SID AccountSid,
547 ACCESS_MASK DesiredAccess,
548 LSAPR_HANDLE *AccountHandle)
549 {
550 PLSA_DB_OBJECT PolicyObject;
551 PLSA_DB_OBJECT AccountObject = NULL;
552 LPWSTR SidString = NULL;
553 PSECURITY_DESCRIPTOR AccountSd = NULL;
554 ULONG AccountSdSize;
555 NTSTATUS Status = STATUS_SUCCESS;
556
557 /* Validate the AccountSid */
558 if (!RtlValidSid(AccountSid))
559 return STATUS_INVALID_PARAMETER;
560
561 /* Validate the PolicyHandle */
562 Status = LsapValidateDbObject(PolicyHandle,
563 LsaDbPolicyObject,
564 POLICY_CREATE_ACCOUNT,
565 &PolicyObject);
566 if (!NT_SUCCESS(Status))
567 {
568 ERR("LsapValidateDbObject returned 0x%08lx\n", Status);
569 return Status;
570 }
571
572 /* Create SID string */
573 if (!ConvertSidToStringSid((PSID)AccountSid,
574 &SidString))
575 {
576 ERR("ConvertSidToStringSid failed\n");
577 Status = STATUS_INVALID_PARAMETER;
578 goto done;
579 }
580
581 /* Create a security descriptor for the account */
582 Status = LsapCreateAccountSd(&AccountSd,
583 &AccountSdSize);
584 if (!NT_SUCCESS(Status))
585 {
586 ERR("LsapCreateAccountSd returned 0x%08lx\n", Status);
587 return Status;
588 }
589
590 /* Create the Account object */
591 Status = LsapCreateDbObject(PolicyObject,
592 L"Accounts",
593 SidString,
594 LsaDbAccountObject,
595 DesiredAccess,
596 &AccountObject);
597 if (!NT_SUCCESS(Status))
598 {
599 ERR("LsapCreateDbObject failed (Status 0x%08lx)\n", Status);
600 goto done;
601 }
602
603 /* Set the Sid attribute */
604 Status = LsapSetObjectAttribute(AccountObject,
605 L"Sid",
606 (PVOID)AccountSid,
607 GetLengthSid(AccountSid));
608 if (!NT_SUCCESS(Status))
609 goto done;
610
611 /* Set the SecDesc attribute */
612 Status = LsapSetObjectAttribute(AccountObject,
613 L"SecDesc",
614 AccountSd,
615 AccountSdSize);
616
617 done:
618 if (SidString != NULL)
619 LocalFree(SidString);
620
621 if (AccountSd != NULL)
622 RtlFreeHeap(RtlGetProcessHeap(), 0, AccountSd);
623
624 if (!NT_SUCCESS(Status))
625 {
626 if (AccountObject != NULL)
627 LsapCloseDbObject(AccountObject);
628 }
629 else
630 {
631 *AccountHandle = (LSAPR_HANDLE)AccountObject;
632 }
633
634 return STATUS_SUCCESS;
635 }
636
637
638 /* Function 11 */
639 NTSTATUS WINAPI LsarEnumerateAccounts(
640 LSAPR_HANDLE PolicyHandle,
641 DWORD *EnumerationContext,
642 PLSAPR_ACCOUNT_ENUM_BUFFER EnumerationBuffer,
643 DWORD PreferedMaximumLength)
644 {
645 LSAPR_ACCOUNT_ENUM_BUFFER EnumBuffer = {0, NULL};
646 PLSA_DB_OBJECT PolicyObject = NULL;
647 WCHAR AccountKeyName[64];
648 HANDLE AccountsKeyHandle = NULL;
649 HANDLE AccountKeyHandle;
650 HANDLE SidKeyHandle;
651 ULONG EnumIndex;
652 ULONG EnumCount;
653 ULONG RequiredLength;
654 ULONG DataLength;
655 ULONG i;
656 NTSTATUS Status = STATUS_SUCCESS;
657
658 TRACE("(%p %p %p %lu)\n", PolicyHandle, EnumerationContext,
659 EnumerationBuffer, PreferedMaximumLength);
660
661 if (EnumerationContext == NULL ||
662 EnumerationBuffer == NULL)
663 return STATUS_INVALID_PARAMETER;
664
665 EnumerationBuffer->EntriesRead = 0;
666 EnumerationBuffer->Information = NULL;
667
668 /* Validate the PolicyHandle */
669 Status = LsapValidateDbObject(PolicyHandle,
670 LsaDbPolicyObject,
671 POLICY_VIEW_LOCAL_INFORMATION,
672 &PolicyObject);
673 if (!NT_SUCCESS(Status))
674 {
675 ERR("LsapValidateDbObject returned 0x%08lx\n", Status);
676 return Status;
677 }
678
679 Status = LsapRegOpenKey(PolicyObject->KeyHandle,
680 L"Accounts",
681 KEY_READ,
682 &AccountsKeyHandle);
683 if (!NT_SUCCESS(Status))
684 return Status;
685
686 EnumIndex = *EnumerationContext;
687 EnumCount = 0;
688 RequiredLength = 0;
689
690 while (TRUE)
691 {
692 Status = LsapRegEnumerateSubKey(AccountsKeyHandle,
693 EnumIndex,
694 64 * sizeof(WCHAR),
695 AccountKeyName);
696 if (!NT_SUCCESS(Status))
697 break;
698
699 TRACE("EnumIndex: %lu\n", EnumIndex);
700 TRACE("Account key name: %S\n", AccountKeyName);
701
702 Status = LsapRegOpenKey(AccountsKeyHandle,
703 AccountKeyName,
704 KEY_READ,
705 &AccountKeyHandle);
706 TRACE("LsapRegOpenKey returned %08lX\n", Status);
707 if (NT_SUCCESS(Status))
708 {
709 Status = LsapRegOpenKey(AccountKeyHandle,
710 L"Sid",
711 KEY_READ,
712 &SidKeyHandle);
713 TRACE("LsapRegOpenKey returned %08lX\n", Status);
714 if (NT_SUCCESS(Status))
715 {
716 DataLength = 0;
717 Status = LsapRegQueryValue(SidKeyHandle,
718 NULL,
719 NULL,
720 NULL,
721 &DataLength);
722 TRACE("LsapRegQueryValue returned %08lX\n", Status);
723 if (NT_SUCCESS(Status))
724 {
725 TRACE("Data length: %lu\n", DataLength);
726
727 if ((RequiredLength + DataLength + sizeof(LSAPR_ACCOUNT_INFORMATION)) > PreferedMaximumLength)
728 break;
729
730 RequiredLength += (DataLength + sizeof(LSAPR_ACCOUNT_INFORMATION));
731 EnumCount++;
732 }
733
734 LsapRegCloseKey(SidKeyHandle);
735 }
736
737 LsapRegCloseKey(AccountKeyHandle);
738 }
739
740 EnumIndex++;
741 }
742
743 TRACE("EnumCount: %lu\n", EnumCount);
744 TRACE("RequiredLength: %lu\n", RequiredLength);
745
746 EnumBuffer.EntriesRead = EnumCount;
747 EnumBuffer.Information = midl_user_allocate(EnumCount * sizeof(LSAPR_ACCOUNT_INFORMATION));
748 if (EnumBuffer.Information == NULL)
749 {
750 Status = STATUS_INSUFFICIENT_RESOURCES;
751 goto done;
752 }
753
754 EnumIndex = *EnumerationContext;
755 for (i = 0; i < EnumCount; i++, EnumIndex++)
756 {
757 Status = LsapRegEnumerateSubKey(AccountsKeyHandle,
758 EnumIndex,
759 64 * sizeof(WCHAR),
760 AccountKeyName);
761 if (!NT_SUCCESS(Status))
762 break;
763
764 TRACE("EnumIndex: %lu\n", EnumIndex);
765 TRACE("Account key name: %S\n", AccountKeyName);
766
767 Status = LsapRegOpenKey(AccountsKeyHandle,
768 AccountKeyName,
769 KEY_READ,
770 &AccountKeyHandle);
771 TRACE("LsapRegOpenKey returned %08lX\n", Status);
772 if (NT_SUCCESS(Status))
773 {
774 Status = LsapRegOpenKey(AccountKeyHandle,
775 L"Sid",
776 KEY_READ,
777 &SidKeyHandle);
778 TRACE("LsapRegOpenKey returned %08lX\n", Status);
779 if (NT_SUCCESS(Status))
780 {
781 DataLength = 0;
782 Status = LsapRegQueryValue(SidKeyHandle,
783 NULL,
784 NULL,
785 NULL,
786 &DataLength);
787 TRACE("LsapRegQueryValue returned %08lX\n", Status);
788 if (NT_SUCCESS(Status))
789 {
790 EnumBuffer.Information[i].Sid = midl_user_allocate(DataLength);
791 if (EnumBuffer.Information[i].Sid == NULL)
792 {
793 LsapRegCloseKey(AccountKeyHandle);
794 Status = STATUS_INSUFFICIENT_RESOURCES;
795 goto done;
796 }
797
798 Status = LsapRegQueryValue(SidKeyHandle,
799 NULL,
800 NULL,
801 EnumBuffer.Information[i].Sid,
802 &DataLength);
803 TRACE("SampRegQueryValue returned %08lX\n", Status);
804 }
805
806 LsapRegCloseKey(SidKeyHandle);
807 }
808
809 LsapRegCloseKey(AccountKeyHandle);
810
811 if (!NT_SUCCESS(Status))
812 goto done;
813 }
814 }
815
816 if (NT_SUCCESS(Status))
817 {
818 *EnumerationContext += EnumCount;
819 EnumerationBuffer->EntriesRead = EnumBuffer.EntriesRead;
820 EnumerationBuffer->Information = EnumBuffer.Information;
821 }
822
823 done:
824 if (!NT_SUCCESS(Status))
825 {
826 if (EnumBuffer.Information)
827 {
828 for (i = 0; i < EnumBuffer.EntriesRead; i++)
829 {
830 if (EnumBuffer.Information[i].Sid != NULL)
831 midl_user_free(EnumBuffer.Information[i].Sid);
832 }
833
834 midl_user_free(EnumBuffer.Information);
835 }
836 }
837
838 if (AccountsKeyHandle != NULL)
839 LsapRegCloseKey(AccountsKeyHandle);
840
841 return Status;
842 }
843
844
845 /* Function 12 */
846 NTSTATUS WINAPI LsarCreateTrustedDomain(
847 LSAPR_HANDLE PolicyHandle,
848 PLSAPR_TRUST_INFORMATION TrustedDomainInformation,
849 ACCESS_MASK DesiredAccess,
850 LSAPR_HANDLE *TrustedDomainHandle)
851 {
852 UNIMPLEMENTED;
853 return STATUS_NOT_IMPLEMENTED;
854 }
855
856
857 /* Function 13 */
858 NTSTATUS WINAPI LsarEnumerateTrustedDomains(
859 LSAPR_HANDLE PolicyHandle,
860 DWORD *EnumerationContext,
861 PLSAPR_TRUSTED_ENUM_BUFFER EnumerationBuffer,
862 DWORD PreferedMaximumLength)
863 {
864 UNIMPLEMENTED;
865 return STATUS_NOT_IMPLEMENTED;
866 }
867
868
869 /* Function 14 */
870 NTSTATUS WINAPI LsarLookupNames(
871 LSAPR_HANDLE PolicyHandle,
872 DWORD Count,
873 PRPC_UNICODE_STRING Names,
874 PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
875 PLSAPR_TRANSLATED_SIDS TranslatedSids,
876 LSAP_LOOKUP_LEVEL LookupLevel,
877 DWORD *MappedCount)
878 {
879 LSAPR_TRANSLATED_SIDS_EX2 TranslatedSidsEx2;
880 ULONG i;
881 NTSTATUS Status;
882
883 TRACE("(%p %lu %p %p %p %d %p)\n",
884 PolicyHandle, Count, Names, ReferencedDomains, TranslatedSids,
885 LookupLevel, MappedCount);
886
887 TranslatedSids->Entries = 0;
888 TranslatedSids->Sids = NULL;
889 *ReferencedDomains = NULL;
890
891 if (Count == 0)
892 return STATUS_NONE_MAPPED;
893
894 TranslatedSidsEx2.Entries = 0;
895 TranslatedSidsEx2.Sids = NULL;
896
897 Status = LsapLookupNames(Count,
898 Names,
899 ReferencedDomains,
900 &TranslatedSidsEx2,
901 LookupLevel,
902 MappedCount,
903 0,
904 0);
905 if (!NT_SUCCESS(Status))
906 return Status;
907
908 TranslatedSids->Entries = TranslatedSidsEx2.Entries;
909 TranslatedSids->Sids = MIDL_user_allocate(TranslatedSids->Entries * sizeof(LSA_TRANSLATED_SID));
910 if (TranslatedSids->Sids == NULL)
911 {
912 MIDL_user_free(TranslatedSidsEx2.Sids);
913 MIDL_user_free(*ReferencedDomains);
914 *ReferencedDomains = NULL;
915 return STATUS_INSUFFICIENT_RESOURCES;
916 }
917
918 for (i = 0; i < TranslatedSidsEx2.Entries; i++)
919 {
920 TranslatedSids->Sids[i].Use = TranslatedSidsEx2.Sids[i].Use;
921 TranslatedSids->Sids[i].RelativeId = LsapGetRelativeIdFromSid(TranslatedSidsEx2.Sids[i].Sid);
922 TranslatedSids->Sids[i].DomainIndex = TranslatedSidsEx2.Sids[i].DomainIndex;
923 }
924
925 MIDL_user_free(TranslatedSidsEx2.Sids);
926
927 return STATUS_SUCCESS;
928 }
929
930
931 /* Function 15 */
932 NTSTATUS WINAPI LsarLookupSids(
933 LSAPR_HANDLE PolicyHandle,
934 PLSAPR_SID_ENUM_BUFFER SidEnumBuffer,
935 PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
936 PLSAPR_TRANSLATED_NAMES TranslatedNames,
937 LSAP_LOOKUP_LEVEL LookupLevel,
938 DWORD *MappedCount)
939 {
940 LSAPR_TRANSLATED_NAMES_EX TranslatedNamesEx;
941 ULONG i;
942 NTSTATUS Status;
943
944 TRACE("(%p %p %p %p %d %p)\n",
945 PolicyHandle, SidEnumBuffer, ReferencedDomains, TranslatedNames,
946 LookupLevel, MappedCount);
947
948 /* FIXME: Fail, if there is an invalid SID in the SidEnumBuffer */
949
950 TranslatedNames->Entries = SidEnumBuffer->Entries;
951 TranslatedNames->Names = NULL;
952 *ReferencedDomains = NULL;
953
954 TranslatedNamesEx.Entries = SidEnumBuffer->Entries;
955 TranslatedNamesEx.Names = NULL;
956
957 Status = LsapLookupSids(SidEnumBuffer,
958 ReferencedDomains,
959 &TranslatedNamesEx,
960 LookupLevel,
961 MappedCount,
962 0,
963 0);
964 if (!NT_SUCCESS(Status))
965 return Status;
966
967 TranslatedNames->Entries = SidEnumBuffer->Entries;
968 TranslatedNames->Names = MIDL_user_allocate(SidEnumBuffer->Entries * sizeof(LSAPR_TRANSLATED_NAME));
969 if (TranslatedNames->Names == NULL)
970 {
971 MIDL_user_free(TranslatedNamesEx.Names);
972 MIDL_user_free(*ReferencedDomains);
973 *ReferencedDomains = NULL;
974 return STATUS_INSUFFICIENT_RESOURCES;
975 }
976
977 for (i = 0; i < TranslatedNamesEx.Entries; i++)
978 {
979 TranslatedNames->Names[i].Use = TranslatedNamesEx.Names[i].Use;
980 TranslatedNames->Names[i].Name.Length = TranslatedNamesEx.Names[i].Name.Length;
981 TranslatedNames->Names[i].Name.MaximumLength = TranslatedNamesEx.Names[i].Name.MaximumLength;
982 TranslatedNames->Names[i].Name.Buffer = TranslatedNamesEx.Names[i].Name.Buffer;
983 TranslatedNames->Names[i].DomainIndex = TranslatedNamesEx.Names[i].DomainIndex;
984 }
985
986 MIDL_user_free(TranslatedNamesEx.Names);
987
988 return Status;
989 }
990
991
992 /* Function 16 */
993 NTSTATUS WINAPI LsarCreateSecret(
994 LSAPR_HANDLE PolicyHandle,
995 PRPC_UNICODE_STRING SecretName,
996 ACCESS_MASK DesiredAccess,
997 LSAPR_HANDLE *SecretHandle)
998 {
999 PLSA_DB_OBJECT PolicyObject;
1000 PLSA_DB_OBJECT SecretObject = NULL;
1001 LARGE_INTEGER Time;
1002 PSECURITY_DESCRIPTOR SecretSd = NULL;
1003 ULONG SecretSdSize;
1004 NTSTATUS Status = STATUS_SUCCESS;
1005
1006 /* Validate the PolicyHandle */
1007 Status = LsapValidateDbObject(PolicyHandle,
1008 LsaDbPolicyObject,
1009 POLICY_CREATE_SECRET,
1010 &PolicyObject);
1011 if (!NT_SUCCESS(Status))
1012 {
1013 ERR("LsapValidateDbObject returned 0x%08lx\n", Status);
1014 return Status;
1015 }
1016
1017 /* Get the current time */
1018 Status = NtQuerySystemTime(&Time);
1019 if (!NT_SUCCESS(Status))
1020 {
1021 ERR("NtQuerySystemTime failed (Status 0x%08lx)\n", Status);
1022 goto done;
1023 }
1024
1025 /* Create a security descriptor for the secret */
1026 Status = LsapCreateSecretSd(&SecretSd,
1027 &SecretSdSize);
1028 if (!NT_SUCCESS(Status))
1029 {
1030 ERR("LsapCreateAccountSd returned 0x%08lx\n", Status);
1031 return Status;
1032 }
1033
1034 /* Create the Secret object */
1035 Status = LsapCreateDbObject(PolicyObject,
1036 L"Secrets",
1037 SecretName->Buffer,
1038 LsaDbSecretObject,
1039 DesiredAccess,
1040 &SecretObject);
1041 if (!NT_SUCCESS(Status))
1042 {
1043 ERR("LsapCreateDbObject failed (Status 0x%08lx)\n", Status);
1044 goto done;
1045 }
1046
1047 /* Set the CurrentTime attribute */
1048 Status = LsapSetObjectAttribute(SecretObject,
1049 L"CurrentTime",
1050 (PVOID)&Time,
1051 sizeof(LARGE_INTEGER));
1052 if (!NT_SUCCESS(Status))
1053 {
1054 ERR("LsapSetObjectAttribute (CurrentTime) failed (Status 0x%08lx)\n", Status);
1055 goto done;
1056 }
1057
1058 /* Set the OldTime attribute */
1059 Status = LsapSetObjectAttribute(SecretObject,
1060 L"OldTime",
1061 (PVOID)&Time,
1062 sizeof(LARGE_INTEGER));
1063 if (!NT_SUCCESS(Status))
1064 {
1065 ERR("LsapSetObjectAttribute (OldTime) failed (Status 0x%08lx)\n", Status);
1066 goto done;
1067 }
1068
1069 /* Set the SecDesc attribute */
1070 Status = LsapSetObjectAttribute(SecretObject,
1071 L"SecDesc",
1072 SecretSd,
1073 SecretSdSize);
1074
1075 done:
1076 if (SecretSd != NULL)
1077 RtlFreeHeap(RtlGetProcessHeap(), 0, SecretSd);
1078
1079 if (!NT_SUCCESS(Status))
1080 {
1081 if (SecretObject != NULL)
1082 LsapCloseDbObject(SecretObject);
1083 }
1084 else
1085 {
1086 *SecretHandle = (LSAPR_HANDLE)SecretObject;
1087 }
1088
1089 return STATUS_SUCCESS;
1090 }
1091
1092
1093 /* Function 17 */
1094 NTSTATUS WINAPI LsarOpenAccount(
1095 LSAPR_HANDLE PolicyHandle,
1096 PRPC_SID AccountSid,
1097 ACCESS_MASK DesiredAccess,
1098 LSAPR_HANDLE *AccountHandle)
1099 {
1100 PLSA_DB_OBJECT PolicyObject;
1101 PLSA_DB_OBJECT AccountObject = NULL;
1102 LPWSTR SidString = NULL;
1103 NTSTATUS Status = STATUS_SUCCESS;
1104
1105 /* Validate the AccountSid */
1106 if (!RtlValidSid(AccountSid))
1107 return STATUS_INVALID_PARAMETER;
1108
1109 /* Validate the PolicyHandle */
1110 Status = LsapValidateDbObject(PolicyHandle,
1111 LsaDbPolicyObject,
1112 0,
1113 &PolicyObject);
1114 if (!NT_SUCCESS(Status))
1115 {
1116 ERR("LsapValidateDbObject returned 0x%08lx\n", Status);
1117 return Status;
1118 }
1119
1120 /* Create SID string */
1121 if (!ConvertSidToStringSid((PSID)AccountSid,
1122 &SidString))
1123 {
1124 ERR("ConvertSidToStringSid failed\n");
1125 Status = STATUS_INVALID_PARAMETER;
1126 goto done;
1127 }
1128
1129 /* Create the Account object */
1130 Status = LsapOpenDbObject(PolicyObject,
1131 L"Accounts",
1132 SidString,
1133 LsaDbAccountObject,
1134 DesiredAccess,
1135 &AccountObject);
1136 if (!NT_SUCCESS(Status))
1137 {
1138 ERR("LsapOpenDbObject failed (Status 0x%08lx)\n", Status);
1139 goto done;
1140 }
1141
1142 /* Set the Sid attribute */
1143 Status = LsapSetObjectAttribute(AccountObject,
1144 L"Sid",
1145 (PVOID)AccountSid,
1146 GetLengthSid(AccountSid));
1147
1148 done:
1149 if (SidString != NULL)
1150 LocalFree(SidString);
1151
1152 if (!NT_SUCCESS(Status))
1153 {
1154 if (AccountObject != NULL)
1155 LsapCloseDbObject(AccountObject);
1156 }
1157 else
1158 {
1159 *AccountHandle = (LSAPR_HANDLE)AccountObject;
1160 }
1161
1162 return Status;
1163 }
1164
1165
1166 /* Function 18 */
1167 NTSTATUS WINAPI LsarEnumeratePrivilegesAccount(
1168 LSAPR_HANDLE AccountHandle,
1169 PLSAPR_PRIVILEGE_SET *Privileges)
1170 {
1171 PLSA_DB_OBJECT AccountObject;
1172 ULONG PrivilegeSetSize = 0;
1173 PLSAPR_PRIVILEGE_SET PrivilegeSet = NULL;
1174 NTSTATUS Status;
1175
1176 *Privileges = NULL;
1177
1178 /* Validate the AccountHandle */
1179 Status = LsapValidateDbObject(AccountHandle,
1180 LsaDbAccountObject,
1181 ACCOUNT_VIEW,
1182 &AccountObject);
1183 if (!NT_SUCCESS(Status))
1184 {
1185 ERR("LsapValidateDbObject returned 0x%08lx\n", Status);
1186 return Status;
1187 }
1188
1189 /* Get the size of the privilege set */
1190 Status = LsapGetObjectAttribute(AccountObject,
1191 L"Privilgs",
1192 NULL,
1193 &PrivilegeSetSize);
1194 if (!NT_SUCCESS(Status))
1195 return Status;
1196
1197 /* Allocate a buffer for the privilege set */
1198 PrivilegeSet = MIDL_user_allocate(PrivilegeSetSize);
1199 if (PrivilegeSet == NULL)
1200 return STATUS_NO_MEMORY;
1201
1202 /* Get the privilege set */
1203 Status = LsapGetObjectAttribute(AccountObject,
1204 L"Privilgs",
1205 PrivilegeSet,
1206 &PrivilegeSetSize);
1207 if (!NT_SUCCESS(Status))
1208 {
1209 MIDL_user_free(PrivilegeSet);
1210 return Status;
1211 }
1212
1213 /* Return a pointer to the privilege set */
1214 *Privileges = PrivilegeSet;
1215
1216 return STATUS_SUCCESS;
1217 }
1218
1219
1220 /* Function 19 */
1221 NTSTATUS WINAPI LsarAddPrivilegesToAccount(
1222 LSAPR_HANDLE AccountHandle,
1223 PLSAPR_PRIVILEGE_SET Privileges)
1224 {
1225 PLSA_DB_OBJECT AccountObject;
1226 PPRIVILEGE_SET CurrentPrivileges = NULL;
1227 PPRIVILEGE_SET NewPrivileges = NULL;
1228 ULONG PrivilegeSetSize = 0;
1229 ULONG PrivilegeCount;
1230 ULONG i, j;
1231 BOOL bFound;
1232 NTSTATUS Status;
1233
1234 /* Validate the AccountHandle */
1235 Status = LsapValidateDbObject(AccountHandle,
1236 LsaDbAccountObject,
1237 ACCOUNT_ADJUST_PRIVILEGES,
1238 &AccountObject);
1239 if (!NT_SUCCESS(Status))
1240 {
1241 ERR("LsapValidateDbObject returned 0x%08lx\n", Status);
1242 return Status;
1243 }
1244
1245 Status = LsapGetObjectAttribute(AccountObject,
1246 L"Privilgs",
1247 NULL,
1248 &PrivilegeSetSize);
1249 if (!NT_SUCCESS(Status) || PrivilegeSetSize == 0)
1250 {
1251 /* The Privilgs attribute does not exist */
1252
1253 PrivilegeSetSize = sizeof(PRIVILEGE_SET) +
1254 (Privileges->PrivilegeCount - 1) * sizeof(LUID_AND_ATTRIBUTES);
1255 Status = LsapSetObjectAttribute(AccountObject,
1256 L"Privilgs",
1257 Privileges,
1258 PrivilegeSetSize);
1259 }
1260 else
1261 {
1262 /* The Privilgs attribute exists */
1263
1264 /* Allocate memory for the stored privilege set */
1265 CurrentPrivileges = MIDL_user_allocate(PrivilegeSetSize);
1266 if (CurrentPrivileges == NULL)
1267 return STATUS_NO_MEMORY;
1268
1269 /* Get the current privilege set */
1270 Status = LsapGetObjectAttribute(AccountObject,
1271 L"Privilgs",
1272 CurrentPrivileges,
1273 &PrivilegeSetSize);
1274 if (!NT_SUCCESS(Status))
1275 {
1276 TRACE("LsapGetObjectAttribute() failed (Status 0x%08lx)\n", Status);
1277 goto done;
1278 }
1279
1280 PrivilegeCount = CurrentPrivileges->PrivilegeCount;
1281 TRACE("Current privilege count: %lu\n", PrivilegeCount);
1282
1283 /* Calculate the number privileges in the combined privilege set */
1284 for (i = 0; i < Privileges->PrivilegeCount; i++)
1285 {
1286 bFound = FALSE;
1287 for (j = 0; j < CurrentPrivileges->PrivilegeCount; j++)
1288 {
1289 if (RtlEqualLuid(&(Privileges->Privilege[i].Luid),
1290 &(CurrentPrivileges->Privilege[i].Luid)))
1291 {
1292 bFound = TRUE;
1293 break;
1294 }
1295 }
1296
1297 if (bFound == FALSE)
1298 {
1299 TRACE("Found new privilege\n");
1300 PrivilegeCount++;
1301 }
1302 }
1303 TRACE("New privilege count: %lu\n", PrivilegeCount);
1304
1305 /* Calculate the size of the new privilege set and allocate it */
1306 PrivilegeSetSize = sizeof(PRIVILEGE_SET) +
1307 (PrivilegeCount - 1) * sizeof(LUID_AND_ATTRIBUTES);
1308 NewPrivileges = MIDL_user_allocate(PrivilegeSetSize);
1309 if (NewPrivileges == NULL)
1310 {
1311 Status = STATUS_NO_MEMORY;
1312 goto done;
1313 }
1314
1315 /* Initialize the new privilege set */
1316 NewPrivileges->PrivilegeCount = PrivilegeCount;
1317 NewPrivileges->Control = 0;
1318
1319 /* Copy all privileges from the current privilege set */
1320 RtlCopyLuidAndAttributesArray(CurrentPrivileges->PrivilegeCount,
1321 &(CurrentPrivileges->Privilege[0]),
1322 &(NewPrivileges->Privilege[0]));
1323
1324 /* Add new privileges to the new privilege set */
1325 PrivilegeCount = CurrentPrivileges->PrivilegeCount;
1326 for (i = 0; i < Privileges->PrivilegeCount; i++)
1327 {
1328 bFound = FALSE;
1329 for (j = 0; j < CurrentPrivileges->PrivilegeCount; j++)
1330 {
1331 if (RtlEqualLuid(&(Privileges->Privilege[i].Luid),
1332 &(CurrentPrivileges->Privilege[i].Luid)))
1333 {
1334 /* Overwrite attributes if a matching privilege was found */
1335 NewPrivileges->Privilege[j].Attributes = Privileges->Privilege[i].Attributes;
1336
1337 bFound = TRUE;
1338 break;
1339 }
1340 }
1341
1342 if (bFound == FALSE)
1343 {
1344 /* Copy the new privilege */
1345 RtlCopyLuidAndAttributesArray(1,
1346 (PLUID_AND_ATTRIBUTES)&(Privileges->Privilege[i]),
1347 &(NewPrivileges->Privilege[PrivilegeCount]));
1348 PrivilegeCount++;
1349 }
1350 }
1351
1352 /* Set the new priivliege set */
1353 Status = LsapSetObjectAttribute(AccountObject,
1354 L"Privilgs",
1355 NewPrivileges,
1356 PrivilegeSetSize);
1357 }
1358
1359 done:
1360 if (CurrentPrivileges != NULL)
1361 MIDL_user_free(CurrentPrivileges);
1362
1363 if (NewPrivileges != NULL)
1364 MIDL_user_free(NewPrivileges);
1365
1366 return Status;
1367 }
1368
1369
1370 /* Function 20 */
1371 NTSTATUS WINAPI LsarRemovePrivilegesFromAccount(
1372 LSAPR_HANDLE AccountHandle,
1373 BOOL AllPrivileges,
1374 PLSAPR_PRIVILEGE_SET Privileges)
1375 {
1376 UNIMPLEMENTED;
1377 return STATUS_NOT_IMPLEMENTED;
1378 }
1379
1380
1381 /* Function 21 */
1382 NTSTATUS WINAPI LsarGetQuotasForAccount(
1383 LSAPR_HANDLE AccountHandle,
1384 PQUOTA_LIMITS QuotaLimits)
1385 {
1386 PLSA_DB_OBJECT AccountObject;
1387 ULONG Size;
1388 NTSTATUS Status;
1389
1390 TRACE("(%p %p)\n", AccountHandle, QuotaLimits);
1391
1392 /* Validate the account handle */
1393 Status = LsapValidateDbObject(AccountHandle,
1394 LsaDbAccountObject,
1395 ACCOUNT_VIEW,
1396 &AccountObject);
1397 if (!NT_SUCCESS(Status))
1398 {
1399 ERR("Invalid handle (Status %lx)\n", Status);
1400 return Status;
1401 }
1402
1403 /* Get the quota attribute */
1404 Status = LsapGetObjectAttribute(AccountObject,
1405 L"DefQuota",
1406 QuotaLimits,
1407 &Size);
1408
1409 return Status;
1410 }
1411
1412
1413 /* Function 22 */
1414 NTSTATUS WINAPI LsarSetQuotasForAccount(
1415 LSAPR_HANDLE AccountHandle,
1416 PQUOTA_LIMITS QuotaLimits)
1417 {
1418 PLSA_DB_OBJECT AccountObject;
1419 QUOTA_LIMITS InternalQuotaLimits;
1420 ULONG Size;
1421 NTSTATUS Status;
1422
1423 TRACE("(%p %p)\n", AccountHandle, QuotaLimits);
1424
1425 /* Validate the account handle */
1426 Status = LsapValidateDbObject(AccountHandle,
1427 LsaDbAccountObject,
1428 ACCOUNT_ADJUST_QUOTAS,
1429 &AccountObject);
1430 if (!NT_SUCCESS(Status))
1431 {
1432 ERR("Invalid handle (Status %lx)\n", Status);
1433 return Status;
1434 }
1435
1436 /* Get the quota limits attribute */
1437 Size = sizeof(QUOTA_LIMITS);
1438 Status = LsapGetObjectAttribute(AccountObject,
1439 L"DefQuota",
1440 &InternalQuotaLimits,
1441 &Size);
1442 if (!NT_SUCCESS(Status))
1443 {
1444 TRACE("LsapGetObjectAttribute() failed (Status 0x%08lx)\n", Status);
1445 return Status;
1446 }
1447
1448 /* Update the quota limits */
1449 if (QuotaLimits->PagedPoolLimit != 0)
1450 InternalQuotaLimits.PagedPoolLimit = QuotaLimits->PagedPoolLimit;
1451
1452 if (QuotaLimits->NonPagedPoolLimit != 0)
1453 InternalQuotaLimits.NonPagedPoolLimit = QuotaLimits->NonPagedPoolLimit;
1454
1455 if (QuotaLimits->MinimumWorkingSetSize != 0)
1456 InternalQuotaLimits.MinimumWorkingSetSize = QuotaLimits->MinimumWorkingSetSize;
1457
1458 if (QuotaLimits->MaximumWorkingSetSize != 0)
1459 InternalQuotaLimits.MaximumWorkingSetSize = QuotaLimits->MaximumWorkingSetSize;
1460
1461 if (QuotaLimits->PagefileLimit != 0)
1462 InternalQuotaLimits.PagefileLimit = QuotaLimits->PagefileLimit;
1463
1464 /* Set the quota limits attribute */
1465 Status = LsapSetObjectAttribute(AccountObject,
1466 L"DefQuota",
1467 &InternalQuotaLimits,
1468 sizeof(QUOTA_LIMITS));
1469
1470 return Status;
1471 }
1472
1473
1474 /* Function 23 */
1475 NTSTATUS WINAPI LsarGetSystemAccessAccount(
1476 LSAPR_HANDLE AccountHandle,
1477 ACCESS_MASK *SystemAccess)
1478 {
1479 PLSA_DB_OBJECT AccountObject;
1480 ULONG Size;
1481 NTSTATUS Status;
1482
1483 /* Validate the account handle */
1484 Status = LsapValidateDbObject(AccountHandle,
1485 LsaDbAccountObject,
1486 ACCOUNT_VIEW,
1487 &AccountObject);
1488 if (!NT_SUCCESS(Status))
1489 {
1490 ERR("Invalid handle (Status %lx)\n", Status);
1491 return Status;
1492 }
1493
1494 /* Get the system access flags */
1495 Status = LsapGetObjectAttribute(AccountObject,
1496 L"ActSysAc",
1497 SystemAccess,
1498 &Size);
1499
1500 return Status;
1501 }
1502
1503
1504 /* Function 24 */
1505 NTSTATUS WINAPI LsarSetSystemAccessAccount(
1506 LSAPR_HANDLE AccountHandle,
1507 ACCESS_MASK SystemAccess)
1508 {
1509 PLSA_DB_OBJECT AccountObject;
1510 NTSTATUS Status;
1511
1512 /* Validate the account handle */
1513 Status = LsapValidateDbObject(AccountHandle,
1514 LsaDbAccountObject,
1515 ACCOUNT_ADJUST_SYSTEM_ACCESS,
1516 &AccountObject);
1517 if (!NT_SUCCESS(Status))
1518 {
1519 ERR("Invalid handle (Status %lx)\n", Status);
1520 return Status;
1521 }
1522
1523 /* Set the system access flags */
1524 Status = LsapSetObjectAttribute(AccountObject,
1525 L"ActSysAc",
1526 &SystemAccess,
1527 sizeof(ACCESS_MASK));
1528
1529 return Status;
1530 }
1531
1532
1533 /* Function 25 */
1534 NTSTATUS WINAPI LsarOpenTrustedDomain(
1535 LSAPR_HANDLE PolicyHandle,
1536 PRPC_SID TrustedDomainSid,
1537 ACCESS_MASK DesiredAccess,
1538 LSAPR_HANDLE *TrustedDomainHandle)
1539 {
1540 UNIMPLEMENTED;
1541 return STATUS_NOT_IMPLEMENTED;
1542 }
1543
1544
1545 /* Function 26 */
1546 NTSTATUS WINAPI LsarQueryInfoTrustedDomain(
1547 LSAPR_HANDLE TrustedDomainHandle,
1548 TRUSTED_INFORMATION_CLASS InformationClass,
1549 PLSAPR_TRUSTED_DOMAIN_INFO *TrustedDomainInformation)
1550 {
1551 UNIMPLEMENTED;
1552 return STATUS_NOT_IMPLEMENTED;
1553 }
1554
1555
1556 /* Function 27 */
1557 NTSTATUS WINAPI LsarSetInformationTrustedDomain(
1558 LSAPR_HANDLE TrustedDomainHandle,
1559 TRUSTED_INFORMATION_CLASS InformationClass,
1560 PLSAPR_TRUSTED_DOMAIN_INFO TrustedDomainInformation)
1561 {
1562 UNIMPLEMENTED;
1563 return STATUS_NOT_IMPLEMENTED;
1564 }
1565
1566
1567 /* Function 28 */
1568 NTSTATUS WINAPI LsarOpenSecret(
1569 LSAPR_HANDLE PolicyHandle,
1570 PRPC_UNICODE_STRING SecretName,
1571 ACCESS_MASK DesiredAccess,
1572 LSAPR_HANDLE *SecretHandle)
1573 {
1574 PLSA_DB_OBJECT PolicyObject;
1575 PLSA_DB_OBJECT SecretObject = NULL;
1576 NTSTATUS Status = STATUS_SUCCESS;
1577
1578 /* Validate the PolicyHandle */
1579 Status = LsapValidateDbObject(PolicyHandle,
1580 LsaDbPolicyObject,
1581 0,
1582 &PolicyObject);
1583 if (!NT_SUCCESS(Status))
1584 {
1585 ERR("LsapValidateDbObject returned 0x%08lx\n", Status);
1586 return Status;
1587 }
1588
1589 /* Create the secret object */
1590 Status = LsapOpenDbObject(PolicyObject,
1591 L"Secrets",
1592 SecretName->Buffer,
1593 LsaDbSecretObject,
1594 DesiredAccess,
1595 &SecretObject);
1596 if (!NT_SUCCESS(Status))
1597 {
1598 ERR("LsapOpenDbObject failed (Status 0x%08lx)\n", Status);
1599 goto done;
1600 }
1601
1602 done:
1603 if (!NT_SUCCESS(Status))
1604 {
1605 if (SecretObject != NULL)
1606 LsapCloseDbObject(SecretObject);
1607 }
1608 else
1609 {
1610 *SecretHandle = (LSAPR_HANDLE)SecretObject;
1611 }
1612
1613 return Status;
1614 }
1615
1616
1617 /* Function 29 */
1618 NTSTATUS WINAPI LsarSetSecret(
1619 LSAPR_HANDLE SecretHandle,
1620 PLSAPR_CR_CIPHER_VALUE EncryptedCurrentValue,
1621 PLSAPR_CR_CIPHER_VALUE EncryptedOldValue)
1622 {
1623 PLSA_DB_OBJECT SecretObject;
1624 PBYTE CurrentValue = NULL;
1625 PBYTE OldValue = NULL;
1626 ULONG CurrentValueLength = 0;
1627 ULONG OldValueLength = 0;
1628 LARGE_INTEGER Time;
1629 NTSTATUS Status;
1630
1631 TRACE("LsarSetSecret(%p %p %p)\n", SecretHandle,
1632 EncryptedCurrentValue, EncryptedOldValue);
1633
1634 /* Validate the SecretHandle */
1635 Status = LsapValidateDbObject(SecretHandle,
1636 LsaDbSecretObject,
1637 SECRET_SET_VALUE,
1638 &SecretObject);
1639 if (!NT_SUCCESS(Status))
1640 {
1641 ERR("LsapValidateDbObject returned 0x%08lx\n", Status);
1642 return Status;
1643 }
1644
1645 if (EncryptedCurrentValue != NULL)
1646 {
1647 /* FIXME: Decrypt the current value */
1648 CurrentValue = EncryptedCurrentValue->Buffer;
1649 CurrentValueLength = EncryptedCurrentValue->MaximumLength;
1650 }
1651
1652 /* Set the current value */
1653 Status = LsapSetObjectAttribute(SecretObject,
1654 L"CurrentValue",
1655 CurrentValue,
1656 CurrentValueLength);
1657 if (!NT_SUCCESS(Status))
1658 {
1659 ERR("LsapSetObjectAttribute failed (Status 0x%08lx)\n", Status);
1660 goto done;
1661 }
1662
1663 /* Get the current time */
1664 Status = NtQuerySystemTime(&Time);
1665 if (!NT_SUCCESS(Status))
1666 {
1667 ERR("NtQuerySystemTime failed (Status 0x%08lx)\n", Status);
1668 goto done;
1669 }
1670
1671 /* Set the current time */
1672 Status = LsapSetObjectAttribute(SecretObject,
1673 L"CurrentTime",
1674 &Time,
1675 sizeof(LARGE_INTEGER));
1676 if (!NT_SUCCESS(Status))
1677 {
1678 ERR("LsapSetObjectAttribute failed (Status 0x%08lx)\n", Status);
1679 goto done;
1680 }
1681
1682 if (EncryptedOldValue != NULL)
1683 {
1684 /* FIXME: Decrypt the old value */
1685 OldValue = EncryptedOldValue->Buffer;
1686 OldValueLength = EncryptedOldValue->MaximumLength;
1687 }
1688
1689 /* Set the old value */
1690 Status = LsapSetObjectAttribute(SecretObject,
1691 L"OldValue",
1692 OldValue,
1693 OldValueLength);
1694 if (!NT_SUCCESS(Status))
1695 {
1696 ERR("LsapSetObjectAttribute failed (Status 0x%08lx)\n", Status);
1697 goto done;
1698 }
1699
1700 /* Set the old time */
1701 Status = LsapSetObjectAttribute(SecretObject,
1702 L"OldTime",
1703 &Time,
1704 sizeof(LARGE_INTEGER));
1705 if (!NT_SUCCESS(Status))
1706 {
1707 ERR("LsapSetObjectAttribute failed (Status 0x%08lx)\n", Status);
1708 }
1709
1710 done:
1711 return Status;
1712 }
1713
1714
1715 /* Function 30 */
1716 NTSTATUS WINAPI LsarQuerySecret(
1717 LSAPR_HANDLE SecretHandle,
1718 PLSAPR_CR_CIPHER_VALUE *EncryptedCurrentValue,
1719 PLARGE_INTEGER CurrentValueSetTime,
1720 PLSAPR_CR_CIPHER_VALUE *EncryptedOldValue,
1721 PLARGE_INTEGER OldValueSetTime)
1722 {
1723 PLSA_DB_OBJECT SecretObject;
1724 PLSAPR_CR_CIPHER_VALUE EncCurrentValue = NULL;
1725 PLSAPR_CR_CIPHER_VALUE EncOldValue = NULL;
1726 PBYTE CurrentValue = NULL;
1727 PBYTE OldValue = NULL;
1728 ULONG CurrentValueLength = 0;
1729 ULONG OldValueLength = 0;
1730 ULONG BufferSize;
1731 NTSTATUS Status;
1732
1733 TRACE("LsarQuerySecret(%p %p %p %p %p)\n", SecretHandle,
1734 EncryptedCurrentValue, CurrentValueSetTime,
1735 EncryptedOldValue, OldValueSetTime);
1736
1737 /* Validate the SecretHandle */
1738 Status = LsapValidateDbObject(SecretHandle,
1739 LsaDbSecretObject,
1740 SECRET_QUERY_VALUE,
1741 &SecretObject);
1742 if (!NT_SUCCESS(Status))
1743 {
1744 ERR("LsapValidateDbObject returned 0x%08lx\n", Status);
1745 return Status;
1746 }
1747
1748 if (EncryptedCurrentValue != NULL)
1749 {
1750 CurrentValueLength = 0;
1751
1752 /* Get the size of the current value */
1753 Status = LsapGetObjectAttribute(SecretObject,
1754 L"CurrentValue",
1755 NULL,
1756 &CurrentValueLength);
1757 if (!NT_SUCCESS(Status))
1758 goto done;
1759
1760 /* Allocate a buffer for the current value */
1761 CurrentValue = midl_user_allocate(CurrentValueLength);
1762 if (CurrentValue == NULL)
1763 {
1764 Status = STATUS_INSUFFICIENT_RESOURCES;
1765 goto done;
1766 }
1767
1768 /* Get the current value */
1769 Status = LsapGetObjectAttribute(SecretObject,
1770 L"CurrentValue",
1771 CurrentValue,
1772 &CurrentValueLength);
1773 if (!NT_SUCCESS(Status))
1774 goto done;
1775
1776 /* Allocate a buffer for the encrypted current value */
1777 EncCurrentValue = midl_user_allocate(sizeof(LSAPR_CR_CIPHER_VALUE));
1778 if (EncCurrentValue == NULL)
1779 {
1780 Status = STATUS_INSUFFICIENT_RESOURCES;
1781 goto done;
1782 }
1783
1784 /* FIXME: Encrypt the current value */
1785 EncCurrentValue->Length = (USHORT)(CurrentValueLength - sizeof(WCHAR));
1786 EncCurrentValue->MaximumLength = (USHORT)CurrentValueLength;
1787 EncCurrentValue->Buffer = (PBYTE)CurrentValue;
1788 }
1789
1790 if (CurrentValueSetTime != NULL)
1791 {
1792 BufferSize = sizeof(LARGE_INTEGER);
1793
1794 /* Get the current value time */
1795 Status = LsapGetObjectAttribute(SecretObject,
1796 L"CurrentTime",
1797 (PBYTE)CurrentValueSetTime,
1798 &BufferSize);
1799 if (!NT_SUCCESS(Status))
1800 goto done;
1801 }
1802
1803 if (EncryptedOldValue != NULL)
1804 {
1805 OldValueLength = 0;
1806
1807 /* Get the size of the old value */
1808 Status = LsapGetObjectAttribute(SecretObject,
1809 L"OldValue",
1810 NULL,
1811 &OldValueLength);
1812 if (!NT_SUCCESS(Status))
1813 goto done;
1814
1815 /* Allocate a buffer for the old value */
1816 OldValue = midl_user_allocate(OldValueLength);
1817 if (OldValue == NULL)
1818 {
1819 Status = STATUS_INSUFFICIENT_RESOURCES;
1820 goto done;
1821 }
1822
1823 /* Get the old value */
1824 Status = LsapGetObjectAttribute(SecretObject,
1825 L"OldValue",
1826 OldValue,
1827 &OldValueLength);
1828 if (!NT_SUCCESS(Status))
1829 goto done;
1830
1831 /* Allocate a buffer for the encrypted old value */
1832 EncOldValue = midl_user_allocate(sizeof(LSAPR_CR_CIPHER_VALUE) + OldValueLength);
1833 if (EncOldValue == NULL)
1834 {
1835 Status = STATUS_INSUFFICIENT_RESOURCES;
1836 goto done;
1837 }
1838
1839 /* FIXME: Encrypt the old value */
1840 EncOldValue->Length = (USHORT)(OldValueLength - sizeof(WCHAR));
1841 EncOldValue->MaximumLength = (USHORT)OldValueLength;
1842 EncOldValue->Buffer = (PBYTE)OldValue;
1843 }
1844
1845 if (OldValueSetTime != NULL)
1846 {
1847 BufferSize = sizeof(LARGE_INTEGER);
1848
1849 /* Get the old value time */
1850 Status = LsapGetObjectAttribute(SecretObject,
1851 L"OldTime",
1852 (PBYTE)OldValueSetTime,
1853 &BufferSize);
1854 if (!NT_SUCCESS(Status))
1855 goto done;
1856 }
1857
1858
1859 done:
1860 if (NT_SUCCESS(Status))
1861 {
1862 if (EncryptedCurrentValue != NULL)
1863 *EncryptedCurrentValue = EncCurrentValue;
1864
1865 if (EncryptedOldValue != NULL)
1866 *EncryptedOldValue = EncOldValue;
1867 }
1868 else
1869 {
1870 if (EncryptedCurrentValue != NULL)
1871 *EncryptedCurrentValue = NULL;
1872
1873 if (EncryptedOldValue != NULL)
1874 *EncryptedOldValue = NULL;
1875
1876 if (EncCurrentValue != NULL)
1877 midl_user_free(EncCurrentValue);
1878
1879 if (EncOldValue != NULL)
1880 midl_user_free(EncOldValue);
1881
1882 if (CurrentValue != NULL)
1883 midl_user_free(CurrentValue);
1884
1885 if (OldValue != NULL)
1886 midl_user_free(OldValue);
1887 }
1888
1889 TRACE("LsarQuerySecret done (Status 0x%08lx)\n", Status);
1890
1891 return Status;
1892 }
1893
1894
1895 /* Function 31 */
1896 NTSTATUS WINAPI LsarLookupPrivilegeValue(
1897 LSAPR_HANDLE PolicyHandle,
1898 PRPC_UNICODE_STRING Name,
1899 PLUID Value)
1900 {
1901 NTSTATUS Status;
1902
1903 TRACE("LsarLookupPrivilegeValue(%p, %wZ, %p)\n",
1904 PolicyHandle, Name, Value);
1905
1906 Status = LsapValidateDbObject(PolicyHandle,
1907 LsaDbPolicyObject,
1908 POLICY_LOOKUP_NAMES,
1909 NULL);
1910 if (!NT_SUCCESS(Status))
1911 {
1912 ERR("Invalid handle (Status %lx)\n", Status);
1913 return Status;
1914 }
1915
1916 TRACE("Privilege: %wZ\n", Name);
1917
1918 Status = LsarpLookupPrivilegeValue(Name,
1919 Value);
1920
1921 return Status;
1922 }
1923
1924
1925 /* Function 32 */
1926 NTSTATUS WINAPI LsarLookupPrivilegeName(
1927 LSAPR_HANDLE PolicyHandle,
1928 PLUID Value,
1929 PRPC_UNICODE_STRING *Name)
1930 {
1931 NTSTATUS Status;
1932
1933 TRACE("LsarLookupPrivilegeName(%p, %p, %p)\n",
1934 PolicyHandle, Value, Name);
1935
1936 Status = LsapValidateDbObject(PolicyHandle,
1937 LsaDbPolicyObject,
1938 POLICY_LOOKUP_NAMES,
1939 NULL);
1940 if (!NT_SUCCESS(Status))
1941 {
1942 ERR("Invalid handle\n");
1943 return Status;
1944 }
1945
1946 Status = LsarpLookupPrivilegeName(Value,
1947 Name);
1948
1949 return Status;
1950 }
1951
1952
1953 /* Function 33 */
1954 NTSTATUS WINAPI LsarLookupPrivilegeDisplayName(
1955 LSAPR_HANDLE PolicyHandle,
1956 PRPC_UNICODE_STRING Name,
1957 USHORT ClientLanguage,
1958 USHORT ClientSystemDefaultLanguage,
1959 PRPC_UNICODE_STRING *DisplayName,
1960 USHORT *LanguageReturned)
1961 {
1962 UNIMPLEMENTED;
1963 return STATUS_NOT_IMPLEMENTED;
1964 }
1965
1966
1967 /* Function 34 */
1968 NTSTATUS WINAPI LsarDeleteObject(
1969 LSAPR_HANDLE *ObjectHandle)
1970 {
1971 UNIMPLEMENTED;
1972 return STATUS_NOT_IMPLEMENTED;
1973 }
1974
1975
1976 /* Function 35 */
1977 NTSTATUS WINAPI LsarEnumerateAccountsWithUserRight(
1978 LSAPR_HANDLE PolicyHandle,
1979 PRPC_UNICODE_STRING UserRight,
1980 PLSAPR_ACCOUNT_ENUM_BUFFER EnumerationBuffer)
1981 {
1982 UNIMPLEMENTED;
1983 return STATUS_NOT_IMPLEMENTED;
1984 }
1985
1986
1987 /* Function 36 */
1988 NTSTATUS WINAPI LsarEnumerateAccountRights(
1989 LSAPR_HANDLE PolicyHandle,
1990 PRPC_SID AccountSid,
1991 PLSAPR_USER_RIGHT_SET UserRights)
1992 {
1993 LSAPR_HANDLE AccountHandle;
1994 PLSAPR_PRIVILEGE_SET PrivilegeSet = NULL;
1995 PRPC_UNICODE_STRING RightsBuffer = NULL;
1996 PRPC_UNICODE_STRING PrivilegeString;
1997 ACCESS_MASK SystemAccess;
1998 ULONG RightsCount;
1999 ULONG RightsIndex;
2000 ULONG i;
2001 NTSTATUS Status;
2002
2003 TRACE("LsarEnumerateAccountRights(%p %p %p)\n",
2004 PolicyHandle, AccountSid, UserRights);
2005
2006 /* Open the account */
2007 Status = LsarOpenAccount(PolicyHandle,
2008 AccountSid,
2009 ACCOUNT_VIEW,
2010 &AccountHandle);
2011 if (!NT_SUCCESS(Status))
2012 {
2013 ERR("LsarOpenAccount returned 0x%08lx\n", Status);
2014 return Status;
2015 }
2016
2017 /* Enumerate the privileges */
2018 Status = LsarEnumeratePrivilegesAccount(AccountHandle,
2019 &PrivilegeSet);
2020 if (!NT_SUCCESS(Status))
2021 {
2022 ERR("LsarEnumeratePrivilegesAccount returned 0x%08lx\n", Status);
2023 goto done;
2024 }
2025
2026 /* Get account rights */
2027 Status = LsarGetSystemAccessAccount(AccountHandle,
2028 &SystemAccess);
2029 if (!NT_SUCCESS(Status))
2030 {
2031 ERR("LsarGetSystemAccessAccount returned 0x%08lx\n", Status);
2032 goto done;
2033 }
2034
2035 RightsCount = PrivilegeSet->PrivilegeCount;
2036
2037 /* Count account rights */
2038 for (i = 0; i < sizeof(ACCESS_MASK) * 8; i++)
2039 {
2040 if (SystemAccess & (1 << i))
2041 RightsCount++;
2042 }
2043
2044 /* We are done if there are no rights to be enumerated */
2045 if (RightsCount == 0)
2046 {
2047 UserRights->Entries = 0;
2048 UserRights->UserRights = NULL;
2049 Status = STATUS_SUCCESS;
2050 goto done;
2051 }
2052
2053 /* Allocate a buffer for the account rights */
2054 RightsBuffer = MIDL_user_allocate(RightsCount * sizeof(RPC_UNICODE_STRING));
2055 if (RightsBuffer == NULL)
2056 {
2057 Status = STATUS_INSUFFICIENT_RESOURCES;
2058 goto done;
2059 }
2060
2061 /* Copy the privileges into the buffer */
2062 RightsIndex = 0;
2063 for (i = 0; i < PrivilegeSet->PrivilegeCount; i++)
2064 {
2065 PrivilegeString = NULL;
2066 Status = LsarLookupPrivilegeName(PolicyHandle,
2067 (PLUID)&PrivilegeSet->Privilege[i].Luid,
2068 &PrivilegeString);
2069 if (!NT_SUCCESS(Status))
2070 goto done;
2071
2072 RightsBuffer[i].Length = PrivilegeString->Length;
2073 RightsBuffer[i].MaximumLength = PrivilegeString->MaximumLength;
2074 RightsBuffer[i].Buffer = PrivilegeString->Buffer;
2075
2076 MIDL_user_free(PrivilegeString);
2077 RightsIndex++;
2078 }
2079
2080 /* Copy account rights into the buffer */
2081 for (i = 0; i < sizeof(ACCESS_MASK) * 8; i++)
2082 {
2083 if (SystemAccess & (1 << i))
2084 {
2085 Status = LsapLookupAccountRightName(1 << i,
2086 &PrivilegeString);
2087 if (!NT_SUCCESS(Status))
2088 goto done;
2089
2090 RightsBuffer[i].Length = PrivilegeString->Length;
2091 RightsBuffer[i].MaximumLength = PrivilegeString->MaximumLength;
2092 RightsBuffer[i].Buffer = PrivilegeString->Buffer;
2093
2094 MIDL_user_free(PrivilegeString);
2095 RightsIndex++;
2096 }
2097 }
2098
2099 UserRights->Entries = RightsCount;
2100 UserRights->UserRights = (PRPC_UNICODE_STRING)RightsBuffer;
2101
2102 done:
2103 if (!NT_SUCCESS(Status))
2104 {
2105 if (RightsBuffer != NULL)
2106 {
2107 for (RightsIndex = 0; RightsIndex < RightsCount; RightsIndex++)
2108 {
2109 if (RightsBuffer[RightsIndex].Buffer != NULL)
2110 MIDL_user_free(RightsBuffer[RightsIndex].Buffer);
2111 }
2112
2113 MIDL_user_free(RightsBuffer);
2114 }
2115 }
2116
2117 if (PrivilegeSet != NULL)
2118 MIDL_user_free(PrivilegeSet);
2119
2120 LsarClose(&AccountHandle);
2121
2122 return Status;
2123 }
2124
2125
2126 /* Function 37 */
2127 NTSTATUS WINAPI LsarAddAccountRights(
2128 LSAPR_HANDLE PolicyHandle,
2129 PRPC_SID AccountSid,
2130 PLSAPR_USER_RIGHT_SET UserRights)
2131 {
2132 UNIMPLEMENTED;
2133 return STATUS_NOT_IMPLEMENTED;
2134 }
2135
2136
2137 /* Function 38 */
2138 NTSTATUS WINAPI LsarRemoveAccountRights(
2139 LSAPR_HANDLE PolicyHandle,
2140 PRPC_SID AccountSid,
2141 BOOL AllRights,
2142 PLSAPR_USER_RIGHT_SET UserRights)
2143 {
2144 UNIMPLEMENTED;
2145 return STATUS_NOT_IMPLEMENTED;
2146 }
2147
2148
2149 /* Function 39 */
2150 NTSTATUS WINAPI LsarQueryTrustedDomainInfo(
2151 LSAPR_HANDLE PolicyHandle,
2152 PRPC_SID TrustedDomainSid,
2153 TRUSTED_INFORMATION_CLASS InformationClass,
2154 PLSAPR_TRUSTED_DOMAIN_INFO *TrustedDomainInformation)
2155 {
2156 UNIMPLEMENTED;
2157 return STATUS_NOT_IMPLEMENTED;
2158 }
2159
2160
2161 /* Function 40 */
2162 NTSTATUS WINAPI LsarSetTrustedDomainInfo(
2163 LSAPR_HANDLE PolicyHandle,
2164 PRPC_SID TrustedDomainSid,
2165 TRUSTED_INFORMATION_CLASS InformationClass,
2166 PLSAPR_TRUSTED_DOMAIN_INFO TrustedDomainInformation)
2167 {
2168 UNIMPLEMENTED;
2169 return STATUS_NOT_IMPLEMENTED;
2170 }
2171
2172
2173 /* Function 41 */
2174 NTSTATUS WINAPI LsarDeleteTrustedDomain(
2175 LSAPR_HANDLE PolicyHandle,
2176 PRPC_SID TrustedDomainSid)
2177 {
2178 UNIMPLEMENTED;
2179 return STATUS_NOT_IMPLEMENTED;
2180 }
2181
2182
2183 /* Function 42 */
2184 NTSTATUS WINAPI LsarStorePrivateData(
2185 LSAPR_HANDLE PolicyHandle,
2186 PRPC_UNICODE_STRING KeyName,
2187 PLSAPR_CR_CIPHER_VALUE EncryptedData)
2188 {
2189 UNIMPLEMENTED;
2190 return STATUS_NOT_IMPLEMENTED;
2191 }
2192
2193
2194 /* Function 43 */
2195 NTSTATUS WINAPI LsarRetrievePrivateData(
2196 LSAPR_HANDLE PolicyHandle,
2197 PRPC_UNICODE_STRING KeyName,
2198 PLSAPR_CR_CIPHER_VALUE *EncryptedData)
2199 {
2200 UNIMPLEMENTED;
2201 return STATUS_NOT_IMPLEMENTED;
2202 }
2203
2204
2205 /* Function 44 */
2206 NTSTATUS WINAPI LsarOpenPolicy2(
2207 LPWSTR SystemName,
2208 PLSAPR_OBJECT_ATTRIBUTES ObjectAttributes,
2209 ACCESS_MASK DesiredAccess,
2210 LSAPR_HANDLE *PolicyHandle)
2211 {
2212 UNIMPLEMENTED;
2213 return STATUS_NOT_IMPLEMENTED;
2214 }
2215
2216
2217 /* Function 45 */
2218 NTSTATUS WINAPI LsarGetUserName(
2219 LPWSTR SystemName,
2220 PRPC_UNICODE_STRING *UserName,
2221 PRPC_UNICODE_STRING *DomainName)
2222 {
2223 UNIMPLEMENTED;
2224 return STATUS_NOT_IMPLEMENTED;
2225 }
2226
2227
2228 /* Function 46 */
2229 NTSTATUS WINAPI LsarQueryInformationPolicy2(
2230 LSAPR_HANDLE PolicyHandle,
2231 POLICY_INFORMATION_CLASS InformationClass,
2232 PLSAPR_POLICY_INFORMATION *PolicyInformation)
2233 {
2234 return LsarQueryInformationPolicy(PolicyHandle,
2235 InformationClass,
2236 PolicyInformation);
2237 }
2238
2239
2240 /* Function 47 */
2241 NTSTATUS WINAPI LsarSetInformationPolicy2(
2242 LSAPR_HANDLE PolicyHandle,
2243 POLICY_INFORMATION_CLASS InformationClass,
2244 PLSAPR_POLICY_INFORMATION PolicyInformation)
2245 {
2246 return LsarSetInformationPolicy(PolicyHandle,
2247 InformationClass,
2248 PolicyInformation);
2249 }
2250
2251
2252 /* Function 48 */
2253 NTSTATUS WINAPI LsarQueryTrustedDomainInfoByName(
2254 LSAPR_HANDLE PolicyHandle,
2255 PRPC_UNICODE_STRING TrustedDomainName,
2256 POLICY_INFORMATION_CLASS InformationClass,
2257 PLSAPR_TRUSTED_DOMAIN_INFO *PolicyInformation)
2258 {
2259 UNIMPLEMENTED;
2260 return STATUS_NOT_IMPLEMENTED;
2261 }
2262
2263
2264 /* Function 49 */
2265 NTSTATUS WINAPI LsarSetTrustedDomainInfoByName(
2266 LSAPR_HANDLE PolicyHandle,
2267 PRPC_UNICODE_STRING TrustedDomainName,
2268 POLICY_INFORMATION_CLASS InformationClass,
2269 PLSAPR_TRUSTED_DOMAIN_INFO PolicyInformation)
2270 {
2271 UNIMPLEMENTED;
2272 return STATUS_NOT_IMPLEMENTED;
2273 }
2274
2275
2276 /* Function 50 */
2277 NTSTATUS WINAPI LsarEnumerateTrustedDomainsEx(
2278 LSAPR_HANDLE PolicyHandle,
2279 DWORD *EnumerationContext,
2280 PLSAPR_TRUSTED_ENUM_BUFFER_EX EnumerationBuffer,
2281 DWORD PreferedMaximumLength)
2282 {
2283 UNIMPLEMENTED;
2284 return STATUS_NOT_IMPLEMENTED;
2285 }
2286
2287
2288 /* Function 51 */
2289 NTSTATUS WINAPI LsarCreateTrustedDomainEx(
2290 LSAPR_HANDLE PolicyHandle,
2291 PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX TrustedDomainInformation,
2292 PLSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION AuthentificationInformation,
2293 ACCESS_MASK DesiredAccess,
2294 LSAPR_HANDLE *TrustedDomainHandle)
2295 {
2296 UNIMPLEMENTED;
2297 return STATUS_NOT_IMPLEMENTED;
2298 }
2299
2300
2301 /* Function 52 */
2302 NTSTATUS WINAPI LsarSetPolicyReplicationHandle(
2303 PLSAPR_HANDLE PolicyHandle)
2304 {
2305 /* Deprecated */
2306 return STATUS_NOT_IMPLEMENTED;
2307 }
2308
2309
2310 /* Function 53 */
2311 NTSTATUS WINAPI LsarQueryDomainInformationPolicy(
2312 LSAPR_HANDLE PolicyHandle,
2313 POLICY_INFORMATION_CLASS InformationClass,
2314 PLSAPR_POLICY_DOMAIN_INFORMATION *PolicyInformation)
2315 {
2316 UNIMPLEMENTED;
2317 return STATUS_NOT_IMPLEMENTED;
2318 }
2319
2320
2321 /* Function 54 */
2322 NTSTATUS WINAPI LsarSetDomainInformationPolicy(
2323 LSAPR_HANDLE PolicyHandle,
2324 POLICY_INFORMATION_CLASS InformationClass,
2325 PLSAPR_POLICY_DOMAIN_INFORMATION PolicyInformation)
2326 {
2327 UNIMPLEMENTED;
2328 return STATUS_NOT_IMPLEMENTED;
2329 }
2330
2331
2332 /* Function 55 */
2333 NTSTATUS WINAPI LsarOpenTrustedDomainByName(
2334 LSAPR_HANDLE PolicyHandle,
2335 PRPC_UNICODE_STRING TrustedDomainName,
2336 ACCESS_MASK DesiredAccess,
2337 LSAPR_HANDLE *TrustedDomainHandle)
2338 {
2339 UNIMPLEMENTED;
2340 return STATUS_NOT_IMPLEMENTED;
2341 }
2342
2343
2344 /* Function 56 */
2345 NTSTATUS WINAPI LsarTestCall(
2346 handle_t hBinding)
2347 {
2348 UNIMPLEMENTED;
2349 return STATUS_NOT_IMPLEMENTED;
2350 }
2351
2352
2353 /* Function 57 */
2354 NTSTATUS WINAPI LsarLookupSids2(
2355 LSAPR_HANDLE PolicyHandle,
2356 PLSAPR_SID_ENUM_BUFFER SidEnumBuffer,
2357 PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
2358 PLSAPR_TRANSLATED_NAMES_EX TranslatedNames,
2359 LSAP_LOOKUP_LEVEL LookupLevel,
2360 DWORD *MappedCount,
2361 DWORD LookupOptions,
2362 DWORD ClientRevision)
2363 {
2364 NTSTATUS Status;
2365
2366 TRACE("(%p %p %p %p %d %p %lu %lu)\n",
2367 PolicyHandle, SidEnumBuffer, ReferencedDomains, TranslatedNames,
2368 LookupLevel, MappedCount, LookupOptions, ClientRevision);
2369
2370 TranslatedNames->Entries = SidEnumBuffer->Entries;
2371 TranslatedNames->Names = NULL;
2372 *ReferencedDomains = NULL;
2373
2374 /* FIXME: Fail, if there is an invalid SID in the SidEnumBuffer */
2375
2376 Status = LsapLookupSids(SidEnumBuffer,
2377 ReferencedDomains,
2378 TranslatedNames,
2379 LookupLevel,
2380 MappedCount,
2381 LookupOptions,
2382 ClientRevision);
2383
2384 return Status;
2385 }
2386
2387
2388 /* Function 58 */
2389 NTSTATUS WINAPI LsarLookupNames2(
2390 LSAPR_HANDLE PolicyHandle,
2391 DWORD Count,
2392 PRPC_UNICODE_STRING Names,
2393 PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
2394 PLSAPR_TRANSLATED_SIDS_EX TranslatedSids,
2395 LSAP_LOOKUP_LEVEL LookupLevel,
2396 DWORD *MappedCount,
2397 DWORD LookupOptions,
2398 DWORD ClientRevision)
2399 {
2400 LSAPR_TRANSLATED_SIDS_EX2 TranslatedSidsEx2;
2401 ULONG i;
2402 NTSTATUS Status;
2403
2404 TRACE("(%p %lu %p %p %p %d %p %lu %lu)\n",
2405 PolicyHandle, Count, Names, ReferencedDomains, TranslatedSids,
2406 LookupLevel, MappedCount, LookupOptions, ClientRevision);
2407
2408 TranslatedSids->Entries = 0;
2409 TranslatedSids->Sids = NULL;
2410 *ReferencedDomains = NULL;
2411
2412 if (Count == 0)
2413 return STATUS_NONE_MAPPED;
2414
2415 TranslatedSidsEx2.Entries = 0;
2416 TranslatedSidsEx2.Sids = NULL;
2417
2418 Status = LsapLookupNames(Count,
2419 Names,
2420 ReferencedDomains,
2421 &TranslatedSidsEx2,
2422 LookupLevel,
2423 MappedCount,
2424 LookupOptions,
2425 ClientRevision);
2426 if (!NT_SUCCESS(Status))
2427 return Status;
2428
2429 TranslatedSids->Entries = TranslatedSidsEx2.Entries;
2430 TranslatedSids->Sids = MIDL_user_allocate(TranslatedSids->Entries * sizeof(LSA_TRANSLATED_SID));
2431 if (TranslatedSids->Sids == NULL)
2432 {
2433 MIDL_user_free(TranslatedSidsEx2.Sids);
2434 MIDL_user_free(*ReferencedDomains);
2435 *ReferencedDomains = NULL;
2436 return STATUS_INSUFFICIENT_RESOURCES;
2437 }
2438
2439 for (i = 0; i < TranslatedSidsEx2.Entries; i++)
2440 {
2441 TranslatedSids->Sids[i].Use = TranslatedSidsEx2.Sids[i].Use;
2442 TranslatedSids->Sids[i].RelativeId = LsapGetRelativeIdFromSid(TranslatedSidsEx2.Sids[i].Sid);
2443 TranslatedSids->Sids[i].DomainIndex = TranslatedSidsEx2.Sids[i].DomainIndex;
2444 TranslatedSids->Sids[i].Flags = TranslatedSidsEx2.Sids[i].Flags;
2445 }
2446
2447 MIDL_user_free(TranslatedSidsEx2.Sids);
2448
2449 return STATUS_SUCCESS;
2450 }
2451
2452
2453 /* Function 59 */
2454 NTSTATUS WINAPI LsarCreateTrustedDomainEx2(
2455 LSAPR_HANDLE PolicyHandle,
2456 PLSAPR_TRUSTED_DOMAIN_INFORMATION_EX TrustedDomainInformation,
2457 PLSAPR_TRUSTED_DOMAIN_AUTH_INFORMATION_INTERNAL AuthentificationInformation,
2458 ACCESS_MASK DesiredAccess,
2459 LSAPR_HANDLE *TrustedDomainHandle)
2460 {
2461 UNIMPLEMENTED;
2462 return STATUS_NOT_IMPLEMENTED;
2463 }
2464
2465
2466 /* Function 60 */
2467 NTSTATUS WINAPI CredrWrite(
2468 handle_t hBinding)
2469 {
2470 UNIMPLEMENTED;
2471 return STATUS_NOT_IMPLEMENTED;
2472 }
2473
2474
2475 /* Function 61 */
2476 NTSTATUS WINAPI CredrRead(
2477 handle_t hBinding)
2478 {
2479 UNIMPLEMENTED;
2480 return STATUS_NOT_IMPLEMENTED;
2481 }
2482
2483
2484 /* Function 62 */
2485 NTSTATUS WINAPI CredrEnumerate(
2486 handle_t hBinding)
2487 {
2488 UNIMPLEMENTED;
2489 return STATUS_NOT_IMPLEMENTED;
2490 }
2491
2492
2493 /* Function 63 */
2494 NTSTATUS WINAPI CredrWriteDomainCredentials(
2495 handle_t hBinding)
2496 {
2497 UNIMPLEMENTED;
2498 return STATUS_NOT_IMPLEMENTED;
2499 }
2500
2501
2502 /* Function 64 */
2503 NTSTATUS WINAPI CredrReadDomainCredentials(
2504 handle_t hBinding)
2505 {
2506 UNIMPLEMENTED;
2507 return STATUS_NOT_IMPLEMENTED;
2508 }
2509
2510
2511 /* Function 65 */
2512 NTSTATUS WINAPI CredrDelete(
2513 handle_t hBinding)
2514 {
2515 UNIMPLEMENTED;
2516 return STATUS_NOT_IMPLEMENTED;
2517 }
2518
2519
2520 /* Function 66 */
2521 NTSTATUS WINAPI CredrGetTargetInfo(
2522 handle_t hBinding)
2523 {
2524 UNIMPLEMENTED;
2525 return STATUS_NOT_IMPLEMENTED;
2526 }
2527
2528
2529 /* Function 67 */
2530 NTSTATUS WINAPI CredrProfileLoaded(
2531 handle_t hBinding)
2532 {
2533 UNIMPLEMENTED;
2534 return STATUS_NOT_IMPLEMENTED;
2535 }
2536
2537
2538 /* Function 68 */
2539 NTSTATUS WINAPI LsarLookupNames3(
2540 LSAPR_HANDLE PolicyHandle,
2541 DWORD Count,
2542 PRPC_UNICODE_STRING Names,
2543 PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
2544 PLSAPR_TRANSLATED_SIDS_EX2 TranslatedSids,
2545 LSAP_LOOKUP_LEVEL LookupLevel,
2546 DWORD *MappedCount,
2547 DWORD LookupOptions,
2548 DWORD ClientRevision)
2549 {
2550 NTSTATUS Status;
2551
2552 TRACE("(%p %lu %p %p %p %d %p %lu %lu)\n",
2553 PolicyHandle, Count, Names, ReferencedDomains, TranslatedSids,
2554 LookupLevel, MappedCount, LookupOptions, ClientRevision);
2555
2556 TranslatedSids->Entries = 0;
2557 TranslatedSids->Sids = NULL;
2558 *ReferencedDomains = NULL;
2559
2560 if (Count == 0)
2561 return STATUS_NONE_MAPPED;
2562
2563 Status = LsapLookupNames(Count,
2564 Names,
2565 ReferencedDomains,
2566 TranslatedSids,
2567 LookupLevel,
2568 MappedCount,
2569 LookupOptions,
2570 ClientRevision);
2571
2572 return Status;
2573 }
2574
2575
2576 /* Function 69 */
2577 NTSTATUS WINAPI CredrGetSessionTypes(
2578 handle_t hBinding)
2579 {
2580 UNIMPLEMENTED;
2581 return STATUS_NOT_IMPLEMENTED;
2582 }
2583
2584
2585 /* Function 70 */
2586 NTSTATUS WINAPI LsarRegisterAuditEvent(
2587 handle_t hBinding)
2588 {
2589 UNIMPLEMENTED;
2590 return STATUS_NOT_IMPLEMENTED;
2591 }
2592
2593
2594 /* Function 71 */
2595 NTSTATUS WINAPI LsarGenAuditEvent(
2596 handle_t hBinding)
2597 {
2598 UNIMPLEMENTED;
2599 return STATUS_NOT_IMPLEMENTED;
2600 }
2601
2602
2603 /* Function 72 */
2604 NTSTATUS WINAPI LsarUnregisterAuditEvent(
2605 handle_t hBinding)
2606 {
2607 UNIMPLEMENTED;
2608 return STATUS_NOT_IMPLEMENTED;
2609 }
2610
2611
2612 /* Function 73 */
2613 NTSTATUS WINAPI LsarQueryForestTrustInformation(
2614 LSAPR_HANDLE PolicyHandle,
2615 PLSA_UNICODE_STRING TrustedDomainName,
2616 LSA_FOREST_TRUST_RECORD_TYPE HighestRecordType,
2617 PLSA_FOREST_TRUST_INFORMATION *ForestTrustInfo)
2618 {
2619 UNIMPLEMENTED;
2620 return STATUS_NOT_IMPLEMENTED;
2621 }
2622
2623
2624 /* Function 74 */
2625 NTSTATUS WINAPI LsarSetForestTrustInformation(
2626 LSAPR_HANDLE PolicyHandle,
2627 PLSA_UNICODE_STRING TrustedDomainName,
2628 LSA_FOREST_TRUST_RECORD_TYPE HighestRecordType,
2629 PLSA_FOREST_TRUST_INFORMATION ForestTrustInfo,
2630 BOOL CheckOnly,
2631 PLSA_FOREST_TRUST_COLLISION_INFORMATION *CollisionInfo)
2632 {
2633 UNIMPLEMENTED;
2634 return STATUS_NOT_IMPLEMENTED;
2635 }
2636
2637
2638 /* Function 75 */
2639 NTSTATUS WINAPI CredrRename(
2640 handle_t hBinding)
2641 {
2642 UNIMPLEMENTED;
2643 return STATUS_NOT_IMPLEMENTED;
2644 }
2645
2646
2647 /* Function 76 */
2648 NTSTATUS WINAPI LsarLookupSids3(
2649 LSAPR_HANDLE PolicyHandle,
2650 PLSAPR_SID_ENUM_BUFFER SidEnumBuffer,
2651 PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
2652 PLSAPR_TRANSLATED_NAMES_EX TranslatedNames,
2653 LSAP_LOOKUP_LEVEL LookupLevel,
2654 DWORD *MappedCount,
2655 DWORD LookupOptions,
2656 DWORD ClientRevision)
2657 {
2658 NTSTATUS Status;
2659
2660 TRACE("(%p %p %p %p %d %p %lu %lu)\n",
2661 PolicyHandle, SidEnumBuffer, ReferencedDomains, TranslatedNames,
2662 LookupLevel, MappedCount, LookupOptions, ClientRevision);
2663
2664 TranslatedNames->Entries = SidEnumBuffer->Entries;
2665 TranslatedNames->Names = NULL;
2666 *ReferencedDomains = NULL;
2667
2668 /* FIXME: Fail, if there is an invalid SID in the SidEnumBuffer */
2669
2670 Status = LsapLookupSids(SidEnumBuffer,
2671 ReferencedDomains,
2672 TranslatedNames,
2673 LookupLevel,
2674 MappedCount,
2675 LookupOptions,
2676 ClientRevision);
2677
2678 return Status;
2679 }
2680
2681
2682 /* Function 77 */
2683 NTSTATUS WINAPI LsarLookupNames4(
2684 handle_t RpcHandle,
2685 DWORD Count,
2686 PRPC_UNICODE_STRING Names,
2687 PLSAPR_REFERENCED_DOMAIN_LIST *ReferencedDomains,
2688 PLSAPR_TRANSLATED_SIDS_EX2 TranslatedSids,
2689 LSAP_LOOKUP_LEVEL LookupLevel,
2690 DWORD *MappedCount,
2691 DWORD LookupOptions,
2692 DWORD ClientRevision)
2693 {
2694 NTSTATUS Status;
2695
2696 TRACE("(%p %lu %p %p %p %d %p %lu %lu)\n",
2697 RpcHandle, Count, Names, ReferencedDomains, TranslatedSids,
2698 LookupLevel, MappedCount, LookupOptions, ClientRevision);
2699
2700 TranslatedSids->Entries = 0;
2701 TranslatedSids->Sids = NULL;
2702 *ReferencedDomains = NULL;
2703
2704 if (Count == 0)
2705 return STATUS_NONE_MAPPED;
2706
2707 Status = LsapLookupNames(Count,
2708 Names,
2709 ReferencedDomains,
2710 TranslatedSids,
2711 LookupLevel,
2712 MappedCount,
2713 LookupOptions,
2714 ClientRevision);
2715
2716 return Status;
2717 }
2718
2719
2720 /* Function 78 */
2721 NTSTATUS WINAPI LsarOpenPolicySce(
2722 handle_t hBinding)
2723 {
2724 UNIMPLEMENTED;
2725 return STATUS_NOT_IMPLEMENTED;
2726 }
2727
2728
2729 /* Function 79 */
2730 NTSTATUS WINAPI LsarAdtRegisterSecurityEventSource(
2731 handle_t hBinding)
2732 {
2733 UNIMPLEMENTED;
2734 return STATUS_NOT_IMPLEMENTED;
2735 }
2736
2737
2738 /* Function 80 */
2739 NTSTATUS WINAPI LsarAdtUnregisterSecurityEventSource(
2740 handle_t hBinding)
2741 {
2742 UNIMPLEMENTED;
2743 return STATUS_NOT_IMPLEMENTED;
2744 }
2745
2746
2747 /* Function 81 */
2748 NTSTATUS WINAPI LsarAdtReportSecurityEvent(
2749 handle_t hBinding)
2750 {
2751 UNIMPLEMENTED;
2752 return STATUS_NOT_IMPLEMENTED;
2753 }
2754
2755
2756 /* Function 82 */
2757 NTSTATUS WINAPI CredrFindBestCredential(
2758 handle_t hBinding)
2759 {
2760 UNIMPLEMENTED;
2761 return STATUS_NOT_IMPLEMENTED;
2762 }
2763
2764
2765 /* Function 83 */
2766 NTSTATUS WINAPI LsarSetAuditPolicy(
2767 handle_t hBinding)
2768 {
2769 UNIMPLEMENTED;
2770 return STATUS_NOT_IMPLEMENTED;
2771 }
2772
2773
2774 /* Function 84 */
2775 NTSTATUS WINAPI LsarQueryAuditPolicy(
2776 handle_t hBinding)
2777 {
2778 UNIMPLEMENTED;
2779 return STATUS_NOT_IMPLEMENTED;
2780 }
2781
2782
2783 /* Function 85 */
2784 NTSTATUS WINAPI LsarEnumerateAuditPolicy(
2785 handle_t hBinding)
2786 {
2787 UNIMPLEMENTED;
2788 return STATUS_NOT_IMPLEMENTED;
2789 }
2790
2791
2792 /* Function 86 */
2793 NTSTATUS WINAPI LsarEnumerateAuditCategories(
2794 handle_t hBinding)
2795 {
2796 UNIMPLEMENTED;
2797 return STATUS_NOT_IMPLEMENTED;
2798 }
2799
2800
2801 /* Function 87 */
2802 NTSTATUS WINAPI LsarEnumerateAuditSubCategories(
2803 handle_t hBinding)
2804 {
2805 UNIMPLEMENTED;
2806 return STATUS_NOT_IMPLEMENTED;
2807 }
2808
2809
2810 /* Function 88 */
2811 NTSTATUS WINAPI LsarLookupAuditCategoryName(
2812 handle_t hBinding)
2813 {
2814 UNIMPLEMENTED;
2815 return STATUS_NOT_IMPLEMENTED;
2816 }
2817
2818
2819 /* Function 89 */
2820 NTSTATUS WINAPI LsarLookupAuditSubCategoryName(
2821 handle_t hBinding)
2822 {
2823 UNIMPLEMENTED;
2824 return STATUS_NOT_IMPLEMENTED;
2825 }
2826
2827
2828 /* Function 90 */
2829 NTSTATUS WINAPI LsarSetAuditSecurity(
2830 handle_t hBinding)
2831 {
2832 UNIMPLEMENTED;
2833 return STATUS_NOT_IMPLEMENTED;
2834 }
2835
2836
2837 /* Function 91 */
2838 NTSTATUS WINAPI LsarQueryAuditSecurity(
2839 handle_t hBinding)
2840 {
2841 UNIMPLEMENTED;
2842 return STATUS_NOT_IMPLEMENTED;
2843 }
2844
2845
2846 /* Function 92 */
2847 NTSTATUS WINAPI CredReadByTokenHandle(
2848 handle_t hBinding)
2849 {
2850 UNIMPLEMENTED;
2851 return STATUS_NOT_IMPLEMENTED;
2852 }
2853
2854
2855 /* Function 93 */
2856 NTSTATUS WINAPI CredrRestoreCredentials(
2857 handle_t hBinding)
2858 {
2859 UNIMPLEMENTED;
2860 return STATUS_NOT_IMPLEMENTED;
2861 }
2862
2863
2864 /* Function 94 */
2865 NTSTATUS WINAPI CredrBackupCredentials(
2866 handle_t hBinding)
2867 {
2868 UNIMPLEMENTED;
2869 return STATUS_NOT_IMPLEMENTED;
2870 }
2871
2872 /* EOF */