"Detlef Riekenberg" wine.dev@web.de wrote:
- len = VirtualQuery(VirtualAddress, &info, sizeof(MEMORY_BASIC_INFORMATION));
- if ((len == sizeof(MEMORY_BASIC_INFORMATION)) &&
(info.Protect & (PAGE_READWRITE || PAGE_EXECUTE_READWRITE)) &&
((info.Protect & PAGE_NOACCESS) == 0) &&
(info.Type & MEM_COMMIT))
- {
return TRUE;
- }
Besides the already pointed out '||' vs. '|' mismatch your code doesn't handle PAGE_READONLY and others implying read-only access. Probably checking for PAGE_NOACCESS and MEM_COMMIT should be enough.
On Di, 2008-03-18 at 09:09 +0800, Dmitry Timoshkov wrote:
"Detlef Riekenberg" wine.dev@web.de wrote:
- len = VirtualQuery(VirtualAddress, &info, sizeof(MEMORY_BASIC_INFORMATION));
- if ((len == sizeof(MEMORY_BASIC_INFORMATION)) &&
(info.Protect & (PAGE_READWRITE || PAGE_EXECUTE_READWRITE)) &&
((info.Protect & PAGE_NOACCESS) == 0) &&
(info.Type & MEM_COMMIT))
- {
return TRUE;
- }
Besides the already pointed out '||' vs. '|' mismatch your code doesn't handle PAGE_READONLY and others implying read-only access. Probably checking for PAGE_NOACCESS and MEM_COMMIT should be enough.
This is not enough, since PAGE_READONLY will Pagefault on Write.
From OSR, the result is only TRUE, when the Address does not pagefault
on read or write access: http://www.osronline.com/DDKx/kmarch/k106_3vle.htm
Thanks for your review.