mirror of
https://github.com/reactos/reactos.git
synced 2024-11-18 13:01:40 +00:00
[NTOS:MM] Fix MiSetSystemCodeProtection
CORE-16387 CORE-17638 Windows only makes the header RO for session space mapped drivers (win32k, dx and display drivers)
This commit is contained in:
parent
ccde294b24
commit
47372e2ac9
1 changed files with 3 additions and 3 deletions
|
@ -2486,13 +2486,13 @@ MiWriteProtectSystemImage(
|
|||
/* Get the base address of the first section */
|
||||
SectionBase = Add2Ptr(ImageBase, SectionHeaders[0].VirtualAddress);
|
||||
|
||||
/* Start protecting the image header as R/O */
|
||||
/* Start protecting the image header as R/W */
|
||||
FirstPte = MiAddressToPte(ImageBase);
|
||||
LastPte = MiAddressToPte(SectionBase) - 1;
|
||||
Protection = IMAGE_SCN_MEM_READ;
|
||||
Protection = IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE;
|
||||
if (LastPte >= FirstPte)
|
||||
{
|
||||
MiSetSystemCodeProtection(FirstPte, LastPte, IMAGE_SCN_MEM_READ);
|
||||
MiSetSystemCodeProtection(FirstPte, LastPte, Protection);
|
||||
}
|
||||
|
||||
/* Loop the sections */
|
||||
|
|
Loading…
Reference in a new issue