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.

381 lines
9.6 KiB

  1. #ifndef __MESSAGES_HPP__
  2. #define __MESSAGES_HPP__
  3. enum
  4. {
  5. MBFTMSG_CREATE_ENGINE = WM_APP + 1,
  6. MBFTMSG_DELETE_ENGINE = WM_APP + 2,
  7. MBFTMSG_HEART_BEAT = WM_APP + 3,
  8. MBFTMSG_BASIC = WM_APP + 4,
  9. };
  10. typedef enum
  11. {
  12. EnumMCSChannelAdmitIndicationMsg,
  13. EnumMCSChannelExpelIndicationMsg,
  14. EnumMCSChannelJoinConfirmMsg,
  15. EnumMCSChannelConveneConfirmMsg,
  16. EnumMCSSendDataIndicationMsg,
  17. EnumGenericMBFTPDUMsg,
  18. EnumCreateSessionMsg,
  19. EnumDeleteSessionMsg,
  20. EnumPeerDeletedMsg,
  21. EnumSubmitFileSendMsg,
  22. EnumFileOfferNotifyMsg,
  23. EnumFileTransferControlMsg,
  24. EnumFileTransmitMsg,
  25. EnumFileErrorMsg,
  26. EnumPeerMsg,
  27. EnumInitUnInitNotifyMsg,
  28. EnumFileEventEndNotifyMsg,
  29. }
  30. MBFT_MSG_TYPE;
  31. class MBFTMsg
  32. {
  33. public:
  34. MBFTMsg(MBFT_MSG_TYPE eMsgType) : m_eMsgType(eMsgType) { }
  35. virtual ~MBFTMsg(void);
  36. MBFT_MSG_TYPE GetMsgType(void) { return m_eMsgType; }
  37. protected:
  38. MBFT_MSG_TYPE m_eMsgType;
  39. };
  40. class MCSChannelAdmitIndicationMsg : public MBFTMsg
  41. {
  42. public:
  43. MCSChannelAdmitIndicationMsg(T120ChannelID wChannelId, T120UserID ManagerID) :
  44. MBFTMsg(EnumMCSChannelAdmitIndicationMsg),
  45. m_wChannelId(wChannelId),
  46. m_ManagerID(ManagerID)
  47. {
  48. }
  49. T120ChannelID m_wChannelId;
  50. T120UserID m_ManagerID;
  51. };
  52. class MCSChannelExpelIndicationMsg : public MBFTMsg
  53. {
  54. public:
  55. MCSChannelExpelIndicationMsg(T120ChannelID wChannelId, Reason iReason) :
  56. MBFTMsg(EnumMCSChannelExpelIndicationMsg),
  57. m_wChannelId(wChannelId),
  58. m_iReason(iReason)
  59. {
  60. }
  61. T120ChannelID m_wChannelId;
  62. Reason m_iReason;
  63. };
  64. class MCSChannelJoinConfirmMsg : public MBFTMsg
  65. {
  66. public:
  67. MCSChannelJoinConfirmMsg(T120ChannelID wChannelId, BOOL bSuccess) :
  68. MBFTMsg(EnumMCSChannelJoinConfirmMsg),
  69. m_wChannelId(wChannelId),
  70. m_bSuccess(bSuccess)
  71. {
  72. }
  73. T120ChannelID m_wChannelId;
  74. BOOL m_bSuccess;
  75. };
  76. class MCSChannelConveneConfirmMsg : public MBFTMsg
  77. {
  78. public:
  79. MCSChannelConveneConfirmMsg(T120ChannelID wChannelId, BOOL bSuccess) :
  80. MBFTMsg(EnumMCSChannelConveneConfirmMsg),
  81. m_wChannelId(wChannelId),
  82. m_bSuccess(bSuccess)
  83. {
  84. }
  85. T120ChannelID m_wChannelId;
  86. BOOL m_bSuccess;
  87. };
  88. class MCSSendDataIndicationMsg : public MBFTMsg
  89. {
  90. public:
  91. MCSSendDataIndicationMsg(T120ChannelID wChannelId,
  92. T120Priority iPriority,
  93. T120UserID SenderID,
  94. LPBYTE lpBuffer,
  95. ULONG ulDataLength,
  96. BOOL IsUniformSendData);
  97. T120ChannelID m_wChannelId;
  98. T120Priority m_iPriority;
  99. T120UserID m_SenderID;
  100. LPBYTE m_lpBuffer;
  101. ULONG m_ulDataLength;
  102. BOOL m_IsUniformSendData;
  103. };
  104. class MBFTPDUMsg : public MBFTMsg
  105. {
  106. public:
  107. MBFTPDUMsg(T120ChannelID wChannelId,
  108. T120Priority iPriority,
  109. T120UserID SenderID,
  110. LPGENERICPDU lpNewPDU,
  111. BOOL IsUniformSendData,
  112. MBFTPDUType PDUType,
  113. LPSTR lpDecodedBuffer);
  114. ~MBFTPDUMsg(void);
  115. T120ChannelID m_wChannelId;
  116. T120Priority m_iPriority;
  117. T120UserID m_SenderID;
  118. LPGENERICPDU m_lpNewPDU;
  119. BOOL m_IsUniformSendData;
  120. MBFTPDUType m_PDUType;
  121. LPSTR m_lpDecodedBuffer;
  122. };
  123. class CreateSessionMsg : public MBFTMsg
  124. {
  125. public:
  126. CreateSessionMsg(MBFT_SESSION_TYPE iSessionType,
  127. MBFTEVENTHANDLE EventHandle,
  128. T120SessionID SessionID = 0,
  129. T120ChannelID wControlChannel = 0,
  130. T120ChannelID wDataChannel = 0,
  131. T120UserID SenderID = 0,
  132. MBFTFILEHANDLE FileHandle = 0);
  133. MBFT_SESSION_TYPE m_iSessionType;
  134. MBFTEVENTHANDLE m_EventHandle;
  135. T120SessionID m_SessionID;
  136. T120ChannelID m_ControlChannel;
  137. T120ChannelID m_DataChannel;
  138. T120UserID m_SenderID;
  139. MBFTFILEHANDLE m_FileHandle;
  140. };
  141. class MBFTSession;
  142. class DeleteSessionMsg : public MBFTMsg
  143. {
  144. public:
  145. DeleteSessionMsg(MBFTSession * lpDeleteSession) :
  146. MBFTMsg(EnumDeleteSessionMsg),
  147. m_lpDeleteSession(lpDeleteSession)
  148. {
  149. }
  150. MBFTSession * m_lpDeleteSession;
  151. };
  152. class CPeerData;
  153. class PeerDeletedMsg : public MBFTMsg
  154. {
  155. public:
  156. PeerDeletedMsg(CPeerData * lpPeerData) :
  157. MBFTMsg(EnumPeerDeletedMsg),
  158. m_lpPeerData(lpPeerData)
  159. {
  160. }
  161. ~PeerDeletedMsg(void);
  162. CPeerData * m_lpPeerData;
  163. };
  164. class SubmitFileSendMsg : public MBFTMsg
  165. {
  166. public:
  167. SubmitFileSendMsg::SubmitFileSendMsg(T120UserID uidReceiver,
  168. T120NodeID nidReceiver,
  169. LPCSTR pszFilePath,
  170. MBFTFILEHANDLE nFileHandle,
  171. MBFTEVENTHANDLE EventHandle,
  172. BOOL bCompressFiles);
  173. ~SubmitFileSendMsg(void);
  174. T120UserID m_nUserID;
  175. T120NodeID m_nNodeID;
  176. LPSTR m_pszFilePath;
  177. MBFTFILEHANDLE m_nFileHandle;
  178. MBFTEVENTHANDLE m_EventHandle;
  179. BOOL m_bCompressFiles;
  180. };
  181. class FileOfferNotifyMsg : public MBFTMsg
  182. {
  183. public:
  184. FileOfferNotifyMsg(MBFTEVENTHANDLE EventHandle,
  185. T120UserID SenderID,
  186. T120NodeID NodeID,
  187. MBFTFILEHANDLE hFile,
  188. LPCSTR lpszFilename,
  189. ULONG FileSize,
  190. time_t FileDateTime,
  191. BOOL bAckNeeded);
  192. MBFTEVENTHANDLE m_EventHandle;
  193. MBFTFILEHANDLE m_hFile;
  194. ULONG m_FileSize;
  195. time_t m_FileDateTime;
  196. BOOL m_bAckNeeded;
  197. T120UserID m_SenderID;
  198. T120NodeID m_NodeID;
  199. char m_szFileName[_MAX_PATH];
  200. };
  201. class FileTransferControlMsg : public MBFTMsg
  202. {
  203. public:
  204. enum FileTransferControl
  205. {
  206. EnumAcceptFile,
  207. EnumRejectFile,
  208. EnumAbortFile,
  209. EnumConductorAbortFile
  210. };
  211. FileTransferControlMsg(MBFTEVENTHANDLE EventHandle,
  212. MBFTFILEHANDLE hFile,
  213. LPCSTR lpszDirectory,
  214. LPCSTR lpszFileName,
  215. FileTransferControl iControlCommand);
  216. MBFTEVENTHANDLE m_EventHandle;
  217. MBFTFILEHANDLE m_hFile;
  218. FileTransferControl m_ControlCommand;
  219. char m_szDirectory[_MAX_PATH];
  220. char m_szFileName[_MAX_FNAME];
  221. };
  222. class FileTransmitMsg : public MBFTMsg
  223. {
  224. public:
  225. FileTransmitMsg(MBFTEVENTHANDLE EventHandle,
  226. MBFTFILEHANDLE hFile,
  227. ULONG FileSize,
  228. ULONG BytesTransmitted,
  229. int iTransmitStatus,
  230. T120UserID iUserID = 0,
  231. BOOL bIsBroadcastEvent = FALSE);
  232. MBFTEVENTHANDLE m_EventHandle;
  233. MBFTFILEHANDLE m_hFile;
  234. ULONG m_FileSize;
  235. ULONG m_BytesTransmitted;
  236. T120UserID m_UserID;
  237. int m_TransmitStatus;
  238. BOOL m_bIsBroadcastEvent;
  239. };
  240. class FileErrorMsg : public MBFTMsg
  241. {
  242. public:
  243. FileErrorMsg(MBFTEVENTHANDLE EventHandle,
  244. MBFTFILEHANDLE hFile,
  245. int iErrorType,
  246. int iErrorCode,
  247. BOOL bIsLocalError,
  248. T120UserID iUserID = 0,
  249. BOOL bIsBroadcastEvent = FALSE,
  250. const char* pFileName = NULL,
  251. ULONG nFileSize = 0);
  252. MBFTEVENTHANDLE m_EventHandle;
  253. MBFTFILEHANDLE m_hFile;
  254. int m_ErrorCode;
  255. int m_ErrorType;
  256. BOOL m_bIsLocalError;
  257. T120UserID m_UserID;
  258. BOOL m_bIsBroadcastEvent;
  259. MBFT_RECEIVE_FILE_INFO m_stFileInfo;
  260. };
  261. class PeerMsg : public MBFTMsg
  262. {
  263. public:
  264. enum PeerChange
  265. {
  266. EnumPeerAdded,
  267. EnumPeerRemoved
  268. };
  269. PeerMsg(T120NodeID NodeID,
  270. T120UserID MBFTPeerID,
  271. BOOL bIsLocalPeer,
  272. BOOL IsProsharePeer,
  273. LPCSTR lpszAppKey,
  274. BOOL bPeerAdded,
  275. T120SessionID MBFTSessionID);
  276. T120NodeID m_NodeID;
  277. T120UserID m_MBFTPeerID;
  278. BOOL m_bIsLocalPeer;
  279. BOOL m_bIsProsharePeer;
  280. T120SessionID m_MBFTSessionID;
  281. BOOL m_bPeerAdded;
  282. char m_szAppKey[MAX_APP_KEY_SIZE];
  283. };
  284. enum InitUnInitNotifyType
  285. {
  286. EnumInitFailed,
  287. EnumUnInitComplete,
  288. EnumInvoluntaryUnInit
  289. };
  290. class InitUnInitNotifyMsg : public MBFTMsg
  291. {
  292. public:
  293. InitUnInitNotifyMsg(InitUnInitNotifyType iNotifyMessage) :
  294. MBFTMsg(EnumInitUnInitNotifyMsg),
  295. m_iNotifyMessage(iNotifyMessage)
  296. {
  297. }
  298. InitUnInitNotifyType m_iNotifyMessage;
  299. };
  300. class FileEventEndNotifyMsg : public MBFTMsg
  301. {
  302. public:
  303. FileEventEndNotifyMsg(MBFTEVENTHANDLE EventHandle) :
  304. MBFTMsg(EnumFileEventEndNotifyMsg),
  305. m_EventHandle(EventHandle)
  306. {
  307. }
  308. MBFTEVENTHANDLE m_EventHandle;
  309. };
  310. #endif //__MESSAGES_HPP__
  311.