This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [BUG] mprotect() on Windows NT 5+

On Thu, Jul 15, 2004 at 11:10:20PM +0200, Xavier Joubert wrote:
>Hello Corinna,
>Selon Corinna Vinschen <>:
>> The cause is a limitation in newer Windows NT versions, which make sense.
>> Well, sort of.  The protection modes PAGE_READWRITE and PAGE_WRITECOPY are
>> mutually exlusive, which is enforced in calls to VirtualProtect since W2K.
>> Since your example uses MAP_PRIVATE, which Cygwin maps to PAGE_WRITECOPY,
>> trying to protect with MAP_WRITE, which internally maps to PAGE_READWRTE,
>> fails on W2K and later.  I've checked in a fix, so that mprotect tests for
>> the original protection mode of the first page in the area, and uses
>> READWRITE or WRITECOPY, whichever matches the original protection.
>Whow! That's amazing! I didn't expect to get a reply today. Even less a fix
>commited to CVS. If all bugs last only 51 minutes in Cygwin, this software will
>quickly become perfect!

Unfortunately, some of us are slackers and are not as adroit as Corinna in
fixing bugs so perfection is still a long way off...


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]