private int GetWorkingSetNumber(NProcessHacker.WsInformationClass WsInformationClass) { if (_pitem.ProcessQueryHandle == null) { return(0); } int wsInfo; int retLen; try { if (NProcessHacker.PhQueryProcessWs(_pitem.ProcessQueryHandle, WsInformationClass, out wsInfo, 4, out retLen) < NtStatus.Error) { return(wsInfo * Program.ProcessProvider.System.PageSize); } } catch { } return(0); }
private int GetWorkingSetNumber(NProcessHacker.WsInformationClass WsInformationClass) { NtStatus status; int wsInfo; int retLen; try { using (var phandle = new ProcessHandle(_pitem.Pid, ProcessAccess.QueryInformation | ProcessAccess.VmRead)) { if ((status = NProcessHacker.PhQueryProcessWs(phandle, WsInformationClass, out wsInfo, 4, out retLen)) < NtStatus.Error) { return(wsInfo * Program.ProcessProvider.System.PageSize); } } } catch { } return(0); }