Your call to VirtualQueryEx looks wrong. Following Rage's advise would help you. Try this:
BOOL bOK = VirtualQueryEx(proc, min_address, &mem_info, sizeof mem_info);
if (!bOK)
{
DWORD dwErr = GetLastError();
std::cout << "VirtualQueryEx returns " << dwErr << std::endl;
}
You may need to truncate the min_address to a page boundary. See:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa366907%28v=vs.85%29.aspx[
^]