Back

// PSLCurrentProcess.h : Declaration of the CPSLCurrentProcess

#pragma once
#include "resource.h"       // main symbols
#include "GUIDs.h"
#include "AutoObject.h"
#include "PSLExceptions.h"
#include "ProSysLib_i.h"

#include "PSLModuleVersion.h"
#include "PSLProcessMemory.h"
#include "PSLEnvironmentVars.h"
#include "PSLProcessIO.h"
#include "PSLThreads.h"
#include "PSLWindows.h"
#include "PSLCmdParams.h"
#include "PSLModules.h"

class ATL_NO_VTABLE CPSLCurrentProcess:
   public CComObjectRootEx<CComMultiThreadModel>,
   public CComCoClass<CPSLCurrentProcess, &CLSID_PSLCurrentProcess>,
   public IDispatchImpl<IPSLCurrentProcess, &IID_IPSLCurrentProcess, &LIBID_ProSysLib, PSL_HiVersion, PSL_LoVersion>,
   public CPSLException<&CLSID_PSLCurrentProcess, &IID_IPSLCurrentProcess>
{

public:

   CPSLCurrentProcess();

BEGIN_COM_MAP(CPSLCurrentProcess)
   COM_INTERFACE_ENTRY(IPSLCurrentProcess)
   COM_INTERFACE_ENTRY(IDispatch)
   COM_INTERFACE_ENTRY(ISupportErrorInfo)
END_COM_MAP()

   DECLARE_PROTECT_FINAL_CONSTRUCT()
   HRESULT FinalConstruct();
   void FinalRelease();

////////////////////////////
// Interface Implementation:
////////////////////////////

   STDMETHOD(get_ProcessID)(long * pValue);
   STDMETHOD(get_ConsoleWnd)(VARIANT * pValue);
   STDMETHOD(get_FileName)(BSTR * pValue);
   STDMETHOD(get_FilePath)(BSTR * pValue);
   STDMETHOD(get_FileDir)(BSTR * pValue);
   STDMETHOD(get_CurrentDir)(BSTR * pValue);
   STDMETHOD(put_CurrentDir)(BSTR newValue);
   STDMETHOD(get_Created)(DATE * pValue);
   STDMETHOD(get_Is64Bit)(VARIANT_BOOL * pValue);
   STDMETHOD(get_IsDebugged)(VARIANT_BOOL * pValue);
   STDMETHOD(get_HandleCount)(long * pValue);
   STDMETHOD(get_GDICount)(long * pValue);
   STDMETHOD(get_USERCount)(long * pValue);
   STDMETHOD(get_ShutdownLevel)(long * pValue);
   STDMETHOD(put_ShutdownLevel)(long newValue);
   STDMETHOD(get_ShutdownFlags)(long * pValue);
   STDMETHOD(put_ShutdownFlags)(long newValue);
   STDMETHOD(get_Priority)(PSLProcessPriority * pValue);
   STDMETHOD(put_Priority)(PSLProcessPriority newValue);
   STDMETHOD(get_AffinityMask)(VARIANT * pValue);
   STDMETHOD(put_AffinityMask)(VARIANT newValue);
   STDMETHOD(get_Memory)(IPSLProcessMemory ** ppValue);
   STDMETHOD(get_IO)(IPSLProcessIO ** ppValue);
   STDMETHOD(get_EnvVars)(IPSLEnvironmentVars ** ppValue);
   STDMETHOD(get_Modules)(IPSLModules ** ppValue);
   STDMETHOD(get_Version)(IPSLModuleVersion ** ppValue);
   STDMETHOD(get_Commands)(IPSLCmdParams ** ppValue);
   STDMETHOD(get_Threads)(IPSLThreads ** ppValue);
   STDMETHOD(get_Windows)(IPSLWindows ** ppValue);

private:

   // Fixed values for the process:
   DWORD m_dwProcessID;
   _bstr_t m_sFilePath;
   _bstr_t m_sFileDir;
   _bstr_t m_sFileName;
   DATE m_Created;

   CAutoObject<CPSLModuleVersion> m_Version;
   CAutoObject<CPSLProcessMemory> m_Memory;
   CAutoObject<CPSLProcessIO> m_ProcessIO;
   CAutoObject<CPSLEnvironmentVars> m_EnvVars;
   CAutoObject<CPSLCmdParams> m_Commands;
   CAutoObject<CPSLModules> m_Modules;
   CAutoObject<CPSLThreads> m_Threads;
   CAutoObject<CPSLWindows> m_Windows;
};

Top