[Bug 12351] thread stack PAGE_GUARD/overflow handling (NT compatibility)

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Apr 4 02:52:19 CDT 2008


http://bugs.winehq.org/show_bug.cgi?id=12351





--- Comment #1 from Alexandre Julliard <julliard at winehq.org>  2008-04-04 02:52:18 ---
(In reply to comment #0)

> --- snip example code ----
> MEMORY_BASIC_INFORMATION mbi;
> DWORD oldProtect;
> 
> SetLastError(0xdeadbeef);
> ok(VirtualQuery( &mbi, &mbi, sizeof(MEMORY_BASIC_INFORMATION)) == sizeof(mbi));
> ok(!VirtualProtect( mbi.BaseAddress, mbi.RegionSize, PAGE_GUARD, &oldProtect));
> ok(GetLastError() == ERROR_INVALID_PARAMETER);
> --- snip example code ----
> 
> Glibc mprotect() code triggers the segfault.

Actually this is not testing guard pages, it just demonstrates that Wine is
less strict about rejecting invalid protection flags. The protection needs to
be something like PAGE_READWRITE|PAGE_GUARD, and then the VirtualProtect call
will succeed both on Windows and Wine.

The second example works fine for me too, you just have to make the buffer
smaller than a page to make sure to hit the last guard page.


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list