Process Private Memory Usage Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
User avatar
jNizM
Posts: 2574
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: Process Private Memory Usage

22 Mar 2019, 08:00

For 32-bit it should beif (NumGet(addr + 68, "ptr") = PID)
Will add 32-bit later too.. because I just work with 64-bit
[AHK] 1.1.30.03 x64 Unicode | [WIN] 10 Pro (Version 1909) x64 | [GitHub] Profile
Donations are appreciated if I could help you
User avatar
jNizM
Posts: 2574
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: Process Private Memory Usage  Topic is solved

22 Mar 2019, 08:25

For 32- & 64-Bit

Code: Select all

MsgBox % GetWorkingSetPrivateSize(2580) " K"

GetWorkingSetPrivateSize(PID)
{
	if (DllCall("ntdll.dll\NtQuerySystemInformation", "int", 0x5, "ptr", 0, "uint", 0, "uint*", size) != 0) {
		size := VarSetCapacity(buf, size, 0)
		if (DllCall("ntdll\NtQuerySystemInformation", "int", 0x5, "ptr", &buf, "uint", size, "uint*", 0) != 0)
			return (ErrorLevel := 2) & 0
		addr := &buf
		while (addr) {
			if (NumGet(addr + 56 + A_PtrSize * 3, "ptr") = PID)
				return NumGet(addr + 8, "int64") // 1024
			if !(NumGet(addr + 0, "uint"))
				break
			addr += NumGet(addr + 0, "uint")
		}
	}
	return (ErrorLevel := 1) & 0
}
Full function -> https://www.autohotkey.com/boards/viewtopic.php?f=6&t=62989
[AHK] 1.1.30.03 x64 Unicode | [WIN] 10 Pro (Version 1909) x64 | [GitHub] Profile
Donations are appreciated if I could help you

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Chunjee, jgcampbell300, millansoft, yessir3 and 254 guests