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.

181 lines
4.5 KiB

  1. //****************************************************************************
  2. //
  3. // Microsoft NT Remote Access Service
  4. //
  5. // Copyright (C) 1992-93 Microsft Corporation. All rights reserved.
  6. //
  7. // Filename: serialpr.h
  8. //
  9. // Revision History
  10. //
  11. // Sep 3, 1992 J. Perry Hannah Created
  12. //
  13. //
  14. // Description: This file contains structure and constant definitions
  15. // SERIAL.DLL. This file is used used only by SERIAL.DLL
  16. // source files, and is not public in any way.
  17. //
  18. //****************************************************************************
  19. #ifndef _SERIAL_DLL_PRIVATE_
  20. #define _SERIAL_DLL_PRIVATE_
  21. //* Defines ****************************************************************
  22. //
  23. #define RAS_PATH "\\ras\\" //*
  24. #define SERIAL_INI_FILENAME "serial.ini"
  25. #define ASYNCMAC_FILENAME L"\\\\.\\ASYNCMAC"
  26. #define ASYNCMAC_BINDING_NAME "\\DEVICE\\ASYNCMAC01"
  27. #define FILE_EXCLUSIVE_MODE 0
  28. #define HANDLE_EXCEPTION 1L
  29. #define CONTINUE_SEARCH 0
  30. #define EXCEPT_RAS_MEDIA 0x00A00002 //*
  31. #define INPUT_QUEUE_SIZE 1514 // ???
  32. #define OUTPUT_QUEUE_SIZE 1514 // ???
  33. #define FROM_TOP_OF_FILE TRUE
  34. #define USE_DEVICE_INI_DEFAULT '\x01'
  35. #define INVALID_RASENDPOINT 0xffff
  36. //* Enumeration Types ******************************************************
  37. //
  38. // typedef enum DEVICETYPE DEVICETYPE; //*
  39. enum DEVICETYPE
  40. {
  41. MODEM = 0,
  42. PAD = 1,
  43. SWITCH = 2
  44. };
  45. //* Macros *****************************************************************
  46. //
  47. #ifdef DEBUG
  48. #define DebugPrintf(_args_) DbgPrntf _args_ //*
  49. #else
  50. #define DebugPrintf(_args_)
  51. #endif
  52. //* Data Structures ********************************************************
  53. //
  54. typedef struct SERIALPCB SERIALPCB;
  55. struct SERIALPCB
  56. {
  57. SERIALPCB *pNextSPCB;
  58. HANDLE hIOPort;
  59. TCHAR szPortName[MAX_PORT_NAME];
  60. HANDLE hAsyMac;
  61. BOOL bErrorControlOn;
  62. HANDLE uRasEndpoint;
  63. DWORD dwActiveDSRMask ; // Stores whether DSR was active when the port
  64. // was opened. (this is fixed)
  65. DWORD dwMonitorDSRMask; // Used to store whether DSR should be
  66. // monitored.(this may change during connection)
  67. DWORD dwEventMask; //Used by WaitCommEvent
  68. DWORD dwPreviousModemStatus; // used to detect changes in state
  69. RAS_OVERLAPPED MonitorDevice; //Used by WaitCommEvent
  70. RAS_OVERLAPPED SendReceive; //Used by WriteFile and ReadFile
  71. DWORD Stats[NUM_RAS_SERIAL_STATS];
  72. TCHAR szDeviceType[MAX_DEVICETYPE_NAME + 1];
  73. TCHAR szDeviceName[MAX_DEVICE_NAME + 1];
  74. TCHAR szCarrierBPS[MAX_BPS_STR_LEN];
  75. TCHAR szDefaultOff[RAS_MAXLINEBUFLEN];
  76. };
  77. //* Error Return Codes for Internal Errors *********************************
  78. //
  79. // Internal errors are not expected after shipping. These errors are not
  80. // normally reported to the user except as an internal error number.
  81. //
  82. #ifndef _INTERROR_
  83. #include "interror.h"
  84. #endif
  85. #define ISER_BASE RAS_INTERNAL_ERROR_BASE + RIEB_ASYNCMEDIADLL
  86. #define ERROR_SPCB_NOT_ON_LIST ISER_BASE + 1
  87. //* Local Prototypes *******************************************************
  88. //
  89. //* From serutil.c ---------------------------------------------------------
  90. //
  91. void AddPortToList(HANDLE hIOPort, char *pszPortName);
  92. SERIALPCB* FindPortInList(HANDLE hIOPort, SERIALPCB **ppPrevSPCB);
  93. SERIALPCB* FindPortNameInList(TCHAR *pszPortName);
  94. void GetDefaultOffStr(HANDLE hIOPort, TCHAR *pszPortName);
  95. void GetIniFileName(char *pszFileName, DWORD dwNameLen);
  96. void GetMem(DWORD dSize, BYTE **ppMem); //*
  97. void GetValueFromFile(TCHAR *pzPortName, TCHAR szKey[], TCHAR *pszValue, DWORD size);
  98. DWORD InitCarrierBps(char *pszPortName, char *pszMaxCarrierBps);
  99. void SetCommDefaults(HANDLE hIOPort, char *pszPortName);
  100. void SetDcbDefaults(DCB *pDCB);
  101. BOOL StrToUsage(char *pszStr, RASMAN_USAGE *peUsage);
  102. DWORD UpdateStatistics(SERIALPCB *pSPCB);
  103. DWORD ValueToNum(RAS_PARAMS *p);
  104. BOOL ValueToBool(RAS_PARAMS *p);
  105. #ifdef DEBUG
  106. void DbgPrntf(const char * format, ...); //*
  107. #endif
  108. #endif // _SERIAL_DLL_PRIVATE_