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.

200 lines
4.5 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 _PORT_PARAMS
  22. {
  23. HDEVINFO DeviceInfoSet;
  24. PSP_DEVINFO_DATA DeviceInfoData;
  25. HCOMDB hComDB;
  26. PBYTE PortUsage;
  27. DWORD PortUsageSize;
  28. BOOL ShowStartCom;
  29. DWORD NumChildren;
  30. TCHAR szComName[20];
  31. } PORT_PARAMS, *PPORT_PARAMS;
  32. typedef struct
  33. {
  34. TCHAR szComName[20];
  35. HDEVINFO DeviceInfoSet;
  36. SP_DEVINFO_DATA DeviceInfoData;
  37. HKEY hDeviceKey;
  38. DWORD NewComNum;
  39. } CHILD_DATA, *PCHILD_DATA;
  40. ///////////////////////////////////////////////////////////////////////////////////
  41. // Cyclom-Y Property Page Prototypes
  42. ///////////////////////////////////////////////////////////////////////////////////
  43. void
  44. InitOurPropParams(
  45. IN OUT PPORT_PARAMS Params,
  46. IN HDEVINFO DeviceInfoSet,
  47. IN PSP_DEVINFO_DATA DeviceInfoData,
  48. IN PTCHAR StrSettings
  49. );
  50. HPROPSHEETPAGE
  51. InitSettingsPage(
  52. PROPSHEETPAGE * Psp,
  53. OUT PPORT_PARAMS Params
  54. );
  55. UINT CALLBACK
  56. PortSettingsDlgCallback(
  57. HWND hwnd,
  58. UINT uMsg,
  59. LPPROPSHEETPAGE ppsp
  60. );
  61. INT_PTR APIENTRY
  62. PortSettingsDlgProc(
  63. IN HWND hDlg,
  64. IN UINT uMessage,
  65. IN WPARAM wParam,
  66. IN LPARAM lParam
  67. );
  68. BOOL
  69. SavePortSettings(
  70. IN HWND DialogHwnd,
  71. IN PPORT_PARAMS Params
  72. );
  73. BOOL
  74. SavePortSettingsDlg(
  75. IN HWND DialogHwnd,
  76. IN PPORT_PARAMS Params
  77. );
  78. //Cyclom-y
  79. void
  80. RestoreDefaults(
  81. HWND DialogHwnd,
  82. PPORT_PARAMS Params
  83. );
  84. ULONG
  85. FillModelAndBusTypeText(
  86. IN HWND DialogHwnd,
  87. IN PPORT_PARAMS Params
  88. );
  89. ULONG
  90. FillNumberOfPortsText(
  91. IN HWND DialogHwnd,
  92. IN PPORT_PARAMS Params
  93. );
  94. BOOL
  95. FillStartComCb(
  96. HWND ParentHwnd,
  97. PPORT_PARAMS Params
  98. );
  99. ULONG
  100. GetPortName(
  101. IN DEVINST PortInst,
  102. IN OUT TCHAR *ComName,
  103. IN ULONG ComNameSize
  104. );
  105. DWORD
  106. CheckComRange(
  107. HWND ParentHwnd,
  108. PPORT_PARAMS Params,
  109. DWORD nCom
  110. );
  111. // Return codes for CheckComRange:
  112. #define COM_RANGE_OK 0
  113. #define COM_RANGE_TOO_BIG 1
  114. #define COM_RANGE_MEM_ERR 2
  115. BOOL
  116. TryToOpen(
  117. IN PTCHAR szCom
  118. );
  119. BOOL
  120. NewComAvailable(
  121. IN PPORT_PARAMS Params,
  122. IN DWORD NewComNum
  123. );
  124. ULONG
  125. GetPortData(
  126. IN DEVINST PortInst,
  127. OUT PCHILD_DATA ChildPtr
  128. );
  129. void
  130. ClosePortData(
  131. IN PCHILD_DATA ChildPtr
  132. );
  133. void
  134. EnactComNameChanges(
  135. IN HWND ParentHwnd,
  136. IN PPORT_PARAMS Params,
  137. IN PCHILD_DATA ChildPtr
  138. );
  139. // Context help header file and arrays for devmgr ports tab
  140. // Created 2/21/98 by WGruber NTUA and DoronH NTDEV
  141. //
  142. // "Port Settings" Dialog Box
  143. //
  144. #if 0
  145. #define IDH_NOHELP ((DWORD)-1)
  146. #define IDH_DEVMGR_PORTSET_ADVANCED 15840 // "&Advanced" (Button)
  147. #define IDH_DEVMGR_PORTSET_BPS 15841 // "" (ComboBox)
  148. #define IDH_DEVMGR_PORTSET_DATABITS 15842 // "" (ComboBox)
  149. #define IDH_DEVMGR_PORTSET_PARITY 15843 // "" (ComboBox)
  150. #define IDH_DEVMGR_PORTSET_STOPBITS 15844 // "" (ComboBox)
  151. #define IDH_DEVMGR_PORTSET_FLOW 15845 // "" (ComboBox)
  152. #define IDH_DEVMGR_PORTSET_DEFAULTS 15892 // "&Restore Defaults" (Button)
  153. //
  154. // "Advanced Communications Port Properties" Dialog Box
  155. //
  156. #define IDH_DEVMGR_PORTSET_ADV_USEFIFO 16885 // "&Use FIFO buffers (requires 16550 compatible UART)" (Button)
  157. #define IDH_DEVMGR_PORTSET_ADV_TRANS 16842 // "" (msctls_trackbar32)
  158. #define IDH_DEVMGR_PORTSET_ADV_DEVICES 161027 // "" (ComboBox)
  159. #define IDH_DEVMGR_PORTSET_ADV_RECV 16821 // "" (msctls_trackbar32)
  160. #define IDH_DEVMGR_PORTSET_ADV_NUMBER 16846 // "" (ComboBox)
  161. #define IDH_DEVMGR_PORTSET_ADV_DEFAULTS 16844
  162. #endif
  163. #include "cyyhelp.h"
  164. #endif // PP_H