• Zebediah Figura's avatar
    ntoskrnl.exe: Protect relocated pages one at a time. · 22dfb0df
    Zebediah Figura authored
    Blindwrite 7's ezplay.sys has sections which are consecutive in memory but not
    page aligned.  Thus changing the protection to PROT_READWRITE one section at a
    time has the effect that old_prot for all sections but the first is set to
    PROT_READWRITE (actually, PROT_WRITECOPY), causing us to restore the wrong
    protection and the driver to crash in its entry point.
    
    To fix this, protect and unprotect one page at a time while processing it, i.e.
    essentially revert 6c0a8c35.  To avoid reintroducing bug 28254, protect two
    pages at a time instead of just one.
    Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com>
    Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
    22dfb0df
ntoskrnl.c 122 KB