home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC / src / wcethunk.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  18.8 KB  |  656 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 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.  
  11. #include "stdafx.h"
  12. #if defined(_WIN32_WCE_NO_DELAYLOAD)
  13.  
  14. class _AFX_EXTDLL_STATE : public CNoTrackObject
  15. {
  16. public:
  17.     _AFX_EXTDLL_STATE::~_AFX_EXTDLL_STATE();
  18.     HINSTANCE m_hInstCommDlg;
  19.     HINSTANCE m_hInstWinSock;
  20.     HINSTANCE m_hInstWinInet;
  21. };
  22.  
  23. PROCESS_LOCAL(_AFX_EXTDLL_STATE, _afxExtDllState)
  24.  
  25.  
  26. HINSTANCE AFXAPI AfxLoadDll(HINSTANCE* volatile pInst, LPCSTR lpszDLL,
  27.     FARPROC* pProcPtrs, LPCSTR lpszProcName)
  28. {
  29.     if (*pInst == NULL)
  30.     {
  31.         AfxLockGlobals(CRIT_DYNDLLLOAD);
  32.         if (*pInst == NULL)
  33.         {
  34.             *pInst = WCE_FCTN(LoadLibraryA)(lpszDLL);
  35.             ASSERT(*pInst != NULL);
  36.         }
  37.         AfxUnlockGlobals(CRIT_DYNDLLLOAD);
  38.         if (*pInst == NULL)
  39.         {
  40.             TRACE1("Error: Unable to load DLL '%hs'!\n", lpszDLL);
  41.  
  42.             CString strError, strFormatted;
  43.             VERIFY(strError.LoadString(AFX_IDP_DLL_LOAD_FAILED));
  44.             strFormatted.Format(strError, lpszDLL);
  45.             AfxMessageBox(strFormatted, MB_ICONEXCLAMATION);
  46.             AfxThrowMemoryException();
  47.         }
  48.     }
  49.  
  50.     if (pProcPtrs != NULL)
  51.     {
  52.         *pProcPtrs = WCE_FCTN(GetProcAddress)(*pInst, lpszProcName);
  53.         ASSERT(*pProcPtrs != NULL);
  54.     }
  55.     return *pInst;
  56. }
  57.  
  58.  
  59.  
  60. #if !defined(_WIN32_WCE_NO_COMMDLG_THUNKS)
  61.  
  62. inline HINSTANCE AfxLoadCommDlg(FARPROC* proc, LPCSTR lpsz)
  63.     { return AfxLoadDll(&_afxExtDllState->m_hInstCommDlg, WCE_COMMDLG_DLL, proc, lpsz); }
  64. #define COMMDLGLOAD(x) AfxLoadCommDlg((FARPROC*)&_afxCommDlg.pfn##x, #x);
  65. #define COMMDLGLOADT(x) AfxLoadCommDlg((FARPROC*)&_afxCommDlg.pfn##x, WCE_IF(#x,#x"W"));
  66.  
  67. #if !defined(_WIN32_WCE_NO_COLORDLG)
  68. BOOL APIENTRY AfxThunkChooseColor(LPCHOOSECOLOR lp)
  69. {
  70.     COMMDLGLOADT(ChooseColor);
  71.     return _afxCommDlg.pfnChooseColor(lp);
  72. }
  73. #endif // _WIN32_WCE_NO_COLORDLG
  74.  
  75. #if !defined(_WIN32_WCE_NO_PRINTING)
  76. DWORD APIENTRY AfxThunkCommDlgExtendedError()
  77. {
  78.     COMMDLGLOAD(CommDlgExtendedError);
  79.     return _afxCommDlg.pfnCommDlgExtendedError();
  80. }
  81.  
  82. BOOL APIENTRY AfxThunkPrintDlg(LPPRINTDLG lp)
  83. {
  84.     COMMDLGLOADT(PrintDlg);
  85.     return _afxCommDlg.pfnPrintDlg(lp);
  86. }
  87.  
  88. #if !defined(_WIN32_WCE)
  89. BOOL APIENTRY AfxThunkPageSetupDlg(LPPAGESETUPDLG lp)
  90. {
  91.     COMMDLGLOADT(PageSetupDlg);
  92.     return _afxCommDlg.pfnPageSetupDlg(lp);
  93. }
  94. #endif // _WIN32_WCE
  95. #endif // _WIN32_WCE_NO_PRINTING
  96.  
  97. AFX_DATADEF AFX_COMMDLG_CALL _afxCommDlg =
  98. {
  99. #if !defined(_WIN32_WCE_NO_COLORDLG)
  100.     AfxThunkChooseColor,
  101. #endif // _WIN32_WCE_NO_COLORDLG
  102. #if !defined(_WIN32_WCE_NO_PRINTING)
  103.     AfxThunkCommDlgExtendedError,
  104.     AfxThunkPrintDlg,
  105. #if !defined(_WIN32_WCE)
  106.     AfxThunkPageSetupDlg,
  107. #endif // _WIN32_WCE
  108. #endif // _WIN32_WCE_NO_PRINTING
  109. };
  110. #endif // _WIN32_WCE_NO_COMMDLG_THUNKS
  111.  
  112.  
  113.  
  114. #if !defined(_WIN32_WCE_NO_WINSOCK_THUNKS)
  115. inline HINSTANCE AfxLoadWinSock(FARPROC* proc, LPCSTR lpsz)
  116.     { return AfxLoadDll(&_afxExtDllState->m_hInstWinSock, WCE_WINSOCK_DLL, proc, lpsz); }
  117. #define SOCKLOAD(x) AfxLoadWinSock((FARPROC*)&_afxWinSock.pfn##x, #x);
  118.  
  119. SOCKET WINSOCKAPI AfxThunkaccept(SOCKET s, struct sockaddr FAR *addr, int FAR *addrlen)
  120. {
  121.     SOCKLOAD(accept);
  122.     return _afxWinSock.pfnaccept(s, addr, addrlen);
  123. }
  124.  
  125. u_short WINSOCKAPI AfxThunkhtons(u_short hostshort)
  126. {
  127.     SOCKLOAD(htons);
  128.     return _afxWinSock.pfnhtons(hostshort);
  129. }
  130.  
  131. unsigned long WINSOCKAPI AfxThunkinet_addr(const char FAR * cp)
  132. {
  133.     SOCKLOAD(inet_addr);
  134.     return _afxWinSock.pfninet_addr(cp);
  135. }
  136.  
  137. int WINSOCKAPI AfxThunkclosesocket(SOCKET s)
  138. {
  139.     SOCKLOAD(closesocket);
  140.     return _afxWinSock.pfnclosesocket(s);
  141. }
  142.  
  143. int WINSOCKAPI AfxThunkgetsockname(SOCKET s, struct sockaddr FAR *name, int FAR * namelen)
  144. {
  145.     SOCKLOAD(getsockname);
  146.     return _afxWinSock.pfngetsockname(s, name, namelen);
  147. }
  148.  
  149. int WINSOCKAPI AfxThunkgetpeername(SOCKET s, struct sockaddr FAR *name, int FAR * namelen)
  150. {
  151.     SOCKLOAD(getpeername);
  152.     return _afxWinSock.pfngetpeername(s, name, namelen);
  153. }
  154.  
  155. u_short WINSOCKAPI AfxThunkntohs(u_short netshort)
  156. {
  157.     SOCKLOAD(ntohs);
  158.     return _afxWinSock.pfnntohs(netshort);
  159. }
  160.  
  161. char* WINSOCKAPI AfxThunkinet_ntoa(struct in_addr in)
  162. {
  163.     SOCKLOAD(inet_ntoa);
  164.     return _afxWinSock.pfninet_ntoa(in);
  165. }
  166.  
  167. int WINSOCKAPI AfxThunkWSAGetLastError(void)
  168. {
  169.     SOCKLOAD(WSAGetLastError);
  170.     return _afxWinSock.pfnWSAGetLastError();
  171. }
  172.  
  173. void WINSOCKAPI AfxThunkWSASetLastError(int iError)
  174. {
  175.     SOCKLOAD(WSASetLastError);
  176.     _afxWinSock.pfnWSASetLastError(iError);
  177. }
  178.  
  179. u_long WINSOCKAPI AfxThunkhtonl(u_long hostlong)
  180. {
  181.     SOCKLOAD(htonl);
  182.     return _afxWinSock.pfnhtonl(hostlong);
  183. }
  184.  
  185. SOCKET WINSOCKAPI AfxThunksocket(int af, int type, int protocol)
  186. {
  187.     SOCKLOAD(socket);
  188.     return _afxWinSock.pfnsocket(af, type, protocol);
  189. }
  190.  
  191. struct hostent* WINSOCKAPI AfxThunkgethostbyname(const char FAR * name)
  192. {
  193.     SOCKLOAD(gethostbyname);
  194.     return _afxWinSock.pfngethostbyname(name);
  195. }
  196.  
  197. int WINSOCKAPI AfxThunkrecv(SOCKET s, char FAR * buf, int len, int flags)
  198. {
  199.     SOCKLOAD(recv);
  200.     return _afxWinSock.pfnrecv(s, buf, len, flags);
  201. }
  202.  
  203. int WINSOCKAPI AfxThunksend(SOCKET s, const char FAR * buf, int len, int flags)
  204. {
  205.     SOCKLOAD(send);
  206.     return _afxWinSock.pfnsend(s, buf, len, flags);
  207. }
  208.  
  209. int WINSOCKAPI AfxThunkWSAAsyncSelect(SOCKET s, HWND hWnd, u_int wMsg, long lEvent)
  210. {
  211.     SOCKLOAD(WSAAsyncSelect);
  212.     return _afxWinSock.pfnWSAAsyncSelect(s, hWnd, wMsg, lEvent);
  213. }
  214.  
  215. int WINSOCKAPI AfxThunkrecvfrom(SOCKET s, char FAR * buf, int len, int flags, struct sockaddr FAR *from, int FAR * fromlen)
  216. {
  217.     SOCKLOAD(recvfrom);
  218.     return _afxWinSock.pfnrecvfrom(s, buf, len, flags, from, fromlen);
  219. }
  220.  
  221. int WINSOCKAPI AfxThunksendto(SOCKET s, const char FAR * buf, int len, int flags, const struct sockaddr FAR *to, int tolen)
  222. {
  223.     SOCKLOAD(sendto);
  224.     return _afxWinSock.pfnsendto(s, buf, len, flags, to, tolen);
  225. }
  226.  
  227. int WINSOCKAPI AfxThunkconnect(SOCKET s, const struct sockaddr FAR *name, int namelen)
  228. {
  229.     SOCKLOAD(connect);
  230.     return _afxWinSock.pfnconnect(s, name, namelen);
  231. }
  232.  
  233. int WINSOCKAPI AfxThunkbind(SOCKET s, const struct sockaddr FAR *addr, int namelen)
  234. {
  235.     SOCKLOAD(bind);
  236.     return _afxWinSock.pfnbind(s, addr, namelen);
  237. }
  238.  
  239. int WINSOCKAPI AfxThunksetsockopt(SOCKET s, int level, int optname, const char FAR * optval, int optlen)
  240. {
  241.     SOCKLOAD(setsockopt);
  242.     return _afxWinSock.pfnsetsockopt(s, level, optname, optval, optlen);
  243. }
  244.  
  245. int WINSOCKAPI AfxThunkgetsockopt(SOCKET s, int level, int optname, char FAR * optval, int FAR *optlen)
  246. {
  247.     SOCKLOAD(getsockopt);
  248.     return _afxWinSock.pfngetsockopt(s, level, optname, optval, optlen);
  249. }
  250.  
  251. int WINSOCKAPI AfxThunkioctlsocket(SOCKET s, long cmd, u_long FAR *argp)
  252. {
  253.     SOCKLOAD(ioctlsocket);
  254.     return _afxWinSock.pfnioctlsocket(s, cmd, argp);
  255. }
  256.  
  257. int WINSOCKAPI AfxThunklisten(SOCKET s, int backlog)
  258. {
  259.     SOCKLOAD(listen);
  260.     return _afxWinSock.pfnlisten(s, backlog);
  261. }
  262.  
  263. int WINSOCKAPI AfxThunkshutdown(SOCKET s, int how)
  264. {
  265.     SOCKLOAD(shutdown);
  266.     return _afxWinSock.pfnshutdown(s, how);
  267. }
  268.  
  269. int WINSOCKAPI AfxThunkselect(int nfds, fd_set *readfds, fd_set *writefds,fd_set *exceptfds, const struct timeval *timeout)
  270. {
  271.     SOCKLOAD(select);
  272.     return _afxWinSock.pfnselect(nfds, readfds, writefds, exceptfds, timeout);
  273. }
  274.  
  275. int WINSOCKAPI AfxThunk__WSAFDIsSet(SOCKET s, fd_set * set)
  276. {
  277.     SOCKLOAD(__WSAFDIsSet);
  278.     return _afxWinSock.pfn__WSAFDIsSet(s, set);
  279. }
  280.  
  281. AFX_DATADEF AFX_WINSOCK_CALL _afxWinSock =
  282. {
  283.     AfxThunkaccept,
  284.     AfxThunkhtons,
  285.     AfxThunkinet_addr,
  286.     AfxThunkclosesocket,
  287.     AfxThunkgetsockname,
  288.     AfxThunkgetpeername,
  289.     AfxThunkntohs,
  290.     AfxThunkinet_ntoa,
  291.     AfxThunkWSAGetLastError,
  292.     AfxThunkWSASetLastError,
  293.     AfxThunkhtonl,
  294.     AfxThunksocket,
  295.     AfxThunkgethostbyname,
  296.     AfxThunkrecv,
  297.     AfxThunksend,
  298.     AfxThunkWSAAsyncSelect,
  299.     AfxThunkrecvfrom,
  300.     AfxThunksendto,
  301.     AfxThunkconnect,
  302.     AfxThunkbind,
  303.     AfxThunksetsockopt,
  304.     AfxThunkgetsockopt,
  305.     AfxThunkioctlsocket,
  306.     AfxThunklisten,
  307.     AfxThunkshutdown,
  308.     AfxThunkselect,
  309.     AfxThunk__WSAFDIsSet,
  310. };
  311. #endif // _WIN32_WCE_NO_WINSOCK_THUNKS
  312.  
  313.  
  314.  
  315.  
  316. #if !defined(_WIN32_WCE_NO_WININET_THUNKS)
  317.  
  318. #define INETLOAD(x) AfxLoadWinInet((FARPROC*)&_afxWinInet.pfn##x, #x)
  319. #define INETLOADT(x) AfxLoadWinInet((FARPROC*)&_afxWinInet.pfn##x, #x"W")
  320. inline HINSTANCE AfxLoadWinInet(FARPROC* proc, LPCSTR lpsz)
  321.     { return AfxLoadDll(&_afxExtDllState->m_hInstWinInet, WCE_WININET_DLL, proc, lpsz); }
  322.  
  323. HINTERNET WINAPI AfxThunkINetInternetOpen(
  324.     LPCTSTR lpszAgent,
  325.     DWORD dwAccessType,
  326.     LPCTSTR lpszProxy,
  327.     LPCTSTR lpszProxyBypass,
  328.     DWORD dwFlags)
  329. {
  330.     INETLOADT(InternetOpen);
  331.     return _afxWinInet.pfnInternetOpen(lpszAgent, dwAccessType,
  332.         lpszProxy, lpszProxyBypass, dwFlags);
  333. }
  334.  
  335. HINTERNET WINAPI AfxThunkINetInternetCloseHandle(HINTERNET hInternet)
  336. {
  337.     INETLOAD(InternetCloseHandle);
  338.     return _afxWinInet.pfnInternetCloseHandle(hInternet);
  339. }
  340.  
  341. HINTERNET WINAPI AfxThunkINetInternetOpenUrl(HINTERNET hInternet,
  342.     LPCTSTR pstrUrl, LPCTSTR pstrHeaders, DWORD dwHeadersLength,
  343.     DWORD dwFlags, DWORD dwContext)
  344. {
  345.     INETLOADT(InternetOpenUrl);
  346.     return _afxWinInet.pfnInternetOpenUrl(hInternet,
  347.         pstrUrl, pstrHeaders, dwHeadersLength, dwFlags, dwContext);
  348. }
  349.  
  350. HINTERNET WINAPI AfxThunkINetInternetReadFile(HINTERNET hInternet,
  351.     LPVOID lpBuffer, DWORD dwNumberOfBytesToRead,
  352.     LPDWORD lpdwNumberOfBytesRead)
  353. {
  354.     INETLOAD(InternetReadFile);
  355.     return _afxWinInet.pfnInternetReadFile(hInternet, lpBuffer,
  356.         dwNumberOfBytesToRead, lpdwNumberOfBytesRead);
  357. }
  358.  
  359. HINTERNET WINAPI AfxThunkINetInternetWriteFile(HINTERNET hInternet,
  360.     LPCVOID lpBuffer, DWORD dwNumberOfBytesToWrite,
  361.     LPDWORD lpdwNumberOfBytesWritten)
  362. {
  363.     INETLOAD(InternetWriteFile);
  364.     return _afxWinInet.pfnInternetWriteFile(hInternet, lpBuffer,
  365.         dwNumberOfBytesToWrite, lpdwNumberOfBytesWritten);
  366. }
  367.  
  368. INTERNET_STATUS_CALLBACK WINAPI AfxThunkINetInternetSetStatusCallback(
  369.     HINTERNET hInternet, INTERNET_STATUS_CALLBACK lpfnInternetCallback)
  370. {
  371.     INETLOAD(InternetSetStatusCallback);
  372.     return _afxWinInet.pfnInternetSetStatusCallback(hInternet,
  373.         lpfnInternetCallback);
  374. }
  375.  
  376. BOOL WINAPI AfxThunkINetInternetQueryOption(HINTERNET hInternet,
  377.     DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength)
  378. {
  379.     INETLOADT(InternetQueryOption);
  380.     return _afxWinInet.pfnInternetQueryOption(hInternet, dwOption,
  381.         lpBuffer, lpdwBufferLength);
  382. }
  383.  
  384. BOOL WINAPI AfxThunkINetInternetSetOption(HINTERNET hInternet,
  385.     DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength)
  386. {
  387.     INETLOADT(InternetSetOption);
  388.     return _afxWinInet.pfnInternetSetOption(hInternet, dwOption, lpBuffer,
  389.         dwBufferLength);
  390. }
  391.  
  392. BOOL WINAPI AfxThunkINetInternetSetOptionEx(HINTERNET hInternet,
  393.     DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength, DWORD dwFlags)
  394. {
  395.     INETLOADT(InternetSetOptionEx);
  396.     return _afxWinInet.pfnInternetSetOptionEx(hInternet, dwOption, lpBuffer,
  397.         dwBufferLength, dwFlags);
  398. }
  399.  
  400. BOOL WINAPI AfxThunkINetInternetGetLastResponseInfo(LPDWORD lpdwError,
  401.     LPTSTR pstrBuffer, LPDWORD lpdwBufferLength)
  402. {
  403.     INETLOADT(InternetGetLastResponseInfo);
  404.     return _afxWinInet.pfnInternetGetLastResponseInfo(lpdwError,
  405.         pstrBuffer, lpdwBufferLength);
  406. }
  407.  
  408. BOOL WINAPI AfxThunkINetInternetFindNextFile(HINTERNET hFind,
  409.     LPVOID lpvFindData)
  410. {
  411.     INETLOADT(InternetFindNextFile);
  412.     return _afxWinInet.pfnInternetFindNextFile(hFind, lpvFindData);
  413. }
  414.  
  415. HINTERNET WINAPI AfxThunkINetInternetConnect(HINTERNET hInternet,
  416.     LPCTSTR pstrServerName, INTERNET_PORT nServerPort, LPCTSTR pstrUsername,
  417.     LPCTSTR pstrPassword, DWORD dwService, DWORD dwFlags, DWORD dwContext)
  418. {
  419.     INETLOADT(InternetConnect);
  420.     return _afxWinInet.pfnInternetConnect(hInternet, pstrServerName,
  421.         nServerPort, pstrUsername, pstrPassword, dwService, dwFlags,
  422.         dwContext);
  423. }
  424.  
  425. DWORD WINAPI AfxThunkINetInternetSetFilePointer(HINTERNET hFile,
  426.     LONG lDistanceToMove, PVOID reserved, DWORD dwMoveMethod, DWORD dwContext)
  427. {
  428.     INETLOAD(InternetSetFilePointer);
  429.     return _afxWinInet.pfnInternetSetFilePointer(hFile, lDistanceToMove,
  430.         reserved, dwMoveMethod, dwContext);
  431. }
  432.  
  433. BOOL WINAPI AfxThunkINetInternetQueryDataAvailable(HINTERNET hFile,
  434.     LPDWORD lpdwNumberOfBytesAvailable, DWORD dwFlags, DWORD dwContext)
  435. {
  436.     INETLOAD(InternetQueryDataAvailable);
  437.     return _afxWinInet.pfnInternetQueryDataAvailable(hFile,
  438.         lpdwNumberOfBytesAvailable, dwFlags, dwContext);
  439. }
  440.  
  441.  
  442. #if !defined(_WIN32_WCE_NO_FTP)
  443.  
  444. HINTERNET WINAPI AfxThunkINetFtpFindFirstFile(HINTERNET hFtpSession,
  445.     LPCTSTR pstrSearchFile, LPWIN32_FIND_DATA lpFindFileData,
  446.     DWORD dwFlags, DWORD dwContext)
  447. {
  448.     INETLOADT(FtpFindFirstFile);
  449.     return _afxWinInet.pfnFtpFindFirstFile(hFtpSession,
  450.         pstrSearchFile, lpFindFileData, dwFlags, dwContext);
  451. }
  452.  
  453. BOOL WINAPI AfxThunkINetFtpGetFile(HINTERNET hFtpSession,
  454.     LPCTSTR pstrRemoteFile, LPCTSTR pstrNewFile, BOOL fFailIfExists,
  455.     DWORD dwFlagsAndAttributes, DWORD dwFlags, DWORD dwContext)
  456. {
  457.     INETLOADT(FtpGetFile);
  458.     return _afxWinInet.pfnFtpGetFile(hFtpSession, pstrRemoteFile,
  459.         pstrNewFile, fFailIfExists, dwFlagsAndAttributes, dwFlags,
  460.         dwContext);
  461. }
  462.  
  463. BOOL WINAPI AfxThunkINetFtpPutFile(HINTERNET hFtpSession,
  464.     LPCTSTR pstrLocalFile, LPCTSTR pstrNewRemoteFile, DWORD dwFlags,
  465.     DWORD dwContext)
  466. {
  467.     INETLOADT(FtpPutFile);
  468.     return _afxWinInet.pfnFtpPutFile(hFtpSession, pstrLocalFile,
  469.         pstrNewRemoteFile, dwFlags, dwContext);
  470. }
  471.  
  472. BOOL WINAPI AfxThunkINetFtpDeleteFile(HINTERNET hFtpSession,
  473.     LPCTSTR pstrFileName)
  474. {
  475.     INETLOADT(FtpDeleteFile);
  476.     return _afxWinInet.pfnFtpDeleteFile(hFtpSession, pstrFileName);
  477. }
  478.  
  479. BOOL WINAPI AfxThunkINetFtpRenameFile(HINTERNET hFtpSession,
  480.     LPCTSTR pstrExisting, LPCTSTR pstrNew)
  481. {
  482.     INETLOADT(FtpRenameFile);
  483.     return _afxWinInet.pfnFtpRenameFile(hFtpSession, pstrExisting, pstrNew);
  484. }
  485.  
  486. BOOL WINAPI AfxThunkINetFtpCreateDirectory(HINTERNET hFtpSession,
  487.     LPCTSTR pstrDirectory)
  488. {
  489.     INETLOADT(FtpCreateDirectory);
  490.     return _afxWinInet.pfnFtpCreateDirectory(hFtpSession, pstrDirectory);
  491. }
  492.  
  493. BOOL WINAPI AfxThunkINetFtpRemoveDirectory(HINTERNET hFtpSession,
  494.     LPCTSTR pstrDirectory)
  495. {
  496.     INETLOADT(FtpRemoveDirectory);
  497.     return _afxWinInet.pfnFtpRemoveDirectory(hFtpSession, pstrDirectory);
  498. }
  499.  
  500. BOOL WINAPI AfxThunkINetFtpSetCurrentDirectory(HINTERNET hFtpSession,
  501.     LPCTSTR pstrDirectory)
  502. {
  503.     INETLOADT(FtpSetCurrentDirectory);
  504.     return _afxWinInet.pfnFtpSetCurrentDirectory(hFtpSession, pstrDirectory);
  505. }
  506.  
  507. BOOL WINAPI AfxThunkINetFtpGetCurrentDirectory(HINTERNET hFtpSession,
  508.     LPCTSTR pstrCurrentDirectory, LPDWORD lpdwCurrentDirectory)
  509. {
  510.     INETLOADT(FtpGetCurrentDirectory);
  511.     return _afxWinInet.pfnFtpGetCurrentDirectory(hFtpSession,
  512.         pstrCurrentDirectory, lpdwCurrentDirectory);
  513. }
  514.  
  515. BOOL WINAPI AfxThunkINetFtpCommand(HINTERNET hFtpSession,
  516.     BOOL fExpectResponse, DWORD dwFlags, LPCTSTR pstrCommand,
  517.     DWORD dwContext)
  518. {
  519.     INETLOADT(FtpCommand);
  520.     return _afxWinInet.pfnFtpCommand(hFtpSession, fExpectResponse,
  521.         dwFlags, pstrCommand, dwContext);
  522. }
  523.  
  524. HINTERNET WINAPI AfxThunkINetFtpOpenFile(HINTERNET hFtpSession,
  525.         LPCTSTR pstrFileName, DWORD dwAccess, DWORD dwFlags,
  526.         DWORD dwContext)
  527. {
  528.     INETLOADT(FtpOpenFile);
  529.     return _afxWinInet.pfnFtpOpenFile(hFtpSession, pstrFileName,
  530.         dwAccess, dwFlags, dwContext);
  531. }
  532. #endif // _WIN32_WCE_NO_FTP
  533.  
  534.  
  535. HINTERNET WINAPI AfxThunkINetHttpOpenRequest(HINTERNET hHttpSession,
  536.     LPCTSTR pstrVerb, LPCTSTR pstrObjectName, LPCTSTR pstrVersion,
  537.     LPCTSTR pstrReferrer, LPCTSTR FAR * lppstrAcceptTypes,
  538.     DWORD dwFlags, DWORD dwContext)
  539. {
  540.     INETLOADT(HttpOpenRequest);
  541.     return _afxWinInet.pfnHttpOpenRequest(hHttpSession, pstrVerb,
  542.         pstrObjectName, pstrVersion, pstrReferrer, lppstrAcceptTypes,
  543.         dwFlags, dwContext);
  544. }
  545.  
  546. BOOL WINAPI AfxThunkINetHttpAddRequestHeaders(HINTERNET hHttpRequest,
  547.     LPCTSTR pstrHeaders, DWORD dwHeadersLength, DWORD dwModifiers)
  548. {
  549.     INETLOADT(HttpAddRequestHeaders);
  550.     return _afxWinInet.pfnHttpAddRequestHeaders(hHttpRequest,
  551.         pstrHeaders, dwHeadersLength, dwModifiers);
  552. }
  553.  
  554. BOOL WINAPI AfxThunkINetHttpSendRequest(HINTERNET hHttpRequest,
  555.     LPCTSTR pstrHeaders, DWORD dwHeadersLength, LPVOID lpOptional,
  556.     DWORD dwOptionalLength)
  557. {
  558.     INETLOADT(HttpSendRequest);
  559.     return _afxWinInet.pfnHttpSendRequest(hHttpRequest, pstrHeaders,
  560.         dwHeadersLength, lpOptional, dwOptionalLength);
  561. }
  562.  
  563. BOOL WINAPI AfxThunkINetHttpQueryInfo(HINTERNET hHttpRequest,
  564.     DWORD dwInfoLevel, LPVOID lpvBuffer, LPDWORD lpdwBufferLength,
  565.     LPDWORD lpdwIndex)
  566. {
  567.     INETLOADT(HttpQueryInfo);
  568.     return _afxWinInet.pfnHttpQueryInfo(hHttpRequest, dwInfoLevel,
  569.         lpvBuffer, lpdwBufferLength, lpdwIndex);
  570. }
  571.  
  572. DWORD WINAPI AfxThunkINetInternetErrorDlg(HWND hWnd, HINTERNET hRequest,
  573.      DWORD dwError, DWORD dwFlags, LPVOID * lppvData)
  574. {
  575.     INETLOADT(InternetErrorDlg);
  576.     return _afxWinInet.pfnInternetErrorDlg(hWnd, hRequest,
  577.         dwError, dwFlags, lppvData);
  578. }
  579.  
  580. BOOL WINAPI AfxThunkINetCrackUrl(LPCTSTR lpszUrl, DWORD dwUrlLength,
  581.     DWORD dwFlags, LPURL_COMPONENTS lpUrlComponents)
  582. {
  583.     INETLOADT(InternetCrackUrl);
  584.     return _afxWinInet.pfnInternetCrackUrl(lpszUrl, dwUrlLength,
  585.         dwFlags, lpUrlComponents);
  586. }
  587.  
  588. BOOL WINAPI AfxThunkINetCanonicalizeUrl(LPCTSTR lpszUrl, LPTSTR lpszBuffer, 
  589.     LPDWORD lpdwBufferLength, DWORD dwFlags)
  590. {
  591.     INETLOADT(InternetCanonicalizeUrl);
  592.     return _afxWinInet.pfnInternetCanonicalizeUrl(lpszUrl, lpszBuffer,
  593.         lpdwBufferLength, dwFlags);
  594. }
  595.  
  596. AFX_DATADEF AFX_WININET_CALL _afxWinInet =
  597. {
  598.     { AfxThunkINetInternetOpen, },
  599.     { AfxThunkINetInternetCloseHandle, },
  600.     { AfxThunkINetInternetOpenUrl, },
  601.     { AfxThunkINetInternetReadFile, },
  602.     { AfxThunkINetInternetWriteFile, },
  603.     { AfxThunkINetInternetSetStatusCallback, },
  604.     { AfxThunkINetInternetQueryOption, },
  605.     { AfxThunkINetInternetSetOption, },
  606.     { AfxThunkINetInternetSetOptionEx, },
  607.     { AfxThunkINetInternetGetLastResponseInfo, },
  608.     { AfxThunkINetInternetFindNextFile, },
  609.     { AfxThunkINetInternetConnect, },
  610.     { AfxThunkINetInternetSetFilePointer, },
  611.     { AfxThunkINetInternetQueryDataAvailable, },
  612.  
  613. #if !defined(_WIN32_WCE_NO_FTP)
  614.     { AfxThunkINetFtpFindFirstFile, },
  615.     { AfxThunkINetFtpGetFile, },
  616.     { AfxThunkINetFtpPutFile, },
  617.     { AfxThunkINetFtpDeleteFile, },
  618.     { AfxThunkINetFtpRenameFile, },
  619.     { AfxThunkINetFtpCreateDirectory, },
  620.     { AfxThunkINetFtpRemoveDirectory, },
  621.     { AfxThunkINetFtpSetCurrentDirectory, },
  622.     { AfxThunkINetFtpGetCurrentDirectory, },
  623.     { AfxThunkINetFtpCommand, },
  624.     { AfxThunkINetFtpOpenFile, },
  625. #endif // _WIN32_WCE_NO_FTP
  626.  
  627.     { AfxThunkINetHttpOpenRequest, },
  628.     { AfxThunkINetHttpAddRequestHeaders, },
  629.     { AfxThunkINetHttpSendRequest, },
  630.     { AfxThunkINetHttpQueryInfo, },
  631.     { AfxThunkINetInternetErrorDlg, },
  632.  
  633.     { AfxThunkINetCrackUrl, },
  634.     { AfxThunkINetCanonicalizeUrl, }
  635. };
  636. #endif // _WIN32_WCE_NO_WININET_THUNKS
  637.  
  638. /////////////////////////////////////////////////////////////////////////////
  639. // _AFX_EXTDLL_STATE
  640.  
  641. #pragma warning(disable: 4074)
  642. #pragma init_seg(lib)
  643.  
  644. _AFX_EXTDLL_STATE::~_AFX_EXTDLL_STATE()
  645. {
  646.     if (m_hInstCommDlg != NULL)
  647.         ::FreeLibrary(m_hInstCommDlg);
  648.     if (m_hInstWinSock != NULL)
  649.         ::FreeLibrary(m_hInstWinSock);
  650.     if (m_hInstWinInet != NULL)
  651.         ::FreeLibrary(m_hInstWinInet);
  652. }
  653.  
  654. #endif // _WIN32_WCE_NO_DELAYLOAD
  655.  
  656.