better ps
This commit is contained in:
1 parent
325149006c
commit
c1a291c4c9
8 files changed
+228
-26
No files matched your search
@@ -1204,6 +1204,28 @@ KSTATUS MmQueryUserRegion(PROCESS* process, const void* address, void** baseOut,
|
||||
return STATUS_NOT_FOUND;
|
||||
}
|
||||
|
||||
|
||||
void MmQueryProcessUserMemory(PROCESS* process, size_t* regionCountOut, size_t* reservedBytesOut, size_t* committedBytesOut) {
|
||||
size_t regions = 0;
|
||||
size_t reserved = 0;
|
||||
size_t committed = 0;
|
||||
|
||||
if (process) {
|
||||
uintptr_t flags = KeAcquireSpinlock(&process->UserRegionLock);
|
||||
for (LIST_ENTRY* node = process->UserRegions.Fwd; node != &process->UserRegions; node = node->Fwd) {
|
||||
USER_VA_REGION* r = CONTAINING_RECORD(node, USER_VA_REGION, ProcessLink);
|
||||
regions++;
|
||||
reserved += r->ReservationSize;
|
||||
committed += r->CommittedSize;
|
||||
}
|
||||
KeReleaseSpinlock(&process->UserRegionLock, flags);
|
||||
}
|
||||
|
||||
if (regionCountOut) *regionCountOut = regions;
|
||||
if (reservedBytesOut) *reservedBytesOut = reserved;
|
||||
if (committedBytesOut) *committedBytesOut = committed;
|
||||
}
|
||||
|
||||
size_t MmGetUserRegionSize(PROCESS* process, const void* base) {
|
||||
if (!process || !base) return 0;
|
||||
uintptr_t procFlags = KeAcquireSpinlock(&process->UserRegionLock);
|
||||
|
||||
Reference in new issue
Block a user