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.

192 lines
4.4 KiB

  1. //
  2. // Share 2.0 Interface
  3. //
  4. #ifndef _H_S20
  5. #define _H_S20
  6. BOOL S20_Init(void);
  7. void S20_Term(void);
  8. //
  9. // We can send to one person or broadcast to everyone listening to the
  10. // app sharing channel. The userID for one person is the mcsID, we get it
  11. // in S20 create/join/respond packets along with name + caps.
  12. //
  13. PS20DATAPACKET S20_AllocDataPkt(UINT streamID, UINT_PTR nodeID, UINT_PTR len);
  14. void S20_FreeDataPkt(PS20DATAPACKET pPacket);
  15. void S20_SendDataPkt(UINT streamID, UINT_PTR nodeID, PS20DATAPACKET pPacket);
  16. //
  17. // API FUNCTION: S20_UTEventProc
  18. //
  19. // DESCRIPTION:
  20. //
  21. // Handles NET_EVENTS
  22. //
  23. // PARAMETERS: standard UT event handler
  24. //
  25. // RETURNS: standard UT event handler
  26. //
  27. BOOL CALLBACK S20_UTEventProc(LPVOID userData, UINT event, UINT_PTR data1, UINT_PTR data2);
  28. //
  29. //
  30. // CONSTANTS
  31. //
  32. //
  33. //
  34. // States
  35. //
  36. typedef enum
  37. {
  38. S20_TERM = 0,
  39. S20_INIT,
  40. S20_ATTACH_PEND,
  41. S20_JOIN_PEND,
  42. S20_NO_SHARE,
  43. S20_SHARE_PEND,
  44. S20_SHARE_STARTING,
  45. S20_IN_SHARE,
  46. S20_NUM_STATES
  47. }
  48. S20_STATE;
  49. #define S20_MAX_QUEUED_CONTROL_PACKETS 20
  50. //
  51. // These pool sizes and latencies control how DC Share T120 flow control
  52. // behaves. They are tuned for performance so you had better understand
  53. // what you are doing if you change them!
  54. //
  55. // For example, can you explain why any setting other than 0 for the medium
  56. // priority will break DC Share? If not then go and read/understand
  57. // amgcflo.c and then look at how DC-Share will interact with it.
  58. //
  59. // To summarize:
  60. //
  61. // We don't control the top priority or medium priority pools because they
  62. // carry non-spoilable data that must therefore flow at a lower bandwidth
  63. // than the transport. In fact, applying back pressure to these streams
  64. // will cause DC-Share to fail in some cases.
  65. //
  66. // Low priority is where flow control really takes effect, since we want
  67. // the pipe to open right up (to 200K per ping) over fast transports but
  68. // to throttle back (to 1K per second possibly!) over slow transports.
  69. //
  70. //
  71. #define S20_LATENCY_TOP_PRIORITY 0
  72. #define S20_LATENCY_HIGH_PRIORITY 0
  73. #define S20_LATENCY_MEDIUM_PRIORITY 0
  74. #define S20_LATENCY_LOW_PRIORITY 7000
  75. #define S20_SIZE_TOP_PRIORITY 0
  76. #define S20_SIZE_HIGH_PRIORITY 0
  77. #define S20_SIZE_MEDIUM_PRIORITY 0
  78. #define S20_SIZE_LOW_PRIORITY 99000
  79. //
  80. //
  81. // MACROS
  82. //
  83. //
  84. #define S20_GET_CREATOR(A) ((TSHR_UINT16)(A & 0xFFFF))
  85. //
  86. //
  87. // TYPEDEFS
  88. //
  89. //
  90. typedef struct tagS20CONTROLPACKETQENTRY
  91. {
  92. UINT what;
  93. TSHR_UINT32 correlator;
  94. UINT who;
  95. UINT priority;
  96. }
  97. S20CONTROLPACKETQENTRY;
  98. typedef S20CONTROLPACKETQENTRY * PS20CONTROLPACKETQENTRY;
  99. //
  100. //
  101. // PROTOTYPES
  102. //
  103. //
  104. BOOL S20CreateOrJoinShare(
  105. UINT what,
  106. UINT_PTR callID);
  107. void S20LeaveOrEndShare(void);
  108. UINT S20MakeControlPacket(
  109. UINT what,
  110. UINT correlator,
  111. UINT who,
  112. PS20PACKETHEADER * ppPacket,
  113. LPUINT pLength,
  114. UINT priority);
  115. UINT S20FlushSendOrQueueControlPacket(
  116. UINT what,
  117. UINT correlator,
  118. UINT who,
  119. UINT priority);
  120. UINT S20FlushAndSendControlPacket(
  121. UINT what,
  122. UINT correlator,
  123. UINT who,
  124. UINT priority);
  125. UINT S20SendControlPacket(
  126. PS20PACKETHEADER pPacket,
  127. UINT length,
  128. UINT priority);
  129. UINT S20SendQueuedControlPackets(void);
  130. void S20AttachConfirm(NET_UID userID, NET_RESULT result, UINT callID);
  131. void S20DetachIndication(NET_UID userID, UINT callID);
  132. void S20LeaveIndication(NET_CHANNEL_ID channelID, UINT callID);
  133. void S20JoinConfirm(PNET_JOIN_CNF_EVENT pEvent);
  134. void S20SendIndication(PNET_SEND_IND_EVENT pEvent);
  135. void S20Flow(UINT priority, UINT newBufferSize);
  136. void S20CreateMsg(PS20CREATEPACKET pS20Packet);
  137. void S20JoinMsg(PS20JOINPACKET pS20Packet);
  138. void S20RespondMsg(PS20RESPONDPACKET pS20Packet);
  139. void S20DeleteMsg(PS20DELETEPACKET pS20Packet);
  140. void S20LeaveMsg(PS20LEAVEPACKET pS20Packet);
  141. void S20EndMsg(PS20ENDPACKET pS20Packet);
  142. void S20DataMsg(PS20DATAPACKET pS20Packet);
  143. void S20CollisionMsg(PS20COLLISIONPACKET pS20Packet);
  144. BOOL S20MaybeAddNewParty(MCSID mcsID,
  145. UINT lenCaps,
  146. UINT lenName,
  147. LPBYTE pData);
  148. void S20MaybeIssuePersonDelete(MCSID mcsID);
  149. UINT S20NewCorrelator(void);
  150. NET_PRIORITY S20StreamToS20Priority(UINT streamID);
  151. #endif // _H_S20
  152.