Commit 1d36d129 authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed prototypes of a couple of ntdll functions.

Replaced the CallWin32ToNt macro by a proper function. PBOOL cannot be cast to PBOOLEAN, we need to use an intermediate variable.
parent ba8200bf
...@@ -92,13 +92,13 @@ static const WCHAR SDDL_INHERITED[] = {'I','D',0}; ...@@ -92,13 +92,13 @@ static const WCHAR SDDL_INHERITED[] = {'I','D',0};
static const WCHAR SDDL_AUDIT_SUCCESS[] = {'S','A',0}; static const WCHAR SDDL_AUDIT_SUCCESS[] = {'S','A',0};
static const WCHAR SDDL_AUDIT_FAILURE[] = {'F','A',0}; static const WCHAR SDDL_AUDIT_FAILURE[] = {'F','A',0};
#define CallWin32ToNt(func) \ /* set last error code from NT status and get the proper boolean return value */
{ NTSTATUS ret; \ /* used for functions that are a simple wrapper around the corresponding ntdll API */
ret = (func); \ static inline BOOL set_ntstatus( NTSTATUS status )
if (ret !=STATUS_SUCCESS) \ {
{ SetLastError (RtlNtStatusToDosError(ret)); return FALSE; } \ if (status) SetLastError( RtlNtStatusToDosError( status ));
return TRUE; \ return !status;
} }
static void dumpLsaAttributes( PLSA_OBJECT_ATTRIBUTES oa ) static void dumpLsaAttributes( PLSA_OBJECT_ATTRIBUTES oa )
{ {
...@@ -176,7 +176,7 @@ BOOL WINAPI ...@@ -176,7 +176,7 @@ BOOL WINAPI
OpenProcessToken( HANDLE ProcessHandle, DWORD DesiredAccess, OpenProcessToken( HANDLE ProcessHandle, DWORD DesiredAccess,
HANDLE *TokenHandle ) HANDLE *TokenHandle )
{ {
CallWin32ToNt(NtOpenProcessToken( ProcessHandle, DesiredAccess, TokenHandle )); return set_ntstatus(NtOpenProcessToken( ProcessHandle, DesiredAccess, TokenHandle ));
} }
/****************************************************************************** /******************************************************************************
...@@ -201,15 +201,15 @@ BOOL WINAPI ...@@ -201,15 +201,15 @@ BOOL WINAPI
OpenThreadToken( HANDLE ThreadHandle, DWORD DesiredAccess, OpenThreadToken( HANDLE ThreadHandle, DWORD DesiredAccess,
BOOL OpenAsSelf, HANDLE *TokenHandle) BOOL OpenAsSelf, HANDLE *TokenHandle)
{ {
CallWin32ToNt (NtOpenThreadToken(ThreadHandle, DesiredAccess, OpenAsSelf, TokenHandle)); return set_ntstatus( NtOpenThreadToken(ThreadHandle, DesiredAccess, OpenAsSelf, TokenHandle));
} }
BOOL WINAPI BOOL WINAPI
AdjustTokenGroups( HANDLE TokenHandle, BOOL ResetToDefault, PTOKEN_GROUPS NewState, AdjustTokenGroups( HANDLE TokenHandle, BOOL ResetToDefault, PTOKEN_GROUPS NewState,
DWORD BufferLength, PTOKEN_GROUPS PreviousState, PDWORD ReturnLength ) DWORD BufferLength, PTOKEN_GROUPS PreviousState, PDWORD ReturnLength )
{ {
CallWin32ToNt(NtAdjustGroupsToken(TokenHandle, ResetToDefault, NewState, BufferLength, return set_ntstatus( NtAdjustGroupsToken(TokenHandle, ResetToDefault, NewState, BufferLength,
PreviousState, ReturnLength)); PreviousState, ReturnLength));
} }
/****************************************************************************** /******************************************************************************
...@@ -238,7 +238,9 @@ AdjustTokenPrivileges( HANDLE TokenHandle, BOOL DisableAllPrivileges, ...@@ -238,7 +238,9 @@ AdjustTokenPrivileges( HANDLE TokenHandle, BOOL DisableAllPrivileges,
LPVOID NewState, DWORD BufferLength, LPVOID NewState, DWORD BufferLength,
LPVOID PreviousState, LPDWORD ReturnLength ) LPVOID PreviousState, LPDWORD ReturnLength )
{ {
CallWin32ToNt(NtAdjustPrivilegesToken(TokenHandle, DisableAllPrivileges, NewState, BufferLength, PreviousState, ReturnLength)); return set_ntstatus( NtAdjustPrivilegesToken(TokenHandle, DisableAllPrivileges,
NewState, BufferLength, PreviousState,
ReturnLength));
} }
/****************************************************************************** /******************************************************************************
...@@ -305,7 +307,8 @@ GetTokenInformation( HANDLE token, TOKEN_INFORMATION_CLASS tokeninfoclass, ...@@ -305,7 +307,8 @@ GetTokenInformation( HANDLE token, TOKEN_INFORMATION_CLASS tokeninfoclass,
(tokeninfoclass == TokenSandBoxInert) ? "TokenSandBoxInert" : (tokeninfoclass == TokenSandBoxInert) ? "TokenSandBoxInert" :
"Unknown", "Unknown",
tokeninfo, tokeninfolength, retlen); tokeninfo, tokeninfolength, retlen);
CallWin32ToNt (NtQueryInformationToken( token, tokeninfoclass, tokeninfo, tokeninfolength, retlen)); return set_ntstatus( NtQueryInformationToken( token, tokeninfoclass, tokeninfo,
tokeninfolength, retlen));
} }
/****************************************************************************** /******************************************************************************
...@@ -347,7 +350,7 @@ SetTokenInformation( HANDLE token, TOKEN_INFORMATION_CLASS tokeninfoclass, ...@@ -347,7 +350,7 @@ SetTokenInformation( HANDLE token, TOKEN_INFORMATION_CLASS tokeninfoclass,
"Unknown", "Unknown",
tokeninfo, tokeninfolength); tokeninfo, tokeninfolength);
CallWin32ToNt (NtSetInformationToken( token, tokeninfoclass, tokeninfo, tokeninfolength )); return set_ntstatus( NtSetInformationToken( token, tokeninfoclass, tokeninfo, tokeninfolength ));
} }
/************************************************************************* /*************************************************************************
...@@ -371,8 +374,8 @@ SetTokenInformation( HANDLE token, TOKEN_INFORMATION_CLASS tokeninfoclass, ...@@ -371,8 +374,8 @@ SetTokenInformation( HANDLE token, TOKEN_INFORMATION_CLASS tokeninfoclass,
*/ */
BOOL WINAPI SetThreadToken(PHANDLE thread, HANDLE token) BOOL WINAPI SetThreadToken(PHANDLE thread, HANDLE token)
{ {
CallWin32ToNt (NtSetInformationThread( thread ? *thread : GetCurrentThread(), return set_ntstatus( NtSetInformationThread( thread ? *thread : GetCurrentThread(),
ThreadImpersonationToken, &token, sizeof token )); ThreadImpersonationToken, &token, sizeof token ));
} }
/* ############################## /* ##############################
...@@ -405,11 +408,11 @@ AllocateAndInitializeSid( PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, ...@@ -405,11 +408,11 @@ AllocateAndInitializeSid( PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
DWORD nSubAuthority6, DWORD nSubAuthority7, DWORD nSubAuthority6, DWORD nSubAuthority7,
PSID *pSid ) PSID *pSid )
{ {
return RtlAllocateAndInitializeSid( return set_ntstatus( RtlAllocateAndInitializeSid(
pIdentifierAuthority, nSubAuthorityCount, pIdentifierAuthority, nSubAuthorityCount,
nSubAuthority0, nSubAuthority1, nSubAuthority2, nSubAuthority3, nSubAuthority0, nSubAuthority1, nSubAuthority2, nSubAuthority3,
nSubAuthority4, nSubAuthority5, nSubAuthority6, nSubAuthority7, nSubAuthority4, nSubAuthority5, nSubAuthority6, nSubAuthority7,
pSid ); pSid ));
} }
/****************************************************************************** /******************************************************************************
...@@ -579,7 +582,7 @@ GetLengthSid (PSID pSid) ...@@ -579,7 +582,7 @@ GetLengthSid (PSID pSid)
BOOL WINAPI BOOL WINAPI
InitializeSecurityDescriptor( PSECURITY_DESCRIPTOR pDescr, DWORD revision ) InitializeSecurityDescriptor( PSECURITY_DESCRIPTOR pDescr, DWORD revision )
{ {
CallWin32ToNt (RtlCreateSecurityDescriptor(pDescr, revision )); return set_ntstatus( RtlCreateSecurityDescriptor(pDescr, revision ));
} }
...@@ -599,10 +602,12 @@ BOOL WINAPI MakeAbsoluteSD ( ...@@ -599,10 +602,12 @@ BOOL WINAPI MakeAbsoluteSD (
OUT PSID pPrimaryGroup, OUT PSID pPrimaryGroup,
OUT LPDWORD lpdwPrimaryGroupSize) OUT LPDWORD lpdwPrimaryGroupSize)
{ {
CallWin32ToNt (RtlSelfRelativeToAbsoluteSD(pSelfRelativeSecurityDescriptor, return set_ntstatus( RtlSelfRelativeToAbsoluteSD(pSelfRelativeSecurityDescriptor,
pAbsoluteSecurityDescriptor, lpdwAbsoluteSecurityDescriptorSize, pAbsoluteSecurityDescriptor,
pDacl, lpdwDaclSize, pSacl, lpdwSaclSize, pOwner, lpdwOwnerSize, lpdwAbsoluteSecurityDescriptorSize,
pPrimaryGroup, lpdwPrimaryGroupSize)); pDacl, lpdwDaclSize, pSacl, lpdwSaclSize,
pOwner, lpdwOwnerSize,
pPrimaryGroup, lpdwPrimaryGroupSize));
} }
...@@ -625,7 +630,10 @@ BOOL WINAPI ...@@ -625,7 +630,10 @@ BOOL WINAPI
GetSecurityDescriptorOwner( PSECURITY_DESCRIPTOR pDescr, PSID *pOwner, GetSecurityDescriptorOwner( PSECURITY_DESCRIPTOR pDescr, PSID *pOwner,
LPBOOL lpbOwnerDefaulted ) LPBOOL lpbOwnerDefaulted )
{ {
CallWin32ToNt (RtlGetOwnerSecurityDescriptor( pDescr, pOwner, (PBOOLEAN)lpbOwnerDefaulted )); BOOLEAN defaulted;
BOOL ret = set_ntstatus( RtlGetOwnerSecurityDescriptor( pDescr, pOwner, &defaulted ));
*lpbOwnerDefaulted = defaulted;
return ret;
} }
/****************************************************************************** /******************************************************************************
...@@ -636,7 +644,7 @@ GetSecurityDescriptorOwner( PSECURITY_DESCRIPTOR pDescr, PSID *pOwner, ...@@ -636,7 +644,7 @@ GetSecurityDescriptorOwner( PSECURITY_DESCRIPTOR pDescr, PSID *pOwner,
BOOL WINAPI SetSecurityDescriptorOwner( PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL WINAPI SetSecurityDescriptorOwner( PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID pOwner, BOOL bOwnerDefaulted) PSID pOwner, BOOL bOwnerDefaulted)
{ {
CallWin32ToNt (RtlSetOwnerSecurityDescriptor(pSecurityDescriptor, pOwner, bOwnerDefaulted)); return set_ntstatus( RtlSetOwnerSecurityDescriptor(pSecurityDescriptor, pOwner, bOwnerDefaulted));
} }
/****************************************************************************** /******************************************************************************
* GetSecurityDescriptorGroup [ADVAPI32.@] * GetSecurityDescriptorGroup [ADVAPI32.@]
...@@ -646,7 +654,10 @@ BOOL WINAPI GetSecurityDescriptorGroup( ...@@ -646,7 +654,10 @@ BOOL WINAPI GetSecurityDescriptorGroup(
PSID *Group, PSID *Group,
LPBOOL GroupDefaulted) LPBOOL GroupDefaulted)
{ {
CallWin32ToNt (RtlGetGroupSecurityDescriptor(SecurityDescriptor, Group, (PBOOLEAN)GroupDefaulted)); BOOLEAN defaulted;
BOOL ret = set_ntstatus( RtlGetGroupSecurityDescriptor(SecurityDescriptor, Group, &defaulted ));
*GroupDefaulted = defaulted;
return ret;
} }
/****************************************************************************** /******************************************************************************
* SetSecurityDescriptorGroup [ADVAPI32.@] * SetSecurityDescriptorGroup [ADVAPI32.@]
...@@ -654,7 +665,7 @@ BOOL WINAPI GetSecurityDescriptorGroup( ...@@ -654,7 +665,7 @@ BOOL WINAPI GetSecurityDescriptorGroup(
BOOL WINAPI SetSecurityDescriptorGroup ( PSECURITY_DESCRIPTOR SecurityDescriptor, BOOL WINAPI SetSecurityDescriptorGroup ( PSECURITY_DESCRIPTOR SecurityDescriptor,
PSID Group, BOOL GroupDefaulted) PSID Group, BOOL GroupDefaulted)
{ {
CallWin32ToNt (RtlSetGroupSecurityDescriptor( SecurityDescriptor, Group, GroupDefaulted)); return set_ntstatus( RtlSetGroupSecurityDescriptor( SecurityDescriptor, Group, GroupDefaulted));
} }
/****************************************************************************** /******************************************************************************
...@@ -666,7 +677,7 @@ BOOL WINAPI SetSecurityDescriptorGroup ( PSECURITY_DESCRIPTOR SecurityDescriptor ...@@ -666,7 +677,7 @@ BOOL WINAPI SetSecurityDescriptorGroup ( PSECURITY_DESCRIPTOR SecurityDescriptor
BOOL WINAPI BOOL WINAPI
IsValidSecurityDescriptor( PSECURITY_DESCRIPTOR SecurityDescriptor ) IsValidSecurityDescriptor( PSECURITY_DESCRIPTOR SecurityDescriptor )
{ {
CallWin32ToNt (RtlValidSecurityDescriptor(SecurityDescriptor)); return set_ntstatus( RtlValidSecurityDescriptor(SecurityDescriptor));
} }
/****************************************************************************** /******************************************************************************
...@@ -678,8 +689,11 @@ BOOL WINAPI GetSecurityDescriptorDacl( ...@@ -678,8 +689,11 @@ BOOL WINAPI GetSecurityDescriptorDacl(
OUT PACL *pDacl, OUT PACL *pDacl,
OUT LPBOOL lpbDaclDefaulted) OUT LPBOOL lpbDaclDefaulted)
{ {
CallWin32ToNt (RtlGetDaclSecurityDescriptor(pSecurityDescriptor, (PBOOLEAN)lpbDaclPresent, BOOLEAN present, defaulted;
pDacl, (PBOOLEAN)lpbDaclDefaulted)); BOOL ret = set_ntstatus( RtlGetDaclSecurityDescriptor(pSecurityDescriptor, &present, pDacl, &defaulted));
*lpbDaclPresent = present;
*lpbDaclDefaulted = defaulted;
return ret;
} }
/****************************************************************************** /******************************************************************************
...@@ -692,7 +706,7 @@ SetSecurityDescriptorDacl ( ...@@ -692,7 +706,7 @@ SetSecurityDescriptorDacl (
PACL dacl, PACL dacl,
BOOL dacldefaulted ) BOOL dacldefaulted )
{ {
CallWin32ToNt (RtlSetDaclSecurityDescriptor (lpsd, daclpresent, dacl, dacldefaulted )); return set_ntstatus( RtlSetDaclSecurityDescriptor (lpsd, daclpresent, dacl, dacldefaulted ) );
} }
/****************************************************************************** /******************************************************************************
* GetSecurityDescriptorSacl [ADVAPI32.@] * GetSecurityDescriptorSacl [ADVAPI32.@]
...@@ -703,8 +717,11 @@ BOOL WINAPI GetSecurityDescriptorSacl( ...@@ -703,8 +717,11 @@ BOOL WINAPI GetSecurityDescriptorSacl(
OUT PACL *pSacl, OUT PACL *pSacl,
OUT LPBOOL lpbSaclDefaulted) OUT LPBOOL lpbSaclDefaulted)
{ {
CallWin32ToNt (RtlGetSaclSecurityDescriptor(lpsd, BOOLEAN present, defaulted;
(PBOOLEAN)lpbSaclPresent, pSacl, (PBOOLEAN)lpbSaclDefaulted)); BOOL ret = set_ntstatus( RtlGetSaclSecurityDescriptor(lpsd, &present, pSacl, &defaulted) );
*lpbSaclPresent = present;
*lpbSaclDefaulted = defaulted;
return ret;
} }
/************************************************************************** /**************************************************************************
...@@ -716,7 +733,7 @@ BOOL WINAPI SetSecurityDescriptorSacl ( ...@@ -716,7 +733,7 @@ BOOL WINAPI SetSecurityDescriptorSacl (
PACL lpsacl, PACL lpsacl,
BOOL sacldefaulted) BOOL sacldefaulted)
{ {
CallWin32ToNt (RtlSetSaclSecurityDescriptor(lpsd, saclpresent, lpsacl, sacldefaulted)); return set_ntstatus (RtlSetSaclSecurityDescriptor(lpsd, saclpresent, lpsacl, sacldefaulted));
} }
/****************************************************************************** /******************************************************************************
* MakeSelfRelativeSD [ADVAPI32.@] * MakeSelfRelativeSD [ADVAPI32.@]
...@@ -732,7 +749,8 @@ MakeSelfRelativeSD( ...@@ -732,7 +749,8 @@ MakeSelfRelativeSD(
IN PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor, IN PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
IN OUT LPDWORD lpdwBufferLength) IN OUT LPDWORD lpdwBufferLength)
{ {
CallWin32ToNt (RtlMakeSelfRelativeSD(pAbsoluteSecurityDescriptor,pSelfRelativeSecurityDescriptor, lpdwBufferLength)); return set_ntstatus( RtlMakeSelfRelativeSD( pAbsoluteSecurityDescriptor,
pSelfRelativeSecurityDescriptor, lpdwBufferLength));
} }
/****************************************************************************** /******************************************************************************
...@@ -742,7 +760,7 @@ MakeSelfRelativeSD( ...@@ -742,7 +760,7 @@ MakeSelfRelativeSD(
BOOL WINAPI GetSecurityDescriptorControl ( PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL WINAPI GetSecurityDescriptorControl ( PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSECURITY_DESCRIPTOR_CONTROL pControl, LPDWORD lpdwRevision) PSECURITY_DESCRIPTOR_CONTROL pControl, LPDWORD lpdwRevision)
{ {
CallWin32ToNt (RtlGetControlSecurityDescriptor(pSecurityDescriptor,pControl,lpdwRevision)); return set_ntstatus( RtlGetControlSecurityDescriptor(pSecurityDescriptor,pControl,lpdwRevision));
} }
/* ############################## /* ##############################
...@@ -755,7 +773,7 @@ BOOL WINAPI GetSecurityDescriptorControl ( PSECURITY_DESCRIPTOR pSecurityDescri ...@@ -755,7 +773,7 @@ BOOL WINAPI GetSecurityDescriptorControl ( PSECURITY_DESCRIPTOR pSecurityDescri
*/ */
BOOL WINAPI InitializeAcl(PACL acl, DWORD size, DWORD rev) BOOL WINAPI InitializeAcl(PACL acl, DWORD size, DWORD rev)
{ {
CallWin32ToNt (RtlCreateAcl(acl, size, rev)); return set_ntstatus( RtlCreateAcl(acl, size, rev));
} }
/****************************************************************************** /******************************************************************************
...@@ -767,7 +785,7 @@ BOOL WINAPI AddAccessAllowedAce( ...@@ -767,7 +785,7 @@ BOOL WINAPI AddAccessAllowedAce(
IN DWORD AccessMask, IN DWORD AccessMask,
IN PSID pSid) IN PSID pSid)
{ {
CallWin32ToNt(RtlAddAccessAllowedAce(pAcl, dwAceRevision, AccessMask, pSid)); return set_ntstatus(RtlAddAccessAllowedAce(pAcl, dwAceRevision, AccessMask, pSid));
} }
/****************************************************************************** /******************************************************************************
...@@ -780,7 +798,7 @@ BOOL WINAPI AddAccessAllowedAceEx( ...@@ -780,7 +798,7 @@ BOOL WINAPI AddAccessAllowedAceEx(
IN DWORD AccessMask, IN DWORD AccessMask,
IN PSID pSid) IN PSID pSid)
{ {
CallWin32ToNt(RtlAddAccessAllowedAceEx(pAcl, dwAceRevision, AceFlags, AccessMask, pSid)); return set_ntstatus(RtlAddAccessAllowedAceEx(pAcl, dwAceRevision, AceFlags, AccessMask, pSid));
} }
/****************************************************************************** /******************************************************************************
...@@ -792,7 +810,7 @@ BOOL WINAPI AddAccessDeniedAce( ...@@ -792,7 +810,7 @@ BOOL WINAPI AddAccessDeniedAce(
IN DWORD AccessMask, IN DWORD AccessMask,
IN PSID pSid) IN PSID pSid)
{ {
CallWin32ToNt(RtlAddAccessDeniedAce(pAcl, dwAceRevision, AccessMask, pSid)); return set_ntstatus(RtlAddAccessDeniedAce(pAcl, dwAceRevision, AccessMask, pSid));
} }
/****************************************************************************** /******************************************************************************
...@@ -805,7 +823,7 @@ BOOL WINAPI AddAccessDeniedAceEx( ...@@ -805,7 +823,7 @@ BOOL WINAPI AddAccessDeniedAceEx(
IN DWORD AccessMask, IN DWORD AccessMask,
IN PSID pSid) IN PSID pSid)
{ {
CallWin32ToNt(RtlAddAccessDeniedAceEx(pAcl, dwAceRevision, AceFlags, AccessMask, pSid)); return set_ntstatus(RtlAddAccessDeniedAceEx(pAcl, dwAceRevision, AceFlags, AccessMask, pSid));
} }
/****************************************************************************** /******************************************************************************
...@@ -818,7 +836,7 @@ BOOL WINAPI AddAce( ...@@ -818,7 +836,7 @@ BOOL WINAPI AddAce(
LPVOID pAceList, LPVOID pAceList,
DWORD nAceListLength) DWORD nAceListLength)
{ {
CallWin32ToNt(RtlAddAce(pAcl, dwAceRevision, dwStartingAceIndex, pAceList, nAceListLength)); return set_ntstatus(RtlAddAce(pAcl, dwAceRevision, dwStartingAceIndex, pAceList, nAceListLength));
} }
/****************************************************************************** /******************************************************************************
...@@ -826,7 +844,7 @@ BOOL WINAPI AddAce( ...@@ -826,7 +844,7 @@ BOOL WINAPI AddAce(
*/ */
BOOL WINAPI DeleteAce(PACL pAcl, DWORD dwAceIndex) BOOL WINAPI DeleteAce(PACL pAcl, DWORD dwAceIndex)
{ {
CallWin32ToNt(RtlDeleteAce(pAcl, dwAceIndex)); return set_ntstatus(RtlDeleteAce(pAcl, dwAceIndex));
} }
/****************************************************************************** /******************************************************************************
...@@ -842,7 +860,7 @@ BOOL WINAPI FindFirstFreeAce(IN PACL pAcl, LPVOID * pAce) ...@@ -842,7 +860,7 @@ BOOL WINAPI FindFirstFreeAce(IN PACL pAcl, LPVOID * pAce)
*/ */
BOOL WINAPI GetAce(PACL pAcl,DWORD dwAceIndex,LPVOID *pAce ) BOOL WINAPI GetAce(PACL pAcl,DWORD dwAceIndex,LPVOID *pAce )
{ {
CallWin32ToNt(RtlGetAce(pAcl, dwAceIndex, pAce)); return set_ntstatus(RtlGetAce(pAcl, dwAceIndex, pAce));
} }
/****************************************************************************** /******************************************************************************
...@@ -854,8 +872,8 @@ BOOL WINAPI GetAclInformation( ...@@ -854,8 +872,8 @@ BOOL WINAPI GetAclInformation(
DWORD nAclInformationLength, DWORD nAclInformationLength,
ACL_INFORMATION_CLASS dwAclInformationClass) ACL_INFORMATION_CLASS dwAclInformationClass)
{ {
CallWin32ToNt(RtlQueryInformationAcl(pAcl, pAclInformation, return set_ntstatus(RtlQueryInformationAcl(pAcl, pAclInformation,
nAclInformationLength, dwAclInformationClass)); nAclInformationLength, dwAclInformationClass));
} }
/****************************************************************************** /******************************************************************************
...@@ -879,7 +897,7 @@ BOOL WINAPI IsValidAcl(IN PACL pAcl) ...@@ -879,7 +897,7 @@ BOOL WINAPI IsValidAcl(IN PACL pAcl)
*/ */
BOOL WINAPI AllocateLocallyUniqueId( PLUID lpLuid ) BOOL WINAPI AllocateLocallyUniqueId( PLUID lpLuid )
{ {
CallWin32ToNt(NtAllocateLocallyUniqueId(lpLuid)); return set_ntstatus(NtAllocateLocallyUniqueId(lpLuid));
} }
static const WCHAR SE_CREATE_TOKEN_NAME_W[] = static const WCHAR SE_CREATE_TOKEN_NAME_W[] =
...@@ -1598,8 +1616,6 @@ BOOL WINAPI ImpersonateLoggedOnUser(HANDLE hToken) ...@@ -1598,8 +1616,6 @@ BOOL WINAPI ImpersonateLoggedOnUser(HANDLE hToken)
/****************************************************************************** /******************************************************************************
* AccessCheck [ADVAPI32.@] * AccessCheck [ADVAPI32.@]
*
* FIXME check cast LPBOOL to PBOOLEAN
*/ */
BOOL WINAPI BOOL WINAPI
AccessCheck( AccessCheck(
...@@ -1612,8 +1628,12 @@ AccessCheck( ...@@ -1612,8 +1628,12 @@ AccessCheck(
LPDWORD GrantedAccess, LPDWORD GrantedAccess,
LPBOOL AccessStatus) LPBOOL AccessStatus)
{ {
CallWin32ToNt (NtAccessCheck(SecurityDescriptor, ClientToken, DesiredAccess, NTSTATUS access_status;
GenericMapping, PrivilegeSet, PrivilegeSetLength, GrantedAccess, (PBOOLEAN)AccessStatus)); BOOL ret = set_ntstatus( NtAccessCheck(SecurityDescriptor, ClientToken, DesiredAccess,
GenericMapping, PrivilegeSet, PrivilegeSetLength,
GrantedAccess, &access_status) );
if (ret) *AccessStatus = set_ntstatus( access_status );
return ret;
} }
...@@ -1649,7 +1669,7 @@ BOOL WINAPI SetKernelObjectSecurity ( ...@@ -1649,7 +1669,7 @@ BOOL WINAPI SetKernelObjectSecurity (
IN SECURITY_INFORMATION SecurityInformation, IN SECURITY_INFORMATION SecurityInformation,
IN PSECURITY_DESCRIPTOR SecurityDescriptor ) IN PSECURITY_DESCRIPTOR SecurityDescriptor )
{ {
CallWin32ToNt (NtSetSecurityObject (Handle, SecurityInformation, SecurityDescriptor)); return set_ntstatus (NtSetSecurityObject (Handle, SecurityInformation, SecurityDescriptor));
} }
......
...@@ -61,7 +61,7 @@ static WINE_EXCEPTION_FILTER(page_fault) ...@@ -61,7 +61,7 @@ static WINE_EXCEPTION_FILTER(page_fault)
* RtlAllocateAndInitializeSid [NTDLL.@] * RtlAllocateAndInitializeSid [NTDLL.@]
* *
*/ */
BOOLEAN WINAPI RtlAllocateAndInitializeSid ( NTSTATUS WINAPI RtlAllocateAndInitializeSid (
PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
BYTE nSubAuthorityCount, BYTE nSubAuthorityCount,
DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority0, DWORD nSubAuthority1,
...@@ -78,7 +78,7 @@ BOOLEAN WINAPI RtlAllocateAndInitializeSid ( ...@@ -78,7 +78,7 @@ BOOLEAN WINAPI RtlAllocateAndInitializeSid (
if (!(*pSid = RtlAllocateHeap( GetProcessHeap(), 0, if (!(*pSid = RtlAllocateHeap( GetProcessHeap(), 0,
RtlLengthRequiredSid(nSubAuthorityCount)))) RtlLengthRequiredSid(nSubAuthorityCount))))
return FALSE; return STATUS_NO_MEMORY;
((SID*)*pSid)->Revision = SID_REVISION; ((SID*)*pSid)->Revision = SID_REVISION;
...@@ -1147,12 +1147,12 @@ NtAccessCheck( ...@@ -1147,12 +1147,12 @@ NtAccessCheck(
OUT PPRIVILEGE_SET PrivilegeSet, OUT PPRIVILEGE_SET PrivilegeSet,
OUT PULONG ReturnLength, OUT PULONG ReturnLength,
OUT PULONG GrantedAccess, OUT PULONG GrantedAccess,
OUT PBOOLEAN AccessStatus) OUT NTSTATUS *AccessStatus)
{ {
FIXME("(%p, %p, %08lx, %p, %p, %p, %p, %p), stub\n", FIXME("(%p, %p, %08lx, %p, %p, %p, %p, %p), stub\n",
SecurityDescriptor, ClientToken, DesiredAccess, GenericMapping, SecurityDescriptor, ClientToken, DesiredAccess, GenericMapping,
PrivilegeSet, ReturnLength, GrantedAccess, AccessStatus); PrivilegeSet, ReturnLength, GrantedAccess, AccessStatus);
*AccessStatus = TRUE; *AccessStatus = STATUS_SUCCESS;
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
......
...@@ -1339,7 +1339,7 @@ void WINAPI LdrInitializeThunk(HANDLE,ULONG,ULONG,ULONG); ...@@ -1339,7 +1339,7 @@ void WINAPI LdrInitializeThunk(HANDLE,ULONG,ULONG,ULONG);
NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*); NTSTATUS WINAPI LdrLoadDll(LPCWSTR, DWORD, const UNICODE_STRING*, HMODULE*);
void WINAPI LdrShutdownProcess(void); void WINAPI LdrShutdownProcess(void);
void WINAPI LdrShutdownThread(void); void WINAPI LdrShutdownThread(void);
NTSTATUS WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,PBOOLEAN); NTSTATUS WINAPI NtAccessCheck(PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,PGENERIC_MAPPING,PPRIVILEGE_SET,PULONG,PULONG,NTSTATUS*);
NTSTATUS WINAPI NtAdjustGroupsToken(HANDLE,BOOLEAN,PTOKEN_GROUPS,ULONG,PTOKEN_GROUPS,PULONG); NTSTATUS WINAPI NtAdjustGroupsToken(HANDLE,BOOLEAN,PTOKEN_GROUPS,ULONG,PTOKEN_GROUPS,PULONG);
NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD); NTSTATUS WINAPI NtAdjustPrivilegesToken(HANDLE,BOOLEAN,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
NTSTATUS WINAPI NtAlertThread(HANDLE ThreadHandle); NTSTATUS WINAPI NtAlertThread(HANDLE ThreadHandle);
...@@ -1464,7 +1464,7 @@ NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID); ...@@ -1464,7 +1464,7 @@ NTSTATUS WINAPI RtlAddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID); NTSTATUS WINAPI RtlAddAccessDeniedAceEx(PACL,DWORD,DWORD,DWORD,PSID);
PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER); PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
DWORD WINAPI RtlAdjustPrivilege(DWORD,DWORD,DWORD,DWORD); DWORD WINAPI RtlAdjustPrivilege(DWORD,DWORD,DWORD,DWORD);
BOOLEAN WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *); NTSTATUS WINAPI RtlAllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
RTL_HANDLE * WINAPI RtlAllocateHandle(RTL_HANDLE_TABLE *,ULONG *); RTL_HANDLE * WINAPI RtlAllocateHandle(RTL_HANDLE_TABLE *,ULONG *);
PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,ULONG); PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,ULONG);
DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING *); DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING *);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment