2 * Copyright 1999, 2000 Juergen Schmied <juergen.schmied@debitel.net>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * FIXME: for all functions thunking down to Rtl* functions: implement SetLastError()
28 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(advapi);
32 #define CallWin32ToNt(func) \
35 if (ret !=STATUS_SUCCESS) \
36 { SetLastError (RtlNtStatusToDosError(ret)); return FALSE; } \
40 static void dumpLsaAttributes( PLSA_OBJECT_ATTRIBUTES oa )
44 TRACE("\n\tlength=%lu, rootdir=0x%08x, objectname=%s\n\tattr=0x%08lx, sid=%p qos=%p\n",
45 oa->Length, oa->RootDirectory,
46 oa->ObjectName?debugstr_w(oa->ObjectName->Buffer):"null",
47 oa->Attributes, oa->SecurityDescriptor, oa->SecurityQualityOfService);
51 /* ##############################
52 ###### TOKEN FUNCTIONS ######
53 ##############################
56 /******************************************************************************
57 * OpenProcessToken [ADVAPI32.@]
58 * Opens the access token associated with a process
61 * ProcessHandle [I] Handle to process
62 * DesiredAccess [I] Desired access to process
63 * TokenHandle [O] Pointer to handle of open access token
68 OpenProcessToken( HANDLE ProcessHandle, DWORD DesiredAccess,
71 CallWin32ToNt(NtOpenProcessToken( ProcessHandle, DesiredAccess, TokenHandle ));
74 /******************************************************************************
75 * OpenThreadToken [ADVAPI32.@]
84 OpenThreadToken( HANDLE ThreadHandle, DWORD DesiredAccess,
85 BOOL OpenAsSelf, HANDLE *TokenHandle)
87 CallWin32ToNt (NtOpenThreadToken(ThreadHandle, DesiredAccess, OpenAsSelf, TokenHandle));
90 /******************************************************************************
91 * AdjustTokenPrivileges [ADVAPI32.@]
95 * DisableAllPrivileges []
102 AdjustTokenPrivileges( HANDLE TokenHandle, BOOL DisableAllPrivileges,
103 LPVOID NewState, DWORD BufferLength,
104 LPVOID PreviousState, LPDWORD ReturnLength )
106 CallWin32ToNt(NtAdjustPrivilegesToken(TokenHandle, DisableAllPrivileges, NewState, BufferLength, PreviousState, ReturnLength));
109 /******************************************************************************
110 * CheckTokenMembership [ADVAPI32.@]
118 CheckTokenMembership( HANDLE TokenHandle, PSID SidToCheck,
121 FIXME("(0x%08x %p %p) stub!\n", TokenHandle, SidToCheck, IsMember);
127 /******************************************************************************
128 * GetTokenInformation [ADVAPI32.@]
134 * tokeninfolength [I]
139 GetTokenInformation( HANDLE token, TOKEN_INFORMATION_CLASS tokeninfoclass,
140 LPVOID tokeninfo, DWORD tokeninfolength, LPDWORD retlen )
142 TRACE("(%x, %s, %p, %ld, %p): \n",
144 (tokeninfoclass == TokenUser) ? "TokenUser" :
145 (tokeninfoclass == TokenGroups) ? "TokenGroups" :
146 (tokeninfoclass == TokenPrivileges) ? "TokenPrivileges" :
147 (tokeninfoclass == TokenOwner) ? "TokenOwner" :
148 (tokeninfoclass == TokenPrimaryGroup) ? "TokenPrimaryGroup" :
149 (tokeninfoclass == TokenDefaultDacl) ? "TokenDefaultDacl" :
150 (tokeninfoclass == TokenSource) ? "TokenSource" :
151 (tokeninfoclass == TokenType) ? "TokenType" :
152 (tokeninfoclass == TokenImpersonationLevel) ? "TokenImpersonationLevel" :
153 (tokeninfoclass == TokenStatistics) ? "TokenStatistics" :
154 (tokeninfoclass == TokenRestrictedSids) ? "TokenRestrictedSids" :
155 (tokeninfoclass == TokenSessionId) ? "TokenSessionId" :
156 (tokeninfoclass == TokenGroupsAndPrivileges) ? "TokenGroupsAndPrivileges" :
157 (tokeninfoclass == TokenSessionReference) ? "TokenSessionReference" :
158 (tokeninfoclass == TokenSandBoxInert) ? "TokenSandBoxInert" :
160 tokeninfo, tokeninfolength, retlen);
161 CallWin32ToNt (NtQueryInformationToken( token, tokeninfoclass, tokeninfo, tokeninfolength, retlen));
164 /******************************************************************************
165 * SetTokenInformation [ADVAPI32.@]
171 * tokeninfolength [I]
175 SetTokenInformation( HANDLE token, TOKEN_INFORMATION_CLASS tokeninfoclass,
176 LPVOID tokeninfo, DWORD tokeninfolength )
178 FIXME("(%x, %s, %p, %ld): stub\n",
180 (tokeninfoclass == TokenUser) ? "TokenUser" :
181 (tokeninfoclass == TokenGroups) ? "TokenGroups" :
182 (tokeninfoclass == TokenPrivileges) ? "TokenPrivileges" :
183 (tokeninfoclass == TokenOwner) ? "TokenOwner" :
184 (tokeninfoclass == TokenPrimaryGroup) ? "TokenPrimaryGroup" :
185 (tokeninfoclass == TokenDefaultDacl) ? "TokenDefaultDacl" :
186 (tokeninfoclass == TokenSource) ? "TokenSource" :
187 (tokeninfoclass == TokenType) ? "TokenType" :
188 (tokeninfoclass == TokenImpersonationLevel) ? "TokenImpersonationLevel" :
189 (tokeninfoclass == TokenStatistics) ? "TokenStatistics" :
190 (tokeninfoclass == TokenRestrictedSids) ? "TokenRestrictedSids" :
191 (tokeninfoclass == TokenSessionId) ? "TokenSessionId" :
192 (tokeninfoclass == TokenGroupsAndPrivileges) ? "TokenGroupsAndPrivileges" :
193 (tokeninfoclass == TokenSessionReference) ? "TokenSessionReference" :
194 (tokeninfoclass == TokenSandBoxInert) ? "TokenSandBoxInert" :
196 tokeninfo, tokeninfolength);
198 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
203 /*************************************************************************
204 * SetThreadToken [ADVAPI32.@]
206 * Assigns an "impersonation token" to a thread so it can assume the
207 * security privledges of another thread or process. Can also remove
208 * a previously assigned token. Only supported on NT - it's a stub
209 * exactly like this one on Win9X.
213 BOOL WINAPI SetThreadToken(PHANDLE thread, HANDLE token)
215 FIXME("(%p, %x): stub (NT impl. only)\n", thread, token);
217 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
222 /* ##############################
223 ###### SID FUNCTIONS ######
224 ##############################
227 /******************************************************************************
228 * AllocateAndInitializeSid [ADVAPI32.@]
231 * pIdentifierAuthority []
232 * nSubAuthorityCount []
244 AllocateAndInitializeSid( PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
245 BYTE nSubAuthorityCount,
246 DWORD nSubAuthority0, DWORD nSubAuthority1,
247 DWORD nSubAuthority2, DWORD nSubAuthority3,
248 DWORD nSubAuthority4, DWORD nSubAuthority5,
249 DWORD nSubAuthority6, DWORD nSubAuthority7,
252 CallWin32ToNt (RtlAllocateAndInitializeSid(
253 pIdentifierAuthority, nSubAuthorityCount,
254 nSubAuthority0, nSubAuthority1, nSubAuthority2, nSubAuthority3,
255 nSubAuthority4, nSubAuthority5, nSubAuthority6, nSubAuthority7,
259 /******************************************************************************
260 * FreeSid [ADVAPI32.@]
269 return NULL; /* is documented like this */
272 /******************************************************************************
273 * CopySid [ADVAPI32.@]
276 * nDestinationSidLength []
281 CopySid( DWORD nDestinationSidLength, PSID pDestinationSid, PSID pSourceSid )
283 return RtlCopySid(nDestinationSidLength, pDestinationSid, pSourceSid);
286 /******************************************************************************
287 * IsValidSid [ADVAPI32.@]
293 IsValidSid( PSID pSid )
295 return RtlValidSid( pSid );
298 /******************************************************************************
299 * EqualSid [ADVAPI32.@]
306 EqualSid( PSID pSid1, PSID pSid2 )
308 return RtlEqualSid( pSid1, pSid2 );
311 /******************************************************************************
312 * EqualPrefixSid [ADVAPI32.@]
314 BOOL WINAPI EqualPrefixSid (PSID pSid1, PSID pSid2)
316 return RtlEqualPrefixSid(pSid1, pSid2);
319 /******************************************************************************
320 * GetSidLengthRequired [ADVAPI32.@]
323 * nSubAuthorityCount []
326 GetSidLengthRequired( BYTE nSubAuthorityCount )
328 return RtlLengthRequiredSid(nSubAuthorityCount);
331 /******************************************************************************
332 * InitializeSid [ADVAPI32.@]
335 * pIdentifierAuthority []
340 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
341 BYTE nSubAuthorityCount)
343 return RtlInitializeSid(pSid, pIdentifierAuthority, nSubAuthorityCount);
346 /******************************************************************************
347 * GetSidIdentifierAuthority [ADVAPI32.@]
352 PSID_IDENTIFIER_AUTHORITY WINAPI
353 GetSidIdentifierAuthority( PSID pSid )
355 return RtlIdentifierAuthoritySid(pSid);
358 /******************************************************************************
359 * GetSidSubAuthority [ADVAPI32.@]
366 GetSidSubAuthority( PSID pSid, DWORD nSubAuthority )
368 return RtlSubAuthoritySid(pSid, nSubAuthority);
371 /******************************************************************************
372 * GetSidSubAuthorityCount [ADVAPI32.@]
378 GetSidSubAuthorityCount (PSID pSid)
380 return RtlSubAuthorityCountSid(pSid);
383 /******************************************************************************
384 * GetLengthSid [ADVAPI32.@]
390 GetLengthSid (PSID pSid)
392 return RtlLengthSid(pSid);
395 /* ##############################################
396 ###### SECURITY DESCRIPTOR FUNCTIONS ######
397 ##############################################
400 /******************************************************************************
401 * InitializeSecurityDescriptor [ADVAPI32.@]
408 InitializeSecurityDescriptor( SECURITY_DESCRIPTOR *pDescr, DWORD revision )
410 CallWin32ToNt (RtlCreateSecurityDescriptor(pDescr, revision ));
413 /******************************************************************************
414 * GetSecurityDescriptorLength [ADVAPI32.@]
416 DWORD WINAPI GetSecurityDescriptorLength( SECURITY_DESCRIPTOR *pDescr)
418 return (RtlLengthSecurityDescriptor(pDescr));
421 /******************************************************************************
422 * GetSecurityDescriptorOwner [ADVAPI32.@]
426 * lpbOwnerDefaulted []
429 GetSecurityDescriptorOwner( SECURITY_DESCRIPTOR *pDescr, PSID *pOwner,
430 LPBOOL lpbOwnerDefaulted )
432 CallWin32ToNt (RtlGetOwnerSecurityDescriptor( pDescr, pOwner, (PBOOLEAN)lpbOwnerDefaulted ));
435 /******************************************************************************
436 * SetSecurityDescriptorOwner [ADVAPI32.@]
440 BOOL WINAPI SetSecurityDescriptorOwner( PSECURITY_DESCRIPTOR pSecurityDescriptor,
441 PSID pOwner, BOOL bOwnerDefaulted)
443 CallWin32ToNt (RtlSetOwnerSecurityDescriptor(pSecurityDescriptor, pOwner, bOwnerDefaulted));
445 /******************************************************************************
446 * GetSecurityDescriptorGroup [ADVAPI32.@]
448 BOOL WINAPI GetSecurityDescriptorGroup(
449 PSECURITY_DESCRIPTOR SecurityDescriptor,
451 LPBOOL GroupDefaulted)
453 CallWin32ToNt (RtlGetGroupSecurityDescriptor(SecurityDescriptor, Group, (PBOOLEAN)GroupDefaulted));
455 /******************************************************************************
456 * SetSecurityDescriptorGroup [ADVAPI32.@]
458 BOOL WINAPI SetSecurityDescriptorGroup ( PSECURITY_DESCRIPTOR SecurityDescriptor,
459 PSID Group, BOOL GroupDefaulted)
461 CallWin32ToNt (RtlSetGroupSecurityDescriptor( SecurityDescriptor, Group, GroupDefaulted));
464 /******************************************************************************
465 * IsValidSecurityDescriptor [ADVAPI32.@]
471 IsValidSecurityDescriptor( PSECURITY_DESCRIPTOR SecurityDescriptor )
473 CallWin32ToNt (RtlValidSecurityDescriptor(SecurityDescriptor));
476 /******************************************************************************
477 * GetSecurityDescriptorDacl [ADVAPI32.@]
479 BOOL WINAPI GetSecurityDescriptorDacl(
480 IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
481 OUT LPBOOL lpbDaclPresent,
483 OUT LPBOOL lpbDaclDefaulted)
485 CallWin32ToNt (RtlGetDaclSecurityDescriptor(pSecurityDescriptor, (PBOOLEAN)lpbDaclPresent,
486 pDacl, (PBOOLEAN)lpbDaclDefaulted));
489 /******************************************************************************
490 * SetSecurityDescriptorDacl [ADVAPI32.@]
493 SetSecurityDescriptorDacl (
494 PSECURITY_DESCRIPTOR lpsd,
499 CallWin32ToNt (RtlSetDaclSecurityDescriptor (lpsd, daclpresent, dacl, dacldefaulted ));
501 /******************************************************************************
502 * GetSecurityDescriptorSacl [ADVAPI32.@]
504 BOOL WINAPI GetSecurityDescriptorSacl(
505 IN PSECURITY_DESCRIPTOR lpsd,
506 OUT LPBOOL lpbSaclPresent,
508 OUT LPBOOL lpbSaclDefaulted)
510 CallWin32ToNt (RtlGetSaclSecurityDescriptor(lpsd,
511 (PBOOLEAN)lpbSaclPresent, pSacl, (PBOOLEAN)lpbSaclDefaulted));
514 /**************************************************************************
515 * SetSecurityDescriptorSacl [ADVAPI32.@]
517 BOOL WINAPI SetSecurityDescriptorSacl (
518 PSECURITY_DESCRIPTOR lpsd,
523 CallWin32ToNt (RtlSetSaclSecurityDescriptor(lpsd, saclpresent, lpsacl, sacldefaulted));
525 /******************************************************************************
526 * MakeSelfRelativeSD [ADVAPI32.@]
535 IN PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
536 IN PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
537 IN OUT LPDWORD lpdwBufferLength)
539 CallWin32ToNt (RtlMakeSelfRelativeSD(pAbsoluteSecurityDescriptor,pSelfRelativeSecurityDescriptor, lpdwBufferLength));
542 /******************************************************************************
543 * GetSecurityDescriptorControl [ADVAPI32.@]
546 BOOL WINAPI GetSecurityDescriptorControl ( PSECURITY_DESCRIPTOR pSecurityDescriptor,
547 PSECURITY_DESCRIPTOR_CONTROL pControl, LPDWORD lpdwRevision)
549 CallWin32ToNt (RtlGetControlSecurityDescriptor(pSecurityDescriptor,pControl,lpdwRevision));
552 /* ##############################
553 ###### ACL FUNCTIONS ######
554 ##############################
557 /*************************************************************************
558 * InitializeAcl [ADVAPI32.@]
560 DWORD WINAPI InitializeAcl(PACL acl, DWORD size, DWORD rev)
562 CallWin32ToNt (RtlCreateAcl(acl, size, rev));
565 /* ##############################
566 ###### MISC FUNCTIONS ######
567 ##############################
570 /******************************************************************************
571 * LookupPrivilegeValueW [ADVAPI32.@]
572 * Retrieves LUID used on a system to represent the privilege name.
575 * lpLuid should be PLUID
578 * lpSystemName [I] Address of string specifying the system
579 * lpName [I] Address of string specifying the privilege
580 * lpLuid [I] Address of locally unique identifier
585 LookupPrivilegeValueW( LPCWSTR lpSystemName, LPCWSTR lpName, LPVOID lpLuid )
587 FIXME("(%s,%s,%p): stub\n",debugstr_w(lpSystemName),
588 debugstr_w(lpName), lpLuid);
592 /******************************************************************************
593 * LookupPrivilegeValueA [ADVAPI32.@]
596 LookupPrivilegeValueA( LPCSTR lpSystemName, LPCSTR lpName, LPVOID lpLuid )
598 LPWSTR lpSystemNameW = HEAP_strdupAtoW(GetProcessHeap(), 0, lpSystemName);
599 LPWSTR lpNameW = HEAP_strdupAtoW(GetProcessHeap(), 0, lpName);
602 ret = LookupPrivilegeValueW( lpSystemNameW, lpNameW, lpLuid);
603 HeapFree(GetProcessHeap(), 0, lpNameW);
604 HeapFree(GetProcessHeap(), 0, lpSystemNameW);
608 /******************************************************************************
609 * GetFileSecurityA [ADVAPI32.@]
611 * Obtains Specified information about the security of a file or directory
612 * The information obtained is constrained by the callers access rights and
616 GetFileSecurityA( LPCSTR lpFileName,
617 SECURITY_INFORMATION RequestedInformation,
618 PSECURITY_DESCRIPTOR pSecurityDescriptor,
619 DWORD nLength, LPDWORD lpnLengthNeeded )
621 FIXME("(%s) : stub\n", debugstr_a(lpFileName));
625 /******************************************************************************
626 * GetFileSecurityW [ADVAPI32.@]
628 * Obtains Specified information about the security of a file or directory
629 * The information obtained is constrained by the callers access rights and
634 * RequestedInformation []
635 * pSecurityDescriptor []
640 GetFileSecurityW( LPCWSTR lpFileName,
641 SECURITY_INFORMATION RequestedInformation,
642 PSECURITY_DESCRIPTOR pSecurityDescriptor,
643 DWORD nLength, LPDWORD lpnLengthNeeded )
645 FIXME("(%s) : stub\n", debugstr_w(lpFileName) );
650 /******************************************************************************
651 * LookupAccountSidA [ADVAPI32.@]
658 IN OUT LPDWORD accountSize,
660 IN OUT LPDWORD domainSize,
661 OUT PSID_NAME_USE name_use )
663 static const char ac[] = "Administrator";
664 static const char dm[] = "DOMAIN";
665 FIXME("(%s,sid=%p,%p,%p(%lu),%p,%p(%lu),%p): semi-stub\n",
666 debugstr_a(system),sid,
667 account,accountSize,accountSize?*accountSize:0,
668 domain,domainSize,domainSize?*domainSize:0,
671 if (accountSize) *accountSize = strlen(ac)+1;
672 if (account && (*accountSize > strlen(ac)))
675 if (domainSize) *domainSize = strlen(dm)+1;
676 if (domain && (*domainSize > strlen(dm)))
679 if (name_use) *name_use = SidTypeUser;
683 /******************************************************************************
684 * LookupAccountSidW [ADVAPI32.@]
700 IN OUT LPDWORD accountSize,
702 IN OUT LPDWORD domainSize,
703 OUT PSID_NAME_USE name_use )
705 static const WCHAR ac[] = {'A','d','m','i','n','i','s','t','r','a','t','o','r',0};
706 static const WCHAR dm[] = {'D','O','M','A','I','N',0};
707 FIXME("(%s,sid=%p,%p,%p(%lu),%p,%p(%lu),%p): semi-stub\n",
708 debugstr_w(system),sid,
709 account,accountSize,accountSize?*accountSize:0,
710 domain,domainSize,domainSize?*domainSize:0,
713 if (accountSize) *accountSize = strlenW(ac)+1;
714 if (account && (*accountSize > strlenW(ac)))
715 strcpyW(account, ac);
717 if (domainSize) *domainSize = strlenW(dm)+1;
718 if (domain && (*domainSize > strlenW(dm)))
721 if (name_use) *name_use = SidTypeUser;
725 /******************************************************************************
726 * SetFileSecurityA [ADVAPI32.@]
727 * Sets the security of a file or directory
729 BOOL WINAPI SetFileSecurityA( LPCSTR lpFileName,
730 SECURITY_INFORMATION RequestedInformation,
731 PSECURITY_DESCRIPTOR pSecurityDescriptor)
733 FIXME("(%s) : stub\n", debugstr_a(lpFileName));
737 /******************************************************************************
738 * SetFileSecurityW [ADVAPI32.@]
739 * Sets the security of a file or directory
743 * RequestedInformation []
744 * pSecurityDescriptor []
747 SetFileSecurityW( LPCWSTR lpFileName,
748 SECURITY_INFORMATION RequestedInformation,
749 PSECURITY_DESCRIPTOR pSecurityDescriptor )
751 FIXME("(%s) : stub\n", debugstr_w(lpFileName) );
755 /******************************************************************************
756 * QueryWindows31FilesMigration [ADVAPI32.@]
762 QueryWindows31FilesMigration( DWORD x1 )
764 FIXME("(%ld):stub\n",x1);
768 /******************************************************************************
769 * SynchronizeWindows31FilesAndWindowsNTRegistry [ADVAPI32.@]
778 SynchronizeWindows31FilesAndWindowsNTRegistry( DWORD x1, DWORD x2, DWORD x3,
781 FIXME("(0x%08lx,0x%08lx,0x%08lx,0x%08lx):stub\n",x1,x2,x3,x4);
785 /******************************************************************************
786 * LsaOpenPolicy [ADVAPI32.@]
796 IN PLSA_UNICODE_STRING SystemName,
797 IN PLSA_OBJECT_ATTRIBUTES ObjectAttributes,
798 IN ACCESS_MASK DesiredAccess,
799 IN OUT PLSA_HANDLE PolicyHandle)
801 FIXME("(%s,%p,0x%08lx,%p):stub\n",
802 SystemName?debugstr_w(SystemName->Buffer):"null",
803 ObjectAttributes, DesiredAccess, PolicyHandle);
804 dumpLsaAttributes(ObjectAttributes);
805 if(PolicyHandle) *PolicyHandle = (LSA_HANDLE)0xcafe;
809 /******************************************************************************
810 * LsaQueryInformationPolicy [ADVAPI32.@]
813 LsaQueryInformationPolicy(
814 IN LSA_HANDLE PolicyHandle,
815 IN POLICY_INFORMATION_CLASS InformationClass,
818 FIXME("(%p,0x%08x,%p):stub\n",
819 PolicyHandle, InformationClass, Buffer);
821 if(!Buffer) return FALSE;
822 switch (InformationClass)
824 case PolicyAuditEventsInformation: /* 2 */
826 PPOLICY_AUDIT_EVENTS_INFO p = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(POLICY_AUDIT_EVENTS_INFO));
827 p->AuditingMode = FALSE; /* no auditing */
831 case PolicyPrimaryDomainInformation: /* 3 */
832 case PolicyAccountDomainInformation: /* 5 */
835 { POLICY_PRIMARY_DOMAIN_INFO ppdi;
838 SID_IDENTIFIER_AUTHORITY localSidAuthority = {SECURITY_NT_AUTHORITY};
840 struct di * xdi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(xdi));
841 RtlInitUnicodeString(&(xdi->ppdi.Name), HEAP_strdupAtoW(GetProcessHeap(),0,"DOMAIN"));
842 xdi->ppdi.Sid = &(xdi->sid);
843 xdi->sid.Revision = SID_REVISION;
844 xdi->sid.SubAuthorityCount = 1;
845 xdi->sid.IdentifierAuthority = localSidAuthority;
846 xdi->sid.SubAuthority[0] = SECURITY_LOCAL_SYSTEM_RID;
850 case PolicyAuditLogInformation:
851 case PolicyPdAccountInformation:
852 case PolicyLsaServerRoleInformation:
853 case PolicyReplicaSourceInformation:
854 case PolicyDefaultQuotaInformation:
855 case PolicyModificationInformation:
856 case PolicyAuditFullSetInformation:
857 case PolicyAuditFullQueryInformation:
858 case PolicyDnsDomainInformation:
860 FIXME("category not implemented\n");
867 /******************************************************************************
868 * LsaLookupSids [ADVAPI32.@]
873 LSA_UNICODE_STRING Name;
875 } LSA_TRANSLATED_NAME, *PLSA_TRANSLATED_NAME;
879 LSA_UNICODE_STRING Name;
881 } LSA_TRUST_INFORMATION, *PLSA_TRUST_INFORMATION;
886 PLSA_TRUST_INFORMATION Domains;
887 } LSA_REFERENCED_DOMAIN_LIST, *PLSA_REFERENCED_DOMAIN_LIST;
891 IN LSA_HANDLE PolicyHandle,
894 OUT PLSA_REFERENCED_DOMAIN_LIST *ReferencedDomains,
895 OUT PLSA_TRANSLATED_NAME *Names )
897 FIXME("%p %lu %p %p %p\n",
898 PolicyHandle, Count, Sids, ReferencedDomains, Names);
902 /******************************************************************************
903 * LsaFreeMemory [ADVAPI32.@]
906 LsaFreeMemory(IN PVOID Buffer)
908 TRACE("(%p)\n",Buffer);
909 return HeapFree(GetProcessHeap(), 0, Buffer);
911 /******************************************************************************
912 * LsaClose [ADVAPI32.@]
915 LsaClose(IN LSA_HANDLE ObjectHandle)
917 FIXME("(%p):stub\n",ObjectHandle);
920 /******************************************************************************
921 * NotifyBootConfigStatus [ADVAPI32.@]
927 NotifyBootConfigStatus( DWORD x1 )
929 FIXME("(0x%08lx):stub\n",x1);
933 /******************************************************************************
934 * RevertToSelf [ADVAPI32.@]
946 /******************************************************************************
947 * ImpersonateSelf [ADVAPI32.@]
950 ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
952 return RtlImpersonateSelf(ImpersonationLevel);
955 /******************************************************************************
956 * ImpersonateLoggedOnUser [ADVAPI32.@]
958 BOOL WINAPI ImpersonateLoggedOnUser(HANDLE hToken)
960 FIXME("(%08x):stub returning FALSE\n", hToken);
964 /******************************************************************************
965 * AccessCheck [ADVAPI32.@]
967 * FIXME check cast LPBOOL to PBOOLEAN
971 PSECURITY_DESCRIPTOR SecurityDescriptor,
974 PGENERIC_MAPPING GenericMapping,
975 PPRIVILEGE_SET PrivilegeSet,
976 LPDWORD PrivilegeSetLength,
977 LPDWORD GrantedAccess,
980 CallWin32ToNt (NtAccessCheck(SecurityDescriptor, ClientToken, DesiredAccess,
981 GenericMapping, PrivilegeSet, PrivilegeSetLength, GrantedAccess, (PBOOLEAN)AccessStatus));
984 /*************************************************************************
985 * SetKernelObjectSecurity [ADVAPI32.@]
987 BOOL WINAPI SetKernelObjectSecurity (
989 IN SECURITY_INFORMATION SecurityInformation,
990 IN PSECURITY_DESCRIPTOR SecurityDescriptor )
992 CallWin32ToNt (NtSetSecurityObject (Handle, SecurityInformation, SecurityDescriptor));
995 /******************************************************************************
996 * AddAccessAllowedAce [ADVAPI32.@]
998 BOOL WINAPI AddAccessAllowedAce(
1000 IN DWORD dwAceRevision,
1001 IN DWORD AccessMask,
1004 return RtlAddAccessAllowedAce(pAcl, dwAceRevision, AccessMask, pSid);
1007 /******************************************************************************
1008 * LookupAccountNameA [ADVAPI32.@]
1016 LPSTR ReferencedDomainName,
1017 IN OUT LPDWORD cbReferencedDomainName,
1018 OUT PSID_NAME_USE name_use )
1020 FIXME("(%s,%s,%p,%p,%p,%p,%p), stub.\n",system,account,sid,cbSid,ReferencedDomainName,cbReferencedDomainName,name_use);
1024 /******************************************************************************
1025 * GetAce [ADVAPI32.@]
1027 BOOL WINAPI GetAce(PACL pAcl,DWORD dwAceIndex,LPVOID *pAce )
1029 CallWin32ToNt(RtlGetAce(pAcl, dwAceIndex, pAce));
1032 /******************************************************************************
1033 * PrivilegeCheck [ADVAPI32.@]
1035 BOOL WINAPI PrivilegeCheck( HANDLE ClientToken, PPRIVILEGE_SET RequiredPrivileges, LPBOOL pfResult)
1037 FIXME("stub %d %p %p\n", ClientToken, RequiredPrivileges, pfResult);