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.

354 lines
13 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 2000 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: Message.h
  6. * Content: DirectNet Internal Messages
  7. *@@BEGIN_MSINTERNAL
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 01/14/00 mjn Created
  12. * 01/20/00 mjn Moved internal messages from DNCore.h
  13. * 01/24/00 mjn Replaced on-wire message pointers to offsets
  14. * 01/24/00 mjn Added messages for NameTable operation list clean-up
  15. * 01/25/00 mjn Added DNSendHostMigrateCompleteMessage
  16. * 01/26/00 mjn Implemented NameTable re-sync at host migration
  17. * 02/09/00 mjn Implemented DNSEND_COMPLETEONPROCESS
  18. * 02/15/00 mjn Added dwInfoFlags to UPDATE_INFO messages
  19. * 04/04/00 mjn Added DNSendTerminateSession() and structure
  20. * 04/05/00 mjn Modified DN_INTERNAL_MESSAGE_DESTROY_PLAYER
  21. * 04/23/00 mjn Removed DN_INTERNAL_MESSAGE_SEND_PROCESSED and DN_INTERNAL_MESSAGE_SEND_PROCESSED_COMPLETE
  22. * mjn Added DN_INTERNAL_MESSAGE_REQ_PROCESS_COMPLETION and DN_INTERNAL_MESSAGE_PROCESS_COMPLETION
  23. * 04/25/00 mjn Removed hCompletionOp from group/info REQUESTs
  24. * 07/12/00 mjn Moved internal messages back from DNCore.h
  25. * 07/20/00 mjn Changed SEND_PLAYER_INFO to PLAYER_CONNECT_INFO
  26. * mjn Added DN_INTERNAL_MESSAGE_CONNECT_INFO structure
  27. * mjn Modified DN_INTERNAL_MESSAGE_CONNECT_FAILED structure
  28. * mjn Moved DN_INTERNAL_MESSAGE_PLAYER_CONNECT_INFO and DN_INTERNAL_MESSAGE_INSTRUCTED_CONNECT_FAILED from connect.h
  29. * mjn Added DN_MSG_INTERNAL_CONNECT_ATTEMPT_FAILED, DN_INTERNAL_MESSAGE_CONNECT_ATTEMPT_FAILED
  30. * 07/31/00 mjn DN_INTERNAL_MESSAGE_DESTROY_PLAYER renamed to DN_INTERNAL_MESSAGE_HOST_DESTROY_PLAYER
  31. * mjn DN_INTERNAL_MESSAGE_DELETE_PLAYER renamed to DN_INTERNAL_MESSAGE_DESTROY_PLAYER
  32. * mjn Added dwDestroyReason to DN_INTERNAL_MESSAGE_DESTROY_PLAYER
  33. * mjn Removed DN_MSG_INTERNAL_HOST_DESTROY_PLAYER and DN_INTERNAL_MESSAGE_HOST_DESTROY_PLAYER structure
  34. * 07/31/00 mjn Change DN_MSG_INTERNAL_DELETE_PLAYER to DN_MSG_INTERNAL_DESTROY_PLAYER
  35. * 08/07/00 mjn Added structures for peer-peer session integrity checking
  36. * 08/08/00 mjn Moved DN_NAMETABLE_OP_INFO from Migration.cpp
  37. * 08/25/00 mjn Added NameTable version to DN_INTERNAL_MESSAGE_INSTRUCT_CONNECT
  38. *@@END_MSINTERNAL
  39. *
  40. ***************************************************************************/
  41. #ifndef __MESSAGE_H__
  42. #define __MESSAGE_H__
  43. //**********************************************************************
  44. // Constant definitions
  45. //**********************************************************************
  46. #define DN_MSG_INTERNAL 0xc0
  47. #define DN_MSG_INTERNAL_PLAYER_CONNECT_INFO (0x01 | DN_MSG_INTERNAL)
  48. #define DN_MSG_INTERNAL_SEND_CONNECT_INFO (0x02 | DN_MSG_INTERNAL)
  49. #define DN_MSG_INTERNAL_ACK_CONNECT_INFO (0x03 | DN_MSG_INTERNAL)
  50. #define DN_MSG_INTERNAL_SEND_PLAYER_DNID (0x04 | DN_MSG_INTERNAL)
  51. #define DN_MSG_INTERNAL_CONNECT_FAILED (0x05 | DN_MSG_INTERNAL)
  52. #define DN_MSG_INTERNAL_INSTRUCT_CONNECT (0x06 | DN_MSG_INTERNAL)
  53. #define DN_MSG_INTERNAL_INSTRUCTED_CONNECT_FAILED (0x07 | DN_MSG_INTERNAL)
  54. #define DN_MSG_INTERNAL_CONNECT_ATTEMPT_FAILED (0x08 | DN_MSG_INTERNAL)
  55. #define DN_MSG_INTERNAL_NAMETABLE_VERSION (0x09 | DN_MSG_INTERNAL)
  56. #define DN_MSG_INTERNAL_RESYNC_VERSION (0x0a | DN_MSG_INTERNAL)
  57. #define DN_MSG_INTERNAL_REQ_NAMETABLE_OP (0x0b | DN_MSG_INTERNAL)
  58. #define DN_MSG_INTERNAL_ACK_NAMETABLE_OP (0x0c | DN_MSG_INTERNAL)
  59. #define DN_MSG_INTERNAL_HOST_MIGRATE (0x0d | DN_MSG_INTERNAL)
  60. #define DN_MSG_INTERNAL_HOST_MIGRATE_COMPLETE (0x0e | DN_MSG_INTERNAL)
  61. #define DN_MSG_INTERNAL_UPDATE_APPLICATION_DESC (0x0f | DN_MSG_INTERNAL)
  62. #define DN_MSG_INTERNAL_ADD_PLAYER (0x10 | DN_MSG_INTERNAL)
  63. #define DN_MSG_INTERNAL_DESTROY_PLAYER (0x11 | DN_MSG_INTERNAL)
  64. #define DN_MSG_INTERNAL_REQ_CREATE_GROUP (0x12 | DN_MSG_INTERNAL)
  65. #define DN_MSG_INTERNAL_REQ_ADD_PLAYER_TO_GROUP (0x13 | DN_MSG_INTERNAL)
  66. #define DN_MSG_INTERNAL_REQ_DELETE_PLAYER_FROM_GROUP (0x14 | DN_MSG_INTERNAL)
  67. #define DN_MSG_INTERNAL_REQ_DESTROY_GROUP (0x15 | DN_MSG_INTERNAL)
  68. #define DN_MSG_INTERNAL_REQ_UPDATE_INFO (0x16 | DN_MSG_INTERNAL)
  69. #define DN_MSG_INTERNAL_CREATE_GROUP (0x17 | DN_MSG_INTERNAL)
  70. #define DN_MSG_INTERNAL_DESTROY_GROUP (0x18 | DN_MSG_INTERNAL)
  71. #define DN_MSG_INTERNAL_ADD_PLAYER_TO_GROUP (0x19 | DN_MSG_INTERNAL)
  72. #define DN_MSG_INTERNAL_DELETE_PLAYER_FROM_GROUP (0x1a | DN_MSG_INTERNAL)
  73. #define DN_MSG_INTERNAL_UPDATE_INFO (0x1b | DN_MSG_INTERNAL)
  74. #ifndef DPNBUILD_NOVOICE
  75. #define DN_MSG_INTERNAL_VOICE_SEND (0x1c | DN_MSG_INTERNAL)
  76. #endif // DPNBUILD_NOVOICE
  77. #define DN_MSG_INTERNAL_BUFFER_IN_USE (0x1d | DN_MSG_INTERNAL)
  78. #define DN_MSG_INTERNAL_REQUEST_FAILED (0x1e | DN_MSG_INTERNAL)
  79. #define DN_MSG_INTERNAL_TERMINATE_SESSION (0x1f | DN_MSG_INTERNAL)
  80. #define DN_MSG_INTERNAL_REQ_PROCESS_COMPLETION (0x20 | DN_MSG_INTERNAL)
  81. #define DN_MSG_INTERNAL_PROCESS_COMPLETION (0x21 | DN_MSG_INTERNAL)
  82. #define DN_MSG_INTERNAL_REQ_INTEGRITY_CHECK (0x22 | DN_MSG_INTERNAL)
  83. #define DN_MSG_INTERNAL_INTEGRITY_CHECK (0x23 | DN_MSG_INTERNAL)
  84. #define DN_MSG_INTERNAL_INTEGRITY_CHECK_RESPONSE (0x24 | DN_MSG_INTERNAL)
  85. #define DN_MSG_USER_SEND 0x02
  86. //**********************************************************************
  87. // Macro definitions
  88. //**********************************************************************
  89. //**********************************************************************
  90. // Structure definitions
  91. //**********************************************************************
  92. typedef struct _DN_INTERNAL_MESSAGE_PLAYER_CONNECT_INFO {
  93. DWORD dwFlags;
  94. DWORD dwDNETVersion;
  95. DWORD dwNameOffset;
  96. DWORD dwNameSize;
  97. DWORD dwDataOffset;
  98. DWORD dwDataSize;
  99. DWORD dwPasswordOffset;
  100. DWORD dwPasswordSize;
  101. DWORD dwConnectDataOffset;
  102. DWORD dwConnectDataSize;
  103. DWORD dwURLOffset;
  104. DWORD dwURLSize;
  105. GUID guidInstance;
  106. GUID guidApplication;
  107. } DN_INTERNAL_MESSAGE_PLAYER_CONNECT_INFO, *PDN_INTERNAL_MESSAGE_PLAYER_CONNECT_INFO;
  108. typedef struct _DN_INTERNAL_MESSAGE_CONNECT_INFO {
  109. DWORD dwReplyOffset;
  110. DWORD dwReplySize;
  111. } DN_INTERNAL_MESSAGE_CONNECT_INFO, *PDN_INTERNAL_MESSAGE_CONNECT_INFO;
  112. typedef struct _DN_INTERNAL_MESSAGE_CONNECT_FAILED {
  113. HRESULT hResultCode;
  114. DWORD dwReplyOffset;
  115. DWORD dwReplySize;
  116. } DN_INTERNAL_MESSAGE_CONNECT_FAILED, *PDN_INTERNAL_MESSAGE_CONNECT_FAILED;
  117. typedef struct _DN_INTERNAL_MESSAGE_INSTRUCT_CONNECT {
  118. DPNID dpnid;
  119. DWORD dwVersion;
  120. DWORD dwVersionNotUsed;
  121. } DN_INTERNAL_MESSAGE_INSTRUCT_CONNECT, *PDN_INTERNAL_MESSAGE_INSTRUCT_CONNECT;
  122. typedef struct _DN_INTERNAL_MESSAGE_INSTRUCTED_CONNECT_FAILED {
  123. DPNID dpnid;
  124. } DN_INTERNAL_MESSAGE_INSTRUCTED_CONNECT_FAILED;
  125. typedef struct _DN_INTERNAL_MESSAGE_CONNECT_ATTEMPT_FAILED {
  126. DPNID dpnid;
  127. } DN_INTERNAL_MESSAGE_CONNECT_ATTEMPT_FAILED;
  128. typedef struct _DN_INTERNAL_MESSAGE_REQUEST_FAILED {
  129. DPNHANDLE hCompletionOp;
  130. HRESULT hResultCode;
  131. } DN_INTERNAL_MESSAGE_REQUEST_FAILED;
  132. typedef struct _DN_INTERNAL_MESSAGE_SEND_PLAYER_DPNID {
  133. DPNID dpnid;
  134. } DN_INTERNAL_MESSAGE_SEND_PLAYER_DPNID, *PDN_INTERNAL_MESSAGE_SEND_PLAYER_DPNID;
  135. typedef struct _DN_INTERNAL_MESSAGE_DESTROY_PLAYER {
  136. DPNID dpnidLeaving; // DPNID of leaving player
  137. DWORD dwVersion; // Name table version of this operation
  138. DWORD dwVersionNotUsed;
  139. DWORD dwDestroyReason;
  140. } DN_INTERNAL_MESSAGE_DESTROY_PLAYER, *PDN_INTERNAL_MESSAGE_DESTROY_PLAYER;
  141. typedef struct _DN_INTERNAL_MESSAGE_CREATE_GROUP {
  142. DPNID dpnidRequesting;
  143. DPNHANDLE hCompletionOp;
  144. } DN_INTERNAL_MESSAGE_CREATE_GROUP;
  145. typedef struct _DN_INTERNAL_MESSAGE_DESTROY_GROUP {
  146. DPNID dpnidGroup;
  147. DWORD dwVersion;
  148. DWORD dwVersionNotUsed;
  149. DPNID dpnidRequesting;
  150. DPNHANDLE hCompletionOp;
  151. } DN_INTERNAL_MESSAGE_DESTROY_GROUP;
  152. typedef struct _DN_INTERNAL_MESSAGE_ADD_PLAYER_TO_GROUP {
  153. DPNID dpnidGroup;
  154. DPNID dpnidPlayer;
  155. DWORD dwVersion;
  156. DWORD dwVersionNotUsed;
  157. DPNID dpnidRequesting;
  158. DPNHANDLE hCompletionOp;
  159. } DN_INTERNAL_MESSAGE_ADD_PLAYER_TO_GROUP, *PDN_INTERNAL_MESSAGE_ADD_PLAYER_TO_GROUP;
  160. typedef struct _DN_INTERNAL_MESSAGE_DELETE_PLAYER_FROM_GROUP {
  161. DPNID dpnidGroup;
  162. DPNID dpnidPlayer;
  163. DWORD dwVersion;
  164. DWORD dwVersionNotUsed;
  165. DPNID dpnidRequesting;
  166. DPNHANDLE hCompletionOp;
  167. } DN_INTERNAL_MESSAGE_DELETE_PLAYER_FROM_GROUP, *PDN_INTERNAL_MESSAGE_DELETE_PLAYER_FROM_GROUP;
  168. typedef struct _DN_INTERNAL_MESSAGE_UPDATE_INFO {
  169. DPNID dpnid;
  170. DWORD dwVersion;
  171. DWORD dwVersionNotUsed;
  172. DWORD dwInfoFlags;
  173. DWORD dwNameOffset;
  174. DWORD dwNameSize;
  175. DWORD dwDataOffset;
  176. DWORD dwDataSize;
  177. DPNID dpnidRequesting;
  178. DPNHANDLE hCompletionOp;
  179. } DN_INTERNAL_MESSAGE_UPDATE_INFO, *PDN_INTERNAL_MESSAGE_UPDATE_INFO;
  180. typedef struct _DN_INTERNAL_MESSAGE_HOST_MIGRATE {
  181. DPNID dpnidOldHost;
  182. DPNID dpnidNewHost;
  183. } DN_INTERNAL_MESSAGE_HOST_MIGRATE, *PDN_INTERNAL_MESSAGE_HOST_MIGRATE;
  184. typedef struct _DN_INTERNAL_MESSAGE_REQ_CREATE_GROUP {
  185. DWORD dwGroupFlags;
  186. DWORD dwInfoFlags;
  187. DWORD dwNameOffset;
  188. DWORD dwNameSize;
  189. DWORD dwDataOffset;
  190. DWORD dwDataSize;
  191. } DN_INTERNAL_MESSAGE_REQ_CREATE_GROUP, *PDN_INTERNAL_MESSAGE_REQ_CREATE_GROUP;
  192. typedef struct _DN_INTERNAL_MESSAGE_REQ_DESTROY_GROUP {
  193. DPNID dpnidGroup;
  194. } DN_INTERNAL_MESSAGE_REQ_DESTROY_GROUP, *PDN_INTERNAL_MESSAGE_REQ_DESTROY_GROUP;
  195. typedef struct _DN_INTERNAL_MESSAGE_REQ_ADD_PLAYER_TO_GROUP {
  196. DPNID dpnidGroup;
  197. DPNID dpnidPlayer;
  198. } DN_INTERNAL_MESSAGE_REQ_ADD_PLAYER_TO_GROUP, *PDN_INTERNAL_MESSAGE_REQ_ADD_PLAYER_TO_GROUP;
  199. typedef struct _DN_INTERNAL_MESSAGE_REQ_DELETE_PLAYER_FROM_GROUP {
  200. DPNID dpnidGroup;
  201. DPNID dpnidPlayer;
  202. } DN_INTERNAL_MESSAGE_REQ_DELETE_PLAYER_FROM_GROUP, *PDN_INTERNAL_MESSAGE_REQ_DELETE_PLAYER_FROM_GROUP;
  203. typedef struct _DN_INTERNAL_MESSAGE_REQ_UPDATE_INFO {
  204. DPNID dpnid;
  205. DWORD dwInfoFlags;
  206. DWORD dwNameOffset;
  207. DWORD dwNameSize;
  208. DWORD dwDataOffset;
  209. DWORD dwDataSize;
  210. } DN_INTERNAL_MESSAGE_REQ_UPDATE_INFO, *PDN_INTERNAL_MESSAGE_REQ_UPDATE_INFO;
  211. typedef struct _DN_INTERNAL_MESSAGE_NAMETABLE_VERSION {
  212. DWORD dwVersion;
  213. DWORD dwVersionNotUsed;
  214. } DN_INTERNAL_MESSAGE_NAMETABLE_VERSION, *PDN_INTERNAL_MESSAGE_NAMETABLE_VERSION;
  215. typedef struct _DN_INTERNAL_MESSAGE_RESYNC_VERSION {
  216. DWORD dwVersion;
  217. DWORD dwVersionNotUsed;
  218. } DN_INTERNAL_MESSAGE_RESYNC_VERSION, *PDN_INTERNAL_MESSAGE_RESYNC_VERSION;
  219. typedef struct _DN_INTERNAL_MESSAGE_REQ_NAMETABLE_OP {
  220. DWORD dwVersion;
  221. DWORD dwVersionNotUsed;
  222. } DN_INTERNAL_MESSAGE_REQ_NAMETABLE_OP, *PDN_INTERNAL_MESSAGE_REQ_NAMETABLE_OP;
  223. typedef struct _DN_INTERNAL_MESSAGE_ACK_NAMETABLE_OP {
  224. DWORD dwNumEntries;
  225. } DN_INTERNAL_MESSAGE_ACK_NAMETABLE_OP, *PDN_INTERNAL_MESSAGE_ACK_NAMETABLE_OP;
  226. typedef struct _DN_INTERNAL_MESSAGE_REQ_PROCESS_COMPLETION {
  227. DPNHANDLE hCompletionOp;
  228. } DN_INTERNAL_MESSAGE_REQ_PROCESS_COMPLETION;
  229. typedef struct _DN_INTERNAL_MESSAGE_PROCESS_COMPLETION {
  230. DPNHANDLE hCompletionOp;
  231. } DN_INTERNAL_MESSAGE_PROCESS_COMPLETION;
  232. typedef struct _DN_INTERNAL_MESSAGE_TERMINATE_SESSION {
  233. DWORD dwTerminateDataOffset;
  234. DWORD dwTerminateDataSize;
  235. } DN_INTERNAL_MESSAGE_TERMINATE_SESSION, *PDN_INTERNAL_MESSAGE_TERMINATE_SESSION;
  236. typedef struct _DN_INTERNAL_MESSAGE_REQ_INTEGRITY_CHECK {
  237. DPNID dpnidTarget;
  238. } DN_INTERNAL_MESSAGE_REQ_INTEGRITY_CHECK;
  239. typedef struct _DN_INTERNAL_MESSAGE_INTEGRITY_CHECK {
  240. DPNID dpnidRequesting;
  241. } DN_INTERNAL_MESSAGE_INTEGRITY_CHECK;
  242. typedef struct _DN_INTERNAL_MESSAGE_INTEGRITY_CHECK_RESPONSE {
  243. DPNID dpnidRequesting;
  244. } DN_INTERNAL_MESSAGE_INTEGRITY_CHECK_RESPONSE;
  245. typedef struct _DN_NAMETABLE_OP_INFO {
  246. DWORD dwMsgId;
  247. DWORD dwOpOffset;
  248. DWORD dwOpSize;
  249. } DN_NAMETABLE_OP_INFO, *PDN_NAMETABLE_OP_INFO;
  250. // DN_APPLICATION_DESC_INFO - used to pack / send info
  251. // Force byte alignment as this may go out on the wire
  252. #pragma pack( push, 1 )
  253. typedef struct DPN_APPLICATION_DESC_INFO {
  254. DWORD dwSize;
  255. DWORD dwFlags;
  256. DWORD dwMaxPlayers;
  257. DWORD dwCurrentPlayers;
  258. DWORD dwSessionNameOffset;
  259. DWORD dwSessionNameSize;
  260. DWORD dwPasswordOffset;
  261. DWORD dwPasswordSize;
  262. DWORD dwReservedDataOffset;
  263. DWORD dwReservedDataSize;
  264. DWORD dwApplicationReservedDataOffset;
  265. DWORD dwApplicationReservedDataSize;
  266. GUID guidInstance;
  267. GUID guidApplication;
  268. } DPN_APPLICATION_DESC_INFO;
  269. #pragma pack( pop )
  270. //**********************************************************************
  271. // Variable definitions
  272. //**********************************************************************
  273. //**********************************************************************
  274. // Function prototypes
  275. //**********************************************************************
  276. //**********************************************************************
  277. // Class prototypes
  278. //**********************************************************************
  279. #endif // __MESSAGE_H__