MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / VirtualQuery

Function VirtualQuery

pkg/util/va/region.go:171–185  ·  view source on GitHub ↗

VirtualQuery queries the virtual address region info.

(process windows.Handle, addr uint64)

Source from the content-addressed store, hash-verified

169
170// VirtualQuery queries the virtual address region info.
171func 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.

Callers 3

AllocationSizeMethod · 0.92
ProtectionMethod · 0.92
QueryMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected