mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
- Add missing parameters probing.
svn path=/trunk/; revision=41203
This commit is contained in:
parent
145292bd14
commit
0a2ab85168
1 changed files with 20 additions and 1 deletions
|
@ -949,12 +949,14 @@ NtFreeVirtualMemory(IN HANDLE ProcessHandle,
|
|||
*/
|
||||
{
|
||||
MEMORY_AREA* MemoryArea;
|
||||
NTSTATUS Status;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
PEPROCESS Process;
|
||||
PMMSUPPORT AddressSpace;
|
||||
PVOID BaseAddress;
|
||||
ULONG RegionSize;
|
||||
|
||||
PAGED_CODE();
|
||||
|
||||
DPRINT("NtFreeVirtualMemory(ProcessHandle %x, *PBaseAddress %x, "
|
||||
"*PRegionSize %x, FreeType %x)\n",ProcessHandle,*PBaseAddress,
|
||||
*PRegionSize,FreeType);
|
||||
|
@ -965,6 +967,23 @@ NtFreeVirtualMemory(IN HANDLE ProcessHandle,
|
|||
return STATUS_INVALID_PARAMETER_4;
|
||||
}
|
||||
|
||||
if(ExGetPreviousMode() != KernelMode)
|
||||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
/* Probe user pointers */
|
||||
ProbeForWriteSize_t(PRegionSize);
|
||||
ProbeForWritePointer(PBaseAddress);
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
/* Get exception code */
|
||||
Status = _SEH2_GetExceptionCode();
|
||||
}
|
||||
_SEH2_END;
|
||||
if (!NT_SUCCESS(Status)) return Status;
|
||||
}
|
||||
|
||||
BaseAddress = (PVOID)PAGE_ROUND_DOWN((*PBaseAddress));
|
||||
RegionSize = PAGE_ROUND_UP((ULONG_PTR)(*PBaseAddress) + (*PRegionSize)) -
|
||||
PAGE_ROUND_DOWN((*PBaseAddress));
|
||||
|
|
Loading…
Reference in a new issue