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.

162 lines
6.5 KiB

  1. #ifndef __MBFTSEND_HPP__
  2. #define __MBFTSEND_HPP__
  3. class CMBFTFile;
  4. class MBFTPrivateSend : public MBFTSession
  5. {
  6. private:
  7. enum MBFTPrivateSendState
  8. {
  9. EnumIdleInitialized,
  10. EnumInitializationFailed,
  11. EnumIdleNotInitialized,
  12. EnumWaitConveneControlChannel,
  13. EnumWaitConveneDataChannel,
  14. EnumWaitRequestControlConvene,
  15. EnumWaitRequestDataConvene,
  16. EnumWaitJoinControlChannel,
  17. EnumWaitRequestJoinControl,
  18. EnumFileSendPending,
  19. EnumSendNonStandardPDU,
  20. EnumSendFileOfferPDU,
  21. EnumSendFileStartPDU,
  22. EnumSendFileDataPDU,
  23. EnumWaitJoinDataChannel,
  24. EnumWaitRequestJoinData,
  25. EnumWaitSendChannelInvitePDU,
  26. EnumWaitChannelResponsePDU,
  27. EnumWaitFileAcceptPDU,
  28. EnumWaitFileEndAcknowledgePDU,
  29. EnumTerminateCurrentSend,
  30. EnumWaitForTermination,
  31. EnumHackWaitFileOffer
  32. };
  33. CMBFTFile *m_lpFile;
  34. T120ChannelID m_MBFTChannelID;
  35. T120ChannelID m_PrivateMBFTControlChannel;
  36. T120ChannelID m_PrivateMBFTDataChannel;
  37. T120UserID *m_lpUserArray;
  38. T120UserID *m_lpAcceptedUsersArray;
  39. T120NodeID *m_lpNodeArray;
  40. ULONG m_iUserCount;
  41. ULONG m_AcceptedIndex;
  42. unsigned m_MaxDataLength;
  43. BOOL m_SentFileStartPDU;
  44. DWORD m_TimeOutValue;
  45. LPSTR m_pszCurrentFilePath;
  46. MBFTFILEHANDLE m_CurrentFileHandle;
  47. time_t m_CurrentDateTime;
  48. LONG m_CurrentFileSize;
  49. MBFTPrivateSendState m_State;
  50. BOOL m_bProshareTransfer;
  51. BOOL m_bEOFAcknowledge;
  52. BOOL m_bCompressFiles;
  53. ULONG m_LastUserCount;
  54. ULONG m_ResponseCount;
  55. ULONG m_AcceptCount;
  56. ULONG m_RejectCount;
  57. ULONG m_AbortedCount;
  58. ULONG m_AcknowledgeCount;
  59. LONG m_lTotalBytesRead;
  60. LPSTR m_lpDataBuffer;
  61. BOOL m_bAbortAllFiles;
  62. BOOL m_bSendingFile;
  63. BOOL m_bAbortFileSend;
  64. BOOL m_bUnInitializing;
  65. BOOL m_bSentFileOfferPDU;
  66. BOOL m_bOKToDisbandChannel;
  67. LPVOID m_lpV42bisPointer;
  68. BOOL m_bFlushv42Compression;
  69. BOOL m_bEventEndPosted;
  70. int m_v42bisP1;
  71. int m_v42bisP2;
  72. void ConveneControlChannel(void);
  73. void ConveneDataChannel(void);
  74. void JoinControlChannel(void);
  75. void AdmitControlChannel(void);
  76. void AdmitDataChannel(void);
  77. void SendChannelInvitePDU(void);
  78. void SendFileOfferPDU(void);
  79. void SendFileStartPDU(void);
  80. void SendFileDataPDU(void);
  81. void SendNextFile(void);
  82. void AbortAllFiles(void);
  83. void AbortCurrentFile(void);
  84. void RemoveFileFromList(MBFTFILEHANDLE);
  85. BOOL RemoveUserFromList(T120UserID);
  86. BOOL RemoveUserFromAcceptedList(T120UserID);
  87. void SendNotificationMessage(int iProgress, T120UserID uid = 0, MBFTFILEHANDLE h = 0);
  88. void ReportError(int iErrorType,int iTransmitError,
  89. BOOL bIsLocalError = TRUE, T120UserID uidSender = 0, MBFTFILEHANDLE h = 0);
  90. void ReportSenderError(int iErrorType,int iErrorCode, MBFTFILEHANDLE h = 0);
  91. void TerminateCurrentSend(void);
  92. void TerminateSendSession(void);
  93. LPSTR StripFilePath(LPSTR lpszFileName);
  94. void Initv42Compression(void);
  95. void Flushv42Compression(void);
  96. public:
  97. MBFTPrivateSend(LPMBFTENGINE lpParentEngine, MBFTEVENTHANDLE EventHandle,
  98. T120UserID wMBFTUserID, ULONG MaxDataLength);
  99. ~MBFTPrivateSend(void);
  100. BOOL OnMCSChannelJoinConfirm(T120ChannelID, BOOL bSuccess);
  101. BOOL OnMCSChannelConveneConfirm(T120ChannelID, BOOL bSuccess);
  102. BOOL OnReceivedPrivateChannelResponsePDU(T120ChannelID, T120Priority,
  103. T120UserID SenderID,
  104. LPPRIVATECHANNELRESPONSEPDU lpNewPDU,
  105. BOOL IsUniformSendData);
  106. BOOL OnReceivedFileAcceptPDU(T120ChannelID, T120Priority,
  107. T120UserID SenderID,
  108. LPFILEACCEPTPDU lpNewPDU,
  109. BOOL IsUniformSendData);
  110. BOOL OnReceivedFileRejectPDU(T120ChannelID, T120Priority,
  111. T120UserID SenderID,
  112. LPFILEREJECTPDU lpNewPDU,
  113. BOOL IsUniformSendData);
  114. BOOL OnReceivedFileAbortPDU(T120ChannelID, T120Priority,
  115. T120UserID SenderID,
  116. LPFILEABORTPDU lpNewPDU,
  117. BOOL IsUniformSendData);
  118. BOOL OnReceivedFileErrorPDU(T120ChannelID, T120Priority,
  119. T120UserID SenderID,
  120. LPFILEERRORPDU lpNewPDU,
  121. BOOL IsUniformSendData);
  122. BOOL OnReceivedNonStandardPDU(T120ChannelID, T120Priority,
  123. T120UserID SenderID,
  124. LPNONSTANDARDPDU lpNewPDU,
  125. BOOL IsUniformSendData);
  126. BOOL OnReceivedFileEndAcknowledgePDU(T120ChannelID, T120Priority,
  127. T120UserID SenderID,
  128. LPFILEENDACKNOWLEDGEPDU lpNewPDU,
  129. BOOL IsUniformSendData);
  130. BOOL OnReceivedChannelLeavePDU(T120ChannelID, T120Priority,
  131. T120UserID SenderID,
  132. LPCHANNELLEAVEPDU lpNewPDU,
  133. BOOL IsUniformSendData);
  134. void OnControlNotification(MBFTFILEHANDLE hFile,
  135. FileTransferControlMsg::FileTransferControl iControlCommand,
  136. LPCSTR lpszDirectory,
  137. LPCSTR lpszFileName);
  138. BOOL SubmitFileSendRequest(SubmitFileSendMsg *);
  139. void OnPeerDeletedNotification(CPeerData * lpPeerData);
  140. void DoStateMachine(void);
  141. void UnInitialize(BOOL bShutDown = FALSE);
  142. };
  143. #endif //__MBFTSEND_HPP__