2002-03-09 23:29:33 +00:00
|
|
|
/*
|
|
|
|
* Wininet
|
|
|
|
*
|
|
|
|
* Copyright 1999 Corel Corporation
|
|
|
|
*
|
|
|
|
* Ulrich Czekalla
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-03-09 23:29:33 +00:00
|
|
|
*/
|
|
|
|
|
2000-04-11 20:07:00 +00:00
|
|
|
#ifndef _WINE_INTERNET_H_
|
|
|
|
#define _WINE_INTERNET_H_
|
|
|
|
|
2004-03-30 04:36:09 +00:00
|
|
|
#include "wine/unicode.h"
|
|
|
|
|
2001-02-15 21:24:07 +00:00
|
|
|
#include <time.h>
|
2001-08-24 19:13:36 +00:00
|
|
|
#ifdef HAVE_NETDB_H
|
|
|
|
# include <netdb.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_NETINET_IN_H
|
2001-09-10 23:07:39 +00:00
|
|
|
# include <sys/types.h>
|
2001-08-24 19:13:36 +00:00
|
|
|
# include <netinet/in.h>
|
|
|
|
#endif
|
2003-06-20 23:26:56 +00:00
|
|
|
#ifdef HAVE_OPENSSL_SSL_H
|
2003-08-05 19:21:08 +00:00
|
|
|
#define DSA __ssl_DSA /* avoid conflict with commctrl.h */
|
2003-11-25 01:48:01 +00:00
|
|
|
#undef FAR
|
2003-06-20 23:26:56 +00:00
|
|
|
# include <openssl/ssl.h>
|
2003-11-25 01:48:01 +00:00
|
|
|
#undef FAR
|
|
|
|
#define FAR do_not_use_this_in_wine
|
2003-08-05 19:21:08 +00:00
|
|
|
#undef DSA
|
2003-06-20 23:26:56 +00:00
|
|
|
#endif
|
2003-10-14 05:27:43 +00:00
|
|
|
#ifdef HAVE_SYS_SOCKET_H
|
|
|
|
# include <sys/socket.h>
|
|
|
|
#endif
|
2003-06-20 23:26:56 +00:00
|
|
|
|
2004-12-20 18:50:33 +00:00
|
|
|
#if defined(__MINGW32__) || defined (_MSC_VER)
|
2004-09-03 18:57:19 +00:00
|
|
|
#include "winsock2.h"
|
2004-12-20 18:50:33 +00:00
|
|
|
#ifndef MSG_WAITALL
|
|
|
|
#define MSG_WAITALL 0
|
|
|
|
#endif
|
2004-09-03 18:57:19 +00:00
|
|
|
#else
|
|
|
|
#define closesocket close
|
|
|
|
#endif /* __MINGW32__ */
|
|
|
|
|
2003-06-20 23:26:56 +00:00
|
|
|
/* used for netconnection.c stuff */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
BOOL useSSL;
|
|
|
|
int socketFD;
|
|
|
|
#ifdef HAVE_OPENSSL_SSL_H
|
|
|
|
SSL *ssl_s;
|
2005-10-20 11:35:54 +00:00
|
|
|
char *peek_msg;
|
|
|
|
char *peek_msg_mem;
|
2006-04-26 09:20:00 +00:00
|
|
|
size_t peek_len;
|
2003-06-20 23:26:56 +00:00
|
|
|
#endif
|
|
|
|
} WININET_NETCONNECTION;
|
2001-02-15 21:24:07 +00:00
|
|
|
|
2004-02-09 21:45:38 +00:00
|
|
|
inline static LPSTR WININET_strdup( LPCSTR str )
|
|
|
|
{
|
|
|
|
LPSTR ret = HeapAlloc( GetProcessHeap(), 0, strlen(str) + 1 );
|
|
|
|
if (ret) strcpy( ret, str );
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2004-03-30 04:36:09 +00:00
|
|
|
inline static LPWSTR WININET_strdupW( LPCWSTR str )
|
|
|
|
{
|
|
|
|
LPWSTR ret = HeapAlloc( GetProcessHeap(), 0, (strlenW(str) + 1)*sizeof(WCHAR) );
|
|
|
|
if (ret) strcpyW( ret, str );
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2004-05-25 04:02:05 +00:00
|
|
|
inline static LPWSTR WININET_strdup_AtoW( LPCSTR str )
|
|
|
|
{
|
|
|
|
int len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0);
|
|
|
|
LPWSTR ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
|
|
|
|
if (ret)
|
|
|
|
MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline static LPSTR WININET_strdup_WtoA( LPCWSTR str )
|
|
|
|
{
|
|
|
|
int len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
|
|
|
|
LPSTR ret = HeapAlloc( GetProcessHeap(), 0, len );
|
|
|
|
if (ret)
|
|
|
|
WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline static void WININET_find_data_WtoA(LPWIN32_FIND_DATAW dataW, LPWIN32_FIND_DATAA dataA)
|
|
|
|
{
|
|
|
|
dataA->dwFileAttributes = dataW->dwFileAttributes;
|
|
|
|
dataA->ftCreationTime = dataW->ftCreationTime;
|
|
|
|
dataA->ftLastAccessTime = dataW->ftLastAccessTime;
|
|
|
|
dataA->ftLastWriteTime = dataW->ftLastWriteTime;
|
|
|
|
dataA->nFileSizeHigh = dataW->nFileSizeHigh;
|
|
|
|
dataA->nFileSizeLow = dataW->nFileSizeLow;
|
|
|
|
dataA->dwReserved0 = dataW->dwReserved0;
|
|
|
|
dataA->dwReserved1 = dataW->dwReserved1;
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, dataW->cFileName, -1,
|
|
|
|
dataA->cFileName, sizeof(dataA->cFileName),
|
|
|
|
NULL, NULL);
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, dataW->cAlternateFileName, -1,
|
|
|
|
dataA->cAlternateFileName, sizeof(dataA->cAlternateFileName),
|
|
|
|
NULL, NULL);
|
|
|
|
}
|
|
|
|
|
2000-04-11 20:07:00 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2000-06-11 20:04:44 +00:00
|
|
|
WH_HINIT = INTERNET_HANDLE_TYPE_INTERNET,
|
|
|
|
WH_HFTPSESSION = INTERNET_HANDLE_TYPE_CONNECT_FTP,
|
|
|
|
WH_HGOPHERSESSION = INTERNET_HANDLE_TYPE_CONNECT_GOPHER,
|
|
|
|
WH_HHTTPSESSION = INTERNET_HANDLE_TYPE_CONNECT_HTTP,
|
|
|
|
WH_HFILE = INTERNET_HANDLE_TYPE_FTP_FILE,
|
2006-10-29 17:53:41 +00:00
|
|
|
WH_HFTPFINDNEXT = INTERNET_HANDLE_TYPE_FTP_FIND,
|
2000-06-11 20:04:44 +00:00
|
|
|
WH_HHTTPREQ = INTERNET_HANDLE_TYPE_HTTP_REQUEST,
|
2000-04-11 20:07:00 +00:00
|
|
|
} WH_TYPE;
|
|
|
|
|
2004-05-13 05:17:25 +00:00
|
|
|
#define INET_OPENURL 0x0001
|
2004-05-25 04:02:05 +00:00
|
|
|
#define INET_CALLBACKW 0x0002
|
2004-05-13 05:17:25 +00:00
|
|
|
|
2004-07-19 21:49:39 +00:00
|
|
|
struct _WININETHANDLEHEADER;
|
|
|
|
typedef struct _WININETHANDLEHEADER WININETHANDLEHEADER, *LPWININETHANDLEHEADER;
|
|
|
|
|
|
|
|
typedef void (*WININET_object_destructor)( LPWININETHANDLEHEADER );
|
|
|
|
|
|
|
|
struct _WININETHANDLEHEADER
|
2000-04-11 20:07:00 +00:00
|
|
|
{
|
|
|
|
WH_TYPE htype;
|
2006-10-29 17:57:11 +00:00
|
|
|
HINTERNET hInternet;
|
2000-04-11 20:07:00 +00:00
|
|
|
DWORD dwFlags;
|
|
|
|
DWORD dwContext;
|
|
|
|
DWORD dwError;
|
2004-05-13 05:17:25 +00:00
|
|
|
DWORD dwInternalFlags;
|
2004-07-19 21:49:39 +00:00
|
|
|
DWORD dwRefCount;
|
|
|
|
WININET_object_destructor destroy;
|
2004-09-20 19:10:31 +00:00
|
|
|
INTERNET_STATUS_CALLBACK lpfnStatusCB;
|
2004-07-19 21:49:39 +00:00
|
|
|
};
|
2000-04-11 20:07:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
WININETHANDLEHEADER hdr;
|
2004-03-25 05:29:47 +00:00
|
|
|
LPWSTR lpszAgent;
|
|
|
|
LPWSTR lpszProxy;
|
|
|
|
LPWSTR lpszProxyBypass;
|
|
|
|
LPWSTR lpszProxyUsername;
|
|
|
|
LPWSTR lpszProxyPassword;
|
2000-04-11 20:07:00 +00:00
|
|
|
DWORD dwAccessType;
|
2004-03-25 05:29:47 +00:00
|
|
|
} WININETAPPINFOW, *LPWININETAPPINFOW;
|
2000-04-11 20:07:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
WININETHANDLEHEADER hdr;
|
2006-10-29 17:48:48 +00:00
|
|
|
WININETAPPINFOW *lpAppInfo;
|
2005-11-28 09:40:42 +00:00
|
|
|
LPWSTR lpszHostName; /* the final destination of the request */
|
|
|
|
LPWSTR lpszServerName; /* the name of the server we directly connect to */
|
2004-03-30 04:36:09 +00:00
|
|
|
LPWSTR lpszUserName;
|
2005-11-28 10:53:05 +00:00
|
|
|
INTERNET_PORT nHostPort; /* the final destination port of the request */
|
|
|
|
INTERNET_PORT nServerPort; /* the port of the server we directly connect to */
|
2000-04-11 20:07:00 +00:00
|
|
|
struct sockaddr_in socketAddress;
|
2004-03-30 04:36:09 +00:00
|
|
|
} WININETHTTPSESSIONW, *LPWININETHTTPSESSIONW;
|
2000-04-11 20:07:00 +00:00
|
|
|
|
2000-06-11 20:04:44 +00:00
|
|
|
#define HDR_ISREQUEST 0x0001
|
|
|
|
#define HDR_COMMADELIMITED 0x0002
|
|
|
|
#define HDR_SEMIDELIMITED 0x0004
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2004-03-30 04:36:09 +00:00
|
|
|
LPWSTR lpszField;
|
|
|
|
LPWSTR lpszValue;
|
2000-06-11 20:04:44 +00:00
|
|
|
WORD wFlags;
|
|
|
|
WORD wCount;
|
2004-03-30 04:36:09 +00:00
|
|
|
} HTTPHEADERW, *LPHTTPHEADERW;
|
2000-06-11 20:04:44 +00:00
|
|
|
|
2000-04-11 20:07:00 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
WININETHANDLEHEADER hdr;
|
2006-10-29 17:50:25 +00:00
|
|
|
WININETHTTPSESSIONW *lpHttpSession;
|
2004-03-30 04:36:09 +00:00
|
|
|
LPWSTR lpszPath;
|
|
|
|
LPWSTR lpszVerb;
|
2004-07-19 20:09:20 +00:00
|
|
|
LPWSTR lpszRawHeaders;
|
2003-06-20 23:26:56 +00:00
|
|
|
WININET_NETCONNECTION netConnection;
|
2005-12-13 16:07:41 +00:00
|
|
|
LPWSTR lpszVersion;
|
|
|
|
LPWSTR lpszStatusText;
|
2007-01-04 18:21:49 +00:00
|
|
|
DWORD dwContentLength; /* total number of bytes to be read */
|
|
|
|
DWORD dwContentRead; /* bytes of the content read so far */
|
2004-03-30 04:36:09 +00:00
|
|
|
HTTPHEADERW *pCustHeaders;
|
2004-08-09 18:54:23 +00:00
|
|
|
DWORD nCustHeaders;
|
2004-03-30 04:36:09 +00:00
|
|
|
} WININETHTTPREQW, *LPWININETHTTPREQW;
|
2000-04-11 20:07:00 +00:00
|
|
|
|
|
|
|
|
2006-10-29 17:55:15 +00:00
|
|
|
struct _WININETFTPSESSIONW;
|
|
|
|
|
2003-07-21 22:04:14 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
WININETHANDLEHEADER hdr;
|
2006-10-29 17:55:15 +00:00
|
|
|
struct _WININETFTPSESSIONW *lpFtpSession;
|
2003-07-21 22:04:14 +00:00
|
|
|
BOOL session_deleted;
|
|
|
|
int nDataSocket;
|
2006-10-29 17:55:15 +00:00
|
|
|
} WININETFTPFILE, *LPWININETFTPFILE;
|
2003-07-21 22:04:14 +00:00
|
|
|
|
|
|
|
|
2006-10-29 17:55:15 +00:00
|
|
|
typedef struct _WININETFTPSESSIONW
|
2000-04-11 20:07:00 +00:00
|
|
|
{
|
|
|
|
WININETHANDLEHEADER hdr;
|
2006-10-29 17:52:02 +00:00
|
|
|
WININETAPPINFOW *lpAppInfo;
|
2000-04-11 20:07:00 +00:00
|
|
|
int sndSocket;
|
|
|
|
int lstnSocket;
|
2000-12-29 05:19:57 +00:00
|
|
|
int pasvSocket; /* data socket connected by us in case of passive FTP */
|
2006-10-29 17:55:15 +00:00
|
|
|
LPWININETFTPFILE download_in_progress;
|
2000-04-11 20:07:00 +00:00
|
|
|
struct sockaddr_in socketAddress;
|
|
|
|
struct sockaddr_in lstnSocketAddress;
|
2004-05-25 04:02:05 +00:00
|
|
|
LPWSTR lpszPassword;
|
|
|
|
LPWSTR lpszUserName;
|
|
|
|
} WININETFTPSESSIONW, *LPWININETFTPSESSIONW;
|
2000-04-11 20:07:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
BOOL bIsDirectory;
|
2004-05-25 04:02:05 +00:00
|
|
|
LPWSTR lpszName;
|
2000-04-11 20:07:00 +00:00
|
|
|
DWORD nSize;
|
|
|
|
struct tm tmLastModified;
|
|
|
|
unsigned short permissions;
|
2004-05-25 04:02:05 +00:00
|
|
|
} FILEPROPERTIESW, *LPFILEPROPERTIESW;
|
2000-04-11 20:07:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
WININETHANDLEHEADER hdr;
|
2006-10-29 17:54:29 +00:00
|
|
|
WININETFTPSESSIONW *lpFtpSession;
|
2004-08-09 18:54:23 +00:00
|
|
|
DWORD index;
|
2000-04-11 20:07:00 +00:00
|
|
|
DWORD size;
|
2004-05-25 04:02:05 +00:00
|
|
|
LPFILEPROPERTIESW lpafp;
|
2006-10-29 17:53:41 +00:00
|
|
|
} WININETFTPFINDNEXTW, *LPWININETFTPFINDNEXTW;
|
2000-04-11 20:07:00 +00:00
|
|
|
|
2004-05-25 04:02:05 +00:00
|
|
|
struct WORKREQ_FTPPUTFILEW
|
2003-09-25 20:25:22 +00:00
|
|
|
{
|
2004-05-25 04:02:05 +00:00
|
|
|
LPWSTR lpszLocalFile;
|
|
|
|
LPWSTR lpszNewRemoteFile;
|
2003-09-25 20:25:22 +00:00
|
|
|
DWORD dwFlags;
|
|
|
|
DWORD dwContext;
|
|
|
|
};
|
|
|
|
|
2004-05-25 04:02:05 +00:00
|
|
|
struct WORKREQ_FTPSETCURRENTDIRECTORYW
|
2003-09-25 20:25:22 +00:00
|
|
|
{
|
2004-05-25 04:02:05 +00:00
|
|
|
LPWSTR lpszDirectory;
|
2003-09-25 20:25:22 +00:00
|
|
|
};
|
|
|
|
|
2004-05-25 04:02:05 +00:00
|
|
|
struct WORKREQ_FTPCREATEDIRECTORYW
|
2003-09-25 20:25:22 +00:00
|
|
|
{
|
2004-05-25 04:02:05 +00:00
|
|
|
LPWSTR lpszDirectory;
|
2003-09-25 20:25:22 +00:00
|
|
|
};
|
|
|
|
|
2004-05-25 04:02:05 +00:00
|
|
|
struct WORKREQ_FTPFINDFIRSTFILEW
|
2003-09-25 20:25:22 +00:00
|
|
|
{
|
2004-05-25 04:02:05 +00:00
|
|
|
LPWSTR lpszSearchFile;
|
|
|
|
LPWIN32_FIND_DATAW lpFindFileData;
|
2003-09-25 20:25:22 +00:00
|
|
|
DWORD dwFlags;
|
|
|
|
DWORD dwContext;
|
|
|
|
};
|
|
|
|
|
2004-05-25 04:02:05 +00:00
|
|
|
struct WORKREQ_FTPGETCURRENTDIRECTORYW
|
2003-09-25 20:25:22 +00:00
|
|
|
{
|
2004-05-25 04:02:05 +00:00
|
|
|
LPWSTR lpszDirectory;
|
2003-09-25 20:25:22 +00:00
|
|
|
DWORD *lpdwDirectory;
|
|
|
|
};
|
|
|
|
|
2004-05-25 04:02:05 +00:00
|
|
|
struct WORKREQ_FTPOPENFILEW
|
2003-09-25 20:25:22 +00:00
|
|
|
{
|
2004-05-25 04:02:05 +00:00
|
|
|
LPWSTR lpszFilename;
|
2003-09-25 20:25:22 +00:00
|
|
|
DWORD dwAccess;
|
|
|
|
DWORD dwFlags;
|
|
|
|
DWORD dwContext;
|
|
|
|
};
|
|
|
|
|
2004-05-25 04:02:05 +00:00
|
|
|
struct WORKREQ_FTPGETFILEW
|
2003-09-25 20:25:22 +00:00
|
|
|
{
|
2004-05-25 04:02:05 +00:00
|
|
|
LPWSTR lpszRemoteFile;
|
|
|
|
LPWSTR lpszNewFile;
|
2003-09-25 20:25:22 +00:00
|
|
|
BOOL fFailIfExists;
|
|
|
|
DWORD dwLocalFlagsAttribute;
|
|
|
|
DWORD dwFlags;
|
|
|
|
DWORD dwContext;
|
|
|
|
};
|
|
|
|
|
2004-05-25 04:02:05 +00:00
|
|
|
struct WORKREQ_FTPDELETEFILEW
|
2003-09-25 20:25:22 +00:00
|
|
|
{
|
2004-05-25 04:02:05 +00:00
|
|
|
LPWSTR lpszFilename;
|
2003-09-25 20:25:22 +00:00
|
|
|
};
|
|
|
|
|
2004-05-25 04:02:05 +00:00
|
|
|
struct WORKREQ_FTPREMOVEDIRECTORYW
|
2003-09-25 20:25:22 +00:00
|
|
|
{
|
2004-05-25 04:02:05 +00:00
|
|
|
LPWSTR lpszDirectory;
|
2003-09-25 20:25:22 +00:00
|
|
|
};
|
|
|
|
|
2004-05-25 04:02:05 +00:00
|
|
|
struct WORKREQ_FTPRENAMEFILEW
|
2003-09-25 20:25:22 +00:00
|
|
|
{
|
2004-05-25 04:02:05 +00:00
|
|
|
LPWSTR lpszSrcFile;
|
|
|
|
LPWSTR lpszDestFile;
|
2003-09-25 20:25:22 +00:00
|
|
|
};
|
|
|
|
|
2006-10-29 17:53:41 +00:00
|
|
|
struct WORKREQ_FTPFINDNEXTW
|
2003-09-25 20:25:22 +00:00
|
|
|
{
|
2004-05-25 04:02:05 +00:00
|
|
|
LPWIN32_FIND_DATAW lpFindFileData;
|
2003-09-25 20:25:22 +00:00
|
|
|
};
|
|
|
|
|
2004-03-30 04:36:09 +00:00
|
|
|
struct WORKREQ_HTTPSENDREQUESTW
|
2003-09-25 20:25:22 +00:00
|
|
|
{
|
2004-03-30 04:36:09 +00:00
|
|
|
LPWSTR lpszHeader;
|
2003-09-25 20:25:22 +00:00
|
|
|
DWORD dwHeaderLength;
|
|
|
|
LPVOID lpOptional;
|
|
|
|
DWORD dwOptionalLength;
|
2005-11-30 11:31:22 +00:00
|
|
|
DWORD dwContentLength;
|
|
|
|
BOOL bEndRequest;
|
2003-09-25 20:25:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct WORKREQ_SENDCALLBACK
|
|
|
|
{
|
|
|
|
DWORD dwContext;
|
|
|
|
DWORD dwInternetStatus;
|
|
|
|
LPVOID lpvStatusInfo;
|
|
|
|
DWORD dwStatusInfoLength;
|
|
|
|
};
|
|
|
|
|
2004-03-30 04:36:09 +00:00
|
|
|
struct WORKREQ_INTERNETOPENURLW
|
2004-02-09 21:45:38 +00:00
|
|
|
{
|
|
|
|
HINTERNET hInternet;
|
2004-03-30 04:36:09 +00:00
|
|
|
LPWSTR lpszUrl;
|
|
|
|
LPWSTR lpszHeaders;
|
2004-02-09 21:45:38 +00:00
|
|
|
DWORD dwHeadersLength;
|
|
|
|
DWORD dwFlags;
|
|
|
|
DWORD dwContext;
|
|
|
|
};
|
|
|
|
|
2005-11-12 19:10:56 +00:00
|
|
|
struct WORKREQ_INTERNETREADFILEEXA
|
|
|
|
{
|
|
|
|
LPINTERNET_BUFFERSA lpBuffersOut;
|
|
|
|
};
|
|
|
|
|
2000-04-11 20:07:00 +00:00
|
|
|
typedef struct WORKREQ
|
|
|
|
{
|
2006-12-25 20:32:52 +00:00
|
|
|
void (*asyncproc)(struct WORKREQ*);
|
2004-07-19 21:49:39 +00:00
|
|
|
WININETHANDLEHEADER *hdr;
|
2003-09-25 20:25:22 +00:00
|
|
|
|
|
|
|
union {
|
2004-05-25 04:02:05 +00:00
|
|
|
struct WORKREQ_FTPPUTFILEW FtpPutFileW;
|
|
|
|
struct WORKREQ_FTPSETCURRENTDIRECTORYW FtpSetCurrentDirectoryW;
|
|
|
|
struct WORKREQ_FTPCREATEDIRECTORYW FtpCreateDirectoryW;
|
|
|
|
struct WORKREQ_FTPFINDFIRSTFILEW FtpFindFirstFileW;
|
|
|
|
struct WORKREQ_FTPGETCURRENTDIRECTORYW FtpGetCurrentDirectoryW;
|
|
|
|
struct WORKREQ_FTPOPENFILEW FtpOpenFileW;
|
|
|
|
struct WORKREQ_FTPGETFILEW FtpGetFileW;
|
|
|
|
struct WORKREQ_FTPDELETEFILEW FtpDeleteFileW;
|
|
|
|
struct WORKREQ_FTPREMOVEDIRECTORYW FtpRemoveDirectoryW;
|
|
|
|
struct WORKREQ_FTPRENAMEFILEW FtpRenameFileW;
|
2006-10-29 17:53:41 +00:00
|
|
|
struct WORKREQ_FTPFINDNEXTW FtpFindNextW;
|
2004-03-30 04:36:09 +00:00
|
|
|
struct WORKREQ_HTTPSENDREQUESTW HttpSendRequestW;
|
2003-09-25 20:25:22 +00:00
|
|
|
struct WORKREQ_SENDCALLBACK SendCallback;
|
2004-03-30 04:36:09 +00:00
|
|
|
struct WORKREQ_INTERNETOPENURLW InternetOpenUrlW;
|
2005-11-12 19:10:56 +00:00
|
|
|
struct WORKREQ_INTERNETREADFILEEXA InternetReadFileExA;
|
2003-09-25 20:25:22 +00:00
|
|
|
} u;
|
2000-04-11 20:07:00 +00:00
|
|
|
|
|
|
|
} WORKREQUEST, *LPWORKREQUEST;
|
|
|
|
|
2004-02-07 01:03:41 +00:00
|
|
|
HINTERNET WININET_AllocHandle( LPWININETHANDLEHEADER info );
|
|
|
|
LPWININETHANDLEHEADER WININET_GetObject( HINTERNET hinternet );
|
2004-07-19 21:49:39 +00:00
|
|
|
LPWININETHANDLEHEADER WININET_AddRef( LPWININETHANDLEHEADER info );
|
|
|
|
BOOL WININET_Release( LPWININETHANDLEHEADER info );
|
2004-02-07 01:03:41 +00:00
|
|
|
BOOL WININET_FreeHandle( HINTERNET hinternet );
|
2000-04-11 20:07:00 +00:00
|
|
|
|
2004-03-30 04:36:09 +00:00
|
|
|
time_t ConvertTimeString(LPCWSTR asctime);
|
2000-04-11 20:07:00 +00:00
|
|
|
|
2004-07-19 21:49:39 +00:00
|
|
|
HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
|
2004-03-30 04:36:09 +00:00
|
|
|
INTERNET_PORT nServerPort, LPCWSTR lpszUserName,
|
2004-05-13 05:17:25 +00:00
|
|
|
LPCWSTR lpszPassword, DWORD dwFlags, DWORD dwContext,
|
|
|
|
DWORD dwInternalFlags);
|
2000-04-11 20:07:00 +00:00
|
|
|
|
2004-07-19 21:49:39 +00:00
|
|
|
HINTERNET HTTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName,
|
2004-03-30 04:36:09 +00:00
|
|
|
INTERNET_PORT nServerPort, LPCWSTR lpszUserName,
|
2004-05-13 05:17:25 +00:00
|
|
|
LPCWSTR lpszPassword, DWORD dwFlags, DWORD dwContext,
|
|
|
|
DWORD dwInternalFlags);
|
2000-06-11 20:04:44 +00:00
|
|
|
|
2004-03-30 04:36:09 +00:00
|
|
|
BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
|
2005-11-15 18:16:55 +00:00
|
|
|
struct sockaddr_in *psa);
|
2000-04-11 20:07:00 +00:00
|
|
|
|
|
|
|
void INTERNET_SetLastError(DWORD dwError);
|
2004-12-13 21:19:01 +00:00
|
|
|
DWORD INTERNET_GetLastError(void);
|
2000-04-11 20:07:00 +00:00
|
|
|
BOOL INTERNET_AsyncCall(LPWORKREQUEST lpWorkRequest);
|
2004-12-13 21:19:01 +00:00
|
|
|
LPSTR INTERNET_GetResponseBuffer(void);
|
2004-05-25 04:02:05 +00:00
|
|
|
LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen);
|
2007-01-04 18:23:17 +00:00
|
|
|
BOOL INTERNET_ReadFile(LPWININETHANDLEHEADER lpwh, LPVOID lpBuffer,
|
|
|
|
DWORD dwNumOfBytesToRead, LPDWORD pdwNumOfBytesRead,
|
|
|
|
BOOL bWait, BOOL bSendCompletionStatus);
|
2000-04-11 20:07:00 +00:00
|
|
|
|
2004-07-19 21:49:39 +00:00
|
|
|
BOOLAPI FTP_FtpPutFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszLocalFile,
|
2004-05-25 04:02:05 +00:00
|
|
|
LPCWSTR lpszNewRemoteFile, DWORD dwFlags, DWORD dwContext);
|
2004-07-19 21:49:39 +00:00
|
|
|
BOOLAPI FTP_FtpSetCurrentDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory);
|
|
|
|
BOOLAPI FTP_FtpCreateDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory);
|
|
|
|
INTERNETAPI HINTERNET WINAPI FTP_FtpFindFirstFileW(LPWININETFTPSESSIONW lpwfs,
|
2004-05-25 04:02:05 +00:00
|
|
|
LPCWSTR lpszSearchFile, LPWIN32_FIND_DATAW lpFindFileData, DWORD dwFlags, DWORD dwContext);
|
2006-10-29 17:53:41 +00:00
|
|
|
BOOL WINAPI FTP_FindNextFileW(LPWININETFTPFINDNEXTW lpwh, LPVOID lpvFindData);
|
2004-07-19 21:49:39 +00:00
|
|
|
BOOLAPI FTP_FtpGetCurrentDirectoryW(LPWININETFTPSESSIONW lpwfs, LPWSTR lpszCurrentDirectory,
|
2000-04-11 20:07:00 +00:00
|
|
|
LPDWORD lpdwCurrentDirectory);
|
2004-05-25 04:02:05 +00:00
|
|
|
BOOL FTP_ConvertFileProp(LPFILEPROPERTIESW lpafp, LPWIN32_FIND_DATAW lpFindFileData);
|
2004-07-19 21:49:39 +00:00
|
|
|
BOOL FTP_FtpRenameFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszSrc, LPCWSTR lpszDest);
|
|
|
|
BOOL FTP_FtpRemoveDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDirectory);
|
|
|
|
BOOL FTP_FtpDeleteFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszFileName);
|
|
|
|
HINTERNET FTP_FtpOpenFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszFileName,
|
2000-04-11 20:07:00 +00:00
|
|
|
DWORD fdwAccess, DWORD dwFlags, DWORD dwContext);
|
2004-07-19 21:49:39 +00:00
|
|
|
BOOLAPI FTP_FtpGetFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile, LPCWSTR lpszNewFile,
|
2000-04-11 20:07:00 +00:00
|
|
|
BOOL fFailIfExists, DWORD dwLocalFlagsAttribute, DWORD dwInternetFlags,
|
|
|
|
DWORD dwContext);
|
|
|
|
|
2004-07-19 21:49:39 +00:00
|
|
|
BOOLAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders,
|
2005-11-30 11:31:22 +00:00
|
|
|
DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength,
|
|
|
|
DWORD dwContentLength, BOOL bEndRequest);
|
2004-07-19 21:49:39 +00:00
|
|
|
INTERNETAPI HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
|
2004-03-30 04:36:09 +00:00
|
|
|
LPCWSTR lpszVerb, LPCWSTR lpszObjectName, LPCWSTR lpszVersion,
|
|
|
|
LPCWSTR lpszReferrer , LPCWSTR *lpszAcceptTypes,
|
2000-06-11 20:04:44 +00:00
|
|
|
DWORD dwFlags, DWORD dwContext);
|
2007-01-04 18:23:17 +00:00
|
|
|
BOOL HTTP_FinishedReading(LPWININETHTTPREQW lpwhr);
|
2000-06-11 20:04:44 +00:00
|
|
|
|
2004-09-20 19:10:31 +00:00
|
|
|
VOID SendAsyncCallback(LPWININETHANDLEHEADER hdr, DWORD dwContext,
|
|
|
|
DWORD dwInternetStatus, LPVOID lpvStatusInfo,
|
|
|
|
DWORD dwStatusInfoLength);
|
2002-06-21 23:59:49 +00:00
|
|
|
|
2005-11-22 11:59:07 +00:00
|
|
|
VOID INTERNET_SendCallback(LPWININETHANDLEHEADER hdr, DWORD dwContext,
|
|
|
|
DWORD dwInternetStatus, LPVOID lpvStatusInfo,
|
|
|
|
DWORD dwStatusInfoLength);
|
2002-06-21 23:59:49 +00:00
|
|
|
|
2005-12-13 16:07:41 +00:00
|
|
|
LPHTTPHEADERW HTTP_GetHeader(LPWININETHTTPREQW lpwhr, LPCWSTR header);
|
|
|
|
|
2003-06-20 23:26:56 +00:00
|
|
|
BOOL NETCON_connected(WININET_NETCONNECTION *connection);
|
2006-03-06 17:31:09 +00:00
|
|
|
BOOL NETCON_init(WININET_NETCONNECTION *connnection, BOOL useSSL);
|
2003-06-20 23:26:56 +00:00
|
|
|
BOOL NETCON_create(WININET_NETCONNECTION *connection, int domain,
|
|
|
|
int type, int protocol);
|
|
|
|
BOOL NETCON_close(WININET_NETCONNECTION *connection);
|
|
|
|
BOOL NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr,
|
2004-09-16 20:34:27 +00:00
|
|
|
unsigned int addrlen);
|
2005-11-28 10:54:31 +00:00
|
|
|
BOOL NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname);
|
2003-06-20 23:26:56 +00:00
|
|
|
BOOL NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len, int flags,
|
|
|
|
int *sent /* out */);
|
|
|
|
BOOL NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int flags,
|
|
|
|
int *recvd /* out */);
|
|
|
|
BOOL NETCON_getNextLine(WININET_NETCONNECTION *connection, LPSTR lpszBuffer, LPDWORD dwBuffer);
|
2006-01-20 19:16:56 +00:00
|
|
|
LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection);
|
2006-03-14 14:36:11 +00:00
|
|
|
BOOL NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value);
|
2003-06-20 23:26:56 +00:00
|
|
|
|
2005-06-13 19:05:42 +00:00
|
|
|
extern void URLCacheContainers_CreateDefaults(void);
|
|
|
|
extern void URLCacheContainers_DeleteAll(void);
|
|
|
|
|
2000-04-11 20:07:00 +00:00
|
|
|
#define MAX_REPLY_LEN 0x5B4
|
|
|
|
|
2004-02-09 22:01:49 +00:00
|
|
|
/* Used for debugging - maybe need to be shared in the Wine debugging code ? */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
DWORD val;
|
|
|
|
const char* name;
|
|
|
|
} wininet_flag_info;
|
2000-04-11 20:07:00 +00:00
|
|
|
|
|
|
|
#endif /* _WINE_INTERNET_H_ */
|