2002-03-10 00:29:33 +01: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 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-03-10 00:29:33 +01:00
|
|
|
*/
|
|
|
|
|
2000-04-11 22:07:00 +02:00
|
|
|
#ifndef _WINE_INTERNET_H_
|
|
|
|
#define _WINE_INTERNET_H_
|
|
|
|
|
2007-01-29 14:52:00 +01:00
|
|
|
#ifndef __WINE_CONFIG_H
|
|
|
|
# error You must include config.h to use this header
|
|
|
|
#endif
|
|
|
|
|
2004-03-30 06:36:09 +02:00
|
|
|
#include "wine/unicode.h"
|
2007-09-21 03:59:40 +02:00
|
|
|
#include "wine/list.h"
|
2004-03-30 06:36:09 +02:00
|
|
|
|
2001-02-15 22:24:07 +01:00
|
|
|
#include <time.h>
|
2001-08-24 21:13:36 +02:00
|
|
|
#ifdef HAVE_NETDB_H
|
|
|
|
# include <netdb.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_NETINET_IN_H
|
2001-09-11 01:07:39 +02:00
|
|
|
# include <sys/types.h>
|
2001-08-24 21:13:36 +02:00
|
|
|
# include <netinet/in.h>
|
|
|
|
#endif
|
2003-10-14 07:27:43 +02:00
|
|
|
#ifdef HAVE_SYS_SOCKET_H
|
|
|
|
# include <sys/socket.h>
|
|
|
|
#endif
|
2003-06-21 01:26:56 +02:00
|
|
|
|
2008-12-12 10:30:09 +01:00
|
|
|
#if !defined(__MINGW32__) && !defined(_MSC_VER)
|
2004-09-03 20:57:19 +02:00
|
|
|
#define closesocket close
|
2008-03-03 22:46:52 +01:00
|
|
|
#define ioctlsocket ioctl
|
2004-09-03 20:57:19 +02:00
|
|
|
#endif /* __MINGW32__ */
|
|
|
|
|
2010-12-19 21:34:27 +01:00
|
|
|
extern HMODULE WININET_hModule;
|
|
|
|
|
2003-06-21 01:26:56 +02:00
|
|
|
/* used for netconnection.c stuff */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
BOOL useSSL;
|
|
|
|
int socketFD;
|
2008-06-02 12:14:37 +02:00
|
|
|
void *ssl_s;
|
2010-09-29 01:46:41 +02:00
|
|
|
DWORD security_flags;
|
2003-06-21 01:26:56 +02:00
|
|
|
} WININET_NETCONNECTION;
|
2001-02-15 22:24:07 +01:00
|
|
|
|
2011-02-02 22:50:31 +01:00
|
|
|
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len)
|
|
|
|
{
|
|
|
|
return HeapAlloc(GetProcessHeap(), 0, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len)
|
|
|
|
{
|
|
|
|
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void * __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t len)
|
|
|
|
{
|
|
|
|
return HeapReAlloc(GetProcessHeap(), 0, mem, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void * __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t len)
|
|
|
|
{
|
|
|
|
return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline BOOL heap_free(void *mem)
|
|
|
|
{
|
|
|
|
return HeapFree(GetProcessHeap(), 0, mem);
|
|
|
|
}
|
|
|
|
|
2009-07-17 01:10:41 +02:00
|
|
|
static inline LPWSTR heap_strdupW(LPCWSTR str)
|
2004-03-30 06:36:09 +02:00
|
|
|
{
|
2009-07-17 01:10:41 +02:00
|
|
|
LPWSTR ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
DWORD size;
|
|
|
|
|
|
|
|
size = (strlenW(str)+1)*sizeof(WCHAR);
|
|
|
|
ret = HeapAlloc(GetProcessHeap(), 0, size);
|
|
|
|
if(ret)
|
|
|
|
memcpy(ret, str, size);
|
|
|
|
}
|
|
|
|
|
2004-03-30 06:36:09 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2010-07-17 14:08:44 +02:00
|
|
|
static inline LPWSTR heap_strndupW(LPCWSTR str, UINT max_len)
|
|
|
|
{
|
|
|
|
LPWSTR ret;
|
|
|
|
UINT len;
|
|
|
|
|
|
|
|
if(!str)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
for(len=0; len<max_len; len++)
|
|
|
|
if(str[len] == '\0')
|
|
|
|
break;
|
|
|
|
|
|
|
|
ret = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*(len+1));
|
|
|
|
if(ret) {
|
|
|
|
memcpy(ret, str, sizeof(WCHAR)*len);
|
|
|
|
ret[len] = '\0';
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2009-07-17 01:11:24 +02:00
|
|
|
static inline WCHAR *heap_strdupAtoW(const char *str)
|
2004-05-25 06:02:05 +02:00
|
|
|
{
|
2009-07-17 01:11:24 +02:00
|
|
|
LPWSTR ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
DWORD len;
|
|
|
|
|
|
|
|
len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
|
|
|
|
ret = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
|
|
|
|
if(ret)
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
|
|
|
|
}
|
|
|
|
|
2004-05-25 06:02:05 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2009-07-17 01:12:04 +02:00
|
|
|
static inline char *heap_strdupWtoA(LPCWSTR str)
|
2004-05-25 06:02:05 +02:00
|
|
|
{
|
2009-07-17 01:12:04 +02:00
|
|
|
char *ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
DWORD size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
|
|
|
|
ret = HeapAlloc(GetProcessHeap(), 0, size);
|
|
|
|
if(ret)
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
2004-05-25 06:02:05 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2007-03-23 16:09:23 +01:00
|
|
|
static inline void WININET_find_data_WtoA(LPWIN32_FIND_DATAW dataW, LPWIN32_FIND_DATAA dataA)
|
2004-05-25 06:02:05 +02:00
|
|
|
{
|
|
|
|
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 22:07:00 +02:00
|
|
|
typedef enum
|
|
|
|
{
|
2000-06-11 22:04:44 +02: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 18:53:41 +01:00
|
|
|
WH_HFTPFINDNEXT = INTERNET_HANDLE_TYPE_FTP_FIND,
|
2000-06-11 22:04:44 +02:00
|
|
|
WH_HHTTPREQ = INTERNET_HANDLE_TYPE_HTTP_REQUEST,
|
2000-04-11 22:07:00 +02:00
|
|
|
} WH_TYPE;
|
|
|
|
|
2004-05-13 07:17:25 +02:00
|
|
|
#define INET_OPENURL 0x0001
|
2004-05-25 06:02:05 +02:00
|
|
|
#define INET_CALLBACKW 0x0002
|
2004-05-13 07:17:25 +02:00
|
|
|
|
2009-07-07 21:46:09 +02:00
|
|
|
typedef struct _object_header_t object_header_t;
|
2004-07-19 23:49:39 +02:00
|
|
|
|
2008-02-26 20:20:41 +01:00
|
|
|
typedef struct {
|
2009-07-07 21:46:09 +02:00
|
|
|
void (*Destroy)(object_header_t*);
|
|
|
|
void (*CloseConnection)(object_header_t*);
|
|
|
|
DWORD (*QueryOption)(object_header_t*,DWORD,void*,DWORD*,BOOL);
|
|
|
|
DWORD (*SetOption)(object_header_t*,DWORD,void*,DWORD);
|
|
|
|
DWORD (*ReadFile)(object_header_t*,void*,DWORD,DWORD*);
|
|
|
|
DWORD (*ReadFileExA)(object_header_t*,INTERNET_BUFFERSA*,DWORD,DWORD_PTR);
|
|
|
|
DWORD (*ReadFileExW)(object_header_t*,INTERNET_BUFFERSW*,DWORD,DWORD_PTR);
|
2009-11-30 00:13:39 +01:00
|
|
|
DWORD (*WriteFile)(object_header_t*,const void*,DWORD,DWORD*);
|
2009-07-07 21:46:09 +02:00
|
|
|
DWORD (*QueryDataAvailable)(object_header_t*,DWORD*,DWORD,DWORD_PTR);
|
|
|
|
DWORD (*FindNextFileW)(object_header_t*,void*);
|
|
|
|
} object_vtbl_t;
|
|
|
|
|
2010-07-20 00:33:24 +02:00
|
|
|
#define INTERNET_HANDLE_IN_USE 1
|
|
|
|
|
2009-07-07 21:46:09 +02:00
|
|
|
struct _object_header_t
|
2000-04-11 22:07:00 +02:00
|
|
|
{
|
|
|
|
WH_TYPE htype;
|
2009-07-07 21:46:09 +02:00
|
|
|
const object_vtbl_t *vtbl;
|
2006-10-29 18:57:11 +01:00
|
|
|
HINTERNET hInternet;
|
2011-02-02 22:50:46 +01:00
|
|
|
BOOL valid_handle;
|
2000-04-11 22:07:00 +02:00
|
|
|
DWORD dwFlags;
|
2007-08-30 16:21:33 +02:00
|
|
|
DWORD_PTR dwContext;
|
2000-04-11 22:07:00 +02:00
|
|
|
DWORD dwError;
|
2010-05-19 12:29:09 +02:00
|
|
|
ULONG ErrorMask;
|
2004-05-13 07:17:25 +02:00
|
|
|
DWORD dwInternalFlags;
|
2008-03-10 17:39:15 +01:00
|
|
|
LONG refs;
|
2004-09-20 21:10:31 +02:00
|
|
|
INTERNET_STATUS_CALLBACK lpfnStatusCB;
|
2007-09-21 03:59:40 +02:00
|
|
|
struct list entry;
|
|
|
|
struct list children;
|
2004-07-19 23:49:39 +02:00
|
|
|
};
|
2000-04-11 22:07:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2009-07-07 21:46:09 +02:00
|
|
|
object_header_t hdr;
|
2011-03-01 20:00:49 +01:00
|
|
|
LPWSTR agent;
|
|
|
|
LPWSTR proxy;
|
|
|
|
LPWSTR proxyBypass;
|
|
|
|
LPWSTR proxyUsername;
|
|
|
|
LPWSTR proxyPassword;
|
|
|
|
DWORD accessType;
|
2009-07-13 01:45:06 +02:00
|
|
|
} appinfo_t;
|
2000-04-11 22:07:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2009-07-07 21:46:09 +02:00
|
|
|
object_header_t hdr;
|
2011-03-01 20:02:14 +01:00
|
|
|
appinfo_t *appInfo;
|
|
|
|
LPWSTR hostName; /* the final destination of the request */
|
|
|
|
LPWSTR serverName; /* the name of the server we directly connect to */
|
|
|
|
LPWSTR userName;
|
|
|
|
LPWSTR password;
|
|
|
|
INTERNET_PORT hostPort; /* the final destination port of the request */
|
|
|
|
INTERNET_PORT serverPort; /* the port of the server we directly connect to */
|
2009-07-09 20:36:00 +02:00
|
|
|
struct sockaddr_storage socketAddress;
|
2009-07-09 20:30:59 +02:00
|
|
|
socklen_t sa_len;
|
2009-07-13 01:41:18 +02:00
|
|
|
} http_session_t;
|
2000-04-11 22:07:00 +02:00
|
|
|
|
2000-06-11 22:04:44 +02:00
|
|
|
#define HDR_ISREQUEST 0x0001
|
|
|
|
#define HDR_COMMADELIMITED 0x0002
|
|
|
|
#define HDR_SEMIDELIMITED 0x0004
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2004-03-30 06:36:09 +02:00
|
|
|
LPWSTR lpszField;
|
|
|
|
LPWSTR lpszValue;
|
2000-06-11 22:04:44 +02:00
|
|
|
WORD wFlags;
|
|
|
|
WORD wCount;
|
2004-03-30 06:36:09 +02:00
|
|
|
} HTTPHEADERW, *LPHTTPHEADERW;
|
2000-06-11 22:04:44 +02:00
|
|
|
|
2000-04-11 22:07:00 +02:00
|
|
|
|
2007-05-21 15:26:26 +02:00
|
|
|
struct HttpAuthInfo;
|
|
|
|
|
2009-05-29 23:35:13 +02:00
|
|
|
typedef struct gzip_stream_t gzip_stream_t;
|
|
|
|
|
2000-04-11 22:07:00 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
2009-07-07 21:46:09 +02:00
|
|
|
object_header_t hdr;
|
2011-03-01 20:18:22 +01:00
|
|
|
http_session_t *session;
|
|
|
|
LPWSTR path;
|
|
|
|
LPWSTR verb;
|
|
|
|
LPWSTR rawHeaders;
|
2003-06-21 01:26:56 +02:00
|
|
|
WININET_NETCONNECTION netConnection;
|
2011-03-01 20:18:22 +01:00
|
|
|
LPWSTR version;
|
|
|
|
LPWSTR statusText;
|
|
|
|
DWORD bytesToWrite;
|
|
|
|
DWORD bytesWritten;
|
|
|
|
HTTPHEADERW *custHeaders;
|
2004-08-09 20:54:23 +02:00
|
|
|
DWORD nCustHeaders;
|
2011-03-04 20:43:54 +01:00
|
|
|
FILETIME last_modified;
|
2008-02-13 13:32:49 +01:00
|
|
|
HANDLE hCacheFile;
|
2011-03-01 20:18:22 +01:00
|
|
|
LPWSTR cacheFile;
|
2011-03-03 20:20:11 +01:00
|
|
|
FILETIME expires;
|
2011-03-01 20:18:22 +01:00
|
|
|
struct HttpAuthInfo *authInfo;
|
|
|
|
struct HttpAuthInfo *proxyAuthInfo;
|
2009-05-28 23:01:28 +02:00
|
|
|
|
|
|
|
CRITICAL_SECTION read_section; /* section to protect the following fields */
|
2011-03-01 20:18:22 +01:00
|
|
|
DWORD contentLength; /* total number of bytes to be read */
|
|
|
|
DWORD contentRead; /* bytes of the content read so far */
|
2009-05-14 16:42:44 +02:00
|
|
|
BOOL read_chunked; /* are we reading in chunked mode? */
|
2009-05-14 16:45:38 +02:00
|
|
|
DWORD read_pos; /* current read position in read_buf */
|
|
|
|
DWORD read_size; /* valid data size in read_buf */
|
2009-05-29 23:34:37 +02:00
|
|
|
BYTE read_buf[4096]; /* buffer for already read but not returned data */
|
2009-05-29 23:35:13 +02:00
|
|
|
|
|
|
|
BOOL decoding;
|
|
|
|
gzip_stream_t *gzip_stream;
|
2009-07-13 01:41:50 +02:00
|
|
|
} http_request_t;
|
2000-04-11 22:07:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2004-05-25 06:02:05 +02:00
|
|
|
struct WORKREQ_FTPPUTFILEW
|
2003-09-25 22:25:22 +02:00
|
|
|
{
|
2004-05-25 06:02:05 +02:00
|
|
|
LPWSTR lpszLocalFile;
|
|
|
|
LPWSTR lpszNewRemoteFile;
|
2003-09-25 22:25:22 +02:00
|
|
|
DWORD dwFlags;
|
2007-08-30 16:21:33 +02:00
|
|
|
DWORD_PTR dwContext;
|
2003-09-25 22:25:22 +02:00
|
|
|
};
|
|
|
|
|
2004-05-25 06:02:05 +02:00
|
|
|
struct WORKREQ_FTPSETCURRENTDIRECTORYW
|
2003-09-25 22:25:22 +02:00
|
|
|
{
|
2004-05-25 06:02:05 +02:00
|
|
|
LPWSTR lpszDirectory;
|
2003-09-25 22:25:22 +02:00
|
|
|
};
|
|
|
|
|
2004-05-25 06:02:05 +02:00
|
|
|
struct WORKREQ_FTPCREATEDIRECTORYW
|
2003-09-25 22:25:22 +02:00
|
|
|
{
|
2004-05-25 06:02:05 +02:00
|
|
|
LPWSTR lpszDirectory;
|
2003-09-25 22:25:22 +02:00
|
|
|
};
|
|
|
|
|
2004-05-25 06:02:05 +02:00
|
|
|
struct WORKREQ_FTPFINDFIRSTFILEW
|
2003-09-25 22:25:22 +02:00
|
|
|
{
|
2004-05-25 06:02:05 +02:00
|
|
|
LPWSTR lpszSearchFile;
|
|
|
|
LPWIN32_FIND_DATAW lpFindFileData;
|
2003-09-25 22:25:22 +02:00
|
|
|
DWORD dwFlags;
|
2007-08-30 16:21:33 +02:00
|
|
|
DWORD_PTR dwContext;
|
2003-09-25 22:25:22 +02:00
|
|
|
};
|
|
|
|
|
2004-05-25 06:02:05 +02:00
|
|
|
struct WORKREQ_FTPGETCURRENTDIRECTORYW
|
2003-09-25 22:25:22 +02:00
|
|
|
{
|
2004-05-25 06:02:05 +02:00
|
|
|
LPWSTR lpszDirectory;
|
2003-09-25 22:25:22 +02:00
|
|
|
DWORD *lpdwDirectory;
|
|
|
|
};
|
|
|
|
|
2004-05-25 06:02:05 +02:00
|
|
|
struct WORKREQ_FTPOPENFILEW
|
2003-09-25 22:25:22 +02:00
|
|
|
{
|
2004-05-25 06:02:05 +02:00
|
|
|
LPWSTR lpszFilename;
|
2003-09-25 22:25:22 +02:00
|
|
|
DWORD dwAccess;
|
|
|
|
DWORD dwFlags;
|
2007-08-30 16:21:33 +02:00
|
|
|
DWORD_PTR dwContext;
|
2003-09-25 22:25:22 +02:00
|
|
|
};
|
|
|
|
|
2004-05-25 06:02:05 +02:00
|
|
|
struct WORKREQ_FTPGETFILEW
|
2003-09-25 22:25:22 +02:00
|
|
|
{
|
2004-05-25 06:02:05 +02:00
|
|
|
LPWSTR lpszRemoteFile;
|
|
|
|
LPWSTR lpszNewFile;
|
2003-09-25 22:25:22 +02:00
|
|
|
BOOL fFailIfExists;
|
|
|
|
DWORD dwLocalFlagsAttribute;
|
|
|
|
DWORD dwFlags;
|
2007-08-30 16:21:33 +02:00
|
|
|
DWORD_PTR dwContext;
|
2003-09-25 22:25:22 +02:00
|
|
|
};
|
|
|
|
|
2004-05-25 06:02:05 +02:00
|
|
|
struct WORKREQ_FTPDELETEFILEW
|
2003-09-25 22:25:22 +02:00
|
|
|
{
|
2004-05-25 06:02:05 +02:00
|
|
|
LPWSTR lpszFilename;
|
2003-09-25 22:25:22 +02:00
|
|
|
};
|
|
|
|
|
2004-05-25 06:02:05 +02:00
|
|
|
struct WORKREQ_FTPREMOVEDIRECTORYW
|
2003-09-25 22:25:22 +02:00
|
|
|
{
|
2004-05-25 06:02:05 +02:00
|
|
|
LPWSTR lpszDirectory;
|
2003-09-25 22:25:22 +02:00
|
|
|
};
|
|
|
|
|
2004-05-25 06:02:05 +02:00
|
|
|
struct WORKREQ_FTPRENAMEFILEW
|
2003-09-25 22:25:22 +02:00
|
|
|
{
|
2004-05-25 06:02:05 +02:00
|
|
|
LPWSTR lpszSrcFile;
|
|
|
|
LPWSTR lpszDestFile;
|
2003-09-25 22:25:22 +02:00
|
|
|
};
|
|
|
|
|
2006-10-29 18:53:41 +01:00
|
|
|
struct WORKREQ_FTPFINDNEXTW
|
2003-09-25 22:25:22 +02:00
|
|
|
{
|
2004-05-25 06:02:05 +02:00
|
|
|
LPWIN32_FIND_DATAW lpFindFileData;
|
2003-09-25 22:25:22 +02:00
|
|
|
};
|
|
|
|
|
2004-03-30 06:36:09 +02:00
|
|
|
struct WORKREQ_HTTPSENDREQUESTW
|
2003-09-25 22:25:22 +02:00
|
|
|
{
|
2004-03-30 06:36:09 +02:00
|
|
|
LPWSTR lpszHeader;
|
2003-09-25 22:25:22 +02:00
|
|
|
DWORD dwHeaderLength;
|
|
|
|
LPVOID lpOptional;
|
|
|
|
DWORD dwOptionalLength;
|
2005-11-30 12:31:22 +01:00
|
|
|
DWORD dwContentLength;
|
|
|
|
BOOL bEndRequest;
|
2003-09-25 22:25:22 +02:00
|
|
|
};
|
|
|
|
|
2009-04-08 15:22:44 +02:00
|
|
|
struct WORKREQ_HTTPENDREQUESTW
|
|
|
|
{
|
|
|
|
DWORD dwFlags;
|
|
|
|
DWORD_PTR dwContext;
|
|
|
|
};
|
|
|
|
|
2003-09-25 22:25:22 +02:00
|
|
|
struct WORKREQ_SENDCALLBACK
|
|
|
|
{
|
2007-08-30 16:21:33 +02:00
|
|
|
DWORD_PTR dwContext;
|
2003-09-25 22:25:22 +02:00
|
|
|
DWORD dwInternetStatus;
|
|
|
|
LPVOID lpvStatusInfo;
|
|
|
|
DWORD dwStatusInfoLength;
|
|
|
|
};
|
|
|
|
|
2004-03-30 06:36:09 +02:00
|
|
|
struct WORKREQ_INTERNETOPENURLW
|
2004-02-09 22:45:38 +01:00
|
|
|
{
|
|
|
|
HINTERNET hInternet;
|
2004-03-30 06:36:09 +02:00
|
|
|
LPWSTR lpszUrl;
|
|
|
|
LPWSTR lpszHeaders;
|
2004-02-09 22:45:38 +01:00
|
|
|
DWORD dwHeadersLength;
|
|
|
|
DWORD dwFlags;
|
2007-08-30 16:21:33 +02:00
|
|
|
DWORD_PTR dwContext;
|
2004-02-09 22:45:38 +01:00
|
|
|
};
|
|
|
|
|
2005-11-12 20:10:56 +01:00
|
|
|
struct WORKREQ_INTERNETREADFILEEXA
|
|
|
|
{
|
|
|
|
LPINTERNET_BUFFERSA lpBuffersOut;
|
|
|
|
};
|
|
|
|
|
2009-01-15 16:41:42 +01:00
|
|
|
struct WORKREQ_INTERNETREADFILEEXW
|
|
|
|
{
|
|
|
|
LPINTERNET_BUFFERSW lpBuffersOut;
|
|
|
|
};
|
|
|
|
|
2000-04-11 22:07:00 +02:00
|
|
|
typedef struct WORKREQ
|
|
|
|
{
|
2006-12-25 21:32:52 +01:00
|
|
|
void (*asyncproc)(struct WORKREQ*);
|
2009-07-07 21:46:09 +02:00
|
|
|
object_header_t *hdr;
|
2003-09-25 22:25:22 +02:00
|
|
|
|
|
|
|
union {
|
2004-05-25 06:02:05 +02: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 18:53:41 +01:00
|
|
|
struct WORKREQ_FTPFINDNEXTW FtpFindNextW;
|
2004-03-30 06:36:09 +02:00
|
|
|
struct WORKREQ_HTTPSENDREQUESTW HttpSendRequestW;
|
2009-04-08 15:22:44 +02:00
|
|
|
struct WORKREQ_HTTPENDREQUESTW HttpEndRequestW;
|
2003-09-25 22:25:22 +02:00
|
|
|
struct WORKREQ_SENDCALLBACK SendCallback;
|
2009-01-15 16:41:42 +01:00
|
|
|
struct WORKREQ_INTERNETOPENURLW InternetOpenUrlW;
|
2005-11-12 20:10:56 +01:00
|
|
|
struct WORKREQ_INTERNETREADFILEEXA InternetReadFileExA;
|
2009-01-15 16:41:42 +01:00
|
|
|
struct WORKREQ_INTERNETREADFILEEXW InternetReadFileExW;
|
2003-09-25 22:25:22 +02:00
|
|
|
} u;
|
2000-04-11 22:07:00 +02:00
|
|
|
|
|
|
|
} WORKREQUEST, *LPWORKREQUEST;
|
|
|
|
|
2011-02-02 22:51:13 +01:00
|
|
|
void *alloc_object(object_header_t*,const object_vtbl_t*,size_t);
|
2011-02-02 22:50:31 +01:00
|
|
|
object_header_t *get_handle_object( HINTERNET hinternet );
|
2009-07-07 21:46:09 +02:00
|
|
|
object_header_t *WININET_AddRef( object_header_t *info );
|
|
|
|
BOOL WININET_Release( object_header_t *info );
|
2000-04-11 22:07:00 +02:00
|
|
|
|
2010-05-25 12:19:32 +02:00
|
|
|
DWORD INET_QueryOption( object_header_t *, DWORD, void *, DWORD *, BOOL );
|
2008-07-19 12:29:28 +02:00
|
|
|
|
2004-03-30 06:36:09 +02:00
|
|
|
time_t ConvertTimeString(LPCWSTR asctime);
|
2000-04-11 22:07:00 +02:00
|
|
|
|
2009-07-13 01:45:06 +02:00
|
|
|
HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
|
2004-03-30 06:36:09 +02:00
|
|
|
INTERNET_PORT nServerPort, LPCWSTR lpszUserName,
|
2007-08-30 16:21:33 +02:00
|
|
|
LPCWSTR lpszPassword, DWORD dwFlags, DWORD_PTR dwContext,
|
2004-05-13 07:17:25 +02:00
|
|
|
DWORD dwInternalFlags);
|
2000-04-11 22:07:00 +02:00
|
|
|
|
2009-12-21 13:58:53 +01:00
|
|
|
DWORD HTTP_Connect(appinfo_t*,LPCWSTR,
|
|
|
|
INTERNET_PORT nServerPort, LPCWSTR lpszUserName,
|
|
|
|
LPCWSTR lpszPassword, DWORD dwFlags, DWORD_PTR dwContext,
|
|
|
|
DWORD dwInternalFlags, HINTERNET*);
|
2000-06-11 22:04:44 +02:00
|
|
|
|
2004-03-30 06:36:09 +02:00
|
|
|
BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
|
2009-07-09 19:53:08 +02:00
|
|
|
struct sockaddr *psa, socklen_t *sa_len);
|
2000-04-11 22:07:00 +02:00
|
|
|
|
|
|
|
void INTERNET_SetLastError(DWORD dwError);
|
2004-12-13 22:19:01 +01:00
|
|
|
DWORD INTERNET_GetLastError(void);
|
2009-12-21 13:57:49 +01:00
|
|
|
DWORD INTERNET_AsyncCall(LPWORKREQUEST lpWorkRequest);
|
2004-12-13 22:19:01 +01:00
|
|
|
LPSTR INTERNET_GetResponseBuffer(void);
|
2004-05-25 06:02:05 +02:00
|
|
|
LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen);
|
2000-04-11 22:07:00 +02:00
|
|
|
|
2009-07-07 21:46:09 +02:00
|
|
|
VOID SendAsyncCallback(object_header_t *hdr, DWORD_PTR dwContext,
|
2004-09-20 21:10:31 +02:00
|
|
|
DWORD dwInternetStatus, LPVOID lpvStatusInfo,
|
|
|
|
DWORD dwStatusInfoLength);
|
2002-06-22 01:59:49 +02:00
|
|
|
|
2009-07-07 21:46:09 +02:00
|
|
|
VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext,
|
2005-11-22 12:59:07 +01:00
|
|
|
DWORD dwInternetStatus, LPVOID lpvStatusInfo,
|
|
|
|
DWORD dwStatusInfoLength);
|
2010-03-13 18:36:46 +01:00
|
|
|
BOOL INTERNET_FindProxyForProtocol(LPCWSTR szProxy, LPCWSTR proto, WCHAR *foundProxy, DWORD *foundProxyLen);
|
2002-06-22 01:59:49 +02:00
|
|
|
|
2003-06-21 01:26:56 +02:00
|
|
|
BOOL NETCON_connected(WININET_NETCONNECTION *connection);
|
2009-11-30 20:00:11 +01:00
|
|
|
DWORD NETCON_init(WININET_NETCONNECTION *connnection, BOOL useSSL);
|
2009-10-02 16:43:45 +02:00
|
|
|
void NETCON_unload(void);
|
2009-11-30 00:12:42 +01:00
|
|
|
DWORD NETCON_create(WININET_NETCONNECTION *connection, int domain,
|
2003-06-21 01:26:56 +02:00
|
|
|
int type, int protocol);
|
2009-11-30 00:14:25 +01:00
|
|
|
DWORD NETCON_close(WININET_NETCONNECTION *connection);
|
2009-11-30 00:12:59 +01:00
|
|
|
DWORD NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr,
|
2004-09-16 22:34:27 +02:00
|
|
|
unsigned int addrlen);
|
2009-12-14 00:31:24 +01:00
|
|
|
DWORD NETCON_secure_connect(WININET_NETCONNECTION *connection, LPWSTR hostname);
|
2009-11-30 00:13:21 +01:00
|
|
|
DWORD NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len, int flags,
|
2003-06-21 01:26:56 +02:00
|
|
|
int *sent /* out */);
|
2009-11-30 19:59:40 +01:00
|
|
|
DWORD NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int flags,
|
2003-06-21 01:26:56 +02:00
|
|
|
int *recvd /* out */);
|
2007-05-28 12:16:06 +02:00
|
|
|
BOOL NETCON_query_data_available(WININET_NETCONNECTION *connection, DWORD *available);
|
2006-01-20 20:16:56 +01:00
|
|
|
LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection);
|
2010-09-30 22:18:07 +02:00
|
|
|
int NETCON_GetCipherStrength(WININET_NETCONNECTION *connection);
|
2008-02-26 20:22:02 +01:00
|
|
|
DWORD NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value);
|
2009-11-30 00:13:39 +01:00
|
|
|
int sock_get_error(int);
|
2003-06-21 01:26:56 +02:00
|
|
|
|
2005-06-13 21:05:42 +02:00
|
|
|
extern void URLCacheContainers_CreateDefaults(void);
|
|
|
|
extern void URLCacheContainers_DeleteAll(void);
|
|
|
|
|
2000-04-11 22:07:00 +02:00
|
|
|
#define MAX_REPLY_LEN 0x5B4
|
|
|
|
|
2004-02-09 23:01:49 +01: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 22:07:00 +02:00
|
|
|
|
|
|
|
#endif /* _WINE_INTERNET_H_ */
|