server: Fix token_access_check to allow full access to security descriptors with...
[wine] / dlls / advapi32 / lsa.c
1 /*
2  * Implementation of the Local Security Authority API
3  *
4  * Copyright 1999 Juergen Schmied
5  * Copyright 2002 Andriy Palamarchuk
6  * Copyright 2004 Mike McCormack
7  * Copyright 2005 Hans Leidekker
8  *
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.
13  *
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.
18  *
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
22  */
23
24 #include <stdarg.h>
25
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"
34
35 #include "wine/debug.h"
36
37 WINE_DEFAULT_DEBUG_CHANNEL(advapi);
38
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; \
45 }
46
47 static void dumpLsaAttributes(const LSA_OBJECT_ATTRIBUTES *oa)
48 {
49     if (oa)
50     {
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);
56     }
57 }
58
59 static void* ADVAPI_GetDomainName(unsigned sz, unsigned ofs)
60 {
61     HKEY key;
62     LONG ret;
63     BYTE* ptr = NULL;
64     UNICODE_STRING* ustr;
65
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'};
71
72     ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, wVNETSUP, 0, KEY_READ, &key);
73     if (ret == ERROR_SUCCESS)
74     {
75         DWORD size = 0;
76         static const WCHAR wg[] = { 'W','o','r','k','g','r','o','u','p',0 };
77
78         ret = RegQueryValueExW(key, wg, NULL, NULL, NULL, &size);
79         if (ret == ERROR_MORE_DATA || ret == ERROR_SUCCESS)
80         {
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)
88             {
89                 HeapFree(GetProcessHeap(), 0, ptr);
90                 ptr = NULL;
91             }   
92             else ustr->Length = size - sizeof(WCHAR);
93         }
94         RegCloseKey(key);
95     }
96     if (!ptr)
97     {
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));
107     }
108     return ptr;
109 }
110
111 /******************************************************************************
112  * LsaAddAccountRights [ADVAPI32.@]
113  *
114  */
115 NTSTATUS WINAPI LsaAddAccountRights(
116     LSA_HANDLE policy,
117     PSID sid,
118     PLSA_UNICODE_STRING rights,
119     ULONG count)
120 {
121     FIXME("(%p,%p,%p,0x%08x) stub\n", policy, sid, rights, count);
122     return STATUS_OBJECT_NAME_NOT_FOUND;
123 }
124
125 /******************************************************************************
126  * LsaClose [ADVAPI32.@]
127  *
128  * Closes a handle to a Policy or TrustedDomain.
129  *
130  * PARAMS
131  *  ObjectHandle [I] Handle to a Policy or TrustedDomain.
132  *
133  * RETURNS
134  *  Success: STATUS_SUCCESS.
135  *  Failure: NTSTATUS code.
136  */
137 NTSTATUS WINAPI LsaClose(IN LSA_HANDLE ObjectHandle)
138 {
139     FIXME("(%p) stub\n", ObjectHandle);
140     return STATUS_SUCCESS;
141 }
142
143 /******************************************************************************
144  * LsaCreateTrustedDomainEx [ADVAPI32.@]
145  *
146  */
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)
153 {
154     FIXME("(%p,%p,%p,0x%08x,%p) stub\n", policy, domain_info, auth_info,
155           access, domain);
156     return STATUS_SUCCESS;
157 }
158
159 /******************************************************************************
160  * LsaDeleteTrustedDomain [ADVAPI32.@]
161  *
162  */
163 NTSTATUS WINAPI LsaDeleteTrustedDomain(LSA_HANDLE policy, PSID sid)
164 {
165     FIXME("(%p,%p) stub\n", policy, sid);
166     return STATUS_SUCCESS;
167 }
168
169 /******************************************************************************
170  * LsaEnumerateAccountRights [ADVAPI32.@]
171  *
172  */
173 NTSTATUS WINAPI LsaEnumerateAccountRights(
174     LSA_HANDLE policy,
175     PSID sid,
176     PLSA_UNICODE_STRING *rights,
177     PULONG count)
178 {
179     FIXME("(%p,%p,%p,%p) stub\n", policy, sid, rights, count);
180     return STATUS_OBJECT_NAME_NOT_FOUND;
181 }
182
183 /******************************************************************************
184  * LsaEnumerateAccountsWithUserRight [ADVAPI32.@]
185  *
186  */
187 NTSTATUS WINAPI LsaEnumerateAccountsWithUserRight(
188     LSA_HANDLE policy,
189     PLSA_UNICODE_STRING rights,
190     PVOID *buffer,
191     PULONG count)
192 {
193     FIXME("(%p,%p,%p,%p) stub\n", policy, rights, buffer, count);
194     return STATUS_NO_MORE_ENTRIES;
195 }
196
197 /******************************************************************************
198  * LsaEnumerateTrustedDomains [ADVAPI32.@]
199  *
200  * Returns the names and SIDs of trusted domains.
201  *
202  * PARAMS
203  *  PolicyHandle          [I] Handle to a Policy object.
204  *  EnumerationContext    [I] Pointer to an enumeration handle.
205  *  Buffer                [O] Contains the names and SIDs of trusted domains.
206  *  PreferredMaximumLength[I] Preferred maximum size in bytes of Buffer.
207  *  CountReturned         [O] Number of elements in Buffer.
208  *
209  * RETURNS
210  *  Success: STATUS_SUCCESS,
211  *           STATUS_MORE_ENTRIES,
212  *           STATUS_NO_MORE_ENTRIES
213  *  Failure: NTSTATUS code.
214  *
215  * NOTES
216  *  LsaEnumerateTrustedDomains can be called multiple times to enumerate
217  *  all trusted domains.
218  */
219 NTSTATUS WINAPI LsaEnumerateTrustedDomains(
220     IN LSA_HANDLE PolicyHandle,
221     IN PLSA_ENUMERATION_HANDLE EnumerationContext,
222     OUT PVOID* Buffer,
223     IN ULONG PreferredMaximumLength,
224     OUT PULONG CountReturned)
225 {
226     FIXME("(%p,%p,%p,0x%08x,%p) stub\n", PolicyHandle, EnumerationContext,
227           Buffer, PreferredMaximumLength, CountReturned);
228
229     if (CountReturned) *CountReturned = 0;
230     return STATUS_SUCCESS;
231 }
232
233 /******************************************************************************
234  * LsaEnumerateTrustedDomainsEx [ADVAPI32.@]
235  *
236  */
237 NTSTATUS WINAPI LsaEnumerateTrustedDomainsEx(
238     LSA_HANDLE policy,
239     PLSA_ENUMERATION_HANDLE context,
240     PVOID *buffer,
241     ULONG length,
242     PULONG count)
243 {
244     FIXME("(%p,%p,%p,0x%08x,%p) stub\n", policy, context, buffer, length, count);
245
246     if (count) *count = 0;
247     return STATUS_SUCCESS;
248 }
249
250 /******************************************************************************
251  * LsaFreeMemory [ADVAPI32.@]
252  *
253  * Frees memory allocated by a LSA function.
254  *
255  * PARAMS
256  *  Buffer [I] Memory buffer to free.
257  *
258  * RETURNS
259  *  Success: STATUS_SUCCESS.
260  *  Failure: NTSTATUS code.
261  */
262 NTSTATUS WINAPI LsaFreeMemory(IN PVOID Buffer)
263 {
264     TRACE("(%p)\n", Buffer);
265     return HeapFree(GetProcessHeap(), 0, Buffer);
266 }
267
268 /******************************************************************************
269  * LsaLookupNames [ADVAPI32.@]
270  *
271  * Returns the SIDs of an array of user, group, or local group names.
272  *
273  * PARAMS
274  *  PolicyHandle      [I] Handle to a Policy object.
275  *  Count             [I] Number of names in Names.
276  *  Names             [I] Array of names to lookup.
277  *  ReferencedDomains [O] Array of domains where the names were found.
278  *  Sids              [O] Array of SIDs corresponding to Names.
279  *
280  * RETURNS
281  *  Success: STATUS_SUCCESS,
282  *           STATUS_SOME_NOT_MAPPED
283  *  Failure: STATUS_NONE_MAPPED or NTSTATUS code.
284  */
285 NTSTATUS WINAPI LsaLookupNames(
286     IN LSA_HANDLE PolicyHandle,
287     IN ULONG Count,
288     IN PLSA_UNICODE_STRING Names,
289     OUT PLSA_REFERENCED_DOMAIN_LIST* ReferencedDomains,
290     OUT PLSA_TRANSLATED_SID* Sids)
291 {
292     FIXME("(%p,0x%08x,%p,%p,%p) stub\n", PolicyHandle, Count, Names,
293           ReferencedDomains, Sids);
294
295     return STATUS_NONE_MAPPED;
296 }
297
298 /******************************************************************************
299  * LsaLookupNames2 [ADVAPI32.@]
300  *
301  */
302 NTSTATUS WINAPI LsaLookupNames2(
303     LSA_HANDLE policy,
304     ULONG flags,
305     ULONG count,
306     PLSA_UNICODE_STRING names,
307     PLSA_REFERENCED_DOMAIN_LIST *domains,
308     PLSA_TRANSLATED_SID2 *sids)
309 {
310     FIXME("(%p,0x%08x,0x%08x,%p,%p,%p) stub\n", policy, flags, count, names, domains, sids);
311     return STATUS_NONE_MAPPED;
312 }
313
314 /******************************************************************************
315  * LsaLookupSids [ADVAPI32.@]
316  *
317  * Looks up the names that correspond to an array of SIDs.
318  *
319  * PARAMS
320  *  PolicyHandle      [I] Handle to a Policy object.
321  *  Count             [I] Number of SIDs in the Sids array.
322  *  Sids              [I] Array of SIDs to lookup.
323  *  ReferencedDomains [O] Array of domains where the sids were found.
324  *  Names             [O] Array of names corresponding to Sids.
325  *
326  * RETURNS
327  *  Success: STATUS_SUCCESS,
328  *           STATUS_SOME_NOT_MAPPED
329  *  Failure: STATUS_NONE_MAPPED or NTSTATUS code.
330  */
331 NTSTATUS WINAPI LsaLookupSids(
332     IN LSA_HANDLE PolicyHandle,
333     IN ULONG Count,
334     IN PSID *Sids,
335     OUT PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains,
336     OUT PLSA_TRANSLATED_NAME *Names )
337 {
338     FIXME("(%p,%u,%p,%p,%p) stub\n", PolicyHandle, Count, Sids,
339           ReferencedDomains, Names);
340
341     return STATUS_NONE_MAPPED;
342 }
343
344 /******************************************************************************
345  * LsaNtStatusToWinError [ADVAPI32.@]
346  *
347  * Converts an LSA NTSTATUS code to a Windows error code.
348  *
349  * PARAMS
350  *  Status [I] NTSTATUS code.
351  *
352  * RETURNS
353  *  Success: Corresponding Windows error code.
354  *  Failure: ERROR_MR_MID_NOT_FOUND.
355  */
356 ULONG WINAPI LsaNtStatusToWinError(NTSTATUS Status)
357 {
358     return RtlNtStatusToDosError(Status);
359 }
360
361 /******************************************************************************
362  * LsaOpenPolicy [ADVAPI32.@]
363  *
364  * Opens a handle to the Policy object on a local or remote system.
365  *
366  * PARAMS
367  *  SystemName       [I] Name of the target system.
368  *  ObjectAttributes [I] Connection attributes.
369  *  DesiredAccess    [I] Requested access rights.
370  *  PolicyHandle     [I/O] Handle to the Policy object.
371  *
372  * RETURNS
373  *  Success: STATUS_SUCCESS.
374  *  Failure: NTSTATUS code.
375  *
376  * NOTES
377  *  Set SystemName to NULL to open the local Policy object.
378  */
379 NTSTATUS WINAPI LsaOpenPolicy(
380     IN PLSA_UNICODE_STRING SystemName,
381     IN PLSA_OBJECT_ATTRIBUTES ObjectAttributes,
382     IN ACCESS_MASK DesiredAccess,
383     IN OUT PLSA_HANDLE PolicyHandle)
384 {
385     FIXME("(%s,%p,0x%08x,%p) stub\n",
386           SystemName?debugstr_w(SystemName->Buffer):"(null)",
387           ObjectAttributes, DesiredAccess, PolicyHandle);
388
389     ADVAPI_ForceLocalComputer(SystemName ? SystemName->Buffer : NULL,
390                               STATUS_ACCESS_VIOLATION);
391     dumpLsaAttributes(ObjectAttributes);
392
393     if(PolicyHandle) *PolicyHandle = (LSA_HANDLE)0xcafe;
394     return STATUS_SUCCESS;
395 }
396
397 /******************************************************************************
398  * LsaOpenTrustedDomainByName [ADVAPI32.@]
399  *
400  */
401 NTSTATUS WINAPI LsaOpenTrustedDomainByName(
402     LSA_HANDLE policy,
403     PLSA_UNICODE_STRING name,
404     ACCESS_MASK access,
405     PLSA_HANDLE handle)
406 {
407     FIXME("(%p,%p,0x%08x,%p) stub\n", policy, name, access, handle);
408     return STATUS_OBJECT_NAME_NOT_FOUND;
409 }
410
411 /******************************************************************************
412  * LsaQueryInformationPolicy [ADVAPI32.@]
413  *
414  * Returns information about a Policy object.
415  *
416  * PARAMS
417  *  PolicyHandle     [I] Handle to a Policy object.
418  *  InformationClass [I] Type of information to retrieve.
419  *  Buffer           [O] Pointer to the requested information.
420  *
421  * RETURNS
422  *  Success: STATUS_SUCCESS.
423  *  Failure: NTSTATUS code.
424  */
425 NTSTATUS WINAPI LsaQueryInformationPolicy(
426     IN LSA_HANDLE PolicyHandle,
427     IN POLICY_INFORMATION_CLASS InformationClass,
428     OUT PVOID *Buffer)
429 {
430     TRACE("(%p,0x%08x,%p)\n", PolicyHandle, InformationClass, Buffer);
431
432     if(!Buffer) return STATUS_INVALID_PARAMETER;
433     switch (InformationClass)
434     {
435         case PolicyAuditEventsInformation: /* 2 */
436         {
437             PPOLICY_AUDIT_EVENTS_INFO p = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
438                                                     sizeof(POLICY_AUDIT_EVENTS_INFO));
439             p->AuditingMode = FALSE; /* no auditing */
440             *Buffer = p;
441         }
442         break;
443         case PolicyPrimaryDomainInformation: /* 3 */
444         {
445             /* Only the domain name is valid for the local computer.
446              * All other fields are zero.
447              */
448             PPOLICY_PRIMARY_DOMAIN_INFO pinfo;
449
450             pinfo = ADVAPI_GetDomainName(sizeof(*pinfo), offsetof(POLICY_PRIMARY_DOMAIN_INFO, Name));
451
452             TRACE("setting domain to %s\n", debugstr_w(pinfo->Name.Buffer));
453
454             *Buffer = pinfo;
455         }
456         break;
457         case PolicyAccountDomainInformation: /* 5 */
458         {
459             struct di
460             {
461                 POLICY_ACCOUNT_DOMAIN_INFO info;
462                 SID sid;
463                 DWORD padding[3];
464                 WCHAR domain[MAX_COMPUTERNAME_LENGTH + 1];
465             };
466
467             DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1;
468             struct di * xdi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*xdi));
469
470             xdi->info.DomainName.MaximumLength = dwSize * sizeof(WCHAR);
471             xdi->info.DomainName.Buffer = xdi->domain;
472             if (GetComputerNameW(xdi->info.DomainName.Buffer, &dwSize))
473                 xdi->info.DomainName.Length = dwSize * sizeof(WCHAR);
474
475             TRACE("setting name to %s\n", debugstr_w(xdi->info.DomainName.Buffer));
476
477             xdi->info.DomainSid = &xdi->sid;
478
479             /* read the computer SID from the registry */
480             if (!ADVAPI_GetComputerSid(&xdi->sid))
481             {
482                 HeapFree(GetProcessHeap(), 0, xdi);
483
484                 WARN("Computer SID not found\n");
485
486                 return STATUS_UNSUCCESSFUL;
487             }
488
489             TRACE("setting SID to %s\n", debugstr_sid(&xdi->sid));
490
491             *Buffer = xdi;
492         }
493         break;
494         case  PolicyDnsDomainInformation:       /* 12 (0xc) */
495         {
496             /* Only the domain name is valid for the local computer.
497              * All other fields are zero.
498              */
499             PPOLICY_DNS_DOMAIN_INFO pinfo;
500
501             pinfo = ADVAPI_GetDomainName(sizeof(*pinfo), offsetof(POLICY_DNS_DOMAIN_INFO, Name));
502
503             TRACE("setting domain to %s\n", debugstr_w(pinfo->Name.Buffer));
504
505             *Buffer = pinfo;
506         }
507         break;
508         case  PolicyAuditLogInformation:
509         case  PolicyPdAccountInformation:
510         case  PolicyLsaServerRoleInformation:
511         case  PolicyReplicaSourceInformation:
512         case  PolicyDefaultQuotaInformation:
513         case  PolicyModificationInformation:
514         case  PolicyAuditFullSetInformation:
515         case  PolicyAuditFullQueryInformation:
516         {
517             FIXME("category %d not implemented\n", InformationClass);
518             return STATUS_UNSUCCESSFUL;
519         }
520     }
521     return STATUS_SUCCESS;
522 }
523
524 /******************************************************************************
525  * LsaQueryTrustedDomainInfo [ADVAPI32.@]
526  *
527  */
528 NTSTATUS WINAPI LsaQueryTrustedDomainInfo(
529     LSA_HANDLE policy,
530     PSID sid,
531     TRUSTED_INFORMATION_CLASS class,
532     PVOID *buffer)
533 {
534     FIXME("(%p,%p,%d,%p) stub\n", policy, sid, class, buffer);
535     return STATUS_OBJECT_NAME_NOT_FOUND;
536 }
537
538 /******************************************************************************
539  * LsaQueryTrustedDomainInfoByName [ADVAPI32.@]
540  *
541  */
542 NTSTATUS WINAPI LsaQueryTrustedDomainInfoByName(
543     LSA_HANDLE policy,
544     PLSA_UNICODE_STRING name,
545     TRUSTED_INFORMATION_CLASS class,
546     PVOID *buffer)
547 {
548     FIXME("(%p,%p,%d,%p) stub\n", policy, name, class, buffer);
549     return STATUS_OBJECT_NAME_NOT_FOUND;
550 }
551
552 /******************************************************************************
553  * LsaRegisterPolicyChangeNotification [ADVAPI32.@]
554  *
555  */
556 NTSTATUS WINAPI LsaRegisterPolicyChangeNotification(
557     POLICY_NOTIFICATION_INFORMATION_CLASS class,
558     HANDLE event)
559 {
560     FIXME("(%d,%p) stub\n", class, event);
561     return STATUS_UNSUCCESSFUL;
562 }
563
564 /******************************************************************************
565  * LsaRemoveAccountRights [ADVAPI32.@]
566  *
567  */
568 NTSTATUS WINAPI LsaRemoveAccountRights(
569     LSA_HANDLE policy,
570     PSID sid,
571     BOOLEAN all,
572     PLSA_UNICODE_STRING rights,
573     ULONG count)
574 {
575     FIXME("(%p,%p,%d,%p,0x%08x) stub\n", policy, sid, all, rights, count);
576     return STATUS_SUCCESS;
577 }
578
579 /******************************************************************************
580  * LsaRetrievePrivateData [ADVAPI32.@]
581  *
582  * Retrieves data stored by LsaStorePrivateData.
583  *
584  * PARAMS
585  *  PolicyHandle [I] Handle to a Policy object.
586  *  KeyName      [I] Name of the key where the data is stored.
587  *  PrivateData  [O] Pointer to the private data.
588  *
589  * RETURNS
590  *  Success: STATUS_SUCCESS.
591  *  Failure: STATUS_OBJECT_NAME_NOT_FOUND or NTSTATUS code.
592  */
593 NTSTATUS WINAPI LsaRetrievePrivateData(
594     IN LSA_HANDLE PolicyHandle,
595     IN PLSA_UNICODE_STRING KeyName,
596     OUT PLSA_UNICODE_STRING* PrivateData)
597 {
598     FIXME("(%p,%p,%p) stub\n", PolicyHandle, KeyName, PrivateData);
599     return STATUS_OBJECT_NAME_NOT_FOUND;
600 }
601
602 /******************************************************************************
603  * LsaSetInformationPolicy [ADVAPI32.@]
604  *
605  * Modifies information in a Policy object.
606  *
607  * PARAMS
608  *  PolicyHandle     [I] Handle to a Policy object.
609  *  InformationClass [I] Type of information to set.
610  *  Buffer           [I] Pointer to the information to set.
611  *
612  * RETURNS
613  *  Success: STATUS_SUCCESS.
614  *  Failure: NTSTATUS code.
615  */
616 NTSTATUS WINAPI LsaSetInformationPolicy(
617     IN LSA_HANDLE PolicyHandle,
618     IN POLICY_INFORMATION_CLASS InformationClass,
619     IN PVOID Buffer)
620 {
621     FIXME("(%p,0x%08x,%p) stub\n", PolicyHandle, InformationClass, Buffer);
622
623     return STATUS_UNSUCCESSFUL;
624 }
625
626 /******************************************************************************
627  * LsaSetTrustedDomainInfoByName [ADVAPI32.@]
628  *
629  */
630 NTSTATUS WINAPI LsaSetTrustedDomainInfoByName(
631     LSA_HANDLE policy,
632     PLSA_UNICODE_STRING name,
633     TRUSTED_INFORMATION_CLASS class,
634     PVOID buffer)
635 {
636     FIXME("(%p,%p,%d,%p) stub\n", policy, name, class, buffer);
637     return STATUS_SUCCESS;
638 }
639
640 /******************************************************************************
641  * LsaSetTrustedDomainInformation [ADVAPI32.@]
642  *
643  */
644 NTSTATUS WINAPI LsaSetTrustedDomainInformation(
645     LSA_HANDLE policy,
646     PSID sid,
647     TRUSTED_INFORMATION_CLASS class,
648     PVOID buffer)
649 {
650     FIXME("(%p,%p,%d,%p) stub\n", policy, sid, class, buffer);
651     return STATUS_SUCCESS;
652 }
653
654 /******************************************************************************
655  * LsaStorePrivateData [ADVAPI32.@]
656  *
657  * Stores or deletes a Policy object's data under the specified reg key.
658  *
659  * PARAMS
660  *  PolicyHandle [I] Handle to a Policy object.
661  *  KeyName      [I] Name of the key where the data will be stored.
662  *  PrivateData  [O] Pointer to the private data.
663  *
664  * RETURNS
665  *  Success: STATUS_SUCCESS.
666  *  Failure: STATUS_OBJECT_NAME_NOT_FOUND or NTSTATUS code.
667  */
668 NTSTATUS WINAPI LsaStorePrivateData(
669     IN LSA_HANDLE PolicyHandle,
670     IN PLSA_UNICODE_STRING KeyName,
671     IN PLSA_UNICODE_STRING PrivateData)
672 {
673     FIXME("(%p,%p,%p) stub\n", PolicyHandle, KeyName, PrivateData);
674     return STATUS_OBJECT_NAME_NOT_FOUND;
675 }
676
677 /******************************************************************************
678  * LsaUnregisterPolicyChangeNotification [ADVAPI32.@]
679  *
680  */
681 NTSTATUS WINAPI LsaUnregisterPolicyChangeNotification(
682     POLICY_NOTIFICATION_INFORMATION_CLASS class,
683     HANDLE event)
684 {
685     FIXME("(%d,%p) stub\n", class, event);
686     return STATUS_SUCCESS;
687 }