"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.