mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 23:45:42 +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:
parent
0ae49a2c5e
commit
8ed329a442
1 changed files with 8 additions and 8 deletions
|
@ -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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -284,7 +284,7 @@ VOID STDCALL MmProbeAndLockPages (PMDL Mdl,
|
||||||
ULONG NrPages;
|
ULONG NrPages;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
KPROCESSOR_MODE Mode;
|
KPROCESSOR_MODE Mode;
|
||||||
PEPROCESS CurrentProcess;
|
PEPROCESS CurrentProcess = NULL;
|
||||||
|
|
||||||
DPRINT("MmProbeAndLockPages(Mdl %x)\n", Mdl);
|
DPRINT("MmProbeAndLockPages(Mdl %x)\n", Mdl);
|
||||||
|
|
||||||
|
@ -296,12 +296,7 @@ VOID STDCALL MmProbeAndLockPages (PMDL Mdl,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentProcess = PsGetCurrentProcess();
|
|
||||||
|
|
||||||
if (Mdl->Process != CurrentProcess)
|
|
||||||
{
|
|
||||||
KeAttachProcess(Mdl->Process);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Mdl->StartVa >= (PVOID)KERNEL_BASE)
|
if (Mdl->StartVa >= (PVOID)KERNEL_BASE)
|
||||||
{
|
{
|
||||||
|
@ -310,6 +305,11 @@ VOID STDCALL MmProbeAndLockPages (PMDL Mdl,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Mode = UserMode;
|
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]);
|
MmReferencePage((LARGE_INTEGER)(LONGLONG)MdlPages[i]);
|
||||||
}
|
}
|
||||||
MmUnlockAddressSpace(&Mdl->Process->AddressSpace);
|
MmUnlockAddressSpace(&Mdl->Process->AddressSpace);
|
||||||
if (Mdl->Process != CurrentProcess)
|
if (Mode == UserMode && Mdl->Process != CurrentProcess)
|
||||||
{
|
{
|
||||||
KeDetachProcess();
|
KeDetachProcess();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue