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.

254 lines
9.8 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // File: _TSrvCom.h
  4. //
  5. // Contents: TSrvCom private include file
  6. //
  7. // Copyright: (c) 1992 - 1997, Microsoft Corporation.
  8. // All Rights Reserved.
  9. // Information Contained Herein is Proprietary
  10. // and Confidential.
  11. //
  12. // History: 17-JUL-97 BrianTa Created.
  13. //
  14. //---------------------------------------------------------------------------
  15. #ifndef __TSRVCOM_H_
  16. #define __TSRVCOM_H_
  17. //
  18. // Defines
  19. //
  20. #if DBG
  21. #define MAX_CONFERENCE_NAME_LEN 255
  22. #define GCC_TBL_ITEM(_x_) {_x_, #_x_}
  23. #define GCC_TCase(_x_,_y_) case _y_: _x_ = #_y_; break;
  24. #endif // DBG defines
  25. //
  26. // Typedefs
  27. //
  28. #if DBG
  29. // GCC return code table
  30. typedef struct _TSRV_GCC_RC_ENTRY
  31. {
  32. GCCError gccRC;
  33. PCHAR pszMessageText;
  34. } TSRV_GCC_RC_ENTRY, *PTSRV_GCC_RC_ENTRY;
  35. TSRV_GCC_RC_ENTRY GCCReturnCodeTBL[] = {
  36. GCC_TBL_ITEM(GCC_NO_ERROR),
  37. GCC_TBL_ITEM(GCC_ALLOCATION_FAILURE),
  38. GCC_TBL_ITEM(GCC_ALREADY_INITIALIZED),
  39. GCC_TBL_ITEM(GCC_ALREADY_REGISTERED),
  40. GCC_TBL_ITEM(GCC_APPLICATION_NOT_REGISTERED),
  41. GCC_TBL_ITEM(GCC_APP_NOT_ENROLLED),
  42. GCC_TBL_ITEM(GCC_BAD_CAPABILITY_ID),
  43. GCC_TBL_ITEM(GCC_BAD_CONNECTION_HANDLE_POINTER),
  44. GCC_TBL_ITEM(GCC_BAD_NETWORK_ADDRESS),
  45. GCC_TBL_ITEM(GCC_BAD_NETWORK_ADDRESS_TYPE),
  46. GCC_TBL_ITEM(GCC_BAD_NUMBER_OF_APES),
  47. GCC_TBL_ITEM(GCC_BAD_NUMBER_OF_HANDLES),
  48. GCC_TBL_ITEM(GCC_BAD_OBJECT_KEY),
  49. GCC_TBL_ITEM(GCC_BAD_REGISTRY_KEY),
  50. GCC_TBL_ITEM(GCC_BAD_SESSION_KEY),
  51. GCC_TBL_ITEM(GCC_BAD_USER_DATA),
  52. GCC_TBL_ITEM(GCC_COMMAND_NOT_SUPPORTED),
  53. GCC_TBL_ITEM(GCC_CONFERENCE_ALREADY_EXISTS),
  54. GCC_TBL_ITEM(GCC_CONFERENCE_NOT_ESTABLISHED),
  55. GCC_TBL_ITEM(GCC_DOMAIN_PARAMETERS_UNACCEPTABLE),
  56. GCC_TBL_ITEM(GCC_FAILURE_CREATING_DOMAIN),
  57. GCC_TBL_ITEM(GCC_FAILURE_CREATING_PACKET),
  58. GCC_TBL_ITEM(GCC_INVALID_ADDRESS_PREFIX),
  59. GCC_TBL_ITEM(GCC_INVALID_ASYMMETRY_INDICATOR),
  60. GCC_TBL_ITEM(GCC_INVALID_CONFERENCE),
  61. GCC_TBL_ITEM(GCC_INVALID_CONFERENCE_MODIFIER),
  62. GCC_TBL_ITEM(GCC_INVALID_CONFERENCE_NAME),
  63. GCC_TBL_ITEM(GCC_INVALID_JOIN_RESPONSE_TAG),
  64. GCC_TBL_ITEM(GCC_INVALID_MCS_USER_ID),
  65. GCC_TBL_ITEM(GCC_INVALID_NODE_PROPERTIES),
  66. GCC_TBL_ITEM(GCC_INVALID_NODE_TYPE),
  67. GCC_TBL_ITEM(GCC_INVALID_PARAMETER),
  68. GCC_TBL_ITEM(GCC_INVALID_PASSWORD),
  69. GCC_TBL_ITEM(GCC_INVALID_QUERY_TAG),
  70. GCC_TBL_ITEM(GCC_BAD_SESSION_KEY),
  71. GCC_TBL_ITEM(GCC_INVALID_TRANSPORT),
  72. GCC_TBL_ITEM(GCC_NOT_INITIALIZED),
  73. GCC_TBL_ITEM(GCC_NO_GIVE_RESPONSE_PENDING),
  74. GCC_TBL_ITEM(GCC_NO_SUCH_APPLICATION),
  75. GCC_TBL_ITEM(GCC_NO_TRANSPORT_STACKS),
  76. GCC_TBL_ITEM(GCC_QUERY_REQUEST_OUTSTANDING),
  77. GCC_TBL_ITEM(GCC_TRANSMIT_BUFFER_FULL),
  78. GCC_TBL_ITEM(GCC_TRANSPORT_ALREADY_LOADED),
  79. GCC_TBL_ITEM(GCC_TRANSPORT_BUSY),
  80. GCC_TBL_ITEM(GCC_TRANSPORT_NOT_READY),
  81. GCC_TBL_ITEM(GCC_UNSUPPORTED_ERROR)
  82. };
  83. // GCC reason code table
  84. typedef struct _TSRV_GCC_REASON_ENTRY
  85. {
  86. GCCReason gccReason;
  87. PCHAR pszMessageText;
  88. } TSRV_GCC_REASON_ENTRY, *PTSRV_GCC_REASON_ENTRY;
  89. TSRV_GCC_REASON_ENTRY GCCReasonTBL[] = {
  90. GCC_TBL_ITEM(GCC_REASON_CONDUCTOR_RELEASE),
  91. GCC_TBL_ITEM(GCC_REASON_ERROR_LOW_RESOURCES),
  92. GCC_TBL_ITEM(GCC_REASON_ERROR_TERMINATION),
  93. GCC_TBL_ITEM(GCC_REASON_HIGHER_NODE_DISCONNECTED),
  94. GCC_TBL_ITEM(GCC_REASON_HIGHER_NODE_EJECTED),
  95. GCC_TBL_ITEM(GCC_REASON_MCS_RESOURCE_FAILURE),
  96. GCC_TBL_ITEM(GCC_REASON_NODE_EJECTED),
  97. GCC_TBL_ITEM(GCC_REASON_NORMAL_TERMINATION),
  98. GCC_TBL_ITEM(GCC_REASON_NO_MORE_PARTICIPANTS),
  99. GCC_TBL_ITEM(GCC_REASON_PARENT_DISCONNECTED),
  100. GCC_TBL_ITEM(GCC_REASON_SYSTEM_RELEASE),
  101. GCC_TBL_ITEM(GCC_REASON_TIMED_TERMINATION),
  102. GCC_TBL_ITEM(GCC_REASON_UNKNOWN),
  103. GCC_TBL_ITEM(GCC_REASON_USER_INITIATED)
  104. };
  105. // GCC callback table
  106. typedef struct _GCC_CBTBL
  107. {
  108. GCCStatusMessageType message_type;
  109. PCHAR pszMessageText;
  110. } GCC_CBTBL, *PGCC_CBTBL;
  111. GCC_CBTBL GCCCallBackTBL[] = {
  112. GCC_TBL_ITEM(GCC_JOIN_CONFIRM),
  113. GCC_TBL_ITEM(GCC_TERMINATE_CONFIRM),
  114. GCC_TBL_ITEM(GCC_TERMINATE_INDICATION),
  115. GCC_TBL_ITEM(GCC_JOIN_INDICATION),
  116. GCC_TBL_ITEM(GCC_INVITE_CONFIRM),
  117. GCC_TBL_ITEM(GCC_ADD_INDICATION),
  118. GCC_TBL_ITEM(GCC_ADD_CONFIRM),
  119. GCC_TBL_ITEM(GCC_DISCONNECT_CONFIRM),
  120. GCC_TBL_ITEM(GCC_EJECT_USER_INDICATION),
  121. GCC_TBL_ITEM(GCC_DISCONNECT_INDICATION),
  122. GCC_TBL_ITEM(GCC_ANNOUNCE_PRESENCE_CONFIRM),
  123. GCC_TBL_ITEM(GCC_ROSTER_REPORT_INDICATION),
  124. GCC_TBL_ITEM(GCC_PERMIT_TO_ANNOUNCE_PRESENCE),
  125. GCC_TBL_ITEM(GCC_CONNECTION_BROKEN_INDICATION),
  126. GCC_TBL_ITEM(GCC_TRANSPORT_STATUS_INDICATION),
  127. GCC_TBL_ITEM(GCC_STATUS_INDICATION),
  128. GCC_TBL_ITEM(GCC_INVITE_INDICATION),
  129. GCC_TBL_ITEM(GCC_CREATE_INDICATION),
  130. GCC_TBL_ITEM(GCC_QUERY_INDICATION),
  131. GCC_TBL_ITEM(GCC_ALLOCATE_HANDLE_CONFIRM),
  132. GCC_TBL_ITEM(GCC_APPLICATION_INVOKE_CONFIRM),
  133. GCC_TBL_ITEM(GCC_APPLICATION_INVOKE_INDICATION),
  134. GCC_TBL_ITEM(GCC_APP_ROSTER_INQUIRE_CONFIRM),
  135. GCC_TBL_ITEM(GCC_APP_ROSTER_REPORT_INDICATION),
  136. GCC_TBL_ITEM(GCC_ASSIGN_TOKEN_CONFIRM),
  137. GCC_TBL_ITEM(GCC_ASSISTANCE_CONFIRM),
  138. GCC_TBL_ITEM(GCC_ASSISTANCE_INDICATION),
  139. GCC_TBL_ITEM(GCC_CONDUCT_ASK_CONFIRM),
  140. GCC_TBL_ITEM(GCC_CONDUCT_ASK_INDICATION),
  141. GCC_TBL_ITEM(GCC_CONDUCT_ASSIGN_CONFIRM),
  142. GCC_TBL_ITEM(GCC_CONDUCT_ASSIGN_INDICATION),
  143. GCC_TBL_ITEM(GCC_CONDUCT_GIVE_CONFIRM),
  144. GCC_TBL_ITEM(GCC_CONDUCT_GIVE_INDICATION),
  145. GCC_TBL_ITEM(GCC_CONDUCT_GRANT_CONFIRM),
  146. GCC_TBL_ITEM(GCC_CONDUCT_GRANT_INDICATION),
  147. GCC_TBL_ITEM(GCC_CONDUCT_INQUIRE_CONFIRM),
  148. GCC_TBL_ITEM(GCC_CONDUCT_PLEASE_CONFIRM),
  149. GCC_TBL_ITEM(GCC_CONDUCT_PLEASE_INDICATION),
  150. GCC_TBL_ITEM(GCC_CONDUCT_RELEASE_CONFIRM),
  151. GCC_TBL_ITEM(GCC_CONDUCT_RELEASE_INDICATION),
  152. GCC_TBL_ITEM(GCC_CONFERENCE_EXTEND_CONFIRM),
  153. GCC_TBL_ITEM(GCC_CONFERENCE_EXTEND_INDICATION),
  154. GCC_TBL_ITEM(GCC_DELETE_ENTRY_CONFIRM),
  155. GCC_TBL_ITEM(GCC_EJECT_USER_CONFIRM),
  156. GCC_TBL_ITEM(GCC_ENROLL_CONFIRM),
  157. GCC_TBL_ITEM(GCC_FATAL_ERROR_SAP_REMOVED),
  158. GCC_TBL_ITEM(GCC_LOCK_CONFIRM),
  159. GCC_TBL_ITEM(GCC_LOCK_INDICATION),
  160. GCC_TBL_ITEM(GCC_LOCK_REPORT_INDICATION),
  161. GCC_TBL_ITEM(GCC_MONITOR_CONFIRM),
  162. GCC_TBL_ITEM(GCC_MONITOR_INDICATION),
  163. GCC_TBL_ITEM(GCC_PERMIT_TO_ENROLL_INDICATION),
  164. GCC_TBL_ITEM(GCC_QUERY_CONFIRM),
  165. GCC_TBL_ITEM(GCC_REGISTER_CHANNEL_CONFIRM),
  166. GCC_TBL_ITEM(GCC_RETRIEVE_ENTRY_CONFIRM),
  167. GCC_TBL_ITEM(GCC_ROSTER_INQUIRE_CONFIRM),
  168. GCC_TBL_ITEM(GCC_SET_PARAMETER_CONFIRM),
  169. GCC_TBL_ITEM(GCC_TEXT_MESSAGE_CONFIRM),
  170. GCC_TBL_ITEM(GCC_TEXT_MESSAGE_INDICATION),
  171. GCC_TBL_ITEM(GCC_TIME_INQUIRE_CONFIRM),
  172. GCC_TBL_ITEM(GCC_TIME_INQUIRE_INDICATION),
  173. GCC_TBL_ITEM(GCC_TIME_REMAINING_CONFIRM),
  174. GCC_TBL_ITEM(GCC_TIME_REMAINING_INDICATION),
  175. GCC_TBL_ITEM(GCC_TRANSFER_CONFIRM),
  176. GCC_TBL_ITEM(GCC_TRANSFER_INDICATION),
  177. GCC_TBL_ITEM(GCC_UNLOCK_CONFIRM),
  178. GCC_TBL_ITEM(GCC_UNLOCK_INDICATION)
  179. };
  180. #endif // DBG typedefs
  181. //
  182. // Prototypes
  183. //
  184. void TSrvSaveUserDataMember(IN GCCUserData *pInUserData,
  185. OUT GCCUserData *pOutUserData,
  186. IN PUSERDATAINFO pUserDataInfo,
  187. IN OUT PULONG pulUserDataOffset);
  188. ULONG TSrvCalculateUserDataSize(IN CreateIndicationMessage *pCreateMessage);
  189. NTSTATUS TSrvSaveUserData(PTSRVINFO pTSrvInfo, CreateIndicationMessage *pCreateMessage);
  190. void TSrvSignalIndication(PTSRVINFO pTSrvInfo, NTSTATUS ntStatus);
  191. void TSrvHandleCreateInd(PTSRVINFO pTSrvInfo, CreateIndicationMessage *pCreateInd);
  192. void TSrvHandleTerminateInd(PTSRVINFO pTSrvInfo, TerminateIndicationMessage *pTermInd);
  193. void TSrvHandleDisconnectInd(PTSRVINFO pTSrvInfo, DisconnectIndicationMessage *pDiscInd);
  194. NTSTATUS TSrvInitWD(PTSRVINFO pTSrvInfo, PUSERDATAINFO *pUserDataInfo);
  195. GCCUserData ** TSrvCreateGCCDataList(PTSRVINFO pTSrvInfo, PUSERDATAINFO pUserDataInfo);
  196. NTSTATUS TSrvConfDisconnectReq(IN PTSRVINFO pTSrvInfo, IN ULONG ulReason);
  197. #if DBG
  198. void TSrvBuildNameFromGCCConfName(GCCConferenceName *gccName, PCHAR pConfName);
  199. void TSrvDumpCreateIndDetails(CreateIndicationMessage *pCreateMessage);
  200. void TSrvDumpGCCRCDetails(GCCError GCCrc, PCHAR pszText);
  201. void TSrvDumpGCCReasonDetails(GCCReason gccReason, PCHAR pszText);
  202. void TSrvDumpTransportStatusIndication(GCCMessage *pGCCMessage);
  203. void TSrvDumpStatusIndication(GCCMessage *pGCCMessage);
  204. void TSrvDumpCallBackMessage(GCCMessage *pGCCMessage);
  205. void TSrvDumpUserData(IN CreateIndicationMessage *pCreateMessage);
  206. #else
  207. #define TSrvBuildNameFromGCCConfName(_x, _y)
  208. #define TSrvDumpCreateIndDetails(_x)
  209. #define TSrvDumpGCCRCDetails(_x, _z)
  210. #define TSrvDumpGCCReasonDetails(_x, _z)
  211. #define TSrvDumpTransportStatusIndication(_x)
  212. #define TSrvDumpStatusIndication(_x)
  213. #define TSrvDumpCallBackMessage(_x)
  214. #define TSrvDumpUserData(_x)
  215. #endif // DBG protptypes
  216. #endif // __TSRVCOM_H_