2 * Implementation of the Local Security Authority API
4 * Copyright 1999 Juergen Schmied
5 * Copyright 2002 Andriy Palamarchuk
6 * Copyright 2004 Mike McCormack
7 * Copyright 2005 Hans Leidekker
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #define WIN32_NO_STATUS
32 #include "advapi32_misc.h"
34 #include "wine/debug.h"
35 #include "wine/unicode.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(advapi);
39 #define ADVAPI_ForceLocalComputer(ServerName, FailureCode) \
40 if (!ADVAPI_IsLocalComputer(ServerName)) \
42 FIXME("Action Implemented for local computer only. " \
43 "Requested for server %s\n", debugstr_w(ServerName)); \
47 static void dumpLsaAttributes(const LSA_OBJECT_ATTRIBUTES *oa)
51 TRACE("\n\tlength=%u, rootdir=%p, objectname=%s\n\tattr=0x%08x, sid=%s qos=%p\n",
52 oa->Length, oa->RootDirectory,
53 oa->ObjectName?debugstr_w(oa->ObjectName->Buffer):"null",
54 oa->Attributes, debugstr_sid(oa->SecurityDescriptor),
55 oa->SecurityQualityOfService);
59 static void* ADVAPI_GetDomainName(unsigned sz, unsigned ofs)
66 static const WCHAR wVNETSUP[] = {
67 'S','y','s','t','e','m','\\',
68 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
69 'S','e','r','v','i','c','e','s','\\',
70 'V','x','D','\\','V','N','E','T','S','U','P','\0'};
72 ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, wVNETSUP, 0, KEY_READ, &key);
73 if (ret == ERROR_SUCCESS)
76 static const WCHAR wg[] = { 'W','o','r','k','g','r','o','u','p',0 };
78 ret = RegQueryValueExW(key, wg, NULL, NULL, NULL, &size);
79 if (ret == ERROR_MORE_DATA || ret == ERROR_SUCCESS)
81 ptr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sz + size);
82 if (!ptr) return NULL;
83 ustr = (UNICODE_STRING*)(ptr + ofs);
84 ustr->MaximumLength = size;
85 ustr->Buffer = (WCHAR*)(ptr + sz);
86 ret = RegQueryValueExW(key, wg, NULL, NULL, (LPBYTE)ustr->Buffer, &size);
87 if (ret != ERROR_SUCCESS)
89 HeapFree(GetProcessHeap(), 0, ptr);
92 else ustr->Length = size - sizeof(WCHAR);
98 static const WCHAR wDomain[] = {'D','O','M','A','I','N','\0'};
99 ptr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
100 sz + sizeof(wDomain));
101 if (!ptr) return NULL;
102 ustr = (UNICODE_STRING*)(ptr + ofs);
103 ustr->MaximumLength = sizeof(wDomain);
104 ustr->Buffer = (WCHAR*)(ptr + sz);
105 ustr->Length = sizeof(wDomain) - sizeof(WCHAR);
106 memcpy(ustr->Buffer, wDomain, sizeof(wDomain));
111 /******************************************************************************
112 * LsaAddAccountRights [ADVAPI32.@]
115 NTSTATUS WINAPI LsaAddAccountRights(
118 PLSA_UNICODE_STRING rights,
121 FIXME("(%p,%p,%p,0x%08x) stub\n", policy, sid, rights, count);
122 return STATUS_OBJECT_NAME_NOT_FOUND;
125 /******************************************************************************
126 * LsaClose [ADVAPI32.@]
128 * Closes a handle to a Policy or TrustedDomain.
131 * ObjectHandle [I] Handle to a Policy or TrustedDomain.
134 * Success: STATUS_SUCCESS.
135 * Failure: NTSTATUS code.
137 NTSTATUS WINAPI LsaClose(IN LSA_HANDLE ObjectHandle)
139 FIXME("(%p) stub\n", ObjectHandle);
140 return STATUS_SUCCESS;
143 /******************************************************************************
144 * LsaCreateTrustedDomainEx [ADVAPI32.@]
147 NTSTATUS WINAPI LsaCreateTrustedDomainEx(
149 PTRUSTED_DOMAIN_INFORMATION_EX domain_info,
150 PTRUSTED_DOMAIN_AUTH_INFORMATION auth_info,
154 FIXME("(%p,%p,%p,0x%08x,%p) stub\n", policy, domain_info, auth_info,
156 return STATUS_SUCCESS;
159 /******************************************************************************
160 * LsaDeleteTrustedDomain [ADVAPI32.@]
163 NTSTATUS WINAPI LsaDeleteTrustedDomain(LSA_HANDLE policy, PSID sid)
165 FIXME("(%p,%p) stub\n", policy, sid);
166 return STATUS_SUCCESS;
169 /******************************************************************************
170 * LsaEnumerateAccountRights [ADVAPI32.@]
173 NTSTATUS WINAPI LsaEnumerateAccountRights(
176 PLSA_UNICODE_STRING *rights,
179 FIXME("(%p,%p,%p,%p) stub\n", policy, sid, rights, count);
182 return STATUS_OBJECT_NAME_NOT_FOUND;
185 /******************************************************************************
186 * LsaEnumerateAccountsWithUserRight [ADVAPI32.@]
189 NTSTATUS WINAPI LsaEnumerateAccountsWithUserRight(
191 PLSA_UNICODE_STRING rights,
195 FIXME("(%p,%p,%p,%p) stub\n", policy, rights, buffer, count);
196 return STATUS_NO_MORE_ENTRIES;
199 /******************************************************************************
200 * LsaEnumerateTrustedDomains [ADVAPI32.@]
202 * Returns the names and SIDs of trusted domains.
205 * PolicyHandle [I] Handle to a Policy object.
206 * EnumerationContext [I] Pointer to an enumeration handle.
207 * Buffer [O] Contains the names and SIDs of trusted domains.
208 * PreferredMaximumLength[I] Preferred maximum size in bytes of Buffer.
209 * CountReturned [O] Number of elements in Buffer.
212 * Success: STATUS_SUCCESS,
213 * STATUS_MORE_ENTRIES,
214 * STATUS_NO_MORE_ENTRIES
215 * Failure: NTSTATUS code.
218 * LsaEnumerateTrustedDomains can be called multiple times to enumerate
219 * all trusted domains.
221 NTSTATUS WINAPI LsaEnumerateTrustedDomains(
222 IN LSA_HANDLE PolicyHandle,
223 IN PLSA_ENUMERATION_HANDLE EnumerationContext,
225 IN ULONG PreferredMaximumLength,
226 OUT PULONG CountReturned)
228 FIXME("(%p,%p,%p,0x%08x,%p) stub\n", PolicyHandle, EnumerationContext,
229 Buffer, PreferredMaximumLength, CountReturned);
231 if (CountReturned) *CountReturned = 0;
232 return STATUS_SUCCESS;
235 /******************************************************************************
236 * LsaEnumerateTrustedDomainsEx [ADVAPI32.@]
239 NTSTATUS WINAPI LsaEnumerateTrustedDomainsEx(
241 PLSA_ENUMERATION_HANDLE context,
246 FIXME("(%p,%p,%p,0x%08x,%p) stub\n", policy, context, buffer, length, count);
248 if (count) *count = 0;
249 return STATUS_SUCCESS;
252 /******************************************************************************
253 * LsaFreeMemory [ADVAPI32.@]
255 * Frees memory allocated by a LSA function.
258 * Buffer [I] Memory buffer to free.
261 * Success: STATUS_SUCCESS.
262 * Failure: NTSTATUS code.
264 NTSTATUS WINAPI LsaFreeMemory(IN PVOID Buffer)
266 TRACE("(%p)\n", Buffer);
268 HeapFree(GetProcessHeap(), 0, Buffer);
269 return STATUS_SUCCESS;
272 /******************************************************************************
273 * LsaLookupNames [ADVAPI32.@]
275 * Returns the SIDs of an array of user, group, or local group names.
278 * PolicyHandle [I] Handle to a Policy object.
279 * Count [I] Number of names in Names.
280 * Names [I] Array of names to lookup.
281 * ReferencedDomains [O] Array of domains where the names were found.
282 * Sids [O] Array of SIDs corresponding to Names.
285 * Success: STATUS_SUCCESS,
286 * STATUS_SOME_NOT_MAPPED
287 * Failure: STATUS_NONE_MAPPED or NTSTATUS code.
289 NTSTATUS WINAPI LsaLookupNames(
290 IN LSA_HANDLE PolicyHandle,
292 IN PLSA_UNICODE_STRING Names,
293 OUT PLSA_REFERENCED_DOMAIN_LIST* ReferencedDomains,
294 OUT PLSA_TRANSLATED_SID* Sids)
296 FIXME("(%p,0x%08x,%p,%p,%p) stub\n", PolicyHandle, Count, Names,
297 ReferencedDomains, Sids);
299 return STATUS_NONE_MAPPED;
302 static BOOL lookup_name( LSA_UNICODE_STRING *name, SID *sid, DWORD *sid_size, WCHAR *domain,
303 DWORD *domain_size, SID_NAME_USE *use, BOOL *handled )
307 ret = lookup_local_wellknown_name( name, sid, sid_size, domain, domain_size, use, handled );
309 ret = lookup_local_user_name( name, sid, sid_size, domain, domain_size, use, handled );
314 static INT build_domain(PLSA_REFERENCED_DOMAIN_LIST currentList, PLSA_UNICODE_STRING domain)
317 ULONG sid_size = 0,domain_size = 0;
318 BOOL handled = FALSE;
321 for (count = 0; count < currentList->Entries; count ++)
323 if ((currentList->Domains[count].Name.Length == domain->Length) &&
324 (strncmpiW(currentList->Domains[count].Name.Buffer,domain->Buffer,(domain->Length / sizeof(WCHAR))) == 0))
326 HeapFree(GetProcessHeap(),0,domain->Buffer);
331 if (currentList->Entries > 0)
332 currentList->Domains = HeapReAlloc(GetProcessHeap(),0,currentList->Domains, (currentList->Entries + 1) * sizeof(LSA_TRUST_INFORMATION));
334 currentList->Domains = HeapAlloc(GetProcessHeap(),0,sizeof(LSA_TRUST_INFORMATION));
336 currentList->Domains[currentList->Entries].Name = *domain;
338 lookup_name( domain, NULL, &sid_size, NULL, &domain_size, &use, &handled );
340 currentList->Domains[currentList->Entries].Sid = HeapAlloc(GetProcessHeap(),0,sid_size);
341 lookup_name( domain, currentList->Domains[currentList->Entries].Sid, &sid_size, NULL, &domain_size, &use, &handled );
343 currentList->Entries++;
344 return currentList->Entries-1;
347 /******************************************************************************
348 * LsaLookupNames2 [ADVAPI32.@]
351 NTSTATUS WINAPI LsaLookupNames2( LSA_HANDLE policy, ULONG flags, ULONG count,
352 PLSA_UNICODE_STRING names, PLSA_REFERENCED_DOMAIN_LIST *domains,
353 PLSA_TRANSLATED_SID2 *sids )
355 ULONG i, sid_size_total = 0, domain_size_max = 0, size;
356 ULONG sid_size, domain_size, mapped;
357 BOOL handled = FALSE;
361 TRACE("(%p,0x%08x,0x%08x,%p,%p,%p)\n", policy, flags, count, names, domains, sids);
364 for (i = 0; i < count; i++)
367 sid_size = domain_size = 0;
368 lookup_name( &names[i], NULL, &sid_size, NULL, &domain_size, &use, &handled );
371 sid_size_total += sid_size;
374 if (domain_size > domain_size_max)
375 domain_size_max = domain_size;
380 TRACE("mapped %u out of %u\n", mapped, count);
382 size = sizeof(LSA_TRANSLATED_SID2) * count + sid_size_total;
383 if (!(*sids = HeapAlloc( GetProcessHeap(), 0, size) )) return STATUS_NO_MEMORY;
385 sid = (SID *)(*sids + count);
387 if (!(*domains = HeapAlloc( GetProcessHeap(), 0, sizeof(LSA_REFERENCED_DOMAIN_LIST) )))
389 HeapFree( GetProcessHeap(), 0, *sids );
390 return STATUS_NO_MEMORY;
392 (*domains)->Entries = 0;
393 (*domains)->Domains = NULL;
395 for (i = 0; i < count; i++)
397 LSA_UNICODE_STRING domain;
399 domain.Length = domain_size_max*sizeof(WCHAR);
400 domain.MaximumLength = domain_size_max*sizeof(WCHAR);
401 domain.Buffer = HeapAlloc(GetProcessHeap(),0,domain.Length);
403 (*sids)[i].Use = SidTypeUnknown;
404 (*sids)[i].DomainIndex = -1;
405 (*sids)[i].Flags = 0;
408 sid_size = sid_size_total;
409 domain_size = domain_size_max;
410 lookup_name( &names[i], sid, &sid_size, domain.Buffer, &domain_size, &use, &handled );
413 (*sids)[i].Sid = sid;
414 (*sids)[i].Use = use;
416 sid = (SID *)((char *)sid + sid_size);
417 sid_size_total -= sid_size;
420 domain.Length = domain_size * sizeof(WCHAR);
421 (*sids)[i].DomainIndex = build_domain(*domains, &domain);
424 HeapFree(GetProcessHeap(),0,domain.Buffer);
427 HeapFree(GetProcessHeap(),0,domain.Buffer);
430 if (mapped == count) return STATUS_SUCCESS;
431 if (mapped > 0 && mapped < count) return STATUS_SOME_NOT_MAPPED;
432 return STATUS_NONE_MAPPED;
435 /******************************************************************************
436 * LsaLookupSids [ADVAPI32.@]
438 * Looks up the names that correspond to an array of SIDs.
441 * PolicyHandle [I] Handle to a Policy object.
442 * Count [I] Number of SIDs in the Sids array.
443 * Sids [I] Array of SIDs to lookup.
444 * ReferencedDomains [O] Array of domains where the sids were found.
445 * Names [O] Array of names corresponding to Sids.
448 * Success: STATUS_SUCCESS,
449 * STATUS_SOME_NOT_MAPPED
450 * Failure: STATUS_NONE_MAPPED or NTSTATUS code.
452 NTSTATUS WINAPI LsaLookupSids(
453 IN LSA_HANDLE PolicyHandle,
456 OUT PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains,
457 OUT PLSA_TRANSLATED_NAME *Names )
459 ULONG i, mapped, size;
460 ULONG name_size, domain_size;
463 TRACE("(%p,%u,%p,%p,%p) stub\n", PolicyHandle, Count, Sids,
464 ReferencedDomains, Names);
466 size = sizeof(LSA_TRANSLATED_NAME) * Count;
467 if (!(*Names = HeapAlloc( GetProcessHeap(), 0, size) )) return STATUS_NO_MEMORY;
468 if (!(*ReferencedDomains = HeapAlloc( GetProcessHeap(), 0, sizeof(LSA_REFERENCED_DOMAIN_LIST)) ))
470 HeapFree( GetProcessHeap(), 0, *Names);
471 return STATUS_NO_MEMORY;
473 (*ReferencedDomains)->Entries = 0;
474 (*ReferencedDomains)->Domains = NULL;
477 for (i = 0; i < Count; i++)
479 name_size = domain_size = 0;
480 (*Names)[i].Use = SidTypeUnknown;
481 (*Names)[i].DomainIndex = -1;
482 (*Names)[i].Name.Length = 0;
483 (*Names)[i].Name.MaximumLength = 0;
484 (*Names)[i].Name.Buffer = NULL;
486 if (!LookupAccountSidW(NULL, Sids[i], NULL, &name_size, NULL, &domain_size, &use) &&
487 GetLastError() == ERROR_INSUFFICIENT_BUFFER)
489 LSA_UNICODE_STRING domain;
495 domain.Length = (domain_size - 1) * sizeof(WCHAR);
496 domain.MaximumLength = domain_size*sizeof(WCHAR);
497 domain.Buffer = HeapAlloc(GetProcessHeap(),0,domain.MaximumLength);
502 domain.MaximumLength = 0;
503 domain.Buffer = NULL;
506 (*Names)[i].Name.Length = (name_size - 1) * sizeof(WCHAR);
507 (*Names)[i].Name.MaximumLength = name_size * sizeof(WCHAR);
508 (*Names)[i].Name.Buffer = HeapAlloc(GetProcessHeap(), 0, name_size * sizeof(WCHAR));
509 LookupAccountSidW(NULL, Sids[i], (*Names)[i].Name.Buffer, &name_size, domain.Buffer, &domain_size, &use);
510 (*Names)[i].Use = use;
513 (*Names)[i].DomainIndex = build_domain(*ReferencedDomains, &domain);
516 TRACE("mapped %u out of %u\n",mapped,Count);
518 if (mapped == Count) return STATUS_SUCCESS;
519 if (mapped) return STATUS_SOME_NOT_MAPPED;
520 return STATUS_NONE_MAPPED;
523 /******************************************************************************
524 * LsaNtStatusToWinError [ADVAPI32.@]
526 * Converts an LSA NTSTATUS code to a Windows error code.
529 * Status [I] NTSTATUS code.
532 * Success: Corresponding Windows error code.
533 * Failure: ERROR_MR_MID_NOT_FOUND.
535 ULONG WINAPI LsaNtStatusToWinError(NTSTATUS Status)
537 return RtlNtStatusToDosError(Status);
540 /******************************************************************************
541 * LsaOpenPolicy [ADVAPI32.@]
543 * Opens a handle to the Policy object on a local or remote system.
546 * SystemName [I] Name of the target system.
547 * ObjectAttributes [I] Connection attributes.
548 * DesiredAccess [I] Requested access rights.
549 * PolicyHandle [I/O] Handle to the Policy object.
552 * Success: STATUS_SUCCESS.
553 * Failure: NTSTATUS code.
556 * Set SystemName to NULL to open the local Policy object.
558 NTSTATUS WINAPI LsaOpenPolicy(
559 IN PLSA_UNICODE_STRING SystemName,
560 IN PLSA_OBJECT_ATTRIBUTES ObjectAttributes,
561 IN ACCESS_MASK DesiredAccess,
562 IN OUT PLSA_HANDLE PolicyHandle)
564 FIXME("(%s,%p,0x%08x,%p) stub\n",
565 SystemName?debugstr_w(SystemName->Buffer):"(null)",
566 ObjectAttributes, DesiredAccess, PolicyHandle);
568 ADVAPI_ForceLocalComputer(SystemName ? SystemName->Buffer : NULL,
569 STATUS_ACCESS_VIOLATION);
570 dumpLsaAttributes(ObjectAttributes);
572 if(PolicyHandle) *PolicyHandle = (LSA_HANDLE)0xcafe;
573 return STATUS_SUCCESS;
576 /******************************************************************************
577 * LsaOpenTrustedDomainByName [ADVAPI32.@]
580 NTSTATUS WINAPI LsaOpenTrustedDomainByName(
582 PLSA_UNICODE_STRING name,
586 FIXME("(%p,%p,0x%08x,%p) stub\n", policy, name, access, handle);
587 return STATUS_OBJECT_NAME_NOT_FOUND;
590 /******************************************************************************
591 * LsaQueryInformationPolicy [ADVAPI32.@]
593 * Returns information about a Policy object.
596 * PolicyHandle [I] Handle to a Policy object.
597 * InformationClass [I] Type of information to retrieve.
598 * Buffer [O] Pointer to the requested information.
601 * Success: STATUS_SUCCESS.
602 * Failure: NTSTATUS code.
604 NTSTATUS WINAPI LsaQueryInformationPolicy(
605 IN LSA_HANDLE PolicyHandle,
606 IN POLICY_INFORMATION_CLASS InformationClass,
609 TRACE("(%p,0x%08x,%p)\n", PolicyHandle, InformationClass, Buffer);
611 if(!Buffer) return STATUS_INVALID_PARAMETER;
612 switch (InformationClass)
614 case PolicyAuditEventsInformation: /* 2 */
616 PPOLICY_AUDIT_EVENTS_INFO p = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
617 sizeof(POLICY_AUDIT_EVENTS_INFO));
618 p->AuditingMode = FALSE; /* no auditing */
622 case PolicyPrimaryDomainInformation: /* 3 */
624 /* Only the domain name is valid for the local computer.
625 * All other fields are zero.
627 PPOLICY_PRIMARY_DOMAIN_INFO pinfo;
629 pinfo = ADVAPI_GetDomainName(sizeof(*pinfo), offsetof(POLICY_PRIMARY_DOMAIN_INFO, Name));
631 TRACE("setting domain to %s\n", debugstr_w(pinfo->Name.Buffer));
636 case PolicyAccountDomainInformation: /* 5 */
640 POLICY_ACCOUNT_DOMAIN_INFO info;
643 WCHAR domain[MAX_COMPUTERNAME_LENGTH + 1];
646 DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1;
647 struct di * xdi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*xdi));
649 xdi->info.DomainName.MaximumLength = dwSize * sizeof(WCHAR);
650 xdi->info.DomainName.Buffer = xdi->domain;
651 if (GetComputerNameW(xdi->info.DomainName.Buffer, &dwSize))
652 xdi->info.DomainName.Length = dwSize * sizeof(WCHAR);
654 TRACE("setting name to %s\n", debugstr_w(xdi->info.DomainName.Buffer));
656 xdi->info.DomainSid = &xdi->sid;
658 if (!ADVAPI_GetComputerSid(&xdi->sid))
660 HeapFree(GetProcessHeap(), 0, xdi);
662 WARN("Computer SID not found\n");
664 return STATUS_UNSUCCESSFUL;
667 TRACE("setting SID to %s\n", debugstr_sid(&xdi->sid));
672 case PolicyDnsDomainInformation: /* 12 (0xc) */
674 /* Only the domain name is valid for the local computer.
675 * All other fields are zero.
677 PPOLICY_DNS_DOMAIN_INFO pinfo;
679 pinfo = ADVAPI_GetDomainName(sizeof(*pinfo), offsetof(POLICY_DNS_DOMAIN_INFO, Name));
681 TRACE("setting domain to %s\n", debugstr_w(pinfo->Name.Buffer));
686 case PolicyAuditLogInformation:
687 case PolicyPdAccountInformation:
688 case PolicyLsaServerRoleInformation:
689 case PolicyReplicaSourceInformation:
690 case PolicyDefaultQuotaInformation:
691 case PolicyModificationInformation:
692 case PolicyAuditFullSetInformation:
693 case PolicyAuditFullQueryInformation:
695 FIXME("category %d not implemented\n", InformationClass);
696 return STATUS_UNSUCCESSFUL;
699 return STATUS_SUCCESS;
702 /******************************************************************************
703 * LsaQueryTrustedDomainInfo [ADVAPI32.@]
706 NTSTATUS WINAPI LsaQueryTrustedDomainInfo(
709 TRUSTED_INFORMATION_CLASS class,
712 FIXME("(%p,%p,%d,%p) stub\n", policy, sid, class, buffer);
713 return STATUS_OBJECT_NAME_NOT_FOUND;
716 /******************************************************************************
717 * LsaQueryTrustedDomainInfoByName [ADVAPI32.@]
720 NTSTATUS WINAPI LsaQueryTrustedDomainInfoByName(
722 PLSA_UNICODE_STRING name,
723 TRUSTED_INFORMATION_CLASS class,
726 FIXME("(%p,%p,%d,%p) stub\n", policy, name, class, buffer);
727 return STATUS_OBJECT_NAME_NOT_FOUND;
730 /******************************************************************************
731 * LsaRegisterPolicyChangeNotification [ADVAPI32.@]
734 NTSTATUS WINAPI LsaRegisterPolicyChangeNotification(
735 POLICY_NOTIFICATION_INFORMATION_CLASS class,
738 FIXME("(%d,%p) stub\n", class, event);
739 return STATUS_UNSUCCESSFUL;
742 /******************************************************************************
743 * LsaRemoveAccountRights [ADVAPI32.@]
746 NTSTATUS WINAPI LsaRemoveAccountRights(
750 PLSA_UNICODE_STRING rights,
753 FIXME("(%p,%p,%d,%p,0x%08x) stub\n", policy, sid, all, rights, count);
754 return STATUS_SUCCESS;
757 /******************************************************************************
758 * LsaRetrievePrivateData [ADVAPI32.@]
760 * Retrieves data stored by LsaStorePrivateData.
763 * PolicyHandle [I] Handle to a Policy object.
764 * KeyName [I] Name of the key where the data is stored.
765 * PrivateData [O] Pointer to the private data.
768 * Success: STATUS_SUCCESS.
769 * Failure: STATUS_OBJECT_NAME_NOT_FOUND or NTSTATUS code.
771 NTSTATUS WINAPI LsaRetrievePrivateData(
772 IN LSA_HANDLE PolicyHandle,
773 IN PLSA_UNICODE_STRING KeyName,
774 OUT PLSA_UNICODE_STRING* PrivateData)
776 FIXME("(%p,%p,%p) stub\n", PolicyHandle, KeyName, PrivateData);
777 return STATUS_OBJECT_NAME_NOT_FOUND;
780 /******************************************************************************
781 * LsaSetInformationPolicy [ADVAPI32.@]
783 * Modifies information in a Policy object.
786 * PolicyHandle [I] Handle to a Policy object.
787 * InformationClass [I] Type of information to set.
788 * Buffer [I] Pointer to the information to set.
791 * Success: STATUS_SUCCESS.
792 * Failure: NTSTATUS code.
794 NTSTATUS WINAPI LsaSetInformationPolicy(
795 IN LSA_HANDLE PolicyHandle,
796 IN POLICY_INFORMATION_CLASS InformationClass,
799 FIXME("(%p,0x%08x,%p) stub\n", PolicyHandle, InformationClass, Buffer);
801 return STATUS_UNSUCCESSFUL;
804 /******************************************************************************
805 * LsaSetSecret [ADVAPI32.@]
807 * Set old and new values on a secret handle
810 * SecretHandle [I] Handle to a secret object.
811 * EncryptedCurrentValue [I] Pointer to encrypted new value, can be NULL
812 * EncryptedOldValue [I] Pointer to encrypted old value, can be NULL
815 * Success: STATUS_SUCCESS
816 * Failure: NTSTATUS code.
818 NTSTATUS WINAPI LsaSetSecret(
819 IN LSA_HANDLE SecretHandle,
820 IN PLSA_UNICODE_STRING EncryptedCurrentValue,
821 IN PLSA_UNICODE_STRING EncryptedOldValue)
823 FIXME("(%p,%p,%p) stub\n", SecretHandle, EncryptedCurrentValue,
825 return STATUS_SUCCESS;
828 /******************************************************************************
829 * LsaSetTrustedDomainInfoByName [ADVAPI32.@]
832 NTSTATUS WINAPI LsaSetTrustedDomainInfoByName(
834 PLSA_UNICODE_STRING name,
835 TRUSTED_INFORMATION_CLASS class,
838 FIXME("(%p,%p,%d,%p) stub\n", policy, name, class, buffer);
839 return STATUS_SUCCESS;
842 /******************************************************************************
843 * LsaSetTrustedDomainInformation [ADVAPI32.@]
846 NTSTATUS WINAPI LsaSetTrustedDomainInformation(
849 TRUSTED_INFORMATION_CLASS class,
852 FIXME("(%p,%p,%d,%p) stub\n", policy, sid, class, buffer);
853 return STATUS_SUCCESS;
856 /******************************************************************************
857 * LsaStorePrivateData [ADVAPI32.@]
859 * Stores or deletes a Policy object's data under the specified reg key.
862 * PolicyHandle [I] Handle to a Policy object.
863 * KeyName [I] Name of the key where the data will be stored.
864 * PrivateData [O] Pointer to the private data.
867 * Success: STATUS_SUCCESS.
868 * Failure: STATUS_OBJECT_NAME_NOT_FOUND or NTSTATUS code.
870 NTSTATUS WINAPI LsaStorePrivateData(
871 IN LSA_HANDLE PolicyHandle,
872 IN PLSA_UNICODE_STRING KeyName,
873 IN PLSA_UNICODE_STRING PrivateData)
875 FIXME("(%p,%p,%p) stub\n", PolicyHandle, KeyName, PrivateData);
876 return STATUS_OBJECT_NAME_NOT_FOUND;
879 /******************************************************************************
880 * LsaUnregisterPolicyChangeNotification [ADVAPI32.@]
883 NTSTATUS WINAPI LsaUnregisterPolicyChangeNotification(
884 POLICY_NOTIFICATION_INFORMATION_CLASS class,
887 FIXME("(%d,%p) stub\n", class, event);
888 return STATUS_SUCCESS;