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.

138 lines
2.7 KiB

  1. /*
  2. * Copyright (c) Microsoft Corporation
  3. *
  4. * Module Name :
  5. * tcsrv.h
  6. *
  7. * Contains the structure definitions and global variables used by the service
  8. *
  9. * Where possible, code has been obtained from BINL server.
  10. *
  11. * Sadagopan Rajaram -- Oct 18, 1999
  12. *
  13. */
  14. //
  15. // NT public header files
  16. //
  17. #include <nt.h>
  18. #include <ntrtl.h>
  19. #include <nturtl.h>
  20. #include <ntseapi.h>
  21. #include <windows.h>
  22. #include <winsock2.h>
  23. #include <align.h>
  24. #include <smbgtpt.h>
  25. #include <dsgetdc.h>
  26. #include <lm.h>
  27. #include <winldap.h>
  28. #include <dsrole.h>
  29. #include <rpc.h>
  30. #include <ntdsapi.h>
  31. #include <lmcons.h>
  32. #include <lmerr.h>
  33. #include <lmsname.h>
  34. #include <rpc.h>
  35. #include <security.h> // General definition of a Security Support Provider
  36. #include <ntlmsp.h>
  37. #include <spseal.h>
  38. #include <userenv.h>
  39. #include <setupapi.h>
  40. //
  41. // C Runtime library includes.
  42. //
  43. #include <stdlib.h>
  44. #include <stdio.h>
  45. #include <string.h>
  46. //
  47. // netlib header.
  48. //
  49. #include <lmcons.h>
  50. #include <secobj.h>
  51. //
  52. // tcp services control hander file
  53. //
  54. #include <tchar.h>
  55. #include "debug.h"
  56. #define MAX_TERMINAL_WIDTH 80
  57. #define MAX_BUFFER_SIZE 256
  58. #define MAX_REGISTRY_NAME_SIZE 256
  59. #define MAX_QUEUE_SIZE 1024
  60. #define SAME_ALL 0
  61. #define SAME_DEVICE 1
  62. #define DIFFERENT_DEVICES 2
  63. #define DIFFERENT_SESSION 4
  64. #define DEFAULT_BAUD_RATE 9600
  65. struct _COM_PORT_INFO;
  66. #ifdef UNICODE
  67. #define TSTRING UNICODE_STRING
  68. #else
  69. #define TSTRING ANSI_STRING
  70. #endif
  71. typedef struct _CONNECTION_INFO{
  72. SOCKET Socket;
  73. WSABUF Buffer;
  74. CHAR buffer[MAX_BUFFER_SIZE];
  75. DWORD BytesRecvd;
  76. DWORD Flags;
  77. IO_STATUS_BLOCK IoStatus;
  78. WSAOVERLAPPED Overlapped;
  79. struct _COM_PORT_INFO *pComPortInfo;
  80. struct _CONNECTION_INFO *Next;
  81. } CONNECTION_INFO, *PCONNECTION_INFO;
  82. typedef struct _COM_PORT_INFO{
  83. CRITICAL_SECTION Mutex;
  84. HANDLE Events[4];
  85. HANDLE ComPortHandle;
  86. HANDLE TerminateEvent;
  87. BOOLEAN ShuttingDown;
  88. BOOLEAN Deleted;
  89. TSTRING Device;
  90. TSTRING Name;
  91. ULONG BaudRate;
  92. UCHAR Parity;
  93. UCHAR StopBits;
  94. UCHAR WordLength;
  95. int Head;
  96. int Tail;
  97. int Number;
  98. CHAR Queue[MAX_QUEUE_SIZE];
  99. DWORD BytesRead;
  100. OVERLAPPED Overlapped;
  101. OVERLAPPED WriteOverlapped;
  102. IO_STATUS_BLOCK IoStatus;
  103. CHAR Buffer[MAX_BUFFER_SIZE];
  104. PCONNECTION_INFO Sockets;
  105. PCONNECTION_INFO Connections;
  106. struct _COM_PORT_INFO *Next;
  107. }COM_PORT_INFO, *PCOM_PORT_INFO;
  108. extern PCOM_PORT_INFO ComPortInfo;
  109. extern int ComPorts;
  110. extern PHANDLE Threads;
  111. extern SOCKET MainSocket;
  112. extern WSAEVENT TerminateService;
  113. extern CRITICAL_SECTION GlobalMutex;
  114. extern SERVICE_STATUS_HANDLE TCGlobalServiceStatusHandle;
  115. extern SERVICE_STATUS TCGlobalServiceStatus;
  116. #define MutexLock(x) EnterCriticalSection(&(x->Mutex))
  117. #define MutexRelease(x) LeaveCriticalSection(&(x->Mutex))