Forward RtlAddAccess* to add_access_ace.

This commit is contained in:
James Hawkins 2005-06-28 10:54:29 +00:00 committed by Alexandre Julliard
parent 996bcc5c40
commit b3738d3b12
1 changed files with 6 additions and 58 deletions

View File

@ -1178,36 +1178,10 @@ NTSTATUS WINAPI RtlAddAccessAllowedAceEx(
IN DWORD AccessMask, IN DWORD AccessMask,
IN PSID pSid) IN PSID pSid)
{ {
DWORD dwLengthSid; TRACE("(%p,0x%08lx,0x%08lx,%p)\n", pAcl, dwAceRevision, AccessMask, pSid);
ACCESS_ALLOWED_ACE * pAaAce;
DWORD dwSpaceLeft;
TRACE("(%p,0x%08lx,0x%08lx,%p)\n", return add_access_ace(pAcl, dwAceRevision, AceFlags,
pAcl, dwAceRevision, AccessMask, pSid); AccessMask, pSid, ACCESS_ALLOWED_ACE_TYPE);
if (!RtlValidSid(pSid))
return STATUS_INVALID_SID;
if (!RtlValidAcl(pAcl))
return STATUS_INVALID_ACL;
dwLengthSid = RtlLengthSid(pSid);
if (!RtlFirstFreeAce(pAcl, (PACE_HEADER *) &pAaAce))
return STATUS_INVALID_ACL;
if (!pAaAce)
return STATUS_ALLOTTED_SPACE_EXCEEDED;
dwSpaceLeft = (DWORD)pAcl + pAcl->AclSize - (DWORD)pAaAce;
if (dwSpaceLeft < sizeof(*pAaAce) - sizeof(pAaAce->SidStart) + dwLengthSid)
return STATUS_ALLOTTED_SPACE_EXCEEDED;
pAaAce->Header.AceType = ACCESS_ALLOWED_ACE_TYPE;
pAaAce->Header.AceFlags = AceFlags;
pAaAce->Header.AceSize = sizeof(*pAaAce) - sizeof(pAaAce->SidStart) + dwLengthSid;
pAaAce->Mask = AccessMask;
pAcl->AceCount++;
RtlCopySid(dwLengthSid, (PSID)&pAaAce->SidStart, pSid);
return STATUS_SUCCESS;
} }
/****************************************************************************** /******************************************************************************
@ -1232,36 +1206,10 @@ NTSTATUS WINAPI RtlAddAccessDeniedAceEx(
IN DWORD AccessMask, IN DWORD AccessMask,
IN PSID pSid) IN PSID pSid)
{ {
DWORD dwLengthSid; TRACE("(%p,0x%08lx,0x%08lx,%p)\n", pAcl, dwAceRevision, AccessMask, pSid);
DWORD dwSpaceLeft;
ACCESS_DENIED_ACE * pAdAce;
TRACE("(%p,0x%08lx,0x%08lx,%p)\n", return add_access_ace(pAcl, dwAceRevision, AceFlags,
pAcl, dwAceRevision, AccessMask, pSid); AccessMask, pSid, ACCESS_DENIED_ACE_TYPE);
if (!RtlValidSid(pSid))
return STATUS_INVALID_SID;
if (!RtlValidAcl(pAcl))
return STATUS_INVALID_ACL;
dwLengthSid = RtlLengthSid(pSid);
if (!RtlFirstFreeAce(pAcl, (PACE_HEADER *) &pAdAce))
return STATUS_INVALID_ACL;
if (!pAdAce)
return STATUS_ALLOTTED_SPACE_EXCEEDED;
dwSpaceLeft = (DWORD)pAcl + pAcl->AclSize - (DWORD)pAdAce;
if (dwSpaceLeft < sizeof(*pAdAce) - sizeof(pAdAce->SidStart) + dwLengthSid)
return STATUS_ALLOTTED_SPACE_EXCEEDED;
pAdAce->Header.AceType = ACCESS_DENIED_ACE_TYPE;
pAdAce->Header.AceFlags = AceFlags;
pAdAce->Header.AceSize = sizeof(*pAdAce) - sizeof(pAdAce->SidStart) + dwLengthSid;
pAdAce->Mask = AccessMask;
pAcl->AceCount++;
RtlCopySid(dwLengthSid, (PSID)&pAdAce->SidStart, pSid);
return STATUS_SUCCESS;
} }
/************************************************************************** /**************************************************************************