[2/3] ntdll: Use PAGE_READWRITE access when resolving DLL imports.

Alexandre Julliard julliard at winehq.org
Thu Nov 3 04:42:28 CDT 2011

Dmitry Timoshkov <dmitry at baikal.ru> writes:

> Alexandre Julliard <julliard at winehq.org> wrote:
>> >      NtProtectVirtualMemory( NtCurrentProcess(), &protect_base,
>> > -                            &protect_size, PAGE_WRITECOPY, &protect_old );
>> > +                            &protect_size, PAGE_READWRITE, &protect_old );
>> Restoring the permissions is not going to work if it was already
>> writable.
> Do you mean that mprotect may fail or something else? Also, how is that
> different from what current code is doing? Do you suggest to check
> the old protection permissions before changing/restoring access with
> NtProtectVirtualMemory()?

What I mean is that if the old protection contains WRITECOPY, you won't
be able to restore it correctly since you are going to make
NtProtectVirtualMemory reject that.

Alexandre Julliard
julliard at winehq.org

More information about the wine-devel mailing list