VirtualQuery queries the virtual address region info.
(process windows.Handle, addr uint64)
| 169 | |
| 170 | // VirtualQuery queries the virtual address region info. |
| 171 | func VirtualQuery(process windows.Handle, addr uint64) *RegionInfo { |
| 172 | var mem windows.MemoryBasicInformation |
| 173 | err := windows.VirtualQueryEx(process, uintptr(addr), &mem, unsafe.Sizeof(mem)) |
| 174 | if err != nil { |
| 175 | return nil |
| 176 | } |
| 177 | return &RegionInfo{ |
| 178 | Type: mem.Type, |
| 179 | Protect: mem.AllocationProtect, |
| 180 | BaseAddr: addr, |
| 181 | Size: uint64(mem.RegionSize), |
| 182 | proc: process, |
| 183 | State: mem.State, |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | // Remove removes the process handle from cache and closes it. |
| 188 | // It returns true if the handle was closed successfully. |
no outgoing calls
no test coverage detected