SymGuardApp.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #ifndef __SymGuardApp_h__
  2. #define __SymGuardApp_h__
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. /////////////////////////////////////////////////////////////////////////////
  7. // SymGuardApp.h: Definition of the SymGuardApp class
  8. //
  9. #include <SymGuard.h>
  10. #include "resource.h"
  11. /////////////////////////////////////////////////////////////////////////////
  12. // Forward Declarations
  13. class CSymModule;
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CSymGuardApp
  16. //
  17. class CSymGuardApp :
  18. public IDispatchImpl<ISymGuardApp, &IID_ISymGuardApp, &LIBID_SymGuardLib>,
  19. public ISupportErrorInfo,
  20. public CComObjectRootEx<CComMultiThreadModel>,
  21. public CComCoClass<CSymGuardApp,&CLSID_SymGuardApp>
  22. {
  23. // Declarations
  24. public:
  25. DECLARE_REGISTRY_RESOURCEID(IDR_SymGuardApp)
  26. DECLARE_PROTECT_FINAL_CONSTRUCT()
  27. DECLARE_GET_CONTROLLING_UNKNOWN()
  28. // Category Map
  29. public:
  30. BEGIN_CATEGORY_MAP(CSymGuardApp)
  31. IMPLEMENTED_CATEGORY(CATID_SymGuard)
  32. IMPLEMENTED_CATEGORY(CATID_SafeForScripting)
  33. IMPLEMENTED_CATEGORY(CATID_SafeForInitializing)
  34. END_CATEGORY_MAP()
  35. // Interface Map
  36. public:
  37. BEGIN_COM_MAP(CSymGuardApp)
  38. COM_INTERFACE_ENTRY(IDispatch)
  39. COM_INTERFACE_ENTRY(ISymGuardApp)
  40. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  41. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_spUnkMarshaler.p)
  42. END_COM_MAP()
  43. // Construction / Destruction
  44. public:
  45. HRESULT FinalConstruct();
  46. void FinalRelease();
  47. // Operations
  48. public:
  49. HRESULT FlushModuleFromCache(const ZString& strCacheKey);
  50. // ISupportErrorInfo Interface Methods
  51. public:
  52. STDMETHODIMP InterfaceSupportsErrorInfo(REFIID riid);
  53. // ISymGuardApp Interface Methods
  54. public:
  55. STDMETHODIMP LoadModule(BSTR bstrSymbolPath, BSTR bstrModuleName,
  56. VARIANT* pvarImageBase, VARIANT* pvarImageSize, ISymModule** ppModule);
  57. STDMETHODIMP FlushAllModulesFromCache(long* pcModulesFlushed);
  58. STDMETHODIMP get_Version(ISymGuardVersion** ppVersion);
  59. STDMETHODIMP get_DbgHelpVersion(ISymGuardVersion** ppVersion);
  60. // Types
  61. protected:
  62. typedef TCObjectLock<CSymGuardApp> XLock;
  63. typedef std::map<ZString, CSymModule*> XModules;
  64. typedef XModules::iterator XModuleIt;
  65. // Data Members
  66. public:
  67. CComPtr<IUnknown> m_spUnkMarshaler;
  68. protected:
  69. XModules m_ModuleCache;
  70. };
  71. /////////////////////////////////////////////////////////////////////////////
  72. #endif // !__SymGuardApp_h__