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.

99 lines
4.4 KiB

  1. /*-----------------------------------------------------------------------------
  2. COMMRKT.H - Windows 3.1 COMM.DRV driver for RocketPort
  3. Prototypes for exported functions
  4. This include file is only needed if you are running the RocketPort
  5. Windows 3.1 driver(commrkt.drv, vcdrkt.vxd) and need to access ports above
  6. COM9. The driver contains additional functions(see below) which allow
  7. you to open com-ports greater than COM9.
  8. If you want the macros below to translate all standard Windows calls to
  9. rocket calls(functions prefixed with a "rkt"), then define the following:
  10. #define NEED_OVER_COM9
  11. This will cause the macros defined below to take effect which will replace
  12. the standard Windows comm-port function calls with the "rkt" function calls.
  13. The rocket library commands will only work with the RocketPort ports,
  14. the OpenComm() call will fail for the standard com ports(COM1,2).
  15. The supplied commdrv.lib import library must then be linked in.
  16. the actual functions are contained in the driver file called commrkt.drv
  17. which is actually the Dynamic Link Library with these functions.
  18. This solution is only available with the Windows 3.1 driver, and will not
  19. work with any of our other Windows drivers. If you move to Win95 or NT
  20. environment we would suggest that you use the 32-bit programming model
  21. to overcome the COM9 limitation associated with the 16-bit Windows API.
  22. For Windows95 an alternative is to install the Windows 3.1 driver,
  23. which will work in a compatibility mode for 16-bit applications.
  24. Company: Comtrol Corporation
  25. -----------------------------------------------------------------------------*/
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. /* Controller initialization error codes. OpenComm() and rktOpenComm()
  30. can both return these if the controller initialization fails on the
  31. first open the system attempts. */
  32. #define IER_INIFILE -20 /* Driver problem reading ROCKETPT.INI file */
  33. #define IER_CTLINIT -21 /* Controller hardware initialization error */
  34. #define IER_CHANINIT -22 /* Channel hardware initialization error */
  35. #define IER_DEVSIZE -23 /* Invalid number of devices found */
  36. #define IER_CTLSIZE -24 /* Invalid number of controllers found */
  37. #define IER_NOINTHND -25 /* Could not install interrupt handler */
  38. #define IER_NOINT -26 /* Interrupts are not occuring */
  39. // the following may be switched on to access over COM9 limitation
  40. // in 16-bit Windows, when used with the RocketPort Windows 3.1
  41. // driver. These are not available in the W95/WFW311/NT Comtrol
  42. // Drivers. The actual library functions exist in the "commrkt.drv"
  43. // file(part of our driver.) This is really just a dynamic link library,
  44. // and the "commrkt.lib" is just an import library which tells the linker
  45. // & compiler where to find these calls at runtime.
  46. // These macros change every standard Windows Comm-API call in our program
  47. // to the rkt##### special library call.
  48. #ifdef NEED_OVER_COM9
  49. #define BuildCommDCB rktBuildCommDCB
  50. #define ClearCommBreak rktClearCommBreak
  51. #define CloseComm rktCloseComm
  52. #define EnableCommNotification rktEnableCommNotification
  53. #define EscapeCommFunction rktEscapeCommFunction
  54. #define FlushComm rktFlushComm
  55. #define GetCommError rktGetCommError
  56. #define GetCommState rktGetCommState
  57. #define GetCommEventMask rktGetCommEventMask
  58. #define OpenComm rktOpenComm
  59. #define ReadComm rktReadComm
  60. #define SetCommBreak rktSetCommBreak
  61. #define SetCommEventMask rktSetCommEventMask
  62. #define SetCommState rktSetCommState
  63. #define TransmitCommChar rktTransmitCommChar
  64. #define WriteComm rktWriteComm
  65. #endif
  66. #ifndef _CDECL
  67. #define _CDECL FAR PASCAL
  68. #endif
  69. int _CDECL rktBuildCommDCB(LPCSTR,DCB far *);
  70. int _CDECL rktClearCommBreak(int);
  71. int _CDECL rktCloseComm(int);
  72. BOOL _CDECL rktEnableCommNotification(int,HWND,int,int);
  73. LONG _CDECL rktEscapeCommFunction(int,int);
  74. int _CDECL rktFlushComm(int,int);
  75. int _CDECL rktGetCommError(int,COMSTAT far *);
  76. int _CDECL rktGetCommState(int,DCB far *);
  77. WORD _CDECL rktGetCommEventMask(int,int);
  78. int _CDECL rktOpenComm(LPCSTR,UINT,UINT);
  79. int _CDECL rktReadComm(int,void far *,int);
  80. int _CDECL rktSetCommBreak(int);
  81. UINT far * _CDECL rktSetCommEventMask(int,UINT);
  82. int _CDECL rktSetCommState(DCB far *);
  83. int _CDECL rktTransmitCommChar(int,char);
  84. int _CDECL rktWriteComm(int,void far *,int);
  85. #ifdef __cplusplus
  86. }
  87. #endif