mirror of
https://github.com/reactos/reactos.git
synced 2024-07-01 10:20:03 +00:00
[NTOSKRNL]
NtAccessCheck - Probe parameters. - Fail if generic access rights have not been mapped. svn path=/trunk/; revision=46297
This commit is contained in:
parent
1436e51e2a
commit
1b3286b8e0
|
@ -704,6 +704,27 @@ NtAccessCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Protect probe in SEH */
|
||||||
|
_SEH2_TRY
|
||||||
|
{
|
||||||
|
/* Probe all pointers */
|
||||||
|
ProbeForRead(GenericMapping, sizeof(GENERIC_MAPPING), sizeof(ULONG));
|
||||||
|
ProbeForRead(PrivilegeSetLength, sizeof(ULONG), sizeof(ULONG));
|
||||||
|
ProbeForWrite(PrivilegeSet, *PrivilegeSetLength, sizeof(ULONG));
|
||||||
|
ProbeForWrite(GrantedAccess, sizeof(ACCESS_MASK), sizeof(ULONG));
|
||||||
|
ProbeForWrite(AccessStatus, sizeof(NTSTATUS), sizeof(ULONG));
|
||||||
|
}
|
||||||
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
{
|
||||||
|
/* Return the exception code */
|
||||||
|
_SEH2_YIELD(return _SEH2_GetExceptionCode());
|
||||||
|
}
|
||||||
|
_SEH2_END;
|
||||||
|
|
||||||
|
/* Check for unmapped access rights */
|
||||||
|
if (DesiredAccess & (GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL))
|
||||||
|
return STATUS_GENERIC_NOT_MAPPED;
|
||||||
|
|
||||||
/* Reference the token */
|
/* Reference the token */
|
||||||
Status = ObReferenceObjectByHandle(TokenHandle,
|
Status = ObReferenceObjectByHandle(TokenHandle,
|
||||||
TOKEN_QUERY,
|
TOKEN_QUERY,
|
||||||
|
|
Loading…
Reference in a new issue