Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
3.5 KiB

  1. // EmManager.h : Declaration of the CEmManager
  2. #ifndef __EMMANAGER_H_
  3. #define __EMMANAGER_H_
  4. #include "resource.h" // main symbols
  5. /////////////////////////////////////////////////////////////////////////////
  6. // CEmManager
  7. class ATL_NO_VTABLE CEmManager :
  8. public CComObjectRootEx<CComSingleThreadModel>,
  9. public CComCoClass<CEmManager, &CLSID_EmManager>,
  10. public ISupportErrorInfo,
  11. public IConnectionPointContainerImpl<CEmManager>,
  12. public IDispatchImpl<IEmManager, &IID_IEmManager, &LIBID_EMSVCLib>
  13. {
  14. public:
  15. VARIANT *m_lpVariant;
  16. int m_nStatus;
  17. int m_nType;
  18. CExcepMonSessionManager *m_pASTManager;
  19. public:
  20. CEmManager()
  21. {
  22. ATLTRACE(_T("CEmManager::CEmManager\n"));
  23. m_pASTManager = &(_Module.m_SessionManager);
  24. m_pcs = new CGenCriticalSection;
  25. }
  26. ~CEmManager()
  27. {
  28. ATLTRACE(_T("CEmManager::~CEmManager\n"));
  29. delete m_pcs;
  30. }
  31. DECLARE_REGISTRY_RESOURCEID(IDR_EMMANAGER)
  32. DECLARE_NOT_AGGREGATABLE(CEmManager)
  33. DECLARE_PROTECT_FINAL_CONSTRUCT()
  34. BEGIN_COM_MAP(CEmManager)
  35. COM_INTERFACE_ENTRY(IEmManager)
  36. COM_INTERFACE_ENTRY(IDispatch)
  37. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  38. COM_INTERFACE_ENTRY(IConnectionPointContainer)
  39. END_COM_MAP()
  40. BEGIN_CONNECTION_POINT_MAP(CEmManager)
  41. END_CONNECTION_POINT_MAP()
  42. // ISupportsErrorInfo
  43. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  44. // IEmManager
  45. public:
  46. STDMETHOD(MakeNFO)(/*[in]*/ BSTR bstrPath, /*[in]*/ BSTR bstrMachineName, /*[in]*/ BSTR bstrCategories);
  47. STDMETHOD(DeleteFile)(/*[in, out]*/ BSTR bstrEmObj);
  48. HRESULT CheckIfCanOpenSession( PEmObject pEmObj );
  49. STDMETHOD(GenerateDumpFile)(BSTR bstrEmObj, UINT nDumpType);
  50. STDMETHOD(GetEmFileInterface)(BSTR bstrEmObj, IStream **ppstrm);
  51. STDMETHOD(EnumObjectsEx)(/*[in]*/ BSTR bstrEmObj, /*[out]*/ VARIANT *lpVariant);
  52. STDMETHOD(DeleteSession)(BSTR bstrEmObj);
  53. STDMETHOD(OpenSession)(BSTR bstrEmObj, IEmDebugSession **ppEmDebugSession);
  54. STDMETHOD(EnumObjects)(EmObjectType eObjectType, VARIANT *lpVariant);
  55. private:
  56. HRESULT EnumProcs();
  57. HRESULT EnumSrvcs();
  58. HRESULT EnumMsInfoFiles( VARIANT *lpVariant, LPCTSTR lpSearchString = NULL );
  59. HRESULT EnumLogFiles ( VARIANT*, LPCTSTR lpszSearchString = NULL );
  60. HRESULT EnumDumpFiles ( VARIANT*, LPCTSTR lpszSearchString = NULL );
  61. HRESULT EnumCmdSets ( VARIANT*, LPCTSTR lpszSearchString = NULL );
  62. HRESULT EnumSessions ( PEmObject, VARIANT* );
  63. HRESULT CEmManager::FillMsInfoFileInfo
  64. (
  65. LPCTSTR lpszMsInfoFileDir,
  66. LPWIN32_FIND_DATA lpFindData,
  67. EmObject *pEmObject
  68. );
  69. HRESULT CEmManager::FillDumpFileInfo
  70. (
  71. LPCTSTR lpszDumpFileDir,
  72. LPWIN32_FIND_DATA lpFindData,
  73. EmObject *pEmObject
  74. );
  75. HRESULT FillLogFileInfo
  76. (
  77. LPCTSTR lpszLogFileDir,
  78. LPWIN32_FIND_DATA lpFindData,
  79. EmObject *pEmObject
  80. );
  81. HRESULT ScanCmdfile (
  82. LPCTSTR lpszCmdFileDir,
  83. LPWIN32_FIND_DATA lpFindData,
  84. EmObject *pEmObject
  85. );
  86. HRESULT EnumFiles (
  87. LPTSTR lpszDirectory,
  88. LPTSTR lpszExt,
  89. LPWIN32_FIND_DATA *lppFindData,
  90. LONG *lpFiles
  91. );
  92. HRESULT PackageFilesToVariant (
  93. EmObjectType eObjectType,
  94. LPWIN32_FIND_DATA lpFindFileData,
  95. LONG cFiles,
  96. LPVARIANT lpVariant
  97. );
  98. protected:
  99. private:
  100. PGenCriticalSection m_pcs;
  101. };
  102. #endif //__EMMANAGER_H_