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.

182 lines
5.9 KiB

  1. /******************************************************************************
  2. *
  3. * File: sendrcv.x
  4. *
  5. * INTEL Corporation Proprietary Information
  6. * Copyright (c) 1994, 1995, 1996 Intel Corporation.
  7. *
  8. * This listing is supplied under the terms of a license agreement
  9. * with INTEL Corporation and may not be used, copied, nor disclosed
  10. * except in accordance with the terms of that agreement.
  11. *
  12. *****************************************************************************/
  13. /******************************************************************************
  14. *
  15. * $Workfile: sendrcv.x $
  16. * $Revision: 1.2 $
  17. * $Modtime: 05 Jun 1996 16:44:30 $
  18. * $Log: S:/STURGEON/SRC/H245/INCLUDE/VCS/sendrcv.x_v $
  19. Rev 1.2 05 Jun 1996 17:13:02 EHOWARDX
  20. Eliminated pErrorString.
  21. Rev 1.1 05 Jun 1996 16:36:18 EHOWARDX
  22. Further work in converting to HRESULT.
  23. Rev 1.0 09 May 1996 21:05:10 EHOWARDX
  24. Initial revision.
  25. *
  26. * Rev 1.14.1.6 09 May 1996 19:38:24 EHOWARDX
  27. * Redesigned locking logic and added new functionality.
  28. *
  29. * Rev 1.14.1.5 29 Apr 1996 12:51:06 unknown
  30. * Commented out SRINSTANCE variables related to receive thread.
  31. *
  32. * Rev 1.14.1.4 25 Apr 1996 20:23:08 EHOWARDX
  33. * Eliminated bAsnInitialized.
  34. *
  35. * Rev 1.14.1.3 19 Apr 1996 12:57:18 EHOWARDX
  36. * Updated to 1.19
  37. *
  38. * Rev 1.14.1.2 04 Apr 1996 13:26:36 EHOWARDX
  39. * Attempt to keep up with Dan's changes...
  40. *
  41. * Rev 1.14.1.1 02 Apr 1996 19:14:24 unknown
  42. * Changed to use linkapi.h & eliminated unnecessary fields.
  43. *
  44. * Rev 1.14.1.0 29 Mar 1996 20:47:12 EHOWARDX
  45. *
  46. * Replaced SRPAPI.H with LINKAPI.H.
  47. *
  48. * Rev 1.14 29 Mar 1996 08:05:48 dabrown1
  49. *
  50. * Modified SR context to:
  51. * Add critical section for ASN.1 activity
  52. * Moved ASN.1 error debug string from stack to context
  53. *
  54. * Rev 1.13 19 Mar 1996 17:43:14 helgebax
  55. *
  56. * removed h245time.h
  57. *
  58. * Rev 1.12 18 Mar 1996 15:11:08 cjutzi
  59. *
  60. * - put winspox back in .. sorry.
  61. *
  62. * Rev 1.11 18 Mar 1996 10:11:10 cjutzi
  63. *
  64. * - removed winspox.h
  65. *
  66. * Rev 1.10 13 Mar 1996 11:33:40 DABROWN1
  67. *
  68. * Enable logging for ring0
  69. *
  70. * Rev 1.8 01 Mar 1996 17:24:00 DABROWN1
  71. *
  72. * moved oss 'world' context to h245instance
  73. *
  74. * Rev 1.7 28 Feb 1996 14:53:00 DABROWN1
  75. *
  76. * Made oss asn.1 errors within sr error range
  77. *
  78. * Rev 1.6 26 Feb 1996 18:57:38 EHOWARDX
  79. *
  80. * Added bReceiveThread field.
  81. *
  82. * Rev 1.5 23 Feb 1996 21:54:56 EHOWARDX
  83. * Changed to use winspox.
  84. *
  85. * Rev 1.4 23 Feb 1996 13:50:58 DABROWN1
  86. * Added error codes for mbx/thread creation/deletion
  87. *
  88. * Rev 1.3 20 Feb 1996 18:56:24 EHOWARDX
  89. * Added windows mailbox fields and RXMSG structure for message queueing.
  90. *
  91. *
  92. *****************************************************************************/
  93. #ifndef STRICT
  94. #define STRICT
  95. #endif // not defined STRICT
  96. #ifndef _SENDRCV_X
  97. #define _SENDRCV_X
  98. #include "linkapi.h"
  99. #if defined(USE_RECEIVE_THREAD)
  100. #include "winspox.h"
  101. #endif
  102. ///////////////////////////////////////////////////////////////
  103. ///
  104. /// Received message
  105. ///
  106. ///////////////////////////////////////////////////////////////
  107. typedef struct _RXMSG {
  108. DWORD h245Inst;
  109. DWORD dwMessage;
  110. PBYTE pbDataBuf;
  111. DWORD dwLength;
  112. } RXMSG;
  113. ///////////////////////////////////////////////////////////////
  114. ///
  115. /// SendRcv Context
  116. ///
  117. ///////////////////////////////////////////////////////////////
  118. // Number of buffers based on underlying protocol
  119. #define MAX_LL_BUFFERS 8 // Max size of rx buffers for any ll protocol
  120. #define NUM_SRP_LL_RCV_BUFFERS 4 // max required for SRP
  121. typedef struct HSRINSTANCE {
  122. DWORD hLinkLayerInstance; // Instance ID of linklayer
  123. DWORD_PTR hH245Instance; // Our instance handle
  124. void * lpRxBuffer[MAX_LL_BUFFERS]; // receive buffers
  125. DWORD dwPDUSize; // max size of ASN.1 message
  126. int dwNumRXBuffers; // Number of buffers allocated for RX
  127. DWORD dwFlushMap; // Shutdown/Flush contrl
  128. HINSTANCE hLinkModule; // handle to link DLL
  129. PFxnlinkLayerInit hLinkLayerInit; // Link layer initialization
  130. PFxnlinkLayerShutdown hLinkShutdown; // Link layer shutdown
  131. PFxnlinkLayerGetInstance hLinkGetInstance; // Link layer GetInstance
  132. PFxndatalinkReceiveRequest hLinkReceiveReq; // Link layer receiverequest
  133. PFxndatalinkSendRequest hLinkSendReq; // Link layer send request
  134. PFxnlinkLayerFlushChannel hLinkLayerFlushChannel; // Link layer flush channel
  135. PFxnlinkLayerFlushAll hLinkLayerFlushAll; // Link layer flush all buffers
  136. HINSTANCE hASN1Module; // ASN1 DLL handle
  137. #if defined(USE_RECEIVE_THREAD)
  138. MBX_Handle pMailbox; // Handle to receive mailbox
  139. TSK_Handle pTaskReceive; // Handle to receive thread
  140. BOOL bReceiveThread; // TRUE if running off receive thread
  141. #endif // (USE_RECEIVE_THREAD)
  142. } hSRINSTANCE, *HSRINSTANCE;
  143. #if 0
  144. ///////////////////////////////////////////////////////////////
  145. ///
  146. /// SR Error defines
  147. ///
  148. ///////////////////////////////////////////////////////////////
  149. #define SR_ERROR_BASE 10000
  150. #define SR_ERROR_NOMEM SR_ERROR_BASE+1 // Memory allocation failure
  151. #define SR_ASN1_INIT_FAIL SR_ERROR_BASE+2
  152. #define SR_INVALID_CONTEXT SR_ERROR_BASE+3
  153. #define SR_INVALID_CONFIGURATION SR_ERROR_BASE+4
  154. #define SR_CREATE_MBX_FAIL SR_ERROR_BASE+5
  155. #define SR_POST_BUFFER_FAIL SR_ERROR_BASE+6
  156. #define SR_THREAD_CREATE_ERROR SR_ERROR_BASE+7
  157. #define SR_FILE_CREATE_ERROR SR_ERROR_BASE+8
  158. #define SR_LINK_INIT_FAILURE SR_ERROR_BASE+9
  159. #define SR_LINK_DLL_OPEN_FAIL SR_ERROR_BASE+10
  160. #endif
  161. #endif // _SENDRCV_X
  162.