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.

184 lines
4.9 KiB

  1. // File: dbgmenu.h
  2. #ifndef _DBGMENU_H_
  3. #define _DBGMENU_H_
  4. const int IDM_DEBUG = 50000; // debug menu ID
  5. const int IDM_DEBUG_FIRST = 50001; // start of menu item range
  6. const int IDM_DEBUG_LAST = 50099; // end of menu item range
  7. #define AS_DEBUG_KEY "Software\\Microsoft\\Conferencing\\AppSharing\\Debug"
  8. #define REGVAL_AS_HATCHSCREENDATA "HatchScreenData"
  9. #define REGVAL_AS_HATCHBMPORDERS "HatchBitmapOrders"
  10. #define REGVAL_AS_COMPRESSION "GDCCompression"
  11. #define REGVAL_AS_VIEWSELF "ViewOwnSharedStuff"
  12. #define REGVAL_AS_NOFLOWCONTROL "NoFlowControl"
  13. #define REGVAL_OM_NOCOMPRESSION "NoOMCompression"
  14. // Base debug option classe
  15. class CDebugOption
  16. {
  17. public:
  18. int m_bst; // Current Button State (BST_CHECKED, BST_UNCHECKED, BST_INDETERMINATE)
  19. PTSTR m_psz; // Text to display
  20. CDebugOption();
  21. ~CDebugOption();
  22. CDebugOption(PTSTR psz, int bst = BST_INDETERMINATE);
  23. virtual void Update(void);
  24. };
  25. // Option checkbox data for modifying a memory flag
  26. class DBGOPTPDW : public CDebugOption
  27. {
  28. public:
  29. DWORD m_dwMask; // bit to flip
  30. DWORD * m_pdw; // pointer to data
  31. DBGOPTPDW(PTSTR psz, DWORD dwMask, DWORD * pdw);
  32. DBGOPTPDW();
  33. void Update(void);
  34. };
  35. // Option checkbox data for modifying a registry entry
  36. class DBGOPTREG : public CDebugOption
  37. {
  38. public:
  39. DWORD m_dwMask; // bit to flip
  40. DWORD m_dwDefault; // default value
  41. HKEY m_hkey; // key
  42. PTSTR m_pszSubKey; // subkey
  43. PTSTR m_pszEntry; // entry
  44. DBGOPTREG(PTSTR psz,
  45. DWORD dwMask,
  46. DWORD dwDefault,
  47. PTSTR pszEntry,
  48. PTSTR pszSubKey = CONFERENCING_KEY,
  49. HKEY hkey = HKEY_CURRENT_USER);
  50. ~DBGOPTREG();
  51. void Update(void);
  52. };
  53. // Option checkbox data used explicitly for maintaining compression data.
  54. // Because of the use of static variables, this subclass should not be used
  55. // for any other purpose.
  56. class DBGOPTCOMPRESS : public CDebugOption
  57. {
  58. public:
  59. static DWORD m_dwCompression; // actual compression value
  60. static int m_total; // total number of instances of this subclass
  61. static int m_count; // internally used counter
  62. static DWORD m_dwDefault; // default value
  63. static HKEY m_hkey; // key
  64. static PTSTR m_pszSubKey; // subkey
  65. static PTSTR m_pszEntry; // entry
  66. BOOL m_bCheckedOn; // if true, a checked option turns a bit on;
  67. // otherwise, it turns a bit off
  68. DWORD m_dwMask; // which bits in m_dwCompression to change
  69. DBGOPTCOMPRESS(PTSTR psz,
  70. DWORD dwMask,
  71. BOOL bCheckedOn);
  72. ~DBGOPTCOMPRESS();
  73. void Update(void);
  74. };
  75. class CDebugMenu
  76. {
  77. public:
  78. HWND m_hwnd;
  79. HMENU m_hMenu;
  80. HMENU m_hMenuDebug;
  81. HWND m_hwndDbgopt;
  82. CDebugMenu(VOID);
  83. // ~CDebugMenu(VOID);
  84. VOID InitDebugMenu(HWND hwnd);
  85. BOOL OnDebugCommand(WPARAM wCmd);
  86. // Member Info Menu Item
  87. VOID DbgMemberInfo(VOID);
  88. VOID InitMemberDlg(HWND);
  89. VOID FillMemberList(HWND);
  90. VOID ShowMemberInfo(HWND, CParticipant *);
  91. static INT_PTR CALLBACK DbgListDlgProc(HWND, UINT, WPARAM, LPARAM);
  92. // Version Menu Item
  93. VOID DbgVersion(VOID);
  94. BOOL DlgVersionMsg(HWND, UINT, WPARAM, LPARAM);
  95. static INT_PTR CALLBACK DbgVersionDlgProc(HWND, UINT, WPARAM, LPARAM);
  96. BOOL InitVerDlg(HWND);
  97. BOOL FillVerList(HWND);
  98. VOID ShowVerInfo(HWND, LPSTR *, int);
  99. // Debug Options Menu Item
  100. VOID DbgOptions(VOID);
  101. BOOL DlgOptionsMsg(HWND, UINT, WPARAM, LPARAM);
  102. static INT_PTR CALLBACK DbgOptionsDlgProc(HWND, UINT, WPARAM, LPARAM);
  103. VOID InitOptionsData(HWND);
  104. VOID AddDbgOptions(LV_ITEM *);
  105. VOID AddASOptions(LV_ITEM *);
  106. // Debug Zones Menu Item
  107. VOID DbgChangeZones(VOID);
  108. VOID AddZones(LV_ITEM *);
  109. VOID InitZonesData(HWND);
  110. VOID SaveZonesData(VOID);
  111. BOOL DlgZonesMsg(HWND, UINT, WPARAM, LPARAM);
  112. static INT_PTR CALLBACK DbgZonesDlgProc(HWND, UINT, WPARAM, LPARAM);
  113. // System Policy Menu Item
  114. VOID DbgSysPolicy(VOID);
  115. VOID InitPolicyData(HWND hDlg);
  116. VOID AddPolicyOptions(LV_ITEM *);
  117. BOOL DlgPolicyMsg(HWND, UINT, WPARAM, LPARAM);
  118. static INT_PTR CALLBACK DbgPolicyDlgProc(HWND, UINT, WPARAM, LPARAM);
  119. // User Interface Menu Item
  120. VOID DbgUI(VOID);
  121. VOID InitUIData(HWND hDlg);
  122. VOID AddUIOptions(LV_ITEM *);
  123. static INT_PTR CALLBACK DbgUIDlgProc(HWND, UINT, WPARAM, LPARAM);
  124. // General Dialog-Checkbox functions
  125. BOOL InitOptionsDlg(HWND);
  126. BOOL SaveOptionsData(HWND);
  127. VOID FreeOptionsData(HWND);
  128. VOID ToggleOption(LV_ITEM *);
  129. VOID OnNotifyDbgopt(LPARAM);
  130. VOID AddOption(LV_ITEM * plvItem, CDebugOption * pDbgOpt);
  131. VOID AddOptionPdw(LV_ITEM * plvItem, PTSTR psz, DWORD dwMask, DWORD * pdw);
  132. VOID AddOptionReg(LV_ITEM * plvItem, PTSTR psz, DWORD dwMask, DWORD dwDefault,
  133. PTSTR pszEntry, PTSTR pszSubKey, HKEY hkey);
  134. VOID CDebugMenu::AddOptionCompress(LV_ITEM * plvItem, PTSTR psz, DWORD dwMask, BOOL bCheckedOn);
  135. VOID AddOptionSection(LV_ITEM* plvItem, PTSTR psz);
  136. };
  137. // Global Interface
  138. #ifdef DEBUG
  139. VOID InitDbgMenu(HWND hwnd);
  140. VOID FreeDbgMenu(void);
  141. BOOL OnDebugCommand(WPARAM wCmd);
  142. #else
  143. #define InitDbgMenu(hwnd)
  144. #define FreeDbgMenu()
  145. #endif
  146. #endif // _DBGMENU_H_