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.

256 lines
5.8 KiB

  1. #ifndef PP_H
  2. #define PP_H
  3. #define SERIAL_ADVANCED_SETTINGS
  4. #include "msports.h"
  5. #ifdef USE_P_TRACE_ERR
  6. #define P_TRACE_ERR(_x) MessageBox( GetFocus(), TEXT(_x), TEXT("ports traceerr"), MB_OK | MB_ICONINFORMATION );
  7. #define W_TRACE_ERR(_x) MessageBox( GetFocus(), _x, TEXT("ports traceerr"), MB_OK | MB_ICONINFORMATION );
  8. #else
  9. #define P_TRACE_ERR(_x)
  10. #define W_TRACE_ERR(_x)
  11. #endif
  12. #define DO_COM_PORT_RENAMES
  13. #define RX_MIN 1
  14. #define RX_MAX 14
  15. #define TX_MIN 1
  16. #define TX_MAX 16
  17. TCHAR m_szDevMgrHelp[];
  18. //
  19. // Structures
  20. //
  21. typedef struct
  22. {
  23. DWORD BaudRate; // actual baud rate
  24. DWORD Parity; // index into dlg selection
  25. DWORD DataBits; // index into dlg selection
  26. DWORD StopBits; // index into dlg selection
  27. DWORD FlowControl; // index into dlg selection
  28. TCHAR szComName[20]; // example: "COM5" (no colon)
  29. } PP_PORTSETTINGS, *PPP_PORTSETTINGS;
  30. typedef struct _ADVANCED_DATA
  31. {
  32. BOOL HidePolling;
  33. BOOL UseFifoBuffersControl;
  34. BOOL UseFifoBuffers;
  35. BOOL UseRxFIFOControl;
  36. BOOL UseTxFIFOControl;
  37. DWORD FifoRxMax;
  38. DWORD FifoTxMax;
  39. DWORD RxFIFO;
  40. DWORD TxFIFO;
  41. DWORD PollingPeriod;
  42. TCHAR szComName[20];
  43. TCHAR szNewComName[20];
  44. HKEY hDeviceKey; // (like ROOT\LEGACY_BEEP\0000)
  45. HCOMDB hComDB;
  46. HDEVINFO DeviceInfoSet;
  47. PSP_DEVINFO_DATA DeviceInfoData;
  48. } ADVANCED_DATA, *PADVANCED_DATA;
  49. typedef struct _PORT_PARAMS
  50. {
  51. PP_PORTSETTINGS PortSettings;
  52. HDEVINFO DeviceInfoSet;
  53. PSP_DEVINFO_DATA DeviceInfoData;
  54. BOOL ShowAdvanced;
  55. BOOL AdvancedChanged;
  56. BOOL ChangesEnabled;
  57. PADVANCED_DATA pAdvancedData;
  58. } PORT_PARAMS, *PPORT_PARAMS;
  59. ///////////////////////////////////////////////////////////////////////////////////
  60. // Port Settings Property Page Prototypes
  61. ///////////////////////////////////////////////////////////////////////////////////
  62. void
  63. InitOurPropParams(
  64. IN OUT PPORT_PARAMS Params,
  65. IN HDEVINFO DeviceInfoSet,
  66. IN PSP_DEVINFO_DATA DeviceInfoData,
  67. IN PTCHAR StrSettings
  68. );
  69. HPROPSHEETPAGE
  70. InitSettingsPage(
  71. PROPSHEETPAGE * Psp,
  72. OUT PPORT_PARAMS Params
  73. );
  74. UINT CALLBACK
  75. PortSettingsDlgCallback(
  76. HWND hwnd,
  77. UINT uMsg,
  78. LPPROPSHEETPAGE ppsp
  79. );
  80. INT_PTR APIENTRY
  81. PortSettingsDlgProc(
  82. IN HWND hDlg,
  83. IN UINT uMessage,
  84. IN WPARAM wParam,
  85. IN LPARAM lParam
  86. );
  87. void
  88. SavePortSettings(
  89. IN HWND DialogHwnd,
  90. IN PTCHAR ComName,
  91. IN PPORT_PARAMS Params
  92. );
  93. void
  94. GetPortSettings(
  95. IN HWND DialogHwnd,
  96. IN PTCHAR ComName,
  97. IN PPORT_PARAMS Params
  98. );
  99. VOID
  100. SetCBFromRes(
  101. HWND HwndCB,
  102. DWORD ResId,
  103. DWORD Default,
  104. BOOL CheckDecimal);
  105. BOOL
  106. FillCommDlg(
  107. IN HWND DialogHwnd
  108. );
  109. ULONG
  110. FillPortSettingsDlg(
  111. IN HWND DialogHwnd,
  112. IN PPORT_PARAMS Params
  113. );
  114. ULONG
  115. SavePortSettingsDlg(
  116. IN HWND DialogHwnd,
  117. IN PPORT_PARAMS Params
  118. );
  119. ULONG
  120. FillPortNameCb(
  121. HWND ParentHwnd,
  122. PADVANCED_DATA Params
  123. );
  124. ///////////////////////////////////////////////////////////////////////////////////
  125. // Advanced Dialog Prototypes
  126. ///////////////////////////////////////////////////////////////////////////////////
  127. INT_PTR APIENTRY
  128. AdvancedPortsDlgProc(
  129. IN HWND hDlg,
  130. IN UINT uMessage,
  131. IN WPARAM wParam,
  132. IN LPARAM lParam
  133. );
  134. ULONG
  135. FillAdvancedDlg(
  136. IN HWND DialogHwnd,
  137. IN PADVANCED_DATA AdvancedData
  138. );
  139. ULONG
  140. SaveAdvancedDlg(
  141. IN HWND DialogHwnd,
  142. IN PPORT_PARAMS Params
  143. );
  144. BOOL
  145. DisplayAdvancedDialog(
  146. IN HWND DialogHwnd,
  147. IN OUT PADVANCED_DATA AdvancedData
  148. );
  149. void
  150. InitializeControls(
  151. IN HWND DialogHwnd,
  152. IN PADVANCED_DATA AdvancedData
  153. );
  154. void
  155. RestoreAdvancedDefaultState(
  156. IN HWND DialogHwnd,
  157. IN PADVANCED_DATA AdvancedData
  158. );
  159. ULONG
  160. SaveAdvancedSettings(
  161. IN HWND DialogHwnd,
  162. IN PADVANCED_DATA AdvancedData
  163. );
  164. void
  165. RestorePortSettings(
  166. HWND DialogHwnd,
  167. PPORT_PARAMS Params
  168. );
  169. void
  170. SetTrackbarTicks(
  171. IN HWND TrackbarHwnd,
  172. IN DWORD MinVal,
  173. IN DWORD MaxVal
  174. );
  175. void
  176. SetLabelText(
  177. IN HWND LabelHwnd,
  178. IN DWORD ResId,
  179. IN ULONG Value
  180. );
  181. void
  182. HandleTrackbarChange(
  183. IN HWND DialogHwnd,
  184. IN HWND TrackbarHwnd
  185. );
  186. void
  187. EnableFifoControls(
  188. HWND DialogHwnd,
  189. BOOL Enabled
  190. );
  191. // Context help header file and arrays for devmgr ports tab
  192. // Created 2/21/98 by WGruber NTUA and DoronH NTDEV
  193. //
  194. // "Port Settings" Dialog Box
  195. //
  196. #define IDH_NOHELP ((DWORD)-1)
  197. #define IDH_DEVMGR_PORTSET_ADVANCED 15840 // "&Advanced" (Button)
  198. #define IDH_DEVMGR_PORTSET_BPS 15841 // "" (ComboBox)
  199. #define IDH_DEVMGR_PORTSET_DATABITS 15842 // "" (ComboBox)
  200. #define IDH_DEVMGR_PORTSET_PARITY 15843 // "" (ComboBox)
  201. #define IDH_DEVMGR_PORTSET_STOPBITS 15844 // "" (ComboBox)
  202. #define IDH_DEVMGR_PORTSET_FLOW 15845 // "" (ComboBox)
  203. #define IDH_DEVMGR_PORTSET_DEFAULTS 15892 // "&Restore Defaults" (Button)
  204. //
  205. // "Advanced Communications Port Properties" Dialog Box
  206. //
  207. #define IDH_DEVMGR_PORTSET_ADV_USEFIFO 16885 // "&Use FIFO buffers (requires 16550 compatible UART)" (Button)
  208. #define IDH_DEVMGR_PORTSET_ADV_TRANS 16842 // "" (msctls_trackbar32)
  209. #define IDH_DEVMGR_PORTSET_ADV_DEVICES 161027 // "" (ComboBox)
  210. #define IDH_DEVMGR_PORTSET_ADV_RECV 16821 // "" (msctls_trackbar32)
  211. #define IDH_DEVMGR_PORTSET_ADV_NUMBER 16846 // "" (ComboBox)
  212. #define IDH_DEVMGR_PORTSET_ADV_DEFAULTS 16844
  213. #endif // PP_H