mshtml: Check for null pointers in IHTMLLocation_get*.
[wine/hramrach.git] / dlls / advapi32 / lsa.c
bloba0a332eed962cec1daa481039f730dd257d60db8
1 /*
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
24 #include <stdarg.h>
26 #include "ntstatus.h"
27 #define WIN32_NO_STATUS
28 #include "windef.h"
29 #include "winbase.h"
30 #include "winreg.h"
31 #include "winternl.h"
32 #include "ntsecapi.h"
33 #include "advapi32_misc.h"
35 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(advapi);
39 #define ADVAPI_ForceLocalComputer(ServerName, FailureCode) \
40 if (!ADVAPI_IsLocalComputer(ServerName)) \
41 { \
42 FIXME("Action Implemented for local computer only. " \
43 "Requested for server %s\n", debugstr_w(ServerName)); \
44 return FailureCode; \
47 static void dumpLsaAttributes(const LSA_OBJECT_ATTRIBUTES *oa)
49 if (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)
61 HKEY key;
62 LONG ret;
63 BYTE* ptr = NULL;
64 UNICODE_STRING* ustr;
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)
75 DWORD size = 0;
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);
90 ptr = NULL;
92 else ustr->Length = size - sizeof(WCHAR);
94 RegCloseKey(key);
96 if (!ptr)
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));
108 return ptr;
111 /******************************************************************************
112 * LsaAddAccountRights [ADVAPI32.@]
115 NTSTATUS WINAPI LsaAddAccountRights(
116 LSA_HANDLE policy,
117 PSID sid,
118 PLSA_UNICODE_STRING rights,
119 ULONG count)
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.
130 * PARAMS
131 * ObjectHandle [I] Handle to a Policy or TrustedDomain.
133 * RETURNS
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(
148 LSA_HANDLE policy,
149 PTRUSTED_DOMAIN_INFORMATION_EX domain_info,
150 PTRUSTED_DOMAIN_AUTH_INFORMATION auth_info,
151 ACCESS_MASK access,
152 PLSA_HANDLE domain)
154 FIXME("(%p,%p,%p,0x%08x,%p) stub\n", policy, domain_info, auth_info,
155 access, domain);
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(
174 LSA_HANDLE policy,
175 PSID sid,
176 PLSA_UNICODE_STRING *rights,
177 PULONG count)
179 FIXME("(%p,%p,%p,%p) stub\n", policy, sid, rights, count);
180 *rights = 0;
181 *count = 0;
182 return STATUS_OBJECT_NAME_NOT_FOUND;
185 /******************************************************************************
186 * LsaEnumerateAccountsWithUserRight [ADVAPI32.@]
189 NTSTATUS WINAPI LsaEnumerateAccountsWithUserRight(
190 LSA_HANDLE policy,
191 PLSA_UNICODE_STRING rights,
192 PVOID *buffer,
193 PULONG count)
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.
204 * PARAMS
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.
211 * RETURNS
212 * Success: STATUS_SUCCESS,
213 * STATUS_MORE_ENTRIES,
214 * STATUS_NO_MORE_ENTRIES
215 * Failure: NTSTATUS code.
217 * NOTES
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,
224 OUT PVOID* Buffer,
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(
240 LSA_HANDLE policy,
241 PLSA_ENUMERATION_HANDLE context,
242 PVOID *buffer,
243 ULONG length,
244 PULONG count)
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.
257 * PARAMS
258 * Buffer [I] Memory buffer to free.
260 * RETURNS
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.
277 * PARAMS
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.
284 * RETURNS
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,
291 IN ULONG Count,
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 )
305 BOOL ret;
307 ret = lookup_local_wellknown_name( name, sid, sid_size, domain, domain_size, use, handled );
308 if (!*handled)
309 ret = lookup_local_user_name( name, sid, sid_size, domain, domain_size, use, handled );
311 return ret;
314 /******************************************************************************
315 * LsaLookupNames2 [ADVAPI32.@]
318 NTSTATUS WINAPI LsaLookupNames2( LSA_HANDLE policy, ULONG flags, ULONG count,
319 PLSA_UNICODE_STRING names, PLSA_REFERENCED_DOMAIN_LIST *domains,
320 PLSA_TRANSLATED_SID2 *sids )
322 ULONG i, sid_size_total = 0, domain_size_total = 0, size, num_domains;
323 ULONG sid_size, domain_size, mapped;
324 BOOL ret, handled = FALSE;
325 SID_NAME_USE use;
326 SID *sid;
328 TRACE("(%p,0x%08x,0x%08x,%p,%p,%p)\n", policy, flags, count, names, domains, sids);
330 mapped = num_domains = 0;
331 for (i = 0; i < count; i++)
333 handled = FALSE;
334 sid_size = domain_size = 0;
335 ret = lookup_name( &names[i], NULL, &sid_size, NULL, &domain_size, &use, &handled );
336 if (handled)
338 sid_size_total += sid_size;
339 if (domain_size)
341 FIXME("domain not handled\n");
342 domain_size_total += domain_size;
343 num_domains++;
345 mapped++;
348 TRACE("mapped %u out of %u\n", mapped, count);
350 size = sizeof(LSA_TRANSLATED_SID2) * count + sid_size_total;
351 if (!(*sids = HeapAlloc( GetProcessHeap(), 0, size) )) return STATUS_NO_MEMORY;
353 sid = (SID *)(*sids + count);
355 if (!(*domains = HeapAlloc( GetProcessHeap(), 0, sizeof(LSA_REFERENCED_DOMAIN_LIST) )))
357 HeapFree( GetProcessHeap(), 0, *sids );
358 return STATUS_NO_MEMORY;
360 (*domains)->Entries = 0;
361 (*domains)->Domains = NULL;
363 for (i = 0; i < count; i++)
365 (*sids)[i].Use = SidTypeUnknown;
366 (*sids)[i].DomainIndex = -1;
367 (*sids)[i].Flags = 0;
369 handled = FALSE;
370 sid_size = sid_size_total;
371 ret = lookup_name( &names[i], sid, &sid_size, NULL, &domain_size, &use, &handled );
372 if (handled)
374 (*sids)[i].Sid = sid;
375 (*sids)[i].Use = use;
377 sid += sid_size;
378 sid_size_total -= sid_size;
382 if (mapped == count) return STATUS_SUCCESS;
383 if (mapped > 0 && mapped < count) return STATUS_SOME_NOT_MAPPED;
384 return STATUS_NONE_MAPPED;
387 /******************************************************************************
388 * LsaLookupSids [ADVAPI32.@]
390 * Looks up the names that correspond to an array of SIDs.
392 * PARAMS
393 * PolicyHandle [I] Handle to a Policy object.
394 * Count [I] Number of SIDs in the Sids array.
395 * Sids [I] Array of SIDs to lookup.
396 * ReferencedDomains [O] Array of domains where the sids were found.
397 * Names [O] Array of names corresponding to Sids.
399 * RETURNS
400 * Success: STATUS_SUCCESS,
401 * STATUS_SOME_NOT_MAPPED
402 * Failure: STATUS_NONE_MAPPED or NTSTATUS code.
404 NTSTATUS WINAPI LsaLookupSids(
405 IN LSA_HANDLE PolicyHandle,
406 IN ULONG Count,
407 IN PSID *Sids,
408 OUT PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains,
409 OUT PLSA_TRANSLATED_NAME *Names )
411 ULONG i, mapped, size;
412 ULONG name_size, domain_size;
413 SID_NAME_USE use;
415 TRACE("(%p,%u,%p,%p,%p) stub\n", PolicyHandle, Count, Sids,
416 ReferencedDomains, Names);
418 size = sizeof(LSA_TRANSLATED_NAME) * Count;
419 if (!(*Names = HeapAlloc( GetProcessHeap(), 0, size) )) return STATUS_NO_MEMORY;
420 if (!(*ReferencedDomains = HeapAlloc( GetProcessHeap(), 0, sizeof(LSA_REFERENCED_DOMAIN_LIST)) ))
422 HeapFree( GetProcessHeap(), 0, *Names);
423 return STATUS_NO_MEMORY;
425 (*ReferencedDomains)->Entries = 0;
426 (*ReferencedDomains)->Domains = NULL;
428 mapped = 0;
429 for (i = 0; i < Count; i++)
431 name_size = domain_size = 0;
432 (*Names)[i].Use = SidTypeUnknown;
433 (*Names)[i].DomainIndex = -1;
434 (*Names)[i].Name.Length = 0;
435 (*Names)[i].Name.MaximumLength = 0;
436 (*Names)[i].Name.Buffer = NULL;
437 if (LookupAccountSidW(NULL, Sids[i], NULL, &name_size, NULL, &domain_size, &use))
439 if (domain_size)
440 FIXME("domains not handled\n");
441 mapped++;
443 domain_size = 0;
444 (*Names)[i].Use = use;
445 (*Names)[i].Name.Length = name_size * sizeof(WCHAR);
446 (*Names)[i].Name.MaximumLength = name_size * sizeof(WCHAR);
447 (*Names)[i].Name.Buffer = HeapAlloc(GetProcessHeap(),0,name_size * sizeof(WCHAR));
448 LookupAccountSidW(NULL, Sids[i], (*Names)[i].Name.Buffer, &name_size, NULL, &domain_size, &use);
451 TRACE("mapped %u out of %u\n",mapped,Count);
453 if (mapped == Count) return STATUS_SUCCESS;
454 if (mapped) return STATUS_SOME_NOT_MAPPED;
455 return STATUS_NONE_MAPPED;
458 /******************************************************************************
459 * LsaNtStatusToWinError [ADVAPI32.@]
461 * Converts an LSA NTSTATUS code to a Windows error code.
463 * PARAMS
464 * Status [I] NTSTATUS code.
466 * RETURNS
467 * Success: Corresponding Windows error code.
468 * Failure: ERROR_MR_MID_NOT_FOUND.
470 ULONG WINAPI LsaNtStatusToWinError(NTSTATUS Status)
472 return RtlNtStatusToDosError(Status);
475 /******************************************************************************
476 * LsaOpenPolicy [ADVAPI32.@]
478 * Opens a handle to the Policy object on a local or remote system.
480 * PARAMS
481 * SystemName [I] Name of the target system.
482 * ObjectAttributes [I] Connection attributes.
483 * DesiredAccess [I] Requested access rights.
484 * PolicyHandle [I/O] Handle to the Policy object.
486 * RETURNS
487 * Success: STATUS_SUCCESS.
488 * Failure: NTSTATUS code.
490 * NOTES
491 * Set SystemName to NULL to open the local Policy object.
493 NTSTATUS WINAPI LsaOpenPolicy(
494 IN PLSA_UNICODE_STRING SystemName,
495 IN PLSA_OBJECT_ATTRIBUTES ObjectAttributes,
496 IN ACCESS_MASK DesiredAccess,
497 IN OUT PLSA_HANDLE PolicyHandle)
499 FIXME("(%s,%p,0x%08x,%p) stub\n",
500 SystemName?debugstr_w(SystemName->Buffer):"(null)",
501 ObjectAttributes, DesiredAccess, PolicyHandle);
503 ADVAPI_ForceLocalComputer(SystemName ? SystemName->Buffer : NULL,
504 STATUS_ACCESS_VIOLATION);
505 dumpLsaAttributes(ObjectAttributes);
507 if(PolicyHandle) *PolicyHandle = (LSA_HANDLE)0xcafe;
508 return STATUS_SUCCESS;
511 /******************************************************************************
512 * LsaOpenTrustedDomainByName [ADVAPI32.@]
515 NTSTATUS WINAPI LsaOpenTrustedDomainByName(
516 LSA_HANDLE policy,
517 PLSA_UNICODE_STRING name,
518 ACCESS_MASK access,
519 PLSA_HANDLE handle)
521 FIXME("(%p,%p,0x%08x,%p) stub\n", policy, name, access, handle);
522 return STATUS_OBJECT_NAME_NOT_FOUND;
525 /******************************************************************************
526 * LsaQueryInformationPolicy [ADVAPI32.@]
528 * Returns information about a Policy object.
530 * PARAMS
531 * PolicyHandle [I] Handle to a Policy object.
532 * InformationClass [I] Type of information to retrieve.
533 * Buffer [O] Pointer to the requested information.
535 * RETURNS
536 * Success: STATUS_SUCCESS.
537 * Failure: NTSTATUS code.
539 NTSTATUS WINAPI LsaQueryInformationPolicy(
540 IN LSA_HANDLE PolicyHandle,
541 IN POLICY_INFORMATION_CLASS InformationClass,
542 OUT PVOID *Buffer)
544 TRACE("(%p,0x%08x,%p)\n", PolicyHandle, InformationClass, Buffer);
546 if(!Buffer) return STATUS_INVALID_PARAMETER;
547 switch (InformationClass)
549 case PolicyAuditEventsInformation: /* 2 */
551 PPOLICY_AUDIT_EVENTS_INFO p = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
552 sizeof(POLICY_AUDIT_EVENTS_INFO));
553 p->AuditingMode = FALSE; /* no auditing */
554 *Buffer = p;
556 break;
557 case PolicyPrimaryDomainInformation: /* 3 */
559 /* Only the domain name is valid for the local computer.
560 * All other fields are zero.
562 PPOLICY_PRIMARY_DOMAIN_INFO pinfo;
564 pinfo = ADVAPI_GetDomainName(sizeof(*pinfo), offsetof(POLICY_PRIMARY_DOMAIN_INFO, Name));
566 TRACE("setting domain to %s\n", debugstr_w(pinfo->Name.Buffer));
568 *Buffer = pinfo;
570 break;
571 case PolicyAccountDomainInformation: /* 5 */
573 struct di
575 POLICY_ACCOUNT_DOMAIN_INFO info;
576 SID sid;
577 DWORD padding[3];
578 WCHAR domain[MAX_COMPUTERNAME_LENGTH + 1];
581 DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1;
582 struct di * xdi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*xdi));
584 xdi->info.DomainName.MaximumLength = dwSize * sizeof(WCHAR);
585 xdi->info.DomainName.Buffer = xdi->domain;
586 if (GetComputerNameW(xdi->info.DomainName.Buffer, &dwSize))
587 xdi->info.DomainName.Length = dwSize * sizeof(WCHAR);
589 TRACE("setting name to %s\n", debugstr_w(xdi->info.DomainName.Buffer));
591 xdi->info.DomainSid = &xdi->sid;
593 /* read the computer SID from the registry */
594 if (!ADVAPI_GetComputerSid(&xdi->sid))
596 HeapFree(GetProcessHeap(), 0, xdi);
598 WARN("Computer SID not found\n");
600 return STATUS_UNSUCCESSFUL;
603 TRACE("setting SID to %s\n", debugstr_sid(&xdi->sid));
605 *Buffer = xdi;
607 break;
608 case PolicyDnsDomainInformation: /* 12 (0xc) */
610 /* Only the domain name is valid for the local computer.
611 * All other fields are zero.
613 PPOLICY_DNS_DOMAIN_INFO pinfo;
615 pinfo = ADVAPI_GetDomainName(sizeof(*pinfo), offsetof(POLICY_DNS_DOMAIN_INFO, Name));
617 TRACE("setting domain to %s\n", debugstr_w(pinfo->Name.Buffer));
619 *Buffer = pinfo;
621 break;
622 case PolicyAuditLogInformation:
623 case PolicyPdAccountInformation:
624 case PolicyLsaServerRoleInformation:
625 case PolicyReplicaSourceInformation:
626 case PolicyDefaultQuotaInformation:
627 case PolicyModificationInformation:
628 case PolicyAuditFullSetInformation:
629 case PolicyAuditFullQueryInformation:
631 FIXME("category %d not implemented\n", InformationClass);
632 return STATUS_UNSUCCESSFUL;
635 return STATUS_SUCCESS;
638 /******************************************************************************
639 * LsaQueryTrustedDomainInfo [ADVAPI32.@]
642 NTSTATUS WINAPI LsaQueryTrustedDomainInfo(
643 LSA_HANDLE policy,
644 PSID sid,
645 TRUSTED_INFORMATION_CLASS class,
646 PVOID *buffer)
648 FIXME("(%p,%p,%d,%p) stub\n", policy, sid, class, buffer);
649 return STATUS_OBJECT_NAME_NOT_FOUND;
652 /******************************************************************************
653 * LsaQueryTrustedDomainInfoByName [ADVAPI32.@]
656 NTSTATUS WINAPI LsaQueryTrustedDomainInfoByName(
657 LSA_HANDLE policy,
658 PLSA_UNICODE_STRING name,
659 TRUSTED_INFORMATION_CLASS class,
660 PVOID *buffer)
662 FIXME("(%p,%p,%d,%p) stub\n", policy, name, class, buffer);
663 return STATUS_OBJECT_NAME_NOT_FOUND;
666 /******************************************************************************
667 * LsaRegisterPolicyChangeNotification [ADVAPI32.@]
670 NTSTATUS WINAPI LsaRegisterPolicyChangeNotification(
671 POLICY_NOTIFICATION_INFORMATION_CLASS class,
672 HANDLE event)
674 FIXME("(%d,%p) stub\n", class, event);
675 return STATUS_UNSUCCESSFUL;
678 /******************************************************************************
679 * LsaRemoveAccountRights [ADVAPI32.@]
682 NTSTATUS WINAPI LsaRemoveAccountRights(
683 LSA_HANDLE policy,
684 PSID sid,
685 BOOLEAN all,
686 PLSA_UNICODE_STRING rights,
687 ULONG count)
689 FIXME("(%p,%p,%d,%p,0x%08x) stub\n", policy, sid, all, rights, count);
690 return STATUS_SUCCESS;
693 /******************************************************************************
694 * LsaRetrievePrivateData [ADVAPI32.@]
696 * Retrieves data stored by LsaStorePrivateData.
698 * PARAMS
699 * PolicyHandle [I] Handle to a Policy object.
700 * KeyName [I] Name of the key where the data is stored.
701 * PrivateData [O] Pointer to the private data.
703 * RETURNS
704 * Success: STATUS_SUCCESS.
705 * Failure: STATUS_OBJECT_NAME_NOT_FOUND or NTSTATUS code.
707 NTSTATUS WINAPI LsaRetrievePrivateData(
708 IN LSA_HANDLE PolicyHandle,
709 IN PLSA_UNICODE_STRING KeyName,
710 OUT PLSA_UNICODE_STRING* PrivateData)
712 FIXME("(%p,%p,%p) stub\n", PolicyHandle, KeyName, PrivateData);
713 return STATUS_OBJECT_NAME_NOT_FOUND;
716 /******************************************************************************
717 * LsaSetInformationPolicy [ADVAPI32.@]
719 * Modifies information in a Policy object.
721 * PARAMS
722 * PolicyHandle [I] Handle to a Policy object.
723 * InformationClass [I] Type of information to set.
724 * Buffer [I] Pointer to the information to set.
726 * RETURNS
727 * Success: STATUS_SUCCESS.
728 * Failure: NTSTATUS code.
730 NTSTATUS WINAPI LsaSetInformationPolicy(
731 IN LSA_HANDLE PolicyHandle,
732 IN POLICY_INFORMATION_CLASS InformationClass,
733 IN PVOID Buffer)
735 FIXME("(%p,0x%08x,%p) stub\n", PolicyHandle, InformationClass, Buffer);
737 return STATUS_UNSUCCESSFUL;
740 /******************************************************************************
741 * LsaSetSecret [ADVAPI32.@]
743 * Set old and new values on a secret handle
745 * PARAMS
746 * SecretHandle [I] Handle to a secret object.
747 * EncryptedCurrentValue [I] Pointer to encrypted new value, can be NULL
748 * EncryptedOldValue [I] Pointer to encrypted old value, can be NULL
750 * RETURNS
751 * Success: STATUS_SUCCESS
752 * Failure: NTSTATUS code.
754 NTSTATUS WINAPI LsaSetSecret(
755 IN LSA_HANDLE SecretHandle,
756 IN PLSA_UNICODE_STRING EncryptedCurrentValue,
757 IN PLSA_UNICODE_STRING EncryptedOldValue)
759 FIXME("(%p,%p,%p) stub\n", SecretHandle, EncryptedCurrentValue,
760 EncryptedOldValue);
761 return STATUS_SUCCESS;
764 /******************************************************************************
765 * LsaSetTrustedDomainInfoByName [ADVAPI32.@]
768 NTSTATUS WINAPI LsaSetTrustedDomainInfoByName(
769 LSA_HANDLE policy,
770 PLSA_UNICODE_STRING name,
771 TRUSTED_INFORMATION_CLASS class,
772 PVOID buffer)
774 FIXME("(%p,%p,%d,%p) stub\n", policy, name, class, buffer);
775 return STATUS_SUCCESS;
778 /******************************************************************************
779 * LsaSetTrustedDomainInformation [ADVAPI32.@]
782 NTSTATUS WINAPI LsaSetTrustedDomainInformation(
783 LSA_HANDLE policy,
784 PSID sid,
785 TRUSTED_INFORMATION_CLASS class,
786 PVOID buffer)
788 FIXME("(%p,%p,%d,%p) stub\n", policy, sid, class, buffer);
789 return STATUS_SUCCESS;
792 /******************************************************************************
793 * LsaStorePrivateData [ADVAPI32.@]
795 * Stores or deletes a Policy object's data under the specified reg key.
797 * PARAMS
798 * PolicyHandle [I] Handle to a Policy object.
799 * KeyName [I] Name of the key where the data will be stored.
800 * PrivateData [O] Pointer to the private data.
802 * RETURNS
803 * Success: STATUS_SUCCESS.
804 * Failure: STATUS_OBJECT_NAME_NOT_FOUND or NTSTATUS code.
806 NTSTATUS WINAPI LsaStorePrivateData(
807 IN LSA_HANDLE PolicyHandle,
808 IN PLSA_UNICODE_STRING KeyName,
809 IN PLSA_UNICODE_STRING PrivateData)
811 FIXME("(%p,%p,%p) stub\n", PolicyHandle, KeyName, PrivateData);
812 return STATUS_OBJECT_NAME_NOT_FOUND;
815 /******************************************************************************
816 * LsaUnregisterPolicyChangeNotification [ADVAPI32.@]
819 NTSTATUS WINAPI LsaUnregisterPolicyChangeNotification(
820 POLICY_NOTIFICATION_INFORMATION_CLASS class,
821 HANDLE event)
823 FIXME("(%d,%p) stub\n", class, event);
824 return STATUS_SUCCESS;