Leaked source code of windows server 2003
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.

145 lines
3.8 KiB

  1. /*===================================================================
  2. Microsoft Denali
  3. Microsoft Confidential.
  4. Copyright 1996 Microsoft Corporation. All Rights Reserved.
  5. Component: misc
  6. File: debugger.h
  7. Owner: DGottner, DmitryR
  8. This file contains debugger useful utility prototypes.
  9. ===================================================================*/
  10. #ifndef _DEBUGGER_H
  11. #define _DEBUGGER_H
  12. #include "activdbg.h"
  13. #include "dbgcxt.h" // Convienence for users of debugger.h
  14. /*
  15. * Globals that we advertise
  16. */
  17. class CViperActivity;
  18. extern IProcessDebugManager *g_pPDM;
  19. extern IDebugApplication *g_pDebugApp;
  20. extern IDebugApplicationNode *g_pDebugAppRoot;
  21. extern CViperActivity *g_pDebugActivity;
  22. extern DWORD g_dwDebugThreadId;
  23. /*
  24. * Initialize/Uninitialize debugging
  25. */
  26. extern HRESULT InitDebugging(CIsapiReqInfo *pIReq);
  27. extern HRESULT UnInitDebugging();
  28. /*
  29. * Get the application node for the virtual server
  30. */
  31. extern HRESULT GetServerDebugRoot(CIsapiReqInfo *pIReq, IDebugApplicationNode **ppDebugRoot);
  32. /*
  33. * Query debugging client
  34. */
  35. BOOL FCaesars(); // TRUE if default JIT debugger is Script Debugger
  36. /*
  37. * Debugger (or Debugger UI) invocation from a correct thread
  38. */
  39. #define DEBUGGER_UI_BRING_DOCUMENT_TO_TOP 0x00000001
  40. #define DEBUGGER_UI_BRING_DOC_CONTEXT_TO_TOP 0x00000002
  41. #define DEBUGGER_EVENT_ON_PAGEBEGIN 0x00000010
  42. #define DEBUGGER_EVENT_ON_PAGEEND 0x00000020
  43. #define DEBUGGER_EVENT_ON_REFRESH_BREAKPOINT 0x00000040
  44. #define DEBUGGER_ON_REMOVE_CHILD 0x00000100
  45. #define DEBUGGER_ON_DESTROY 0x00000200
  46. #define DEBUGGER_UNUSED_RECORD 0x80000000 // can reclaim argument space
  47. HRESULT InvokeDebuggerWithThreadSwitch(IDebugApplication *pDebugAppln, DWORD iMethod, void *Arg = NULL);
  48. /*
  49. * Create/Destroy entire document trees (debugger)
  50. */
  51. HRESULT CreateDocumentTree(wchar_t *szDocPath, IDebugApplicationNode *pDocParent, IDebugApplicationNode **ppDocRoot, IDebugApplicationNode **ppDocLeaf, wchar_t **pwszLeaf);
  52. void DestroyDocumentTree(IDebugApplicationNode *pDocRoot);
  53. /*===================================================================
  54. C F i l e N o d e
  55. These are used to provide directory nodes in debugger
  56. Used by application mgr & by CreateDocumentTree
  57. ===================================================================*/
  58. extern const GUID IID_IFileNode;
  59. struct IFileNode : IDebugDocumentProvider
  60. {
  61. //
  62. // This private interface provides two functions:
  63. //
  64. // * An extra method to retrieve/set the count of documents in
  65. // a directory (used to know when we can detach a folder from
  66. // the UI
  67. //
  68. // * A way of verifying that an IDebugDocumentProvider is a CFileNode
  69. //
  70. STDMETHOD_(DWORD, IncrementDocumentCount)() = 0;
  71. STDMETHOD_(DWORD, DecrementDocumentCount)() = 0;
  72. };
  73. class CFileNode : public IFileNode
  74. {
  75. private:
  76. DWORD m_cRefs; // Reference Count
  77. DWORD m_cDocuments; // # of CTemplates in the directory (and recursively in subdirectories)
  78. wchar_t *m_wszName;
  79. public:
  80. CFileNode();
  81. ~CFileNode();
  82. HRESULT Init(wchar_t *wszName);
  83. // IUnknown methods
  84. STDMETHOD(QueryInterface)(const GUID &, void **);
  85. STDMETHOD_(ULONG, AddRef)();
  86. STDMETHOD_(ULONG, Release)();
  87. // IDebugDocumentProvider methods
  88. STDMETHOD(GetDocument)(/* [out] */ IDebugDocument **ppDebugDoc);
  89. // IDebugDocumentInfo (also IDebugDocumentProvider) methods
  90. STDMETHOD(GetName)(
  91. /* [in] */ DOCUMENTNAMETYPE dnt,
  92. /* [out] */ BSTR *pbstrName);
  93. STDMETHOD(GetDocumentClassId)(/* [out] */ CLSID *)
  94. {
  95. return E_NOTIMPL;
  96. }
  97. STDMETHOD_(DWORD, IncrementDocumentCount)()
  98. {
  99. return ++m_cDocuments;
  100. }
  101. STDMETHOD_(DWORD, DecrementDocumentCount)()
  102. {
  103. return --m_cDocuments;
  104. }
  105. };
  106. #endif // _DEBUGGER_H