inetimpl.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1997 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10. #ifndef _MAC
  11. #ifdef _AFXDLL
  12. /////////////////////////////////////////////////////////////////////////////
  13. // AFX_WININET_CALL - used to dynamically load WININET.DLL
  14. struct AFX_WININET_CALL
  15. {
  16. // generic connection
  17. HINTERNET (WINAPI* pfnInternetOpen)(
  18. LPCTSTR lpszAgent, DWORD dwAccessType,
  19. LPCTSTR lpszProxy, LPCTSTR lpszProxyBypass, DWORD dwFlags);
  20. HINTERNET (WINAPI* pfnInternetCloseHandle)(HINTERNET hInternet);
  21. HINTERNET (WINAPI* pfnInternetOpenUrl)(HINTERNET hInternet,
  22. LPCTSTR pstrUrl, LPCTSTR pstrHeaders, DWORD dwHeadersLength,
  23. DWORD dwFlags, DWORD dwContext);
  24. HINTERNET (WINAPI* pfnInternetReadFile)(HINTERNET hInternet,
  25. LPVOID lpBuffer, DWORD dwNumberOfBytesToRead,
  26. LPDWORD lpdwNumberOfBytesRead);
  27. HINTERNET (WINAPI* pfnInternetWriteFile)(HINTERNET hInternet,
  28. LPCVOID lpBuffer, DWORD dwNumberOfBytesToWrite,
  29. LPDWORD lpdwNumberOfBytesWritten);
  30. INTERNET_STATUS_CALLBACK (WINAPI* pfnInternetSetStatusCallback)(
  31. HINTERNET hInternet, INTERNET_STATUS_CALLBACK lpfnInternetCallback);
  32. BOOL (WINAPI* pfnInternetQueryOption)(HINTERNET hInternet,
  33. DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength);
  34. BOOL (WINAPI* pfnInternetSetOption)(HINTERNET hInternet,
  35. DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength);
  36. BOOL (WINAPI* pfnInternetSetOptionEx)(HINTERNET hInternet,
  37. DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength, DWORD dwFlags);
  38. BOOL (WINAPI* pfnInternetGetLastResponseInfo)(LPDWORD lpdwError,
  39. LPTSTR pstrBuffer, LPDWORD lpdwBufferLength);
  40. BOOL (WINAPI* pfnInternetFindNextFile)(HINTERNET hFind,
  41. LPVOID lpvFindData);
  42. HINTERNET (WINAPI* pfnInternetConnect)(HINTERNET hInternet,
  43. LPCTSTR pstrServerName, INTERNET_PORT nServerPort,
  44. LPCTSTR pstrUsername, LPCTSTR pstrPassword, DWORD dwService,
  45. DWORD dwFlags, DWORD dwContext);
  46. DWORD (WINAPI* pfnInternetSetFilePointer)(HINTERNET hFile,
  47. LONG lDistanceToMove, PVOID reserved, DWORD dwMoveMethod,
  48. DWORD dwContext);
  49. BOOL (WINAPI* pfnInternetQueryDataAvailable)(HINTERNET hFile,
  50. LPDWORD lpdwNumberOfBytesAvailable, DWORD dwFlags, DWORD dwContext);
  51. // ftp
  52. HINTERNET (WINAPI* pfnFtpFindFirstFile)(HINTERNET hFtpSession,
  53. LPCTSTR pstrSearchFile, LPWIN32_FIND_DATA lpFindFileData,
  54. DWORD dwFlags, DWORD dwContext);
  55. BOOL (WINAPI* pfnFtpGetFile)(HINTERNET hFtpSession,
  56. LPCTSTR pstrRemoteFile, LPCTSTR pstrNewFile, BOOL fFailIfExists,
  57. DWORD dwFlagsAndAttributes, DWORD dwFlags, DWORD dwContext);
  58. BOOL (WINAPI* pfnFtpPutFile)(HINTERNET hFtpSession,
  59. LPCTSTR pstrLocalFile, LPCTSTR pstrNewRemoteFile, DWORD dwFlags,
  60. DWORD dwContext);
  61. BOOL (WINAPI* pfnFtpDeleteFile)(HINTERNET hFtpSession,
  62. LPCTSTR pstrFileName);
  63. BOOL (WINAPI* pfnFtpRenameFile)(HINTERNET hFtpSession,
  64. LPCTSTR pstrExisting, LPCTSTR pstrNew);
  65. BOOL (WINAPI* pfnFtpCreateDirectory)(HINTERNET hFtpSession,
  66. LPCTSTR pstrDirectory);
  67. BOOL (WINAPI* pfnFtpRemoveDirectory)(HINTERNET hFtpSession,
  68. LPCTSTR pstrDirectory);
  69. BOOL (WINAPI* pfnFtpSetCurrentDirectory)(HINTERNET hFtpSession,
  70. LPCTSTR pstrDirectory);
  71. BOOL (WINAPI* pfnFtpGetCurrentDirectory)(HINTERNET hFtpSession,
  72. LPCTSTR pstrCurrentDirectory, LPDWORD lpdwCurrentDirectory);
  73. BOOL (WINAPI* pfnFtpCommand)(HINTERNET hFtpSession,
  74. BOOL fExpectResponse, DWORD dwFlags, LPCTSTR pstrCommand,
  75. DWORD dwContext);
  76. HINTERNET (WINAPI* pfnFtpOpenFile)(HINTERNET hFtpSession,
  77. LPCTSTR pstrFileName, DWORD dwAccess, DWORD dwFlags, DWORD dwContext);
  78. // gopher
  79. HINTERNET (WINAPI* pfnGopherFindFirstFile)(HINTERNET hGopherSession,
  80. LPCTSTR pstrLocator, LPCTSTR pstrSearchString,
  81. LPGOPHER_FIND_DATA lpFindData, DWORD dwFlags, DWORD dwContext);
  82. HINTERNET (WINAPI* pfnGopherOpenFile)(HINTERNET hGopherSession,
  83. LPCTSTR pstrLocator, LPCTSTR pstrView, DWORD dwFlags,
  84. DWORD dwContext);
  85. BOOL (WINAPI* pfnGopherCreateLocator)(LPCTSTR pstrHost,
  86. INTERNET_PORT nServerPort, LPCTSTR pstrDisplayString,
  87. LPCTSTR pstrSelectorString, DWORD dwGopherType,
  88. LPTSTR pstrLocator, LPDWORD lpdwBufferLength);
  89. BOOL (WINAPI* pfnGopherGetAttribute)(HINTERNET hGopherSession,
  90. LPCTSTR pstrLocator, LPCTSTR pstrAttributeName, LPBYTE lpBuffer,
  91. DWORD dwBufferLength, LPDWORD lpdwCharactersReturned,
  92. GOPHER_ATTRIBUTE_ENUMERATOR lpfnEnumerator, DWORD dwContext);
  93. BOOL (WINAPI* pfnGopherGetLocatorType)(LPCTSTR pstrLocator,
  94. LPDWORD pdwGopherType);
  95. // html
  96. HINTERNET (WINAPI* pfnHttpOpenRequest)(HINTERNET hHttpSession,
  97. LPCTSTR pstrVerb, LPCTSTR pstrObjectName, LPCTSTR pstrVersion,
  98. LPCTSTR pstrReferrer, LPCTSTR FAR * lppstrAcceptTypes,
  99. DWORD dwFlags, DWORD dwContext);
  100. BOOL (WINAPI* pfnHttpAddRequestHeaders)(HINTERNET hHttpRequest,
  101. LPCTSTR pstrHeaders, DWORD dwHeadersLength, DWORD dwModifiers);
  102. BOOL (WINAPI* pfnHttpSendRequest)(HINTERNET hHttpRequest,
  103. LPCTSTR pstrHeaders, DWORD dwHeadersLength, LPVOID lpOptional,
  104. DWORD dwOptionalLength);
  105. BOOL (WINAPI* pfnHttpQueryInfo)(HINTERNET hHttpRequest,
  106. DWORD dwInfoLevel, LPVOID lpvBuffer, LPDWORD lpdwBufferLength,
  107. LPDWORD dwIndex);
  108. DWORD (WINAPI*pfnInternetErrorDlg)(HWND hWnd, HINTERNET hRequest,
  109. DWORD dwError, DWORD dwFlags, LPVOID * lppvData);
  110. // utility
  111. BOOL (WINAPI* pfnInternetCrackUrl)(LPCTSTR lpszUrl, DWORD dwUrlLength,
  112. DWORD dwFlags, LPURL_COMPONENTS lpUrlComponents);
  113. BOOL (WINAPI* pfnInternetCanonicalizeUrl)(LPCTSTR lpszUrl,
  114. LPTSTR lpszBuffer, LPDWORD lpdwBufferLength, DWORD dwFlags);
  115. };
  116. extern AFX_DATA AFX_WININET_CALL _afxWinINet;
  117. /////////////////////////////////////////////////////////////////////////////
  118. // macros for AFX_WININET_CALL access
  119. // generic connection
  120. #ifdef InternetOpen
  121. #undef InternetOpen
  122. #endif
  123. #define InternetOpen _afxWinINet.pfnInternetOpen
  124. #ifdef InternetCloseHandle
  125. #undef InternetCloseHandle
  126. #endif
  127. #define InternetCloseHandle _afxWinINet.pfnInternetCloseHandle
  128. #ifdef InternetOpenUrl
  129. #undef InternetOpenUrl
  130. #endif
  131. #define InternetOpenUrl _afxWinINet.pfnInternetOpenUrl
  132. #ifdef InternetReadFile
  133. #undef InternetReadFile
  134. #endif
  135. #define InternetReadFile _afxWinINet.pfnInternetReadFile
  136. #ifdef InternetWriteFile
  137. #undef InternetWriteFile
  138. #endif
  139. #define InternetWriteFile _afxWinINet.pfnInternetWriteFile
  140. #ifdef InternetSetStatusCallback
  141. #undef InternetSetStatusCallback
  142. #endif
  143. #define InternetSetStatusCallback _afxWinINet.pfnInternetSetStatusCallback
  144. #ifdef InternetSetOption
  145. #undef InternetSetOption
  146. #endif
  147. #define InternetSetOption _afxWinINet.pfnInternetSetOption
  148. #ifdef InternetSetOptionEx
  149. #undef InternetSetOptionEx
  150. #endif
  151. #define InternetSetOptionEx _afxWinINet.pfnInternetSetOptionEx
  152. #ifdef InternetQueryOption
  153. #undef InternetQueryOption
  154. #endif
  155. #define InternetQueryOption _afxWinINet.pfnInternetQueryOption
  156. #ifdef InternetGetLastResponseInfo
  157. #undef InternetGetLastResponseInfo
  158. #endif
  159. #define InternetGetLastResponseInfo _afxWinINet.pfnInternetGetLastResponseInfo
  160. #ifdef InternetFindNextFile
  161. #undef InternetFindNextFile
  162. #endif
  163. #define InternetFindNextFile _afxWinINet.pfnInternetFindNextFile
  164. #ifdef InternetConnect
  165. #undef InternetConnect
  166. #endif
  167. #define InternetConnect _afxWinINet.pfnInternetConnect
  168. #ifdef InternetSetFilePointer
  169. #undef InternetSetFilePointer
  170. #endif
  171. #define InternetSetFilePointer _afxWinINet.pfnInternetSetFilePointer
  172. #ifdef InternetQueryDataAvailable
  173. #undef InternetQueryDataAvailable
  174. #endif
  175. #define InternetQueryDataAvailable _afxWinINet.pfnInternetQueryDataAvailable
  176. // ftp
  177. #ifdef FtpFindFirstFile
  178. #undef FtpFindFirstFile
  179. #endif
  180. #define FtpFindFirstFile _afxWinINet.pfnFtpFindFirstFile
  181. #ifdef FtpGetFile
  182. #undef FtpGetFile
  183. #endif
  184. #define FtpGetFile _afxWinINet.pfnFtpGetFile
  185. #ifdef FtpPutFile
  186. #undef FtpPutFile
  187. #endif
  188. #define FtpPutFile _afxWinINet.pfnFtpPutFile
  189. #ifdef FtpDeleteFile
  190. #undef FtpDeleteFile
  191. #endif
  192. #define FtpDeleteFile _afxWinINet.pfnFtpDeleteFile
  193. #ifdef FtpRenameFile
  194. #undef FtpRenameFile
  195. #endif
  196. #define FtpRenameFile _afxWinINet.pfnFtpRenameFile
  197. #ifdef FtpCreateDirectory
  198. #undef FtpCreateDirectory
  199. #endif
  200. #define FtpCreateDirectory _afxWinINet.pfnFtpCreateDirectory
  201. #ifdef FtpRemoveDirectory
  202. #undef FtpRemoveDirectory
  203. #endif
  204. #define FtpRemoveDirectory _afxWinINet.pfnFtpRemoveDirectory
  205. #ifdef FtpGetCurrentDirectory
  206. #undef FtpGetCurrentDirectory
  207. #endif
  208. #define FtpGetCurrentDirectory _afxWinINet.pfnFtpGetCurrentDirectory
  209. #ifdef FtpSetCurrentDirectory
  210. #undef FtpSetCurrentDirectory
  211. #endif
  212. #define FtpSetCurrentDirectory _afxWinINet.pfnFtpSetCurrentDirectory
  213. #ifdef FtpCommand
  214. #undef FtpCommand
  215. #endif
  216. #define FtpCommand _afxWinINet.pfnFtpCommand
  217. #ifdef FtpOpenFile
  218. #undef FtpOpenFile
  219. #endif
  220. #define FtpOpenFile _afxWinINet.pfnFtpOpenFile
  221. // gopher
  222. #ifdef GopherFindFirstFile
  223. #undef GopherFindFirstFile
  224. #endif
  225. #define GopherFindFirstFile _afxWinINet.pfnGopherFindFirstFile
  226. #ifdef GopherOpenFile
  227. #undef GopherOpenFile
  228. #endif
  229. #define GopherOpenFile _afxWinINet.pfnGopherOpenFile
  230. #ifdef GopherCreateLocator
  231. #undef GopherCreateLocator
  232. #endif
  233. #define GopherCreateLocator _afxWinINet.pfnGopherCreateLocator
  234. #ifdef GopherGetAttribute
  235. #undef GopherGetAttribute
  236. #endif
  237. #define GopherGetAttribute _afxWinINet.pfnGopherGetAttribute
  238. #ifdef GopherGetLocatorType
  239. #undef GopherGetLocatorType
  240. #endif
  241. #define GopherGetLocatorType _afxWinINet.pfnGopherGetLocatorType
  242. // html
  243. #ifdef HttpOpenRequest
  244. #undef HttpOpenRequest
  245. #endif
  246. #define HttpOpenRequest _afxWinINet.pfnHttpOpenRequest
  247. #ifdef HttpAddRequestHeaders
  248. #undef HttpAddRequestHeaders
  249. #endif
  250. #define HttpAddRequestHeaders _afxWinINet.pfnHttpAddRequestHeaders
  251. #ifdef HttpSendRequest
  252. #undef HttpSendRequest
  253. #endif
  254. #define HttpSendRequest _afxWinINet.pfnHttpSendRequest
  255. #ifdef HttpQueryInfo
  256. #undef HttpQueryInfo
  257. #endif
  258. #define HttpQueryInfo _afxWinINet.pfnHttpQueryInfo
  259. #ifdef InternetErrorDlg
  260. #undef InternetErrorDlg
  261. #endif
  262. #define InternetErrorDlg _afxWinINet.pfnInternetErrorDlg
  263. #ifdef InternetCrackUrl
  264. #undef InternetCrackUrl
  265. #endif
  266. #define InternetCrackUrl _afxWinINet.pfnInternetCrackUrl
  267. #ifdef InternetCanonicalizeUrl
  268. #undef InternetCanonicalizeUrl
  269. #endif
  270. #define InternetCanonicalizeUrl _afxWinINet.pfnInternetCanonicalizeUrl
  271. #endif //_AFXDLL
  272. #endif //!_MAC