mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
- Do only attach/detach the process if the address is in user space
and if the current process is not the creator process (in MmProbeAndLockPages). svn path=/trunk/; revision=5009
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $Id: mdl.c,v 1.50 2003/06/19 19:01:01 gvg Exp $
|
||||
/* $Id: mdl.c,v 1.51 2003/07/06 10:50:21 hbirr Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
@@ -284,7 +284,7 @@ VOID STDCALL MmProbeAndLockPages (PMDL Mdl,
|
||||
ULONG NrPages;
|
||||
NTSTATUS Status;
|
||||
KPROCESSOR_MODE Mode;
|
||||
PEPROCESS CurrentProcess;
|
||||
PEPROCESS CurrentProcess = NULL;
|
||||
|
||||
DPRINT("MmProbeAndLockPages(Mdl %x)\n", Mdl);
|
||||
|
||||
@@ -296,12 +296,7 @@ VOID STDCALL MmProbeAndLockPages (PMDL Mdl,
|
||||
return;
|
||||
}
|
||||
|
||||
CurrentProcess = PsGetCurrentProcess();
|
||||
|
||||
if (Mdl->Process != CurrentProcess)
|
||||
{
|
||||
KeAttachProcess(Mdl->Process);
|
||||
}
|
||||
|
||||
if (Mdl->StartVa >= (PVOID)KERNEL_BASE)
|
||||
{
|
||||
@@ -310,6 +305,11 @@ VOID STDCALL MmProbeAndLockPages (PMDL Mdl,
|
||||
else
|
||||
{
|
||||
Mode = UserMode;
|
||||
CurrentProcess = PsGetCurrentProcess();
|
||||
if (Mdl->Process != CurrentProcess)
|
||||
{
|
||||
KeAttachProcess(Mdl->Process);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -361,7 +361,7 @@ VOID STDCALL MmProbeAndLockPages (PMDL Mdl,
|
||||
MmReferencePage((LARGE_INTEGER)(LONGLONG)MdlPages[i]);
|
||||
}
|
||||
MmUnlockAddressSpace(&Mdl->Process->AddressSpace);
|
||||
if (Mdl->Process != CurrentProcess)
|
||||
if (Mode == UserMode && Mdl->Process != CurrentProcess)
|
||||
{
|
||||
KeDetachProcess();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user