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.

195 lines
5.6 KiB

  1. /* File: D:\WACKER\xfer\xfer.h (Created: 16-Dec-1993)
  2. *
  3. * Copyright 1994 by Hilgraeve Inc. -- Monroe, MI
  4. * All rights reserved
  5. *
  6. * $Revision: 8 $
  7. * $Date: 7/11/02 11:11a $
  8. */
  9. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  10. *
  11. * This module contains all the function prototypes and associated data
  12. * types that are needed to start transfers.
  13. *
  14. *=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
  15. // CRC Calculation lookup tables
  16. extern const unsigned short usCrc16Lookup[ ];
  17. extern const unsigned long ulCrc32Lookup[ ];
  18. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
  19. /* Error codes from transfer routines */
  20. #define XFR_ERR_BASE 0x100
  21. #define XFR_NO_MEMORY XFR_ERR_BASE+1
  22. #define XFR_BAD_PROTOCOL XFR_ERR_BASE+2
  23. #define XFR_BAD_POINTER XFR_ERR_BASE+3
  24. #define XFR_BAD_PARAMETER XFR_ERR_BASE+4
  25. #define XFR_IN_PROGRESS XFR_ERR_BASE+5
  26. #define XFR_NO_CARRIER XFR_ERR_BASE+6
  27. #define XFER_CNCT XFR_ERR_BASE+7
  28. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
  29. /*
  30. * This structure contains the "generic" transfer parameters.
  31. * The values are set in the Transfer Send and Transfer Receive
  32. * dialogs and then passed to the transfer routines in the
  33. * session handle.
  34. */
  35. struct xfer_parameters
  36. {
  37. int nSize; /* Set to the size of this structure */
  38. /*
  39. * This section is for receiving parameters
  40. */
  41. int nRecProtocol; /* default receiving protocol, see below */
  42. int fUseFilenames; /* TRUE to use received filenames */
  43. int fUseDateTime; /* TRUE to use received date and time */
  44. int fUseDirectory; /* TRUE to use received directory */
  45. int fSavePartial; /* TRUE to save partial files */
  46. #define XFR_RO_ALWAYS 0x1
  47. #define XFR_RO_NEVER 0x2
  48. #define XFR_RO_APPEND 0x3
  49. #define XFR_RO_NEWER 0x4
  50. #define XFR_RO_REN_DATE 0x5
  51. #define XFR_RO_REN_SEQ 0x6
  52. int nRecOverwrite; /* default overwrite options */
  53. /*
  54. * This section is for sending parameters
  55. */
  56. int nSndProtocol; /* default sending protocol, see below */
  57. int fChkSubdirs; /* TRUE to check subdirs on search op */
  58. int fIncPaths; /* TRUE to send paths to receiver */
  59. };
  60. typedef struct xfer_parameters XFR_PARAMS;
  61. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
  62. /* Protocols supported */
  63. #define XF_HYPERP 1
  64. #define XF_ZMODEM 2
  65. #define XF_XMODEM 3
  66. #define XF_XMODEM_1K 4
  67. #define XF_YMODEM 5
  68. #define XF_YMODEM_G 6
  69. #define XF_KERMIT 7
  70. #define XF_CSB 8
  71. #define XF_ZMODEM_CR 9
  72. #define PROTOCOL_NAME_LENGTH 40
  73. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
  74. struct xfer_protocol
  75. {
  76. int nProtocol;
  77. TCHAR acName[PROTOCOL_NAME_LENGTH]; /* that should be big enough. JPN needs 32bytes at least*/
  78. };
  79. typedef struct xfer_protocol XFR_PROTOCOL;
  80. extern int WINAPI xfrGetProtocols(const HSESSION hSession,
  81. const XFR_PROTOCOL **ppList);
  82. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
  83. #if defined(DEADWOOD)
  84. extern int WINAPI xfrGetParameters(const HSESSION hSession,
  85. const int nProtocol,
  86. const HWND hwnd,
  87. VOID **ppData); /* protocol parameters */
  88. #endif // defined(DEADWOOD)
  89. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
  90. struct xfer_receive
  91. {
  92. int nProtocol; /* what protocol to use */
  93. XFR_PARAMS *pParams; /* general transfer parameters */
  94. VOID *pProParams; /* protocol specific parameters */
  95. LPTSTR pszDir; /* prototype directory string */
  96. LPTSTR pszName; /* prototype filename string */
  97. };
  98. typedef struct xfer_receive XFR_RECEIVE;
  99. extern int WINAPI xfrReceive(const HSESSION hSession,
  100. const XFR_RECEIVE *pXferRec);
  101. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
  102. struct xfer_send_list
  103. {
  104. long lSize;
  105. LPTSTR pszName;
  106. };
  107. typedef struct xfer_send_list XFR_LIST;
  108. struct xfer_send
  109. {
  110. int nProtocol; /* what protocol to use */
  111. XFR_PARAMS *pParams; /* general transfer parameters */
  112. VOID *pProParams; /* protocol specific parameters */
  113. int nCount; /* number of files to send */
  114. int nIndex; /* current index into the list */
  115. long lSize; /* total size of files in list */
  116. XFR_LIST *pList; /* pointer to the list */
  117. };
  118. typedef struct xfer_send XFR_SEND;
  119. extern int WINAPI xfrSend(const HSESSION hSession,
  120. const XFR_SEND *pXferSend);
  121. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
  122. #define XF_DUPNAME_MASK 0x00000F00L
  123. #define XF_DUPNAME_APPEND 0x00000100L
  124. #define XF_DUPNAME_OVERWRT 0x00000200L
  125. #define XF_DUPNAME_REFUSE 0x00000300L
  126. #define XF_DUPNAME_NEWER 0x00000400L
  127. #define XF_DUPNAME_DATE 0x00000500L
  128. #define XF_DUPNAME_SEQ 0x00000600L
  129. #define XF_CHECK_VIRUS 0x00001000L
  130. #define XF_USE_FILENAME 0x00002000L
  131. #define XF_USE_DIRECTORY 0x00004000L
  132. #define XF_SAVE_PARTIAL 0x00008000L
  133. #define XF_USE_DATETIME 0x00010000L
  134. #define XF_INCLUDE_SUBDIRS 0x00020000L
  135. #define XF_INCLUDE_PATHS 0x00040000L
  136. struct st_rcv_open
  137. {
  138. HANDLE bfHdl;
  139. TCHAR *pszSuggestedName;
  140. TCHAR *pszActualName;
  141. LONG lInitialSize;
  142. // struct s_filetime FAR *pstFtCompare;
  143. LONG lFileTime;
  144. // SSHDLMCH ssmchVscanHdl;
  145. VOID (FAR *pfnVscanOutput)(VOID FAR *hSession, USHORT usID);
  146. };
  147. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
  148. int xfer_makepaths(HSESSION hSession, LPTSTR pszPath);