|
// PSLProcessMemory.h : Declaration of the CPSLProcessMemory
#pragma once
#include "resource.h" // main symbols
#include <Psapi.h>
#include "GUIDs.h"
#include "PSLExceptions.h"
#include "ProSysLib_i.h"
#if (_WIN32_WINNT < 0x0501)
struct PROCESS_MEMORY_COUNTERS_EX;
#endif
class ATL_NO_VTABLE CPSLProcessMemory:
public CComObjectRootEx<CComMultiThreadModel>,
public CComCoClass<CPSLProcessMemory, &CLSID_PSLProcessMemory>,
public IDispatchImpl<IPSLProcessMemory, &IID_IPSLProcessMemory, &LIBID_ProSysLib, PSL_HiVersion, PSL_LoVersion>,
public CPSLException<&CLSID_PSLProcessMemory, &IID_IPSLProcessMemory>
{
public:
CPSLProcessMemory();
void Initialize(long ProcessID);
BEGIN_COM_MAP(CPSLProcessMemory)
COM_INTERFACE_ENTRY(IPSLProcessMemory)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(ISupportErrorInfo)
END_COM_MAP()
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct();
void FinalRelease();
////////////////////////////
// Interface Implementation:
////////////////////////////
STDMETHOD(get_PageFaultCount)(long * pValue);
STDMETHOD(get_PageFaultDelta)(long * pValue);
STDMETHOD(get_PeakWorkingSetSize)(long * pValue);
STDMETHOD(get_WorkingSetSize)(long * pValue);
STDMETHOD(get_QuotaPeakPagedPoolUsage)(long * pValue);
STDMETHOD(get_QuotaPagedPoolUsage)(long * pValue);
STDMETHOD(get_QuotaPeakNonPagedPoolUsage)(long * pValue);
STDMETHOD(get_QuotaNonPagedPoolUsage)(long * pValue);
STDMETHOD(get_PagefileUsage)(long * pValue);
STDMETHOD(get_PeakPagefileUsage)(long * pValue);
STDMETHOD(get_PrivateUsage)(long * pValue);
private:
bool GetMemoryInfo(PROCESS_MEMORY_COUNTERS_EX * pInfo);
long m_ProcessID;
long m_CurrentProcessID;
long m_LastPageFaultCount;
};
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.