mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1201205 part 2: Restore protection on the nop space separately from the function. r=m_kato
This commit is contained in:
parent
ec23b6de3f
commit
0187e37a6b
@ -169,9 +169,10 @@ public:
|
||||
|
||||
// Ensure we can read and write starting at fn - 5 (for the long jmp we're
|
||||
// going to write) and ending at fn + 2 (for the short jmp up to the long
|
||||
// jmp).
|
||||
AutoVirtualProtect protect(fn - 5, 7, PAGE_EXECUTE_READWRITE);
|
||||
if (!protect.Protect()) {
|
||||
// jmp). These bytes may span two pages with different protection.
|
||||
AutoVirtualProtect protectBefore(fn - 5, 5, PAGE_EXECUTE_READWRITE);
|
||||
AutoVirtualProtect protectAfter(fn, 2, PAGE_EXECUTE_READWRITE);
|
||||
if (!protectBefore.Protect() || !protectAfter.Protect()) {
|
||||
//printf ("VirtualProtectEx failed! %d\n", GetLastError());
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user