6c34400e498d25239eb5489615353be26b1f703d
[reactos.git] / reactos / dll / win32 / advapi32 / sec / lsa.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: dll/win32/advapi32/sec/lsa.c
5 * PURPOSE: Local security authority functions
6 * PROGRAMMER: Emanuele Aliberti
7 * UPDATE HISTORY:
8 * 19990322 EA created
9 * 19990515 EA stubs
10 * 20030202 KJK compressed stubs
11 *
12 */
13 #include <advapi32.h>
14 #include "wine/debug.h"
15 #include "wine/unicode.h"
16
17 WINE_DEFAULT_DEBUG_CHANNEL(advapi);
18
19 /* imported from wine 1.1.14 */
20 static void* ADVAPI_GetDomainName(unsigned sz, unsigned ofs)
21 {
22 HKEY key;
23 LONG ret;
24 BYTE* ptr = NULL;
25 UNICODE_STRING* ustr;
26
27 static const WCHAR wVNETSUP[] = {
28 'S','y','s','t','e','m','\\',
29 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
30 'S','e','r','v','i','c','e','s','\\',
31 'V','x','D','\\','V','N','E','T','S','U','P','\0'};
32
33 ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, wVNETSUP, 0, KEY_READ, &key);
34 if (ret == ERROR_SUCCESS)
35 {
36 DWORD size = 0;
37 static const WCHAR wg[] = { 'W','o','r','k','g','r','o','u','p',0 };
38
39 ret = RegQueryValueExW(key, wg, NULL, NULL, NULL, &size);
40 if (ret == ERROR_MORE_DATA || ret == ERROR_SUCCESS)
41 {
42 ptr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sz + size);
43 if (!ptr) return NULL;
44 ustr = (UNICODE_STRING*)(ptr + ofs);
45 ustr->MaximumLength = size;
46 ustr->Buffer = (WCHAR*)(ptr + sz);
47 ret = RegQueryValueExW(key, wg, NULL, NULL, (LPBYTE)ustr->Buffer, &size);
48 if (ret != ERROR_SUCCESS)
49 {
50 HeapFree(GetProcessHeap(), 0, ptr);
51 ptr = NULL;
52 }
53 else ustr->Length = size - sizeof(WCHAR);
54 }
55 RegCloseKey(key);
56 }
57 if (!ptr)
58 {
59 static const WCHAR wDomain[] = {'D','O','M','A','I','N','\0'};
60 ptr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
61 sz + sizeof(wDomain));
62 if (!ptr) return NULL;
63 ustr = (UNICODE_STRING*)(ptr + ofs);
64 ustr->MaximumLength = sizeof(wDomain);
65 ustr->Buffer = (WCHAR*)(ptr + sz);
66 ustr->Length = sizeof(wDomain) - sizeof(WCHAR);
67 memcpy(ustr->Buffer, wDomain, sizeof(wDomain));
68 }
69 return ptr;
70 }
71
72 handle_t __RPC_USER
73 PLSAPR_SERVER_NAME_bind(PLSAPR_SERVER_NAME pszSystemName)
74 {
75 handle_t hBinding = NULL;
76 LPWSTR pszStringBinding;
77 RPC_STATUS status;
78
79 TRACE("PLSAPR_SERVER_NAME_bind() called\n");
80
81 status = RpcStringBindingComposeW(NULL,
82 L"ncacn_np",
83 pszSystemName,
84 L"\\pipe\\lsarpc",
85 NULL,
86 &pszStringBinding);
87 if (status)
88 {
89 TRACE("RpcStringBindingCompose returned 0x%x\n", status);
90 return NULL;
91 }
92
93 /* Set the binding handle that will be used to bind to the server. */
94 status = RpcBindingFromStringBindingW(pszStringBinding,
95 &hBinding);
96 if (status)
97 {
98 TRACE("RpcBindingFromStringBinding returned 0x%x\n", status);
99 }
100
101 status = RpcStringFreeW(&pszStringBinding);
102 if (status)
103 {
104 TRACE("RpcStringFree returned 0x%x\n", status);
105 }
106
107 return hBinding;
108 }
109
110
111 void __RPC_USER
112 PLSAPR_SERVER_NAME_unbind(PLSAPR_SERVER_NAME pszSystemName,
113 handle_t hBinding)
114 {
115 RPC_STATUS status;
116
117 TRACE("PLSAPR_SERVER_NAME_unbind() called\n");
118
119 status = RpcBindingFree(&hBinding);
120 if (status)
121 {
122 TRACE("RpcBindingFree returned 0x%x\n", status);
123 }
124 }
125
126
127 /*
128 * @implemented
129 */
130 NTSTATUS WINAPI
131 LsaClose(LSA_HANDLE ObjectHandle)
132 {
133 NTSTATUS Status;
134
135 TRACE("LsaClose(0x%p) called\n", ObjectHandle);
136
137 RpcTryExcept
138 {
139 Status = LsarClose((PLSAPR_HANDLE)&ObjectHandle);
140 }
141 RpcExcept(EXCEPTION_EXECUTE_HANDLER)
142 {
143 Status = I_RpcMapWin32Status(RpcExceptionCode());
144 }
145 RpcEndExcept;
146
147 return Status;
148 }
149
150
151 /*
152 * @implemented
153 */
154 NTSTATUS WINAPI
155 LsaDelete(LSA_HANDLE ObjectHandle)
156 {
157 NTSTATUS Status;
158
159 TRACE("LsaDelete(0x%p) called\n", ObjectHandle);
160
161 RpcTryExcept
162 {
163 Status = LsarDelete((LSAPR_HANDLE)ObjectHandle);
164 }
165 RpcExcept(EXCEPTION_EXECUTE_HANDLER)
166 {
167 Status = I_RpcMapWin32Status(RpcExceptionCode());
168 }
169 RpcEndExcept;
170
171 return Status;
172 }
173
174
175 /*
176 * @unimplemented
177 */
178 NTSTATUS
179 WINAPI
180 LsaAddAccountRights(
181 LSA_HANDLE PolicyHandle,
182 PSID AccountSid,
183 PLSA_UNICODE_STRING UserRights,
184 ULONG CountOfRights)
185 {
186 FIXME("(%p,%p,%p,0x%08x) stub\n", PolicyHandle, AccountSid, UserRights, CountOfRights);
187 return STATUS_OBJECT_NAME_NOT_FOUND;
188 }
189
190 /*
191 * @unimplemented
192 */
193 NTSTATUS
194 WINAPI
195 LsaCreateTrustedDomainEx(
196 LSA_HANDLE PolicyHandle,
197 PTRUSTED_DOMAIN_INFORMATION_EX TrustedDomainInformation,
198 PTRUSTED_DOMAIN_AUTH_INFORMATION AuthenticationInformation,
199 ACCESS_MASK DesiredAccess,
200 PLSA_HANDLE TrustedDomainHandle)
201 {
202 FIXME("(%p,%p,%p,0x%08x,%p) stub\n", PolicyHandle, TrustedDomainInformation, AuthenticationInformation,
203 DesiredAccess, TrustedDomainHandle);
204 return STATUS_SUCCESS;
205 }
206
207 /*
208 * @unimplemented
209 */
210 NTSTATUS
211 WINAPI
212 LsaDeleteTrustedDomain(
213 LSA_HANDLE PolicyHandle,
214 PSID TrustedDomainSid)
215 {
216 FIXME("(%p,%p) stub\n", PolicyHandle, TrustedDomainSid);
217 return STATUS_SUCCESS;
218 }
219
220 /*
221 * @implemented
222 */
223 NTSTATUS
224 WINAPI
225 LsaEnumerateAccountRights(
226 LSA_HANDLE PolicyHandle,
227 PSID AccountSid,
228 PLSA_UNICODE_STRING *UserRights,
229 PULONG CountOfRights)
230 {
231 LSAPR_USER_RIGHT_SET UserRightsSet;
232 NTSTATUS Status;
233
234 TRACE("(%p,%p,%p,%p) stub\n", PolicyHandle, AccountSid, UserRights, CountOfRights);
235
236 UserRightsSet.Entries = 0;
237 UserRightsSet.UserRights = NULL;
238
239 RpcTryExcept
240 {
241 Status = LsarEnmuerateAccountRights((LSAPR_HANDLE)PolicyHandle,
242 AccountSid,
243 &UserRightsSet);
244
245 *CountOfRights = UserRightsSet.Entries;
246 *UserRights = (PUNICODE_STRING)UserRightsSet.UserRights;
247 }
248 RpcExcept(EXCEPTION_EXECUTE_HANDLER)
249 {
250 Status = I_RpcMapWin32Status(RpcExceptionCode());
251
252 if (UserRightsSet.UserRights != NULL)
253 {
254 MIDL_user_free(UserRightsSet.UserRights);
255 }
256 }
257 RpcEndExcept;
258
259 return Status;
260 }
261
262 /*
263 * @unimplemented
264 */
265 NTSTATUS
266 WINAPI
267 LsaEnumerateAccountsWithUserRight(
268 LSA_HANDLE PolicyHandle,
269 OPTIONAL PLSA_UNICODE_STRING UserRights,
270 PVOID *EnumerationBuffer,
271 PULONG CountReturned)
272 {
273 FIXME("(%p,%p,%p,%p) stub\n", PolicyHandle, UserRights, EnumerationBuffer, CountReturned);
274 return STATUS_NO_MORE_ENTRIES;
275 }
276
277 /*
278 * @unimplemented
279 */
280 NTSTATUS
281 WINAPI
282 LsaEnumerateTrustedDomains(
283 LSA_HANDLE PolicyHandle,
284 PLSA_ENUMERATION_HANDLE EnumerationContext,
285 PVOID *Buffer,
286 ULONG PreferedMaximumLength,
287 PULONG CountReturned)
288 {
289 FIXME("(%p,%p,%p,0x%08x,%p) stub\n", PolicyHandle, EnumerationContext,
290 Buffer, PreferedMaximumLength, CountReturned);
291
292 if (CountReturned) *CountReturned = 0;
293 return STATUS_SUCCESS;
294 }
295
296 /*
297 * @unimplemented
298 */
299 NTSTATUS
300 WINAPI
301 LsaEnumerateTrustedDomainsEx(
302 LSA_HANDLE PolicyHandle,
303 PLSA_ENUMERATION_HANDLE EnumerationContext,
304 PVOID *Buffer,
305 ULONG PreferedMaximumLength,
306 PULONG CountReturned)
307 {
308 FIXME("(%p,%p,%p,0x%08x,%p) stub\n", PolicyHandle, EnumerationContext, Buffer,
309 PreferedMaximumLength, CountReturned);
310 if (CountReturned) *CountReturned = 0;
311 return STATUS_SUCCESS;
312 }
313
314 /*
315 * @implemented
316 */
317 NTSTATUS
318 WINAPI
319 LsaFreeMemory(PVOID Buffer)
320 {
321 TRACE("(%p)\n", Buffer);
322 return RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
323 }
324
325 /*
326 * @implemented
327 */
328 NTSTATUS
329 WINAPI
330 LsaLookupNames(
331 LSA_HANDLE PolicyHandle,
332 ULONG Count,
333 PLSA_UNICODE_STRING Names,
334 PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains,
335 PLSA_TRANSLATED_SID *Sids)
336 {
337 PLSA_TRANSLATED_SID2 Sids2;
338 LSA_TRANSLATED_SID *TranslatedSids;
339 ULONG i;
340 NTSTATUS Status;
341
342 TRACE("(%p,0x%08x,%p,%p,%p)\n", PolicyHandle, Count, Names,
343 ReferencedDomains, Sids);
344
345 /* Call LsaLookupNames2, which supersedes this function */
346 Status = LsaLookupNames2(PolicyHandle, Count, 0, Names, ReferencedDomains, &Sids2);
347 if (!NT_SUCCESS(Status))
348 return Status;
349
350 /* Translate the returned structure */
351 TranslatedSids = RtlAllocateHeap(RtlGetProcessHeap(), 0, Count * sizeof(LSA_TRANSLATED_SID));
352 if (!TranslatedSids)
353 {
354 LsaFreeMemory(Sids2);
355 return SCESTATUS_NOT_ENOUGH_RESOURCE;
356 }
357 RtlZeroMemory(Sids, Count * sizeof(PLSA_TRANSLATED_SID));
358 for (i = 0; i < Count; i++)
359 {
360 TranslatedSids[i].Use = Sids2[i].Use;
361 if (Sids2[i].Use != SidTypeInvalid && Sids2[i].Use != SidTypeUnknown)
362 {
363 TranslatedSids[i].DomainIndex = Sids2[i].DomainIndex;
364 if (Sids2[i].Use != SidTypeDomain)
365 TranslatedSids[i].RelativeId = *GetSidSubAuthority(Sids2[i].Sid, 0);
366 }
367 }
368 LsaFreeMemory(Sids2);
369
370 *Sids = TranslatedSids;
371
372 return Status;
373 }
374
375 /*
376 * @unimplemented
377 */
378 NTSTATUS
379 WINAPI
380 LsaLookupNames2(
381 LSA_HANDLE PolicyHandle,
382 ULONG Flags,
383 ULONG Count,
384 PLSA_UNICODE_STRING Names,
385 PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains,
386 PLSA_TRANSLATED_SID2 *Sids)
387 {
388 FIXME("(%p,0x%08x,0x%08x,%p,%p,%p) stub\n", PolicyHandle, Flags,
389 Count, Names, ReferencedDomains, Sids);
390 if (Names != NULL && Count > 0)
391 {
392 *ReferencedDomains = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(LSA_REFERENCED_DOMAIN_LIST));
393 *Sids = RtlAllocateHeap(RtlGetProcessHeap(), 0, Count * sizeof(LSA_TRANSLATED_SID2));
394 return STATUS_SOME_NOT_MAPPED;
395 }
396 return STATUS_NONE_MAPPED;
397 }
398
399 /*
400 * @implemented
401 */
402 NTSTATUS
403 WINAPI
404 LsaLookupPrivilegeValue(IN LSA_HANDLE PolicyHandle,
405 IN PLSA_UNICODE_STRING Name,
406 OUT PLUID Value)
407 {
408 LUID Luid;
409 NTSTATUS Status;
410
411 FIXME("(%p,%p,%p) stub\n", PolicyHandle, Name, Value);
412
413 RpcTryExcept
414 {
415 Status = LsarLookupPrivilegeValue(PolicyHandle,
416 (PRPC_UNICODE_STRING)Name,
417 &Luid);
418 if (Status == STATUS_SUCCESS)
419 *Value = Luid;
420 }
421 RpcExcept(EXCEPTION_EXECUTE_HANDLER)
422 {
423 Status = I_RpcMapWin32Status(RpcExceptionCode());
424 }
425 RpcEndExcept;
426
427 return Status;
428 }
429
430 /*
431 * @unimplemented
432 */
433 NTSTATUS
434 WINAPI
435 LsaLookupSids(
436 LSA_HANDLE PolicyHandle,
437 ULONG Count,
438 PSID *Sids,
439 PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains,
440 PLSA_TRANSLATED_NAME *Names)
441 {
442 static const UNICODE_STRING UserName = RTL_CONSTANT_STRING(L"Administrator");
443 PLSA_REFERENCED_DOMAIN_LIST LocalDomains;
444 PLSA_TRANSLATED_NAME LocalNames;
445
446 TRACE("(%p,%u,%p,%p,%p) stub\n", PolicyHandle, Count, Sids,
447 ReferencedDomains, Names);
448
449 WARN("LsaLookupSids(): stub. Always returning 'Administrator'\n");
450 if (Count != 1)
451 return STATUS_NONE_MAPPED;
452 LocalDomains = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(LSA_TRANSLATED_SID));
453 if (!LocalDomains)
454 return SCESTATUS_NOT_ENOUGH_RESOURCE;
455 LocalNames = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(LSA_TRANSLATED_NAME) + UserName.MaximumLength);
456 if (!LocalNames)
457 {
458 LsaFreeMemory(LocalDomains);
459 return SCESTATUS_NOT_ENOUGH_RESOURCE;
460 }
461 LocalDomains[0].Entries = 0;
462 LocalDomains[0].Domains = NULL;
463 LocalNames[0].Use = SidTypeWellKnownGroup;
464 LocalNames[0].Name.Buffer = (LPWSTR)((ULONG_PTR)(LocalNames) + sizeof(LSA_TRANSLATED_NAME));
465 LocalNames[0].Name.Length = UserName.Length;
466 LocalNames[0].Name.MaximumLength = UserName.MaximumLength;
467 RtlCopyMemory(LocalNames[0].Name.Buffer, UserName.Buffer, UserName.MaximumLength);
468
469 *ReferencedDomains = LocalDomains;
470 *Names = LocalNames;
471 return STATUS_SUCCESS;
472 }
473
474 /******************************************************************************
475 * LsaNtStatusToWinError
476 *
477 * PARAMS
478 * Status [I]
479 *
480 * @implemented
481 */
482 ULONG WINAPI
483 LsaNtStatusToWinError(NTSTATUS Status)
484 {
485 TRACE("(%lx)\n", Status);
486 return RtlNtStatusToDosError(Status);
487 }
488
489 /******************************************************************************
490 * LsaOpenPolicy
491 *
492 * PARAMS
493 * x1 []
494 * x2 []
495 * x3 []
496 * x4 []
497 *
498 * @unimplemented
499 */
500 NTSTATUS
501 WINAPI
502 LsaOpenPolicy(
503 IN PLSA_UNICODE_STRING SystemName,
504 IN PLSA_OBJECT_ATTRIBUTES ObjectAttributes,
505 IN ACCESS_MASK DesiredAccess,
506 IN OUT PLSA_HANDLE PolicyHandle)
507 {
508 NTSTATUS Status;
509
510 TRACE("LsaOpenPolicy (%s,%p,0x%08x,%p)\n",
511 SystemName ? debugstr_w(SystemName->Buffer) : "(null)",
512 ObjectAttributes, DesiredAccess, PolicyHandle);
513
514 RpcTryExcept
515 {
516 *PolicyHandle = NULL;
517
518 Status = LsarOpenPolicy(SystemName ? SystemName->Buffer : NULL,
519 (PLSAPR_OBJECT_ATTRIBUTES)ObjectAttributes,
520 DesiredAccess,
521 PolicyHandle);
522 }
523 RpcExcept(EXCEPTION_EXECUTE_HANDLER)
524 {
525 Status = I_RpcMapWin32Status(RpcExceptionCode());
526 }
527 RpcEndExcept;
528
529 TRACE("LsaOpenPolicy() done (Status: 0x%08lx)\n", Status);
530
531 return Status;
532 }
533
534
535 /*
536 * @unimplemented
537 */
538 NTSTATUS
539 WINAPI
540 LsaOpenTrustedDomainByName(
541 LSA_HANDLE PolicyHandle,
542 PLSA_UNICODE_STRING TrustedDomainName,
543 ACCESS_MASK DesiredAccess,
544 PLSA_HANDLE TrustedDomainHandle)
545 {
546 FIXME("(%p,%p,0x%08x,%p) stub\n", PolicyHandle, TrustedDomainName, DesiredAccess, TrustedDomainHandle);
547 return STATUS_OBJECT_NAME_NOT_FOUND;
548 }
549
550 /*
551 * @unimplemented
552 */
553 NTSTATUS
554 WINAPI
555 LsaQueryDomainInformationPolicy(
556 LSA_HANDLE PolicyHandle,
557 POLICY_DOMAIN_INFORMATION_CLASS InformationClass,
558 PVOID *Buffer)
559 {
560 FIXME("(%p,0x%08x,%p)\n", PolicyHandle, InformationClass, Buffer);
561 return STATUS_NOT_IMPLEMENTED;
562 }
563
564 /*
565 * @unimplemented
566 */
567 NTSTATUS
568 WINAPI
569 LsaQueryForestTrustInformation(
570 LSA_HANDLE PolicyHandle,
571 PLSA_UNICODE_STRING TrustedDomainName,
572 PLSA_FOREST_TRUST_INFORMATION * ForestTrustInfo)
573 {
574 FIXME("(%p,%p,%p) stub\n", PolicyHandle, TrustedDomainName, ForestTrustInfo);
575 return STATUS_NOT_IMPLEMENTED;
576 }
577
578 /*
579 * @unimplemented
580 */
581 NTSTATUS WINAPI
582 LsaQueryInformationPolicy(LSA_HANDLE PolicyHandle,
583 POLICY_INFORMATION_CLASS InformationClass,
584 PVOID *Buffer)
585 {
586 TRACE("(%p,0x%08x,%p)\n", PolicyHandle, InformationClass, Buffer);
587
588 if(!Buffer) return STATUS_INVALID_PARAMETER;
589 switch (InformationClass)
590 {
591 case PolicyAuditEventsInformation: /* 2 */
592 {
593 PPOLICY_AUDIT_EVENTS_INFO p = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY,
594 sizeof(POLICY_AUDIT_EVENTS_INFO));
595 p->AuditingMode = FALSE; /* no auditing */
596 *Buffer = p;
597 }
598 break;
599 case PolicyPrimaryDomainInformation: /* 3 */
600 {
601 /* Only the domain name is valid for the local computer.
602 * All other fields are zero.
603 */
604 PPOLICY_PRIMARY_DOMAIN_INFO pinfo;
605
606 pinfo = ADVAPI_GetDomainName(sizeof(*pinfo), offsetof(POLICY_PRIMARY_DOMAIN_INFO, Name));
607
608 TRACE("setting domain to %s\n", debugstr_w(pinfo->Name.Buffer));
609
610 *Buffer = pinfo;
611 }
612 case PolicyAccountDomainInformation: /* 5 */
613 {
614 struct di
615 {
616 POLICY_ACCOUNT_DOMAIN_INFO info;
617 SID sid;
618 DWORD padding[3];
619 WCHAR domain[MAX_COMPUTERNAME_LENGTH + 1];
620 };
621
622 DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1;
623 struct di * xdi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*xdi));
624
625 xdi->info.DomainName.MaximumLength = dwSize * sizeof(WCHAR);
626 xdi->info.DomainName.Buffer = xdi->domain;
627 if (GetComputerNameW(xdi->info.DomainName.Buffer, &dwSize))
628 xdi->info.DomainName.Length = dwSize * sizeof(WCHAR);
629
630 TRACE("setting name to %s\n", debugstr_w(xdi->info.DomainName.Buffer));
631
632 xdi->info.DomainSid = &xdi->sid;
633
634 /* read the computer SID from the registry */
635 if (!ADVAPI_GetComputerSid(&xdi->sid))
636 {
637 HeapFree(GetProcessHeap(), 0, xdi);
638
639 WARN("Computer SID not found\n");
640
641 return STATUS_UNSUCCESSFUL;
642 }
643
644 *Buffer = xdi;
645 }
646 break;
647 case PolicyDnsDomainInformation: /* 12 (0xc) */
648 {
649 /* Only the domain name is valid for the local computer.
650 * All other fields are zero.
651 */
652 PPOLICY_DNS_DOMAIN_INFO pinfo;
653
654 pinfo = ADVAPI_GetDomainName(sizeof(*pinfo), offsetof(POLICY_DNS_DOMAIN_INFO, Name));
655
656 TRACE("setting domain to %s\n", debugstr_w(pinfo->Name.Buffer));
657
658 *Buffer = pinfo;
659 }
660 break;
661 case PolicyAuditLogInformation:
662 case PolicyPdAccountInformation:
663 case PolicyLsaServerRoleInformation:
664 case PolicyReplicaSourceInformation:
665 case PolicyDefaultQuotaInformation:
666 case PolicyModificationInformation:
667 case PolicyAuditFullSetInformation:
668 case PolicyAuditFullQueryInformation:
669 case PolicyEfsInformation:
670 {
671 FIXME("category not implemented\n");
672 return STATUS_UNSUCCESSFUL;
673 }
674 }
675 return STATUS_SUCCESS;
676 }
677
678 /*
679 * @unimplemented
680 */
681 NTSTATUS
682 WINAPI
683 LsaQueryTrustedDomainInfoByName(
684 LSA_HANDLE PolicyHandle,
685 PLSA_UNICODE_STRING TrustedDomainName,
686 TRUSTED_INFORMATION_CLASS InformationClass,
687 PVOID *Buffer)
688 {
689 FIXME("(%p,%p,%d,%p) stub\n", PolicyHandle, TrustedDomainName, InformationClass, Buffer);
690 return STATUS_OBJECT_NAME_NOT_FOUND;
691 }
692
693 /*
694 * @unimplemented
695 */
696 NTSTATUS
697 WINAPI
698 LsaQueryTrustedDomainInfo(
699 LSA_HANDLE PolicyHandle,
700 PSID TrustedDomainSid,
701 TRUSTED_INFORMATION_CLASS InformationClass,
702 PVOID *Buffer)
703 {
704 FIXME("(%p,%p,%d,%p) stub\n", PolicyHandle, TrustedDomainSid, InformationClass, Buffer);
705 return STATUS_OBJECT_NAME_NOT_FOUND;
706 }
707
708 /*
709 * @unimplemented
710 */
711 NTSTATUS
712 WINAPI
713 LsaRemoveAccountRights(
714 LSA_HANDLE PolicyHandle,
715 PSID AccountSid,
716 BOOLEAN AllRights,
717 PLSA_UNICODE_STRING UserRights,
718 ULONG CountOfRights)
719 {
720 FIXME("(%p,%p,%d,%p,0x%08x) stub\n", PolicyHandle, AccountSid, AllRights, UserRights, CountOfRights);
721 return STATUS_SUCCESS;
722 }
723
724 /*
725 * @unimplemented
726 */
727 NTSTATUS
728 WINAPI
729 LsaRetrievePrivateData(
730 LSA_HANDLE PolicyHandle,
731 PLSA_UNICODE_STRING KeyName,
732 PLSA_UNICODE_STRING *PrivateData)
733 {
734 FIXME("(%p,%p,%p) stub\n", PolicyHandle, KeyName, PrivateData);
735 return STATUS_OBJECT_NAME_NOT_FOUND;
736 }
737
738 /*
739 * @unimplemented
740 */
741 NTSTATUS
742 WINAPI
743 LsaSetDomainInformationPolicy(
744 LSA_HANDLE PolicyHandle,
745 POLICY_DOMAIN_INFORMATION_CLASS InformationClass,
746 PVOID Buffer)
747 {
748 FIXME("(%p,0x%08x,%p) stub\n", PolicyHandle, InformationClass, Buffer);
749 return STATUS_UNSUCCESSFUL;
750 }
751
752 /*
753 * @unimplemented
754 */
755 NTSTATUS
756 WINAPI
757 LsaSetInformationPolicy(
758 LSA_HANDLE PolicyHandle,
759 POLICY_INFORMATION_CLASS InformationClass,
760 PVOID Buffer)
761 {
762 FIXME("(%p,0x%08x,%p) stub\n", PolicyHandle, InformationClass, Buffer);
763 return STATUS_UNSUCCESSFUL;
764 }
765
766 /*
767 * @unimplemented
768 */
769 NTSTATUS WINAPI LsaSetSecret(
770 IN LSA_HANDLE SecretHandle,
771 IN PLSA_UNICODE_STRING EncryptedCurrentValue,
772 IN PLSA_UNICODE_STRING EncryptedOldValue)
773 {
774 FIXME("(%p,%p,%p) stub\n", SecretHandle, EncryptedCurrentValue,
775 EncryptedOldValue);
776 return STATUS_SUCCESS;
777 }
778
779 /*
780 * @unimplemented
781 */
782 NTSTATUS
783 WINAPI
784 LsaSetForestTrustInformation(
785 LSA_HANDLE PolicyHandle,
786 PLSA_UNICODE_STRING TrustedDomainName,
787 PLSA_FOREST_TRUST_INFORMATION ForestTrustInfo,
788 BOOL CheckOnly,
789 PLSA_FOREST_TRUST_COLLISION_INFORMATION *CollisionInfo)
790 {
791 FIXME("(%p,%p,%p,%d,%p) stub\n", PolicyHandle, TrustedDomainName, ForestTrustInfo, CheckOnly, CollisionInfo);
792 return STATUS_NOT_IMPLEMENTED;
793 }
794
795 /*
796 * @unimplemented
797 */
798 NTSTATUS
799 WINAPI
800 LsaSetTrustedDomainInfoByName(
801 LSA_HANDLE PolicyHandle,
802 PLSA_UNICODE_STRING TrustedDomainName,
803 TRUSTED_INFORMATION_CLASS InformationClass,
804 PVOID Buffer)
805 {
806 FIXME("(%p,%p,%d,%p) stub\n", PolicyHandle, TrustedDomainName, InformationClass, Buffer);
807 return STATUS_SUCCESS;
808 }
809
810 /*
811 * @unimplemented
812 */
813 NTSTATUS WINAPI LsaRegisterPolicyChangeNotification(
814 POLICY_NOTIFICATION_INFORMATION_CLASS class,
815 HANDLE event)
816 {
817 FIXME("(%d,%p) stub\n", class, event);
818 return STATUS_UNSUCCESSFUL;
819 }
820
821 /*
822 * @unimplemented
823 */
824 NTSTATUS
825 WINAPI
826 LsaSetTrustedDomainInformation(
827 LSA_HANDLE PolicyHandle,
828 PSID TrustedDomainSid,
829 TRUSTED_INFORMATION_CLASS InformationClass,
830 PVOID Buffer)
831 {
832 FIXME("(%p,%p,%d,%p) stub\n", PolicyHandle, TrustedDomainSid, InformationClass, Buffer);
833 return STATUS_SUCCESS;
834 }
835
836 /*
837 * @unimplemented
838 */
839 NTSTATUS
840 WINAPI
841 LsaStorePrivateData(
842 LSA_HANDLE PolicyHandle,
843 PLSA_UNICODE_STRING KeyName,
844 PLSA_UNICODE_STRING PrivateData)
845 {
846 FIXME("(%p,%p,%p) stub\n", PolicyHandle, KeyName, PrivateData);
847 return STATUS_OBJECT_NAME_NOT_FOUND;
848 }
849
850 /*
851 * @unimplemented
852 */
853 NTSTATUS WINAPI LsaUnregisterPolicyChangeNotification(
854 POLICY_NOTIFICATION_INFORMATION_CLASS class,
855 HANDLE event)
856 {
857 FIXME("(%d,%p) stub\n", class, event);
858 return STATUS_SUCCESS;
859 }
860
861 /*
862 * @unimplemented
863 */
864 NTSTATUS
865 WINAPI
866 LsaGetUserName(
867 PUNICODE_STRING *UserName,
868 PUNICODE_STRING *DomainName)
869 {
870 FIXME("(%p,%p) stub\n", UserName, DomainName);
871 return STATUS_NOT_IMPLEMENTED;
872 }
873
874 /*
875 * @unimplemented
876 */
877 NTSTATUS
878 WINAPI
879 LsaQueryInfoTrustedDomain (DWORD Unknonw0,
880 DWORD Unknonw1,
881 DWORD Unknonw2)
882 {
883 FIXME("(%d,%d,%d) stub\n", Unknonw0, Unknonw1, Unknonw2);
884 return STATUS_NOT_IMPLEMENTED;
885 }
886
887
888 /* EOF */