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