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_
|
|
|
|
|
2018-02-06 01:07:21 +01:00
|
|
|
#include "wine/heap.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>
|
2004-09-03 20:57:19 +02:00
|
|
|
|
2012-06-11 10:22:38 +02:00
|
|
|
#include "winineti.h"
|
|
|
|
|
2011-05-25 19:09:51 +02:00
|
|
|
extern HMODULE WININET_hModule DECLSPEC_HIDDEN;
|
2010-12-19 21:34:27 +01:00
|
|
|
|
2011-05-10 11:26:43 +02:00
|
|
|
typedef struct {
|
|
|
|
WCHAR *name;
|
|
|
|
INTERNET_PORT port;
|
2012-11-19 11:46:50 +01:00
|
|
|
BOOL is_https;
|
2011-05-10 11:26:43 +02:00
|
|
|
struct sockaddr_storage addr;
|
2015-02-16 11:17:08 +01:00
|
|
|
int addr_len;
|
2011-05-10 11:26:43 +02:00
|
|
|
char addr_str[INET6_ADDRSTRLEN];
|
|
|
|
|
2012-11-19 11:47:19 +01:00
|
|
|
WCHAR *scheme_host_port;
|
|
|
|
const WCHAR *host_port;
|
|
|
|
const WCHAR *canon_host_port;
|
|
|
|
|
2011-05-10 11:26:43 +02:00
|
|
|
LONG ref;
|
|
|
|
|
2012-05-25 16:34:43 +02:00
|
|
|
DWORD security_flags;
|
2012-06-11 10:22:38 +02:00
|
|
|
const CERT_CHAIN_CONTEXT *cert_chain;
|
2012-05-25 16:34:43 +02:00
|
|
|
|
2011-05-10 11:26:43 +02:00
|
|
|
struct list entry;
|
|
|
|
struct list conn_pool;
|
|
|
|
} server_t;
|
|
|
|
|
2011-05-25 19:09:51 +02:00
|
|
|
void server_addref(server_t*) DECLSPEC_HIDDEN;
|
|
|
|
void server_release(server_t*) DECLSPEC_HIDDEN;
|
2012-05-25 16:35:48 +02:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
COLLECT_TIMEOUT,
|
|
|
|
COLLECT_CONNECTIONS,
|
|
|
|
COLLECT_CLEANUP
|
|
|
|
} collect_type_t;
|
|
|
|
BOOL collect_connections(collect_type_t) DECLSPEC_HIDDEN;
|
2011-05-10 11:26:43 +02:00
|
|
|
|
2003-06-21 01:26:56 +02:00
|
|
|
/* used for netconnection.c stuff */
|
|
|
|
typedef struct
|
|
|
|
{
|
2013-03-01 11:16:17 +01:00
|
|
|
int socket;
|
2013-03-01 11:15:53 +01:00
|
|
|
BOOL secure;
|
2015-06-19 15:21:46 +02:00
|
|
|
BOOL is_blocking;
|
2013-04-03 14:03:13 +02:00
|
|
|
CtxtHandle ssl_ctx;
|
|
|
|
SecPkgContext_StreamSizes ssl_sizes;
|
2011-05-10 11:26:43 +02:00
|
|
|
server_t *server;
|
2013-04-03 14:03:13 +02:00
|
|
|
char *ssl_buf;
|
|
|
|
char *extra_buf;
|
|
|
|
size_t extra_len;
|
2013-04-03 14:03:52 +02:00
|
|
|
char *peek_msg;
|
|
|
|
char *peek_msg_mem;
|
|
|
|
size_t peek_len;
|
2010-09-29 01:46:41 +02:00
|
|
|
DWORD security_flags;
|
2012-05-25 16:51:20 +02:00
|
|
|
BOOL mask_errors;
|
2011-05-10 11:26:43 +02:00
|
|
|
|
|
|
|
BOOL keep_alive;
|
|
|
|
DWORD64 keep_until;
|
|
|
|
struct list pool_entry;
|
2011-04-28 18:29:04 +02:00
|
|
|
} netconn_t;
|
2001-02-15 22:24:07 +01:00
|
|
|
|
2013-12-11 10:48:41 +01:00
|
|
|
BOOL is_valid_netconn(netconn_t *) DECLSPEC_HIDDEN;
|
|
|
|
void close_netconn(netconn_t *) DECLSPEC_HIDDEN;
|
|
|
|
|
2011-02-02 22:50:31 +01:00
|
|
|
static inline void * __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t len)
|
|
|
|
{
|
|
|
|
return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len);
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
|
2019-11-25 13:30:14 +01:00
|
|
|
size = (lstrlenW(str)+1)*sizeof(WCHAR);
|
2011-04-21 13:39:03 +02:00
|
|
|
ret = heap_alloc(size);
|
2009-07-17 01:10:41 +02:00
|
|
|
if(ret)
|
|
|
|
memcpy(ret, str, size);
|
|
|
|
}
|
|
|
|
|
2004-03-30 06:36:09 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-04-01 13:12:13 +02:00
|
|
|
static inline char *heap_strdupA(const char *str)
|
|
|
|
{
|
|
|
|
char *ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
DWORD size = strlen(str)+1;
|
|
|
|
|
|
|
|
ret = heap_alloc(size);
|
|
|
|
if(ret)
|
|
|
|
memcpy(ret, str, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2011-04-21 13:39:03 +02:00
|
|
|
ret = heap_alloc(sizeof(WCHAR)*(len+1));
|
2010-07-17 14:08:44 +02:00
|
|
|
if(ret) {
|
|
|
|
memcpy(ret, str, sizeof(WCHAR)*len);
|
|
|
|
ret[len] = '\0';
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-04-27 14:18:12 +02:00
|
|
|
static inline WCHAR *heap_strndupAtoW(const char *str, int len_a, DWORD *len_w)
|
|
|
|
{
|
|
|
|
WCHAR *ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
size_t len;
|
|
|
|
if(len_a < 0) len_a = strlen(str);
|
|
|
|
len = MultiByteToWideChar(CP_ACP, 0, str, len_a, NULL, 0);
|
|
|
|
ret = heap_alloc((len+1)*sizeof(WCHAR));
|
|
|
|
if(ret) {
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, str, len_a, ret, len);
|
|
|
|
ret[len] = 0;
|
|
|
|
*len_w = len;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
2011-04-21 13:39:03 +02:00
|
|
|
ret = heap_alloc(len*sizeof(WCHAR));
|
2009-07-17 01:11:24 +02:00
|
|
|
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);
|
2011-04-21 13:39:03 +02:00
|
|
|
ret = heap_alloc(size);
|
2009-07-17 01:12:04 +02:00
|
|
|
if(ret)
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
2004-05-25 06:02:05 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-05-16 22:42:25 +02:00
|
|
|
typedef struct {
|
|
|
|
const WCHAR *str;
|
|
|
|
size_t len;
|
|
|
|
} substr_t;
|
|
|
|
|
|
|
|
static inline substr_t substr(const WCHAR *str, size_t len)
|
|
|
|
{
|
|
|
|
substr_t r = {str, len};
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline substr_t substrz(const WCHAR *str)
|
|
|
|
{
|
2019-11-25 13:30:14 +01:00
|
|
|
return substr(str, lstrlenW(str));
|
2016-05-16 22:42:25 +02:00
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2013-10-04 16:52:43 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
LONG ref;
|
2013-10-04 16:53:22 +02:00
|
|
|
HANDLE file_handle;
|
2013-10-04 16:52:43 +02:00
|
|
|
WCHAR *file_name;
|
2016-05-17 19:14:38 +02:00
|
|
|
WCHAR *url;
|
2013-10-04 16:52:43 +02:00
|
|
|
BOOL is_committed;
|
|
|
|
} req_file_t;
|
|
|
|
|
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);
|
2017-03-09 18:20:14 +01:00
|
|
|
DWORD (*ReadFile)(object_header_t*,void*,DWORD,DWORD*,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*);
|
2013-10-04 16:52:58 +02:00
|
|
|
DWORD (*LockRequestFile)(object_header_t*,req_file_t**);
|
2009-07-07 21:46:09 +02:00
|
|
|
} 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;
|
2019-06-25 06:27:55 +02:00
|
|
|
BOOL decoding;
|
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;
|
2012-05-14 13:49:29 +02:00
|
|
|
DWORD connect_timeout;
|
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 userName;
|
|
|
|
LPWSTR password;
|
|
|
|
INTERNET_PORT hostPort; /* the final destination port of the request */
|
2012-01-13 15:15:04 +01:00
|
|
|
DWORD connect_timeout;
|
2012-01-13 15:15:48 +01:00
|
|
|
DWORD send_timeout;
|
|
|
|
DWORD receive_timeout;
|
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;
|
|
|
|
|
2011-04-02 15:20:33 +02:00
|
|
|
typedef struct data_stream_vtbl_t data_stream_vtbl_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const data_stream_vtbl_t *vtbl;
|
|
|
|
} data_stream_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
data_stream_t data_stream;
|
2019-09-07 06:57:48 +02:00
|
|
|
ULONGLONG content_length;
|
|
|
|
ULONGLONG content_read;
|
2011-04-02 15:20:33 +02:00
|
|
|
} netconn_stream_t;
|
|
|
|
|
|
|
|
#define READ_BUFFER_SIZE 8192
|
2009-05-29 23:35:13 +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:18:22 +01:00
|
|
|
http_session_t *session;
|
2012-05-25 16:34:24 +02:00
|
|
|
server_t *server;
|
2012-11-16 14:38:56 +01:00
|
|
|
server_t *proxy;
|
2011-03-01 20:18:22 +01:00
|
|
|
LPWSTR path;
|
|
|
|
LPWSTR verb;
|
2011-05-10 11:26:43 +02:00
|
|
|
netconn_t *netconn;
|
|
|
|
DWORD security_flags;
|
2012-01-13 15:15:04 +01:00
|
|
|
DWORD connect_timeout;
|
2012-01-13 15:15:48 +01:00
|
|
|
DWORD send_timeout;
|
|
|
|
DWORD receive_timeout;
|
2011-03-01 20:18:22 +01:00
|
|
|
LPWSTR version;
|
2012-05-03 12:19:47 +02:00
|
|
|
DWORD status_code;
|
2011-03-01 20:18:22 +01:00
|
|
|
LPWSTR statusText;
|
|
|
|
DWORD bytesToWrite;
|
|
|
|
DWORD bytesWritten;
|
2014-09-25 14:21:37 +02:00
|
|
|
|
|
|
|
CRITICAL_SECTION headers_section; /* section to protect the headers array */
|
2011-03-01 20:18:22 +01:00
|
|
|
HTTPHEADERW *custHeaders;
|
2004-08-09 20:54:23 +02:00
|
|
|
DWORD nCustHeaders;
|
2014-09-25 14:21:37 +02:00
|
|
|
|
2011-03-04 20:43:54 +01:00
|
|
|
FILETIME last_modified;
|
2008-02-13 13:32:49 +01:00
|
|
|
HANDLE hCacheFile;
|
2013-10-04 16:52:43 +02:00
|
|
|
req_file_t *req_file;
|
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 */
|
2019-09-07 06:57:48 +02:00
|
|
|
ULONGLONG contentLength; /* total number of bytes to be read */
|
2011-04-02 15:20:33 +02:00
|
|
|
BOOL read_gzip; /* are we reading in gzip 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 */
|
2011-04-02 15:20:33 +02:00
|
|
|
BYTE read_buf[READ_BUFFER_SIZE]; /* buffer for already read but not returned data */
|
2009-05-29 23:35:13 +02:00
|
|
|
|
2011-04-02 15:20:33 +02:00
|
|
|
data_stream_t *data_stream;
|
|
|
|
netconn_stream_t netconn_stream;
|
2009-07-13 01:41:50 +02:00
|
|
|
} http_request_t;
|
2000-04-11 22:07:00 +02:00
|
|
|
|
2013-01-30 11:39:34 +01:00
|
|
|
typedef struct task_header_t task_header_t;
|
2013-01-28 11:23:03 +01:00
|
|
|
typedef void (*async_task_proc_t)(task_header_t*);
|
|
|
|
|
2013-01-30 11:39:34 +01:00
|
|
|
struct task_header_t
|
2000-04-11 22:07:00 +02:00
|
|
|
{
|
2013-01-28 11:23:03 +01:00
|
|
|
async_task_proc_t proc;
|
2009-07-07 21:46:09 +02:00
|
|
|
object_header_t *hdr;
|
2013-01-30 11:39:34 +01:00
|
|
|
};
|
2000-04-11 22:07:00 +02:00
|
|
|
|
2013-01-28 11:23:03 +01:00
|
|
|
void *alloc_async_task(object_header_t*,async_task_proc_t,size_t) DECLSPEC_HIDDEN;
|
|
|
|
|
2011-04-21 11:09:16 +02:00
|
|
|
void *alloc_object(object_header_t*,const object_vtbl_t*,size_t) DECLSPEC_HIDDEN;
|
|
|
|
object_header_t *get_handle_object( HINTERNET hinternet ) DECLSPEC_HIDDEN;
|
|
|
|
object_header_t *WININET_AddRef( object_header_t *info ) DECLSPEC_HIDDEN;
|
|
|
|
BOOL WININET_Release( object_header_t *info ) DECLSPEC_HIDDEN;
|
2000-04-11 22:07:00 +02:00
|
|
|
|
2012-03-08 12:19:14 +01:00
|
|
|
DWORD INET_QueryOption(object_header_t*,DWORD,void*,DWORD*,BOOL) DECLSPEC_HIDDEN;
|
|
|
|
DWORD INET_SetOption(object_header_t*,DWORD,void*,DWORD) DECLSPEC_HIDDEN;
|
2008-07-19 12:29:28 +02:00
|
|
|
|
2011-04-21 11:09:16 +02:00
|
|
|
time_t ConvertTimeString(LPCWSTR asctime) DECLSPEC_HIDDEN;
|
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,
|
2011-04-21 11:09:16 +02:00
|
|
|
DWORD dwInternalFlags) DECLSPEC_HIDDEN;
|
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,
|
2011-04-21 11:09:16 +02:00
|
|
|
DWORD dwInternalFlags, HINTERNET*) DECLSPEC_HIDDEN;
|
2000-06-11 22:04:44 +02:00
|
|
|
|
2015-02-16 11:16:53 +01:00
|
|
|
BOOL GetAddress(const WCHAR*,INTERNET_PORT,SOCKADDR*,int*,char*) DECLSPEC_HIDDEN;
|
2000-04-11 22:07:00 +02:00
|
|
|
|
2014-07-15 17:13:03 +02:00
|
|
|
DWORD get_cookie_header(const WCHAR*,const WCHAR*,WCHAR**) DECLSPEC_HIDDEN;
|
2016-05-16 22:45:41 +02:00
|
|
|
DWORD set_cookie(substr_t,substr_t,substr_t,substr_t,DWORD) DECLSPEC_HIDDEN;
|
2011-05-19 16:11:30 +02:00
|
|
|
|
2011-04-21 11:09:16 +02:00
|
|
|
void INTERNET_SetLastError(DWORD dwError) DECLSPEC_HIDDEN;
|
|
|
|
DWORD INTERNET_GetLastError(void) DECLSPEC_HIDDEN;
|
2013-01-30 11:39:34 +01:00
|
|
|
DWORD INTERNET_AsyncCall(task_header_t*) DECLSPEC_HIDDEN;
|
2011-04-21 11:09:16 +02:00
|
|
|
LPSTR INTERNET_GetResponseBuffer(void) DECLSPEC_HIDDEN;
|
2000-04-11 22:07:00 +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,
|
2011-04-21 11:09:16 +02:00
|
|
|
DWORD dwStatusInfoLength) DECLSPEC_HIDDEN;
|
2016-05-17 19:19:59 +02:00
|
|
|
WCHAR *INTERNET_FindProxyForProtocol(LPCWSTR szProxy, LPCWSTR proto) DECLSPEC_HIDDEN;
|
2002-06-22 01:59:49 +02:00
|
|
|
|
2018-09-05 05:36:38 +02:00
|
|
|
DWORD create_netconn(server_t*,DWORD,BOOL,DWORD,netconn_t**) DECLSPEC_HIDDEN;
|
2011-05-10 11:26:43 +02:00
|
|
|
void free_netconn(netconn_t*) DECLSPEC_HIDDEN;
|
2011-04-21 11:09:16 +02:00
|
|
|
void NETCON_unload(void) DECLSPEC_HIDDEN;
|
2012-11-16 14:39:16 +01:00
|
|
|
DWORD NETCON_secure_connect(netconn_t*,server_t*) DECLSPEC_HIDDEN;
|
2011-04-28 18:29:04 +02:00
|
|
|
DWORD NETCON_send(netconn_t *connection, const void *msg, size_t len, int flags,
|
2011-04-21 11:09:16 +02:00
|
|
|
int *sent /* out */) DECLSPEC_HIDDEN;
|
2015-06-18 13:28:24 +02:00
|
|
|
DWORD NETCON_recv(netconn_t*,void*,size_t,BOOL,int*) DECLSPEC_HIDDEN;
|
2011-05-10 11:26:43 +02:00
|
|
|
BOOL NETCON_is_alive(netconn_t*) DECLSPEC_HIDDEN;
|
2011-04-28 18:29:04 +02:00
|
|
|
LPCVOID NETCON_GetCert(netconn_t *connection) DECLSPEC_HIDDEN;
|
|
|
|
int NETCON_GetCipherStrength(netconn_t*) DECLSPEC_HIDDEN;
|
2012-01-13 15:15:48 +01:00
|
|
|
DWORD NETCON_set_timeout(netconn_t *connection, BOOL send, DWORD value) DECLSPEC_HIDDEN;
|
2014-05-30 02:20:14 +02:00
|
|
|
int sock_send(int fd, const void *msg, size_t len, int flags) DECLSPEC_HIDDEN;
|
2014-06-12 07:24:45 +02:00
|
|
|
int sock_recv(int fd, void *msg, size_t len, int flags) DECLSPEC_HIDDEN;
|
2011-04-21 11:09:16 +02:00
|
|
|
|
2016-05-17 19:18:32 +02:00
|
|
|
server_t *get_server(substr_t,INTERNET_PORT,BOOL,BOOL) DECLSPEC_HIDDEN;
|
2012-06-11 10:22:38 +02:00
|
|
|
|
2013-10-04 16:52:43 +02:00
|
|
|
DWORD create_req_file(const WCHAR*,req_file_t**) DECLSPEC_HIDDEN;
|
|
|
|
void req_file_release(req_file_t*) DECLSPEC_HIDDEN;
|
|
|
|
|
|
|
|
static inline req_file_t *req_file_addref(req_file_t *req_file)
|
|
|
|
{
|
|
|
|
InterlockedIncrement(&req_file->ref);
|
|
|
|
return req_file;
|
|
|
|
}
|
|
|
|
|
2012-09-21 14:53:33 +02:00
|
|
|
BOOL init_urlcache(void) DECLSPEC_HIDDEN;
|
|
|
|
void free_urlcache(void) DECLSPEC_HIDDEN;
|
2012-10-01 14:23:10 +02:00
|
|
|
void free_cookie(void) DECLSPEC_HIDDEN;
|
2019-09-19 02:47:44 +02:00
|
|
|
void free_authorization_cache(void) DECLSPEC_HIDDEN;
|
2005-06-13 21:05:42 +02:00
|
|
|
|
2015-02-12 12:05:23 +01:00
|
|
|
void init_winsock(void) DECLSPEC_HIDDEN;
|
|
|
|
|
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
|
|
|
|
2012-05-25 16:51:20 +02:00
|
|
|
/* Undocumented security flags */
|
2012-06-01 16:41:44 +02:00
|
|
|
#define _SECURITY_FLAG_CERT_REV_FAILED 0x00800000
|
2012-06-07 15:40:31 +02:00
|
|
|
#define _SECURITY_FLAG_CERT_INVALID_CA 0x01000000
|
2012-06-01 16:41:44 +02:00
|
|
|
#define _SECURITY_FLAG_CERT_INVALID_CN 0x02000000
|
|
|
|
#define _SECURITY_FLAG_CERT_INVALID_DATE 0x04000000
|
2012-05-25 16:51:20 +02:00
|
|
|
|
|
|
|
#define _SECURITY_ERROR_FLAGS_MASK \
|
2012-05-28 13:55:00 +02:00
|
|
|
(_SECURITY_FLAG_CERT_REV_FAILED \
|
2012-06-07 15:40:31 +02:00
|
|
|
|_SECURITY_FLAG_CERT_INVALID_CA \
|
2012-06-01 16:41:44 +02:00
|
|
|
|_SECURITY_FLAG_CERT_INVALID_CN \
|
|
|
|
|_SECURITY_FLAG_CERT_INVALID_DATE)
|
2012-05-25 16:51:20 +02:00
|
|
|
|
2000-04-11 22:07:00 +02:00
|
|
|
#endif /* _WINE_INTERNET_H_ */
|