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.

106 lines
3.0 KiB

  1. // EmDebugSession.h : Declaration of the CEmDebugSession
  2. #ifndef __EMDEBUGSESSION_H_
  3. #define __EMDEBUGSESSION_H_
  4. #include "resource.h" // main symbols
  5. /////////////////////////////////////////////////////////////////////////////
  6. // CEmDebugSession
  7. class ATL_NO_VTABLE CEmDebugSession :
  8. public CComObjectRootEx<CComSingleThreadModel>,
  9. public CComCoClass<CEmDebugSession, &CLSID_EmDebugSession>,
  10. public ISupportErrorInfo,
  11. public IConnectionPointContainerImpl<CEmDebugSession>,
  12. public IDispatchImpl<IEmDebugSession, &IID_IEmDebugSession, &LIBID_EMSVCLib>
  13. {
  14. public:
  15. CEMSessionThread *m_pEmSessThrd;
  16. PEmObject m_pEmObj;
  17. CExcepMonSessionManager *m_pASTManager;
  18. bool m_bMaster;
  19. PGenCriticalSection m_pcs;
  20. public:
  21. CEmDebugSession()
  22. {
  23. ATLTRACE(_T("CEmDebugSession::CEmDebugSession\n"));
  24. m_pEmSessThrd = NULL;
  25. m_pEmObj = NULL;
  26. m_pASTManager = &(_Module.m_SessionManager);
  27. m_bMaster = false;
  28. m_pcs = new CGenCriticalSection;
  29. }
  30. ~CEmDebugSession()
  31. {
  32. ATLTRACE(_T("CEmDebugSession::~CEmDebugSession\n"));
  33. if( AmITheMaster() == true ) {
  34. m_pASTManager->OrphanThisSession(m_pEmObj->guidstream);
  35. }
  36. if( m_pcs ) delete m_pcs;
  37. }
  38. void Init();
  39. bool AmITheMaster();
  40. HRESULT
  41. StartAutomaticSession
  42. (
  43. IN BOOL bRecursive,
  44. IN BSTR bstrEcxFilePath,
  45. IN BSTR bstrNotificationString,
  46. IN BSTR bstrAltSymPath,
  47. IN BOOL bGenMiniDumpFile,
  48. IN BOOL bGenUserDumpFile
  49. );
  50. HRESULT
  51. StartManualSession
  52. (
  53. IN BSTR bstrEcxFilePath,
  54. IN UINT nPort,
  55. IN BSTR bstrUserName,
  56. IN BSTR bstrPassword,
  57. IN BOOL bBlockIncomingIPConnections,
  58. IN BSTR bstrAltSymPath
  59. );
  60. DECLARE_REGISTRY_RESOURCEID(IDR_EMDEBUGSESSION)
  61. DECLARE_NOT_AGGREGATABLE(CEmDebugSession)
  62. DECLARE_PROTECT_FINAL_CONSTRUCT()
  63. BEGIN_COM_MAP(CEmDebugSession)
  64. COM_INTERFACE_ENTRY(IEmDebugSession)
  65. COM_INTERFACE_ENTRY(IDispatch)
  66. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  67. COM_INTERFACE_ENTRY(IConnectionPointContainer)
  68. END_COM_MAP()
  69. BEGIN_CONNECTION_POINT_MAP(CEmDebugSession)
  70. END_CONNECTION_POINT_MAP()
  71. // ISupportsErrorInfo
  72. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  73. // IEmDebugSession
  74. public:
  75. STDMETHOD(AdoptOrphan)();
  76. HRESULT CanTakeOwnership();
  77. void SetMyselfAsMaster(bool bMaster = true);
  78. STDMETHOD(CancelDebug)(BOOL bForceCancel);
  79. STDMETHOD(DebugEx)(/*[in, out]*/ BSTR bstrEmObj, /*[in]*/ SessionType eSessType, /*[in]*/ BSTR bstrEcxFilePath, /*[in]*/ LONG lParam, /*[in, optional]*/ VARIANT vtUserName, /*[in, optional]*/ VARIANT vtPassword, /*[in, optional]*/ VARIANT vtPort, /*[in, optional]*/ VARIANT vtNotifyAdmin, /*[in, optional]*/ VARIANT vtAltSymPath);
  80. STDMETHOD(GetStatus)(/*[out]*/ BSTR bstrEmObj);
  81. STDMETHOD(GenerateDumpFile)(/*[in]*/ UINT neDumpType);
  82. STDMETHOD(StopDebug)(BOOL bForceStop);
  83. STDMETHOD(Debug)(BSTR bstrEmObj, SessionType eSessType);
  84. };
  85. #endif //__EMDEBUGSESSION_H_