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.

85 lines
2.7 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Copyright (C) Microsoft Corporation, 2000.
  3. //
  4. // debugmon.hpp
  5. //
  6. // Direct3D Debug Monitor
  7. //
  8. ///////////////////////////////////////////////////////////////////////////////
  9. #ifndef _DEBUGMON_HPP
  10. #define _DEBUGMON_HPP
  11. #include "d3ddm.hpp"
  12. //////////////////////////////////////////////////////////////////////////
  13. //
  14. // Shared Memory object - creates or attaches to shared memory identified
  15. // by character string name and of the size (in bytes) provided to
  16. // constructor
  17. //
  18. //////////////////////////////////////////////////////////////////////////
  19. class D3DSharedMem
  20. {
  21. private:
  22. HANDLE m_hFileMap;
  23. void* m_pMem;
  24. BOOL m_bAlreadyExisted;
  25. public:
  26. //
  27. // 6/20/2000(RichGr) - IA64: Change first parameter from int to INT_PTR so that
  28. // all parameters are the same length. This is needed to make the va_start
  29. // macro work correctly.
  30. D3DSharedMem(INT_PTR cbSize, const char* pszFormat, ...);
  31. ~D3DSharedMem(void);
  32. void* GetPtr(void) { return m_pMem; }
  33. BOOL AlreadyExisted(void) { return m_bAlreadyExisted; }
  34. };
  35. //////////////////////////////////////////////////////////////////////////
  36. //////////////////////////////////////////////////////////////////////////
  37. //
  38. //
  39. //
  40. //////////////////////////////////////////////////////////////////////////
  41. class D3DDebugMonitor
  42. {
  43. public:
  44. D3DDebugMonitor( void );
  45. ~D3DDebugMonitor( void );
  46. // communications between target and monitor
  47. DebugTargetContext* m_pTgtCtx;
  48. const DebugMonitorContext* m_pMonCtx;
  49. void* m_pCmdData;
  50. HANDLE m_hTgtEventBP;
  51. HANDLE m_hTgtEventAck;
  52. HANDLE m_hMonEventCmd;
  53. BOOL m_bDbgMonConnectionEnabled;
  54. HRESULT AttachToMonitor( int iMon );
  55. void DetachMonitorConnection( void );
  56. BOOL CheckLostMonitorConnection( void );
  57. inline BOOL MonitorConnected( void ) { return (NULL != m_pMonCtx); }
  58. inline UINT32 MonitorEventBP( void )
  59. { return MonitorConnected() ? (m_pMonCtx->EventBP) : (0x0); }
  60. BOOL IsEventBreak( UINT32 EventType );
  61. HRESULT MonitorBreakpoint( void );
  62. virtual HRESULT ProcessMonitorCommand( void ) = 0;
  63. inline void StateChanged( UINT32 WhichState )
  64. { m_pTgtCtx->StateChanged |= WhichState; }
  65. protected:
  66. // shared-memory segments for the communications resources
  67. D3DSharedMem* m_pMonCtxSM;
  68. D3DSharedMem* m_pTgtCtxSM;
  69. D3DSharedMem* m_pCmdDataSM;
  70. };
  71. ///////////////////////////////////////////////////////////////////////////////
  72. #endif // _DEBUGMON_HPP