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.

141 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. com.hxx
  5. Abstract:
  6. Header specific to COM
  7. Author:
  8. Ramon Juan San Andres (ramonsa) 26-Jun-1991
  9. Revision History:
  10. --*/
  11. #include "comm.hxx"
  12. #include "string.hxx"
  13. //
  14. // Registry key with the names of the serial ports
  15. //
  16. #define COMM_KEY_NAME "HARDWARE\\DEVICEMAP\\SERIALCOMM"
  17. //
  18. // Data for request type REQUEST_TYPE_COM_SET
  19. //
  20. typedef struct _REQUEST_DATA_COM_SET {
  21. //
  22. // These flags tell what options to set
  23. //
  24. BOOLEAN SetBaud;
  25. BOOLEAN SetDataBits;
  26. BOOLEAN SetStopBits;
  27. BOOLEAN SetParity;
  28. BOOLEAN SetRetry;
  29. BOOLEAN SetTimeOut;
  30. BOOLEAN SetXon;
  31. BOOLEAN SetOdsr;
  32. BOOLEAN SetIdsr;
  33. BOOLEAN SetOcts;
  34. BOOLEAN SetDtrControl;
  35. BOOLEAN SetRtsControl;
  36. //
  37. // The values
  38. //
  39. ULONG Baud; // Baud rate
  40. ULONG DataBits; // Number of data bits
  41. STOPBITS StopBits; // Number of stop bits
  42. PARITY Parity; // Parity
  43. WCHAR Retry; // Retry
  44. BOOLEAN TimeOut; // TimeOut
  45. BOOLEAN Xon; // XON/XOFF protocol enabled/disabled
  46. BOOLEAN Odsr; // DSR Handshaking
  47. BOOLEAN Idsr; // DSR Sensitivity
  48. BOOLEAN Octs; // CTS Handshaking
  49. DTR_CONTROL DtrControl; // DTR Control
  50. RTS_CONTROL RtsControl; // RTS Control
  51. } REQUEST_DATA_COM_SET, *PREQUEST_DATA_COM_SET;
  52. //
  53. // Data for requests to COM
  54. //
  55. typedef union _COM_REQUEST_DATA {
  56. REQUEST_DATA_COM_SET Set;
  57. } COM_REQUEST_DATA, *PCOM_REQUEST_DATA;
  58. //
  59. // Structure of a request to COM
  60. //
  61. typedef struct _COM_REQUEST {
  62. REQUEST_HEADER Header; // Request Header
  63. COM_REQUEST_DATA Data; // Request data
  64. } COM_REQUEST, *PCOM_REQUEST;
  65. //
  66. // Prototypes
  67. //
  68. LONG
  69. ConvertBaudRate (
  70. IN LONG BaudIn
  71. );
  72. LONG
  73. ConvertDataBits (
  74. IN LONG DataBitsIn
  75. );
  76. STOPBITS
  77. ConvertStopBits (
  78. IN LONG StopBitsIn
  79. );
  80. PARITY
  81. ConvertParity (
  82. IN WCHAR ParityIn
  83. );
  84. WCHAR
  85. ConvertRetry (
  86. IN WCHAR RetryIn
  87. );
  88. DTR_CONTROL
  89. ConvertDtrControl (
  90. IN PCWSTRING CmdLine,
  91. IN CHNUM IdxBegin,
  92. IN CHNUM IdxEnd
  93. );
  94. RTS_CONTROL
  95. ConvertRtsControl (
  96. IN PCWSTRING CmdLine,
  97. IN CHNUM IdxBegin,
  98. IN CHNUM IdxEnd
  99. );