ReactOS 0.4.17-dev-1190-g4c812f4
internet.c File Reference
#include "winsock2.h"
#include "ws2ipdef.h"
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <assert.h>
#include <wchar.h>
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winuser.h"
#include "wininet.h"
#include "winnls.h"
#include "wine/debug.h"
#include "winerror.h"
#include "shlwapi.h"
#include "ws2tcpip.h"
#include "winternl.h"
#include "iphlpapi.h"
#include "dhcpcsdk.h"
#include "internet.h"
#include "resource.h"
Include dependency graph for internet.c:

Go to the source code of this file.

Classes

struct  WITHREADERROR
 
struct  proxyinfo_t
 
struct  connection_settings
 
struct  open_url_task_t
 

Macros

#define NO_SHLWAPI_STREAM
 
#define CONNECTION_SETTINGS_VERSION   0x46
 
#define FE(x)   { x, #x }
 
#define FE(x)   { x, #x }
 
#define MAX_WORD_DIGITS   5
 
#define URL_GET_COMP_LENGTH(url, component)
 
#define URL_GET_COMP_LENGTHA(url, component)
 

Typedefs

typedef struct WITHREADERROR * LPWITHREADERROR
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wininet)
 
static WCHAR * get_proxy_autoconfig_url (void)
 
void * alloc_object (object_header_t *parent, const object_vtbl_t *vtbl, size_t size)
 
object_header_t * WININET_AddRef (object_header_t *info)
 
object_header_t * get_handle_object (HINTERNET hinternet)
 
static void invalidate_handle (object_header_t *info)
 
BOOL WININET_Release (object_header_t *info)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
HRESULT WINAPI DllInstall (BOOL bInstall, LPCWSTR cmdline)
 
static void connection_settings_write (connection_settings *settings, DWORD *pos, DWORD size, const WCHAR *str)
 
static LONG save_connection_settings (HKEY key, const WCHAR *connection, proxyinfo_t *lpwpi)
 
static LONG INTERNET_SaveProxySettings (proxyinfo_t *lpwpi)
 
WCHAR * INTERNET_FindProxyForProtocol (LPCWSTR szProxy, LPCWSTR proto)
 
BOOL WINAPI InternetInitializeAutoProxyDll (DWORD dwReserved)
 
BOOL WINAPI DetectAutoProxyUrl (LPSTR lpszAutoProxyUrl, DWORD dwAutoProxyUrlLength, DWORD dwDetectFlags)
 
static void FreeProxyInfo (proxyinfo_t *lpwpi)
 
static void free_global_proxy (void)
 
static BOOL parse_proxy_url (proxyinfo_t *info, const WCHAR *url)
 
static WCHAR * get_http_proxy (const WCHAR *proxy)
 
static LONG connection_settings_read (const connection_settings *settings, DWORD *pos, DWORD size, WCHAR **str)
 
static LONG load_connection_settings (HKEY key, const WCHAR *connection, proxyinfo_t *lpwpi)
 
static LONG INTERNET_LoadProxySettings (proxyinfo_t *lpwpi)
 
static void init_global_proxy (void)
 
static LONG INTERNET_GetProxySettings (proxyinfo_t *lpwpi)
 
static BOOL INTERNET_ConfigureProxy (appinfo_t *lpwai)
 
static void dump_INTERNET_FLAGS (DWORD dwFlags)
 
static VOID APPINFO_Destroy (object_header_t *hdr)
 
static WCHAR * copy_optionW (WCHAR *value)
 
static char * copy_optionA (WCHAR *value)
 
static DWORD APPINFO_QueryOption (object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
 
static DWORD APPINFO_SetOption (object_header_t *hdr, DWORD option, void *buf, DWORD size)
 
HINTERNET WINAPI InternetOpenW (LPCWSTR lpszAgent, DWORD dwAccessType, LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
 
HINTERNET WINAPI InternetOpenA (LPCSTR lpszAgent, DWORD dwAccessType, LPCSTR lpszProxy, LPCSTR lpszProxyBypass, DWORD dwFlags)
 
BOOL WINAPI InternetGetLastResponseInfoA (LPDWORD lpdwError, LPSTR lpszBuffer, LPDWORD lpdwBufferLength)
 
BOOL WINAPI InternetGetLastResponseInfoW (LPDWORD lpdwError, LPWSTR lpszBuffer, LPDWORD lpdwBufferLength)
 
BOOL WINAPI InternetGetConnectedState (LPDWORD lpdwStatus, DWORD dwReserved)
 
BOOL WINAPI InternetGetConnectedStateExW (LPDWORD lpdwStatus, LPWSTR lpszConnectionName, DWORD dwNameLen, DWORD dwReserved)
 
BOOL WINAPI InternetGetConnectedStateExA (LPDWORD lpdwStatus, LPSTR lpszConnectionName, DWORD dwNameLen, DWORD dwReserved)
 
HINTERNET WINAPI InternetConnectW (HINTERNET hInternet, LPCWSTR lpszServerName, INTERNET_PORT nServerPort, LPCWSTR lpszUserName, LPCWSTR lpszPassword, DWORD dwService, DWORD dwFlags, DWORD_PTR dwContext)
 
HINTERNET WINAPI InternetConnectA (HINTERNET hInternet, LPCSTR lpszServerName, INTERNET_PORT nServerPort, LPCSTR lpszUserName, LPCSTR lpszPassword, DWORD dwService, DWORD dwFlags, DWORD_PTR dwContext)
 
BOOL WINAPI InternetFindNextFileA (HINTERNET hFind, LPVOID lpvFindData)
 
BOOL WINAPI InternetFindNextFileW (HINTERNET hFind, LPVOID lpvFindData)
 
BOOL WINAPI InternetCloseHandle (HINTERNET hInternet)
 
static BOOL set_url_component (WCHAR **component, DWORD *component_length, const WCHAR *value, DWORD len)
 
static BOOL set_url_component_WtoA (const WCHAR *comp_w, DWORD length, const WCHAR *url_w, char **comp, DWORD *ret_length, const char *url_a)
 
static BOOL set_url_component_AtoW (const char *comp_a, DWORD len_a, WCHAR **comp_w, DWORD *len_w, WCHAR **buf)
 
BOOL WINAPI InternetCrackUrlA (const char *url, DWORD url_length, DWORD flags, URL_COMPONENTSA *ret_comp)
 
static INTERNET_SCHEME GetInternetSchemeW (LPCWSTR lpszScheme, DWORD nMaxCmp)
 
BOOL WINAPI InternetCrackUrlW (const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwFlags, URL_COMPONENTSW *lpUC)
 
DWORD WINAPI InternetAttemptConnect (DWORD dwReserved)
 
static DWORD convert_url_canonicalization_flags (DWORD dwFlags)
 
BOOL WINAPI InternetCanonicalizeUrlA (LPCSTR lpszUrl, LPSTR lpszBuffer, LPDWORD lpdwBufferLength, DWORD dwFlags)
 
BOOL WINAPI InternetCanonicalizeUrlW (LPCWSTR lpszUrl, LPWSTR lpszBuffer, LPDWORD lpdwBufferLength, DWORD dwFlags)
 
static INTERNET_STATUS_CALLBACK set_status_callback (object_header_t *lpwh, INTERNET_STATUS_CALLBACK callback, BOOL unicode)
 
INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackA (HINTERNET hInternet, INTERNET_STATUS_CALLBACK lpfnIntCB)
 
INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackW (HINTERNET hInternet, INTERNET_STATUS_CALLBACK lpfnIntCB)
 
DWORD WINAPI InternetSetFilePointer (HINTERNET hFile, LONG lDistanceToMove, PVOID pReserved, DWORD dwMoveContext, DWORD_PTR dwContext)
 
BOOL WINAPI InternetWriteFile (HINTERNET hFile, LPCVOID lpBuffer, DWORD dwNumOfBytesToWrite, LPDWORD lpdwNumOfBytesWritten)
 
BOOL WINAPI InternetReadFile (HINTERNET hFile, LPVOID lpBuffer, DWORD dwNumOfBytesToRead, LPDWORD pdwNumOfBytesRead)
 
BOOL WINAPI InternetReadFileExA (HINTERNET hFile, LPINTERNET_BUFFERSA lpBuffersOut, DWORD dwFlags, DWORD_PTR dwContext)
 
BOOL WINAPI InternetReadFileExW (HINTERNET hFile, LPINTERNET_BUFFERSW lpBuffer, DWORD dwFlags, DWORD_PTR dwContext)
 
static IP_ADAPTER_ADDRESSES * get_adapters (void)
 
static WCHAR * detect_proxy_autoconfig_url_dhcp (void)
 
static char * get_computer_name (COMPUTER_NAME_FORMAT format)
 
static BOOL is_domain_suffix (const char *domain, const char *suffix)
 
static int reverse_lookup (const struct addrinfo *ai, char *hostname, size_t len)
 
static WCHAR * build_wpad_url (const char *hostname, const struct addrinfo *ai)
 
static WCHAR * detect_proxy_autoconfig_url_dns (void)
 
static DWORD query_global_option (DWORD option, void *buffer, DWORD *size, BOOL unicode)
 
DWORD INET_QueryOption (object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
 
BOOL WINAPI InternetQueryOptionW (HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength)
 
BOOL WINAPI InternetQueryOptionA (HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength)
 
DWORD INET_SetOption (object_header_t *hdr, DWORD option, void *buf, DWORD size)
 
static DWORD set_global_option (DWORD option, void *buf, DWORD size)
 
BOOL WINAPI InternetSetOptionW (HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength)
 
BOOL WINAPI InternetSetOptionA (HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength)
 
BOOL WINAPI InternetSetOptionExA (HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength, DWORD dwFlags)
 
BOOL WINAPI InternetSetOptionExW (HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength, DWORD dwFlags)
 
static BOOL is_time_digit (const WCHAR c)
 
BOOL WINAPI InternetTimeFromSystemTimeA (const SYSTEMTIME *time, DWORD format, LPSTR string, DWORD size)
 
BOOL WINAPI InternetTimeFromSystemTimeW (const SYSTEMTIME *time, DWORD format, LPWSTR string, DWORD size)
 
BOOL WINAPI InternetTimeToSystemTimeA (LPCSTR string, SYSTEMTIME *time, DWORD reserved)
 
BOOL WINAPI InternetTimeToSystemTimeW (LPCWSTR string, SYSTEMTIME *time, DWORD reserved)
 
BOOL WINAPI InternetCheckConnectionW (LPCWSTR lpszUrl, DWORD dwFlags, DWORD dwReserved)
 
BOOL WINAPI InternetCheckConnectionA (LPCSTR lpszUrl, DWORD dwFlags, DWORD dwReserved)
 
static HINTERNET INTERNET_InternetOpenUrlW (appinfo_t *hIC, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
 
static void AsyncInternetOpenUrlProc (task_header_t *hdr)
 
HINTERNET WINAPI InternetOpenUrlW (HINTERNET hInternet, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
 
HINTERNET WINAPI InternetOpenUrlA (HINTERNET hInternet, LPCSTR lpszUrl, LPCSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
 
static LPWITHREADERROR INTERNET_AllocThreadError (void)
 
void INTERNET_SetLastError (DWORD dwError)
 
DWORD INTERNET_GetLastError (void)
 
static DWORD CALLBACK INTERNET_WorkerThreadFunc (LPVOID lpvParam)
 
void * alloc_async_task (object_header_t *hdr, async_task_proc_t proc, size_t size)
 
DWORD INTERNET_AsyncCall (task_header_t *task)
 
LPSTR INTERNET_GetResponseBuffer (void)
 
BOOL WINAPI InternetQueryDataAvailable (HINTERNET hFile, LPDWORD lpdwNumberOfBytesAvailable, DWORD dwFlags, DWORD_PTR dwContext)
 
DWORD create_req_file (const WCHAR *file_name, req_file_t **ret)
 
void req_file_release (req_file_t *req_file)
 
BOOL WINAPI InternetLockRequestFile (HINTERNET hInternet, HANDLE *lphLockReqHandle)
 
BOOL WINAPI InternetUnlockRequestFile (HANDLE hLockHandle)
 
BOOL WINAPI InternetAutodial (DWORD dwFlags, HWND hwndParent)
 
BOOL WINAPI InternetAutodialHangup (DWORD dwReserved)
 
BOOL WINAPI InternetCombineUrlA (LPCSTR lpszBaseUrl, LPCSTR lpszRelativeUrl, LPSTR lpszBuffer, LPDWORD lpdwBufferLength, DWORD dwFlags)
 
BOOL WINAPI InternetCombineUrlW (LPCWSTR lpszBaseUrl, LPCWSTR lpszRelativeUrl, LPWSTR lpszBuffer, LPDWORD lpdwBufferLength, DWORD dwFlags)
 
static BOOL url_uses_default_port (INTERNET_SCHEME nScheme, INTERNET_PORT nPort)
 
static BOOL scheme_is_opaque (INTERNET_SCHEME nScheme)
 
static LPCWSTR INTERNET_GetSchemeString (INTERNET_SCHEME scheme)
 
static BOOL calc_url_length (LPURL_COMPONENTSW lpUrlComponents, LPDWORD lpdwUrlLength)
 
static void convert_urlcomp_atow (LPURL_COMPONENTSA lpUrlComponents, LPURL_COMPONENTSW urlCompW)
 
BOOL WINAPI InternetCreateUrlA (LPURL_COMPONENTSA lpUrlComponents, DWORD dwFlags, LPSTR lpszUrl, LPDWORD lpdwUrlLength)
 
BOOL WINAPI InternetCreateUrlW (LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags, LPWSTR lpszUrl, LPDWORD lpdwUrlLength)
 
DWORD WINAPI InternetConfirmZoneCrossingA (HWND hWnd, LPSTR szUrlPrev, LPSTR szUrlNew, BOOL bPost)
 
DWORD WINAPI InternetConfirmZoneCrossingW (HWND hWnd, LPWSTR szUrlPrev, LPWSTR szUrlNew, BOOL bPost)
 
DWORD WINAPI PrivacySetZonePreferenceW (DWORD zone, DWORD type, DWORD template, LPCWSTR preference)
 
DWORD WINAPI PrivacyGetZonePreferenceW (DWORD zone, DWORD type, LPDWORD template, LPWSTR preference, LPDWORD length)
 
BOOL WINAPI InternetGetSecurityInfoByURLA (LPSTR lpszURL, PCCERT_CHAIN_CONTEXT *ppCertChain, DWORD *pdwSecureFlags)
 
BOOL WINAPI InternetGetSecurityInfoByURLW (LPCWSTR lpszURL, PCCERT_CHAIN_CONTEXT *ppCertChain, DWORD *pdwSecureFlags)
 
DWORD WINAPI InternetDialA (HWND hwndParent, LPSTR lpszConnectoid, DWORD dwFlags, DWORD_PTR *lpdwConnection, DWORD dwReserved)
 
DWORD WINAPI InternetDialW (HWND hwndParent, LPWSTR lpszConnectoid, DWORD dwFlags, DWORD_PTR *lpdwConnection, DWORD dwReserved)
 
BOOL WINAPI InternetGoOnlineA (LPSTR lpszURL, HWND hwndParent, DWORD dwReserved)
 
BOOL WINAPI InternetGoOnlineW (LPWSTR lpszURL, HWND hwndParent, DWORD dwReserved)
 
DWORD WINAPI InternetHangUp (DWORD_PTR dwConnection, DWORD dwReserved)
 
BOOL WINAPI CreateMD5SSOHash (PWSTR pszChallengeInfo, PWSTR pwszRealm, PWSTR pwszTarget, PBYTE pbHexHash)
 
BOOL WINAPI ResumeSuspendedDownload (HINTERNET hInternet, DWORD dwError)
 
BOOL WINAPI InternetQueryFortezzaStatus (DWORD *a, DWORD_PTR b)
 
DWORD WINAPI ShowClientAuthCerts (HWND parent)
 

Variables

static DWORD g_dwTlsErrIndex = TLS_OUT_OF_INDEXES
 
HMODULE WININET_hModule
 
static CRITICAL_SECTION WININET_cs = { &WININET_cs_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG WININET_cs_debug
 
static object_header_t ** handle_table
 
static UINT_PTR next_handle
 
static UINT_PTR handle_table_size
 
static ULONG max_conns = 2
 
static ULONG max_1_0_conns = 4
 
static ULONG connect_timeout = 60000
 
static ULONG send_timeout = 60000
 
static ULONG receive_timeout = 60000
 
static ULONG data_send_timeout = 60000
 
static ULONG data_receive_timeout = 60000
 
static const WCHAR szInternetSettings []
 
static proxyinfo_t global_proxy
 
static const object_vtbl_t APPINFOVtbl
 
static const WCHAR * url_schemes []
 
static const WCHAR WININET_wkday [7][4]
 
static const WCHAR WININET_month [12][4]
 
static DWORD zone_preference = 3
 

Macro Definition Documentation

◆ CONNECTION_SETTINGS_VERSION

#define CONNECTION_SETTINGS_VERSION   0x46

Definition at line 96 of file internet.c.

◆ FE [1/2]

#define FE (   x)    { x, #x }

◆ FE [2/2]

#define FE (   x)    { x, #x }

◆ MAX_WORD_DIGITS

#define MAX_WORD_DIGITS   5

Definition at line 4782 of file internet.c.

◆ NO_SHLWAPI_STREAM

#define NO_SHLWAPI_STREAM

Definition at line 51 of file internet.c.

◆ URL_GET_COMP_LENGTH

#define URL_GET_COMP_LENGTH (   url,
  component 
)
Value:
((url)->dw##component##Length ? \
(url)->dw##component##Length : lstrlenW((url)->lpsz##component))
#define lstrlenW
Definition: compat.h:750
REFIID LPVOID DWORD_PTR dw
Definition: atlbase.h:40
static const WCHAR url[]
Definition: encode.c:1384
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102

Definition at line 4784 of file internet.c.

◆ URL_GET_COMP_LENGTHA

#define URL_GET_COMP_LENGTHA (   url,
  component 
)
Value:
((url)->dw##component##Length ? \
(url)->dw##component##Length : strlen((url)->lpsz##component))
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597

Definition at line 4786 of file internet.c.

Typedef Documentation

◆ LPWITHREADERROR

Function Documentation

◆ alloc_async_task()

void * alloc_async_task ( object_header_t *  hdr,
async_task_proc_t  proc,
size_t  size 
)

Definition at line 4513 of file internet.c.

4514{
4516
4517 task = malloc(size);
4518 if(!task)
4519 return NULL;
4520
4521 task->hdr = WININET_AddRef(hdr);
4522 task->proc = proc;
4523 return task;
4524}
#define malloc
Definition: debug_ros.c:4
DWORD task
Definition: delayimp.cpp:484
#define NULL
Definition: types.h:112
object_header_t * WININET_AddRef(object_header_t *info)
Definition: internet.c:202
GLsizeiptr size
Definition: glext.h:5919
char hdr[14]
Definition: iptest.cpp:33
static HANDLE proc()
Definition: pdb.c:32

Referenced by async_read(), FtpCreateDirectoryW(), FtpDeleteFileW(), FTPFILE_QueryDataAvailable(), FtpFindFirstFileW(), FTPFINDNEXT_FindNextFileW(), FtpGetCurrentDirectoryW(), FtpGetFileW(), FtpOpenFileW(), FtpPutFileW(), FtpRemoveDirectoryW(), FtpRenameFileW(), FtpSetCurrentDirectoryW(), HttpEndRequestW(), HttpSendRequestExW(), HttpSendRequestW(), and InternetOpenUrlW().

◆ alloc_object()

void * alloc_object ( object_header_t *  parent,
const object_vtbl_t *  vtbl,
size_t  size 
)

Definition at line 124 of file internet.c.

125{
126 UINT_PTR handle = 0, num;
129 BOOL res = TRUE;
130
131 ret = calloc(1, size);
132 if(!ret)
133 return NULL;
134
135 list_init(&ret->children);
136
138
139 if(!handle_table_size) {
140 num = 16;
141 p = calloc(num, sizeof(handle_table[0]));
142 if(p) {
143 handle_table = p;
145 next_handle = 1;
146 }else {
147 res = FALSE;
148 }
149 }else if(next_handle == handle_table_size) {
151 p = realloc(handle_table, sizeof(handle_table[0]) * num);
152 if(p) {
154 handle_table = p;
156 }else {
157 res = FALSE;
158 }
159 }
160
161 if(res) {
164 ERR("handle isn't free but should be\n");
166 ret->valid_handle = TRUE;
167
169 next_handle++;
170 }
171
173
174 if(!res) {
175 free(ret);
176 return NULL;
177 }
178
179 ret->vtbl = vtbl;
180 ret->refs = 1;
181 ret->hInternet = (HINTERNET)handle;
182
183 if(parent) {
184 ret->lpfnStatusCB = parent->lpfnStatusCB;
185 ret->dwInternalFlags = parent->dwInternalFlags & INET_CALLBACKW;
186 ret->connect_timeout = parent->connect_timeout;
187 ret->send_timeout = parent->send_timeout;
188 ret->receive_timeout = parent->receive_timeout;
189 ret->data_send_timeout = parent->data_send_timeout;
190 ret->data_receive_timeout = parent->data_receive_timeout;
191 } else {
192 ret->connect_timeout = connect_timeout;
193 ret->send_timeout = send_timeout;
194 ret->receive_timeout = receive_timeout;
195 ret->data_send_timeout = data_send_timeout;
196 ret->data_receive_timeout = data_receive_timeout;
197 }
198
199 return ret;
200}
static void list_init(struct list_entry *head)
Definition: list.h:51
#define ERR(fmt,...)
Definition: precomp.h:57
#define realloc
Definition: debug_ros.c:6
#define free
Definition: debug_ros.c:5
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static ULONG send_timeout
Definition: internet.c:113
static UINT_PTR next_handle
Definition: internet.c:83
static CRITICAL_SECTION WININET_cs
Definition: internet.c:73
static ULONG data_send_timeout
Definition: internet.c:115
static ULONG data_receive_timeout
Definition: internet.c:116
static ULONG connect_timeout
Definition: internet.c:112
static ULONG receive_timeout
Definition: internet.c:114
static UINT_PTR handle_table_size
Definition: internet.c:84
return ret
Definition: mutex.c:147
r parent
Definition: btrfs.c:3010
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint res
Definition: glext.h:9613
GLfloat GLfloat p
Definition: glext.h:8902
GLuint GLuint num
Definition: glext.h:9618
#define INET_CALLBACKW
Definition: internet.h:210
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define calloc
Definition: rosglue.h:14
#define memset(x, y, z)
Definition: compat.h:39
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
LPVOID HINTERNET
Definition: winhttp.h:37

Referenced by FTP_Connect(), FTP_FtpOpenFileW(), FTP_ReceiveFileList(), HTTP_Connect(), HTTP_HttpOpenRequestW(), and InternetOpenW().

◆ APPINFO_Destroy()

static VOID APPINFO_Destroy ( object_header_t *  hdr)
static

Definition at line 998 of file internet.c.

999{
1000 appinfo_t *lpwai = (appinfo_t*)hdr;
1001
1002 TRACE("%p\n",lpwai);
1003
1004 free(lpwai->agent);
1005 free(lpwai->proxy);
1006 free(lpwai->proxyBypass);
1007 free(lpwai->proxyUsername);
1008 free(lpwai->proxyPassword);
1009}
#define TRACE(s)
Definition: solgame.cpp:4
LPWSTR proxy
Definition: internet.h:265
LPWSTR proxyBypass
Definition: internet.h:266
LPWSTR agent
Definition: internet.h:264
LPWSTR proxyPassword
Definition: internet.h:268
LPWSTR proxyUsername
Definition: internet.h:267

Referenced by query_global_option().

◆ APPINFO_QueryOption()

static DWORD APPINFO_QueryOption ( object_header_t *  hdr,
DWORD  option,
void *  buffer,
DWORD *  size,
BOOL  unicode 
)
static

Definition at line 1042 of file internet.c.

1043{
1044 appinfo_t *ai = (appinfo_t*)hdr;
1045
1046 switch(option) {
1048 TRACE("INTERNET_OPTION_HANDLE_TYPE\n");
1049
1050 if (*size < sizeof(ULONG))
1052
1053 *size = sizeof(DWORD);
1055 return ERROR_SUCCESS;
1056
1058 DWORD bufsize;
1059
1060 TRACE("INTERNET_OPTION_USER_AGENT\n");
1061
1062 bufsize = *size;
1063
1064 if (unicode) {
1065 DWORD len = ai->agent ? lstrlenW(ai->agent) : 0;
1066
1067 *size = (len + 1) * sizeof(WCHAR);
1068 if(!buffer || bufsize < *size)
1070
1071 if (ai->agent)
1072 lstrcpyW(buffer, ai->agent);
1073 else
1074 *(WCHAR *)buffer = 0;
1075 /* If the buffer is copied, the returned length doesn't include
1076 * the NULL terminator.
1077 */
1078 *size = len;
1079 }else {
1080 if (ai->agent)
1081 *size = WideCharToMultiByte(CP_ACP, 0, ai->agent, -1, NULL, 0, NULL, NULL);
1082 else
1083 *size = 1;
1084 if(!buffer || bufsize < *size)
1086
1087 if (ai->agent)
1089 else
1090 *(char *)buffer = 0;
1091 /* If the buffer is copied, the returned length doesn't include
1092 * the NULL terminator.
1093 */
1094 *size -= 1;
1095 }
1096
1097 return ERROR_SUCCESS;
1098 }
1099
1101 if(!size) return ERROR_INVALID_PARAMETER;
1102 if (unicode) {
1104 DWORD proxyBytesRequired = 0, proxyBypassBytesRequired = 0;
1105 LPWSTR proxy, proxy_bypass;
1106
1107 if (ai->proxy)
1108 proxyBytesRequired = (lstrlenW(ai->proxy) + 1) * sizeof(WCHAR);
1109 if (ai->proxyBypass)
1110 proxyBypassBytesRequired = (lstrlenW(ai->proxyBypass) + 1) * sizeof(WCHAR);
1111 if (!pi || *size < sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired + proxyBypassBytesRequired)
1112 {
1113 *size = sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired + proxyBypassBytesRequired;
1115 }
1117 proxy_bypass = (LPWSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired);
1118
1119 pi->dwAccessType = ai->accessType;
1120 pi->lpszProxy = NULL;
1121 pi->lpszProxyBypass = NULL;
1122 if (ai->proxy) {
1123 lstrcpyW(proxy, ai->proxy);
1124 pi->lpszProxy = proxy;
1125 }
1126
1127 if (ai->proxyBypass) {
1128 lstrcpyW(proxy_bypass, ai->proxyBypass);
1129 pi->lpszProxyBypass = proxy_bypass;
1130 }
1131
1132 *size = sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired + proxyBypassBytesRequired;
1133 return ERROR_SUCCESS;
1134 }else {
1136 DWORD proxyBytesRequired = 0, proxyBypassBytesRequired = 0;
1137 LPSTR proxy, proxy_bypass;
1138
1139 if (ai->proxy)
1140 proxyBytesRequired = WideCharToMultiByte(CP_ACP, 0, ai->proxy, -1, NULL, 0, NULL, NULL);
1141 if (ai->proxyBypass)
1142 proxyBypassBytesRequired = WideCharToMultiByte(CP_ACP, 0, ai->proxyBypass, -1,
1143 NULL, 0, NULL, NULL);
1144 if (!pi || *size < sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired + proxyBypassBytesRequired)
1145 {
1146 *size = sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired + proxyBypassBytesRequired;
1148 }
1150 proxy_bypass = (LPSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired);
1151
1152 pi->dwAccessType = ai->accessType;
1153 pi->lpszProxy = NULL;
1154 pi->lpszProxyBypass = NULL;
1155 if (ai->proxy) {
1156 WideCharToMultiByte(CP_ACP, 0, ai->proxy, -1, proxy, proxyBytesRequired, NULL, NULL);
1157 pi->lpszProxy = proxy;
1158 }
1159
1160 if (ai->proxyBypass) {
1161 WideCharToMultiByte(CP_ACP, 0, ai->proxyBypass, -1, proxy_bypass,
1162 proxyBypassBytesRequired, NULL, NULL);
1163 pi->lpszProxyBypass = proxy_bypass;
1164 }
1165
1166 *size = sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired + proxyBypassBytesRequired;
1167 return ERROR_SUCCESS;
1168 }
1169
1174 WCHAR *url = NULL;
1175 int i;
1176
1177 if (*size < sizeof(INTERNET_PER_CONN_OPTION_LISTW))
1179
1181
1184
1185 for (i = 0; i < con->dwOptionCount; i++) {
1187 INTERNET_PER_CONN_OPTIONA *optionA = conA->pOptions + i;
1188
1189 switch (optionW->dwOption) {
1191 optionW->Value.dwValue = global_proxy.flags;
1192 break;
1193
1195 if (unicode)
1196 optionW->Value.pszValue = copy_optionW(global_proxy.proxy);
1197 else
1199 break;
1200
1202 if (unicode)
1203 optionW->Value.pszValue = copy_optionW(global_proxy.proxyBypass);
1204 else
1206 break;
1207
1209 if (unicode)
1210 optionW->Value.pszValue = copy_optionW(global_proxy.autoconf_url);
1211 else
1213 break;
1214
1216 optionW->Value.dwValue = AUTO_PROXY_FLAG_ALWAYS_DETECT;
1217 break;
1218
1220 if (unicode)
1221 optionW->Value.pszValue = copy_optionW(url);
1222 else
1223 optionA->Value.pszValue = copy_optionA(url);
1224 break;
1225
1229 FIXME("Unhandled dwOption %ld\n", optionW->dwOption);
1230 memset(&optionW->Value, 0, sizeof(optionW->Value));
1231 break;
1232
1233 default:
1234 FIXME("Unknown dwOption %ld\n", optionW->dwOption);
1236 break;
1237 }
1238 }
1239
1241 return res;
1242 }
1243 }
1244
1245 return INET_QueryOption(hdr, option, buffer, size, unicode);
1246}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:109
#define lstrcpyW
Definition: compat.h:749
#define WideCharToMultiByte
Definition: compat.h:111
static WCHAR * copy_optionW(WCHAR *value)
Definition: internet.c:1011
static WCHAR * get_proxy_autoconfig_url(void)
Definition: internet.c:2918
static proxyinfo_t global_proxy
Definition: internet.c:606
DWORD INET_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
Definition: internet.c:3159
static char * copy_optionA(WCHAR *value)
Definition: internet.c:1026
unsigned long DWORD
Definition: ntddk_ex.h:95
int proxy
Definition: main.c:67
GLuint buffer
Definition: glext.h:5915
GLenum GLuint GLsizei bufsize
Definition: glext.h:7473
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static const WCHAR optionW[]
Definition: htmlelem.c:36
static PROCESS_INFORMATION pi
Definition: debugger.c:2303
#define DWORD
Definition: nt_native.h:44
short WCHAR
Definition: pedump.c:58
long LONG
Definition: pedump.c:60
union _INTERNET_PER_CONN_OPTIONA::@4112 Value
LPINTERNET_PER_CONN_OPTIONA pOptions
Definition: wininet.h:364
LPINTERNET_PER_CONN_OPTIONW pOptions
Definition: wininet.h:372
DWORD accessType
Definition: internet.h:269
Definition: getopt.h:109
LPWSTR autoconf_url
Definition: internet.c:93
DWORD flags
Definition: internet.c:88
LPWSTR proxy
Definition: internet.c:89
LPWSTR proxyBypass
Definition: internet.c:90
unsigned char * LPBYTE
Definition: typedefs.h:53
uint16_t * LPWSTR
Definition: typedefs.h:56
char * LPSTR
Definition: typedefs.h:51
uint32_t ULONG
Definition: typedefs.h:59
#define AUTO_PROXY_FLAG_ALWAYS_DETECT
Definition: wininet.h:352
#define INTERNET_PER_CONN_AUTOCONFIG_RELOAD_DELAY_MINS
Definition: wininet.h:340
#define INTERNET_PER_CONN_FLAGS
Definition: wininet.h:334
#define INTERNET_PER_CONN_AUTODISCOVERY_FLAGS
Definition: wininet.h:338
#define INTERNET_OPTION_USER_AGENT
Definition: wininet.h:735
#define INTERNET_PER_CONN_AUTOCONFIG_URL
Definition: wininet.h:337
#define INTERNET_HANDLE_TYPE_INTERNET
Definition: wininet.h:802
#define INTERNET_PER_CONN_PROXY_SERVER
Definition: wininet.h:335
#define INTERNET_OPTION_PROXY
Definition: wininet.h:732
#define INTERNET_PER_CONN_PROXY_BYPASS
Definition: wininet.h:336
#define INTERNET_PER_CONN_AUTOCONFIG_SECONDARY_URL
Definition: wininet.h:339
#define INTERNET_OPTION_PER_CONNECTION_OPTION
Definition: wininet.h:765
#define INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_URL
Definition: wininet.h:342
#define INTERNET_OPTION_HANDLE_TYPE
Definition: wininet.h:710
#define INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME
Definition: wininet.h:341
#define PROXY_TYPE_AUTO_DETECT
Definition: wininet.h:349
#define INTERNET_PROXY_INFOA
Definition: wininet_test.h:55
#define INTERNET_PROXY_INFOW
Definition: wininet_test.h:56

Referenced by query_global_option().

◆ APPINFO_SetOption()

static DWORD APPINFO_SetOption ( object_header_t *  hdr,
DWORD  option,
void *  buf,
DWORD  size 
)
static

Definition at line 1248 of file internet.c.

1249{
1250 appinfo_t *ai = (appinfo_t*)hdr;
1251
1252 switch(option) {
1254 free(ai->agent);
1255 if (!(ai->agent = wcsdup(buf))) return ERROR_OUTOFMEMORY;
1256 return ERROR_SUCCESS;
1258 FIXME("INTERNET_OPTION_REFRESH\n");
1259 return ERROR_SUCCESS;
1262 unsigned int i;
1263
1265 for (i = 0; i < con->dwOptionCount; i++) {
1267
1268 switch (option->dwOption) {
1271 global_proxy.proxy = wcsdup(option->Value.pszValue);
1272 break;
1273
1275 if(option->Value.dwValue & ~(PROXY_TYPE_PROXY | PROXY_TYPE_DIRECT))
1276 FIXME("Unhandled flags: 0x%lx\n", option->Value.dwValue);
1277 global_proxy.flags = option->Value.dwValue;
1278 break;
1279
1282 global_proxy.proxyBypass = wcsdup(option->Value.pszValue);
1283 break;
1284
1287 global_proxy.autoconf_url = wcsdup(option->Value.pszValue);
1288 break;
1289
1295 FIXME("Unhandled dwOption %ld\n", option->dwOption);
1296 break;
1297
1298 default:
1299 FIXME("Unknown dwOption %ld\n", option->dwOption);
1301 break;
1302 }
1303 }
1305 return ERROR_SUCCESS;
1306 }
1307 }
1308
1309 return INET_SetOption(hdr, option, buf, size);
1310}
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define SetLastError(x)
Definition: compat.h:752
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
DWORD INET_SetOption(object_header_t *hdr, DWORD option, void *buf, DWORD size)
Definition: internet.c:3309
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define PROXY_TYPE_DIRECT
Definition: wininet.h:346
#define INTERNET_OPTION_REFRESH
Definition: wininet.h:731
#define PROXY_TYPE_PROXY
Definition: wininet.h:347

◆ AsyncInternetOpenUrlProc()

static void AsyncInternetOpenUrlProc ( task_header_t *  hdr)
static

Definition at line 4329 of file internet.c.

4330{
4332
4333 TRACE("%p\n", task->hdr.hdr);
4334
4335 INTERNET_InternetOpenUrlW((appinfo_t*)task->hdr.hdr, task->url, task->headers,
4336 task->headers_len, task->flags, task->context);
4337 free(task->url);
4338 free(task->headers);
4339}
static HINTERNET INTERNET_InternetOpenUrlW(appinfo_t *hIC, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
Definition: internet.c:4222

Referenced by InternetOpenUrlW().

◆ build_wpad_url()

static WCHAR * build_wpad_url ( const char *  hostname,
const struct addrinfo *  ai 
)
static

Definition at line 2849 of file internet.c.

2850{
2851 char name[NI_MAXHOST];
2852 WCHAR *ret, *p;
2853 int len;
2854
2855 while (ai && ai->ai_family != AF_INET && ai->ai_family != AF_INET6) ai = ai->ai_next;
2856 if (!ai) return NULL;
2857
2858 if (!reverse_lookup( ai, name, sizeof(name) )) hostname = name;
2859
2860 len = lstrlenW( L"http://" ) + strlen( hostname ) + lstrlenW( L"/wpad.dat" );
2861 if (!(ret = p = GlobalAlloc( 0, (len + 1) * sizeof(WCHAR) ))) return NULL;
2862 lstrcpyW( p, L"http://" );
2863 p += lstrlenW( L"http://" );
2864 while (*hostname) { *p++ = *hostname++; }
2865 lstrcpyW( p, L"/wpad.dat" );
2866 return ret;
2867}
char * hostname
Definition: ftp.c:88
static int reverse_lookup(const struct addrinfo *ai, char *hostname, size_t len)
Definition: internet.c:2844
#define L(x)
Definition: resources.c:13
#define AF_INET
Definition: tcpip.h:117
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
struct addrinfo * ai_next
Definition: ws2def.h:678
int ai_family
Definition: ws2def.h:672
Definition: name.c:39
#define AF_INET6
Definition: winsock.h:363
#define NI_MAXHOST
Definition: ws2def.h:365

Referenced by detect_proxy_autoconfig_url_dns().

◆ calc_url_length()

static BOOL calc_url_length ( LPURL_COMPONENTSW  lpUrlComponents,
LPDWORD  lpdwUrlLength 
)
static

Definition at line 4835 of file internet.c.

4837{
4838 INTERNET_SCHEME nScheme;
4839
4840 *lpdwUrlLength = 0;
4841
4842 if (lpUrlComponents->lpszScheme)
4843 {
4844 DWORD dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, Scheme);
4845 *lpdwUrlLength += dwLen;
4846 nScheme = GetInternetSchemeW(lpUrlComponents->lpszScheme, dwLen);
4847 }
4848 else
4849 {
4851
4852 if (lpUrlComponents->nScheme == INTERNET_SCHEME_UNKNOWN)
4853 {
4855 return FALSE;
4856 }
4857
4858 nScheme = lpUrlComponents->nScheme;
4859
4860 if (nScheme == INTERNET_SCHEME_DEFAULT)
4861 nScheme = INTERNET_SCHEME_HTTP;
4863 *lpdwUrlLength += lstrlenW(scheme);
4864 }
4865
4866 (*lpdwUrlLength)++; /* ':' */
4867 if (!scheme_is_opaque(nScheme) || lpUrlComponents->lpszHostName)
4868 *lpdwUrlLength += strlen("//");
4869
4870 if (lpUrlComponents->lpszUserName)
4871 {
4872 *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, UserName);
4873 *lpdwUrlLength += strlen("@");
4874 }
4875 else
4876 {
4877 if (lpUrlComponents->lpszPassword)
4878 {
4880 return FALSE;
4881 }
4882 }
4883
4884 if (lpUrlComponents->lpszPassword)
4885 {
4886 *lpdwUrlLength += strlen(":");
4887 *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, Password);
4888 }
4889
4890 if (lpUrlComponents->lpszHostName)
4891 {
4892 *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, HostName);
4893
4894 if (!url_uses_default_port(nScheme, lpUrlComponents->nPort))
4895 {
4897
4898 _ltow(lpUrlComponents->nPort, port, 10);
4899 *lpdwUrlLength += lstrlenW(port);
4900 *lpdwUrlLength += strlen(":");
4901 }
4902
4903 if (lpUrlComponents->lpszUrlPath && *lpUrlComponents->lpszUrlPath != '/')
4904 (*lpdwUrlLength)++; /* '/' */
4905 }
4906
4907 if (lpUrlComponents->lpszUrlPath)
4908 *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, UrlPath);
4909
4910 if (lpUrlComponents->lpszExtraInfo)
4911 *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, ExtraInfo);
4912
4913 return TRUE;
4914}
_ACRTIMP wchar_t *__cdecl _ltow(__msvcrt_long, wchar_t *, int)
Definition: string.c:2148
USHORT port
Definition: uri.c:210
static LPCWSTR INTERNET_GetSchemeString(INTERNET_SCHEME scheme)
Definition: internet.c:4821
static INTERNET_SCHEME GetInternetSchemeW(LPCWSTR lpszScheme, DWORD nMaxCmp)
Definition: internet.c:2027
#define URL_GET_COMP_LENGTH(url, component)
Definition: internet.c:4784
void INTERNET_SetLastError(DWORD dwError)
Definition: internet.c:4456
static BOOL scheme_is_opaque(INTERNET_SCHEME nScheme)
Definition: internet.c:4812
static BOOL url_uses_default_port(INTERNET_SCHEME nScheme, INTERNET_PORT nPort)
Definition: internet.c:4789
#define MAX_WORD_DIGITS
Definition: internet.c:4782
DWORD scheme
INTERNET_PORT nPort
Definition: winhttp.h:543
LPWSTR lpszScheme
Definition: winhttp.h:538
LPWSTR lpszUserName
Definition: winhttp.h:544
LPWSTR lpszExtraInfo
Definition: winhttp.h:550
LPWSTR lpszUrlPath
Definition: winhttp.h:548
LPWSTR lpszHostName
Definition: winhttp.h:541
LPWSTR lpszPassword
Definition: winhttp.h:546
INTERNET_SCHEME nScheme
Definition: winhttp.h:540
@ Password
Definition: telnetd.h:67
const uint16_t * LPCWSTR
Definition: typedefs.h:57
#define INTERNET_SCHEME_HTTP
Definition: winhttp.h:47
INTERNET_SCHEME
Definition: wininet.h:135
@ INTERNET_SCHEME_DEFAULT
Definition: wininet.h:138
@ INTERNET_SCHEME_UNKNOWN
Definition: wininet.h:137

Referenced by InternetCreateUrlW().

◆ connection_settings_read()

static LONG connection_settings_read ( const connection_settings *  settings,
DWORD *  pos,
DWORD  size,
WCHAR **  str 
)
static

Definition at line 668 of file internet.c.

669{
670 int len, wlen;
671
672 *str = NULL;
673 if (*pos + sizeof(int) >= size)
674 return ERROR_SUCCESS;
675 memcpy( &len, settings->data + *pos, sizeof(int) );
676 *pos += sizeof(int);
677
678 if (*pos + len >= size)
679 {
680 *pos = size;
681 return ERROR_SUCCESS;
682 }
683 wlen = MultiByteToWideChar( CP_UTF8, 0, (const char *)settings->data + *pos, len, NULL, 0 );
684 if (wlen)
685 {
686 *str = malloc( (wlen + 1) * sizeof(WCHAR) );
687 if (!*str)
688 {
689 *pos = size;
690 return ERROR_OUTOFMEMORY;
691 }
692 MultiByteToWideChar( CP_UTF8, 0, (const char *)settings->data + *pos, len, *str, wlen );
693 (*str)[wlen] = 0;
694 *pos += len;
695 }
696 return ERROR_SUCCESS;
697}
struct mke2fs_defaults settings[]
#define MultiByteToWideChar
Definition: compat.h:110
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
const WCHAR * str
#define CP_UTF8
Definition: nls.h:20

Referenced by load_connection_settings().

◆ connection_settings_write()

static void connection_settings_write ( connection_settings *  settings,
DWORD *  pos,
DWORD  size,
const WCHAR *  str 
)
static

Definition at line 356 of file internet.c.

357{
358 int len = 0;
359
360 if (str)
361 {
362 len = wcslen( str );
363 len = WideCharToMultiByte( CP_UTF8, 0, str, len, settings ? (char*)settings->data + *pos + sizeof(len) : NULL,
364 settings ? size - *pos - sizeof(len) : 0, NULL, NULL );
365 }
366 if (settings)
367 memcpy(settings->data + *pos, &len, sizeof(len));
368 *pos += sizeof(len) + len;
369}
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988

Referenced by save_connection_settings().

◆ convert_url_canonicalization_flags()

static DWORD convert_url_canonicalization_flags ( DWORD  dwFlags)
static

Definition at line 2386 of file internet.c.

2387{
2389
2390 if (dwFlags & ICU_BROWSER_MODE) dwUrlFlags |= URL_BROWSER_MODE;
2391 if (dwFlags & ICU_DECODE) dwUrlFlags |= URL_UNESCAPE;
2392 if (dwFlags & ICU_ENCODE_PERCENT) dwUrlFlags |= URL_ESCAPE_PERCENT;
2394 /* Flip this bit to correspond to URL_ESCAPE_UNSAFE */
2395 if (dwFlags & ICU_NO_ENCODE) dwUrlFlags ^= URL_ESCAPE_UNSAFE;
2396 if (dwFlags & ICU_NO_META) dwUrlFlags |= URL_NO_META;
2397
2398 return dwUrlFlags;
2399}
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
#define URL_ESCAPE_UNSAFE
Definition: shlwapi.h:533
#define URL_NO_META
Definition: shlwapi.h:538
#define URL_WININET_COMPATIBILITY
Definition: shlwapi.h:535
#define URL_UNESCAPE
Definition: shlwapi.h:532
#define URL_ESCAPE_SPACES_ONLY
Definition: shlwapi.h:530
#define URL_BROWSER_MODE
Definition: shlwapi.h:540
#define URL_ESCAPE_PERCENT
Definition: shlwapi.h:521
#define ICU_NO_META
Definition: winhttp.h:354
#define ICU_ENCODE_SPACES_ONLY
Definition: winhttp.h:355
#define ICU_DECODE
Definition: winhttp.h:353
#define ICU_BROWSER_MODE
Definition: winhttp.h:356
#define ICU_NO_ENCODE
Definition: winhttp.h:352
#define ICU_ENCODE_PERCENT
Definition: winhttp.h:357

Referenced by InternetCanonicalizeUrlA(), and InternetCanonicalizeUrlW().

◆ convert_urlcomp_atow()

static void convert_urlcomp_atow ( LPURL_COMPONENTSA  lpUrlComponents,
LPURL_COMPONENTSW  urlCompW 
)
static

Definition at line 4916 of file internet.c.

4917{
4918 INT len;
4919
4920 ZeroMemory(urlCompW, sizeof(URL_COMPONENTSW));
4921
4922 urlCompW->dwStructSize = sizeof(URL_COMPONENTSW);
4923 urlCompW->dwSchemeLength = lpUrlComponents->dwSchemeLength;
4924 urlCompW->nScheme = lpUrlComponents->nScheme;
4925 urlCompW->dwHostNameLength = lpUrlComponents->dwHostNameLength;
4926 urlCompW->nPort = lpUrlComponents->nPort;
4927 urlCompW->dwUserNameLength = lpUrlComponents->dwUserNameLength;
4928 urlCompW->dwPasswordLength = lpUrlComponents->dwPasswordLength;
4929 urlCompW->dwUrlPathLength = lpUrlComponents->dwUrlPathLength;
4930 urlCompW->dwExtraInfoLength = lpUrlComponents->dwExtraInfoLength;
4931
4932 if (lpUrlComponents->lpszScheme)
4933 {
4934 len = URL_GET_COMP_LENGTHA(lpUrlComponents, Scheme) + 1;
4935 urlCompW->lpszScheme = malloc(len * sizeof(WCHAR));
4936 MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszScheme,
4937 -1, urlCompW->lpszScheme, len);
4938 }
4939
4940 if (lpUrlComponents->lpszHostName)
4941 {
4942 len = URL_GET_COMP_LENGTHA(lpUrlComponents, HostName) + 1;
4943 urlCompW->lpszHostName = malloc(len * sizeof(WCHAR));
4944 MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszHostName,
4945 -1, urlCompW->lpszHostName, len);
4946 }
4947
4948 if (lpUrlComponents->lpszUserName)
4949 {
4950 len = URL_GET_COMP_LENGTHA(lpUrlComponents, UserName) + 1;
4951 urlCompW->lpszUserName = malloc(len * sizeof(WCHAR));
4952 MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszUserName,
4953 -1, urlCompW->lpszUserName, len);
4954 }
4955
4956 if (lpUrlComponents->lpszPassword)
4957 {
4958 len = URL_GET_COMP_LENGTHA(lpUrlComponents, Password) + 1;
4959 urlCompW->lpszPassword = malloc(len * sizeof(WCHAR));
4960 MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszPassword,
4961 -1, urlCompW->lpszPassword, len);
4962 }
4963
4964 if (lpUrlComponents->lpszUrlPath)
4965 {
4966 len = URL_GET_COMP_LENGTHA(lpUrlComponents, UrlPath) + 1;
4967 urlCompW->lpszUrlPath = malloc(len * sizeof(WCHAR));
4968 MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszUrlPath,
4969 -1, urlCompW->lpszUrlPath, len);
4970 }
4971
4972 if (lpUrlComponents->lpszExtraInfo)
4973 {
4974 len = URL_GET_COMP_LENGTHA(lpUrlComponents, ExtraInfo) + 1;
4975 urlCompW->lpszExtraInfo = malloc(len * sizeof(WCHAR));
4976 MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszExtraInfo,
4977 -1, urlCompW->lpszExtraInfo, len);
4978 }
4979}
#define URL_GET_COMP_LENGTHA(url, component)
Definition: internet.c:4786
#define ZeroMemory
Definition: minwinbase.h:31
INTERNET_SCHEME nScheme
Definition: wininet.h:196
LPSTR lpszScheme
Definition: wininet.h:194
DWORD dwSchemeLength
Definition: wininet.h:195
DWORD dwExtraInfoLength
Definition: wininet.h:207
DWORD dwUrlPathLength
Definition: wininet.h:205
DWORD dwUserNameLength
Definition: wininet.h:201
LPSTR lpszExtraInfo
Definition: wininet.h:206
DWORD dwPasswordLength
Definition: wininet.h:203
LPSTR lpszPassword
Definition: wininet.h:202
LPSTR lpszUserName
Definition: wininet.h:200
DWORD dwHostNameLength
Definition: wininet.h:198
LPSTR lpszHostName
Definition: wininet.h:197
LPSTR lpszUrlPath
Definition: wininet.h:204
INTERNET_PORT nPort
Definition: wininet.h:199
DWORD dwPasswordLength
Definition: winhttp.h:547
DWORD dwHostNameLength
Definition: winhttp.h:542
DWORD dwExtraInfoLength
Definition: winhttp.h:551
DWORD dwUrlPathLength
Definition: winhttp.h:549
DWORD dwStructSize
Definition: winhttp.h:537
DWORD dwUserNameLength
Definition: winhttp.h:545
DWORD dwSchemeLength
Definition: winhttp.h:539
int32_t INT
Definition: typedefs.h:58

Referenced by InternetCreateUrlA().

◆ copy_optionA()

static char * copy_optionA ( WCHAR *  value)
static

Definition at line 1026 of file internet.c.

1027{
1028 DWORD len;
1029 void *tmp;
1030
1031 if (!value)
1032 return NULL;
1033
1034 len = WideCharToMultiByte(CP_ACP, 0, value, -1, NULL, 0, NULL, NULL);
1035 if (!(tmp = GlobalAlloc(0, len)))
1036 return NULL;
1037
1038 WideCharToMultiByte(CP_ACP, 0, value, -1, tmp, len, NULL, NULL);
1039 return tmp;
1040}
Definition: pdh_main.c:64

Referenced by APPINFO_QueryOption(), and query_global_option().

◆ copy_optionW()

static WCHAR * copy_optionW ( WCHAR *  value)
static

Definition at line 1011 of file internet.c.

1012{
1013 DWORD len;
1014 void *tmp;
1015
1016 if (!value)
1017 return NULL;
1018
1019 len = (wcslen(value) + 1) * sizeof(WCHAR);
1020 if (!(tmp = GlobalAlloc(0, len)))
1021 return NULL;
1022
1023 return memcpy(tmp, value, len);
1024}

Referenced by APPINFO_QueryOption(), and query_global_option().

◆ create_req_file()

DWORD create_req_file ( const WCHAR *  file_name,
req_file_t **  ret 
)

Definition at line 4607 of file internet.c.

4608{
4609 req_file_t *req_file;
4610
4611 req_file = calloc(1, sizeof(*req_file));
4612 if(!req_file)
4614
4615 req_file->ref = 1;
4616
4617 req_file->file_name = wcsdup(file_name);
4618 if(!req_file->file_name) {
4619 free(req_file);
4621 }
4622
4625 if(req_file->file_handle == INVALID_HANDLE_VALUE) {
4626 req_file_release(req_file);
4627 return GetLastError();
4628 }
4629
4630 *ret = req_file;
4631 return ERROR_SUCCESS;
4632}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GENERIC_READ
Definition: compat.h:135
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define FILE_SHARE_READ
Definition: compat.h:136
void req_file_release(req_file_t *req_file)
Definition: internet.c:4634
static LPCWSTR file_name
Definition: protocol.c:152
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
LONG ref
Definition: internet.h:214
WCHAR * file_name
Definition: internet.h:216
HANDLE file_handle
Definition: internet.h:215
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by create_cache_entry().

◆ CreateMD5SSOHash()

BOOL WINAPI CreateMD5SSOHash ( PWSTR  pszChallengeInfo,
PWSTR  pwszRealm,
PWSTR  pwszTarget,
PBYTE  pbHexHash 
)

Definition at line 5315 of file internet.c.

5317{
5318 FIXME("(%s, %s, %s, %p) stub\n", debugstr_w(pszChallengeInfo), debugstr_w(pwszRealm),
5319 debugstr_w(pwszTarget), pbHexHash);
5320 return FALSE;
5321}
#define debugstr_w
Definition: kernel32.h:32

◆ detect_proxy_autoconfig_url_dhcp()

static WCHAR * detect_proxy_autoconfig_url_dhcp ( void  )
static

Definition at line 2762 of file internet.c.

2763{
2764 IP_ADAPTER_ADDRESSES *adapters, *ptr;
2765 DHCPCAPI_PARAMS_ARRAY send_params, recv_params;
2768 DWORD err, size;
2769 BYTE *tmp, *buf = NULL;
2770
2771 if (!(adapters = get_adapters())) return NULL;
2772
2773 memset( &send_params, 0, sizeof(send_params) );
2774 memset( &param, 0, sizeof(param) );
2775 param.OptionId = OPTION_MSFT_IE_PROXY;
2776 recv_params.nParams = 1;
2777 recv_params.Params = &param;
2778
2779 for (ptr = adapters; ptr; ptr = ptr->Next)
2780 {
2781 MultiByteToWideChar( CP_ACP, 0, ptr->AdapterName, -1, name, ARRAY_SIZE(name) );
2782 TRACE( "adapter '%s' type %lu dhcpv4 enabled %d\n", wine_dbgstr_w(name), ptr->IfType, ptr->Dhcpv4Enabled );
2783
2784 if (ptr->IfType == IF_TYPE_SOFTWARE_LOOPBACK) continue;
2785 /* FIXME: also skip adapters where DHCP is disabled */
2786
2787 size = 256;
2788 if (!(buf = malloc( size ))) goto done;
2789 err = DhcpRequestParams( DHCPCAPI_REQUEST_SYNCHRONOUS, NULL, name, NULL, send_params, recv_params,
2790 buf, &size, NULL );
2791 while (err == ERROR_MORE_DATA)
2792 {
2793 if (!(tmp = realloc( buf, size ))) goto done;
2794 buf = tmp;
2795 err = DhcpRequestParams( DHCPCAPI_REQUEST_SYNCHRONOUS, NULL, name, NULL, send_params, recv_params,
2796 buf, &size, NULL );
2797 }
2798 if (err == ERROR_SUCCESS && param.nBytesData)
2799 {
2800 int len = MultiByteToWideChar( CP_ACP, 0, (const char *)param.Data, param.nBytesData, NULL, 0 );
2801 if ((ret = malloc( (len + 1) * sizeof(WCHAR) )))
2802 {
2803 MultiByteToWideChar( CP_ACP, 0, (const char *)param.Data, param.nBytesData, ret, len );
2804 ret[len] = 0;
2805 }
2806 TRACE("returning %s\n", debugstr_w(ret));
2807 break;
2808 }
2809 free( buf );
2810 buf = NULL;
2811 }
2812
2813done:
2814 free( buf );
2815 free( adapters );
2816 return ret;
2817}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define DHCPCAPI_REQUEST_SYNCHRONOUS
Definition: dhcpcsdk.h:129
#define OPTION_MSFT_IE_PROXY
Definition: dhcpcsdk.h:87
DWORD APIENTRY DhcpRequestParams(_In_ DWORD Flags, _In_ PVOID Reserved, _In_ LPWSTR AdapterName, _In_ LPDHCPCAPI_CLASSID ClassId, _In_ DHCPCAPI_PARAMS_ARRAY SendParams, _Inout_ DHCPCAPI_PARAMS_ARRAY RecdParams, _In_ LPBYTE Buffer, _Inout_ LPDWORD pSize, _In_ LPWSTR RequestIdStr)
Definition: dhcpcsvc.c:720
static IP_ADAPTER_ADDRESSES * get_adapters(void)
Definition: internet.c:2743
GLfloat param
Definition: glext.h:5796
#define IF_TYPE_SOFTWARE_LOOPBACK
Definition: ipifcons.h:44
#define wine_dbgstr_w
Definition: kernel32.h:34
static PVOID ptr
Definition: dispmode.c:27
#define MAX_ADAPTER_NAME_LENGTH
Definition: iptypes.h:16
#define err(...)
LPDHCPCAPI_PARAMS Params
Definition: dhcpcsdk.h:111
unsigned char BYTE
Definition: xxhash.c:193

Referenced by get_proxy_autoconfig_url().

◆ detect_proxy_autoconfig_url_dns()

static WCHAR * detect_proxy_autoconfig_url_dns ( void  )
static

Definition at line 2869 of file internet.c.

2870{
2871 char *fqdn, *domain, *p;
2872 WCHAR *ret;
2873
2874 if (!(fqdn = get_computer_name( ComputerNamePhysicalDnsFullyQualified ))) return NULL;
2875 if (!(domain = get_computer_name( ComputerNamePhysicalDnsDomain )))
2876 {
2877 free( fqdn );
2878 return NULL;
2879 }
2880 p = fqdn;
2881 while ((p = strchr( p, '.' )) && is_domain_suffix( p + 1, domain ))
2882 {
2883 char *name;
2884 struct addrinfo *ai, hints;
2885 int res;
2886
2887 if (!(name = malloc( sizeof("wpad") + strlen(p) )))
2888 {
2889 free( fqdn );
2890 free( domain );
2891 return NULL;
2892 }
2893 strcpy( name, "wpad" );
2894 strcat( name, p );
2895 memset( &hints, 0, sizeof(hints) );
2896 hints.ai_flags = AI_ALL | AI_DNS_ONLY;
2897 hints.ai_family = AF_UNSPEC;
2898 res = getaddrinfo( name, NULL, &hints, &ai );
2899 if (!res)
2900 {
2901 ret = build_wpad_url( name, ai );
2902 freeaddrinfo( ai );
2903 if (ret)
2904 {
2905 TRACE("returning %s\n", debugstr_w(ret));
2906 free( name );
2907 break;
2908 }
2909 }
2910 free( name );
2911 p++;
2912 }
2913 free( domain );
2914 free( fqdn );
2915 return ret;
2916}
_ACRTIMP char *__cdecl strchr(const char *, int)
Definition: string.c:3291
static WCHAR * build_wpad_url(const char *hostname, const struct addrinfo *ai)
Definition: internet.c:2849
static char * get_computer_name(COMPUTER_NAME_FORMAT format)
Definition: internet.c:2819
static BOOL is_domain_suffix(const char *domain, const char *suffix)
Definition: internet.c:2835
strcat
Definition: string.h:92
strcpy
Definition: string.h:131
namespace GUID const ADDRINFOEXW * hints
Definition: sock.c:80
Definition: cookie.c:42
#define AF_UNSPEC
Definition: winsock.h:338
#define AI_ALL
Definition: ws2def.h:298
#define AI_DNS_ONLY
Definition: ws2def.h:312
#define getaddrinfo
Definition: wspiapi.h:44
#define freeaddrinfo
Definition: wspiapi.h:46

Referenced by get_proxy_autoconfig_url().

◆ DetectAutoProxyUrl()

BOOL WINAPI DetectAutoProxyUrl ( LPSTR  lpszAutoProxyUrl,
DWORD  dwAutoProxyUrlLength,
DWORD  dwDetectFlags 
)

Definition at line 589 of file internet.c.

591{
592 FIXME("STUB\n");
594 return FALSE;
595}
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

Referenced by test_InternetQueryOptionA().

◆ DllInstall()

HRESULT WINAPI DllInstall ( BOOL  bInstall,
LPCWSTR  cmdline 
)

Definition at line 350 of file internet.c.

351{
352 FIXME("(%x %s): stub\n", bInstall, debugstr_w(cmdline));
353 return S_OK;
354}
#define S_OK
Definition: intsafe.h:52
TCHAR * cmdline
Definition: stretchblt.cpp:32

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

Definition at line 299 of file internet.c.

300{
301 TRACE("%p,%lx,%p\n", hinstDLL, fdwReason, lpvReserved);
302
303 switch (fdwReason) {
305
307
309 return FALSE;
310
311 if(!init_urlcache())
312 {
314 return FALSE;
315 }
316
317 WININET_hModule = hinstDLL;
318 break;
319
321 break;
322
325 {
327 }
328 break;
329
331 if (lpvReserved) break;
335 free_cookie();
336
338 {
341 }
342 break;
343 }
344 return TRUE;
345}
static DWORD const fdwReason
#define DLL_THREAD_DETACH
Definition: compat.h:133
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define DLL_THREAD_ATTACH
Definition: compat.h:132
LPVOID WINAPI TlsGetValue(IN DWORD Index)
Definition: thread.c:1301
BOOL WINAPI TlsFree(IN DWORD Index)
Definition: thread.c:1227
DWORD WINAPI DECLSPEC_HOTPATCH TlsAlloc(void)
Definition: thread.c:657
BOOL collect_connections(collect_type_t collect_type)
Definition: http.c:229
static DWORD g_dwTlsErrIndex
Definition: internet.c:70
HMODULE WININET_hModule
Definition: internet.c:71
@ COLLECT_CLEANUP
Definition: internet.h:61
void NETCON_unload(void)
void free_urlcache(void)
Definition: urlcache.c:4124
BOOL init_urlcache(void)
Definition: urlcache.c:4106
static IN DWORD IN LPVOID lpvReserved
#define TLS_OUT_OF_INDEXES
Definition: winbase.h:529
void free_cookie(void)
Definition: cookie.c:1269

◆ dump_INTERNET_FLAGS()

static void dump_INTERNET_FLAGS ( DWORD  dwFlags)
static

Definition at line 944 of file internet.c.

945{
946#define FE(x) { x, #x }
947 static const wininet_flag_info flag[] = {
976 };
977#undef FE
978 unsigned int i;
979
980 for (i = 0; i < ARRAY_SIZE(flag); i++) {
981 if (flag[i].val & dwFlags) {
982 TRACE(" %s", flag[i].name);
983 dwFlags &= ~flag[i].val;
984 }
985 }
986 if (dwFlags)
987 TRACE(" Unknown flags (%08lx)\n", dwFlags);
988 else
989 TRACE("\n");
990}
#define FE(x)
GLuint GLfloat * val
Definition: glext.h:7180
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
Definition: glfuncs.h:52
#define INTERNET_FLAG_FROM_CACHE
Definition: wininet.h:69
#define INTERNET_FLAG_PRAGMA_NOCACHE
Definition: wininet.h:85
#define INTERNET_FLAG_NO_AUTO_REDIRECT
Definition: wininet.h:73
#define INTERNET_FLAG_RELOAD
Definition: wininet.h:61
#define INTERNET_FLAG_RESYNCHRONIZE
Definition: wininet.h:82
#define INTERNET_FLAG_RAW_DATA
Definition: wininet.h:62
#define INTERNET_FLAG_TRANSFER_ASCII
Definition: wininet.h:90
#define INTERNET_FLAG_ASYNC
Definition: wininet.h:64
#define INTERNET_FLAG_NO_COOKIES
Definition: wininet.h:75
#define INTERNET_FLAG_KEEP_CONNECTION
Definition: wininet.h:72
#define INTERNET_FLAG_PASSIVE
Definition: wininet.h:65
#define INTERNET_FLAG_NEED_FILE
Definition: wininet.h:88
#define INTERNET_FLAG_NO_CACHE_WRITE
Definition: wininet.h:66
#define INTERNET_FLAG_TRANSFER_BINARY
Definition: wininet.h:91
#define INTERNET_FLAG_CACHE_ASYNC
Definition: wininet.h:86
#define INTERNET_FLAG_SECURE
Definition: wininet.h:71
#define INTERNET_FLAG_HYPERLINK
Definition: wininet.h:83
#define INTERNET_FLAG_NO_UI
Definition: wininet.h:84
#define INTERNET_FLAG_MAKE_PERSISTENT
Definition: wininet.h:68
#define INTERNET_FLAG_READ_PREFETCH
Definition: wininet.h:74
#define INTERNET_FLAG_IGNORE_CERT_DATE_INVALID
Definition: wininet.h:80
#define INTERNET_FLAG_CACHE_IF_NET_FAIL
Definition: wininet.h:77
#define INTERNET_FLAG_IGNORE_CERT_CN_INVALID
Definition: wininet.h:81
#define INTERNET_FLAG_FORMS_SUBMIT
Definition: wininet.h:87
#define INTERNET_FLAG_EXISTING_CONNECT
Definition: wininet.h:63
#define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP
Definition: wininet.h:78
#define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS
Definition: wininet.h:79
#define INTERNET_FLAG_NO_AUTH
Definition: wininet.h:76

Referenced by InternetOpenUrlW(), and InternetOpenW().

◆ free_global_proxy()

static void free_global_proxy ( void  )
static

Definition at line 608 of file internet.c.

609{
612 memset( &global_proxy, 0, sizeof(global_proxy) );
614}
static void FreeProxyInfo(proxyinfo_t *lpwpi)
Definition: internet.c:597

Referenced by InternetSetOptionW().

◆ FreeProxyInfo()

static void FreeProxyInfo ( proxyinfo_t *  lpwpi)
static

Definition at line 597 of file internet.c.

598{
599 free(lpwpi->proxy);
600 free(lpwpi->proxyBypass);
601 free(lpwpi->proxyUsername);
602 free(lpwpi->proxyPassword);
603 free(lpwpi->autoconf_url);
604}
LPWSTR proxyPassword
Definition: internet.c:92
LPWSTR proxyUsername
Definition: internet.c:91

Referenced by free_global_proxy(), INTERNET_ConfigureProxy(), INTERNET_LoadProxySettings(), InternetSetOptionW(), load_connection_settings(), and query_global_option().

◆ get_adapters()

static IP_ADAPTER_ADDRESSES * get_adapters ( void  )
static

Definition at line 2743 of file internet.c.

2744{
2745 ULONG err, size = 1024, flags = GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST |
2746 GAA_FLAG_SKIP_DNS_SERVER | GAA_FLAG_SKIP_FRIENDLY_NAME;
2747 IP_ADAPTER_ADDRESSES *tmp, *ret;
2748
2749 if (!(ret = malloc( size ))) return NULL;
2750 err = GetAdaptersAddresses( AF_UNSPEC, flags, NULL, ret, &size );
2751 while (err == ERROR_BUFFER_OVERFLOW)
2752 {
2753 if (!(tmp = realloc( ret, size ))) break;
2754 ret = tmp;
2755 err = GetAdaptersAddresses( AF_UNSPEC, flags, NULL, ret, &size );
2756 }
2757 if (err == ERROR_SUCCESS) return ret;
2758 free( ret );
2759 return NULL;
2760}
GLbitfield flags
Definition: glext.h:7161
#define GAA_FLAG_SKIP_FRIENDLY_NAME
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:307

Referenced by detect_proxy_autoconfig_url_dhcp().

◆ get_computer_name()

static char * get_computer_name ( COMPUTER_NAME_FORMAT  format)
static

Definition at line 2819 of file internet.c.

2820{
2821 char *ret;
2822 DWORD size = 0;
2823
2825 if (GetLastError() != ERROR_MORE_DATA) return NULL;
2826 if (!(ret = malloc( size ))) return NULL;
2827 if (!GetComputerNameExA( format, ret, &size ))
2828 {
2829 free( ret );
2830 return NULL;
2831 }
2832 return ret;
2833}
BOOL WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT, LPSTR, LPDWORD)
Definition: compname.c:376

Referenced by detect_proxy_autoconfig_url_dns().

◆ get_handle_object()

◆ get_http_proxy()

static WCHAR * get_http_proxy ( const WCHAR *  proxy)
static

Definition at line 651 of file internet.c.

652{
653 const WCHAR *p, *end;
654 WCHAR *ret;
655
656 p = wcsstr( proxy, L"http=" );
657 if (p) p += 5;
658 else p = proxy;
659 end = wcschr( p, ';' );
660 if (!end) end = p + wcslen( p );
661
662 ret = malloc( (end - p + 1) * sizeof(WCHAR) );
663 memcpy(ret, p, (end - p) * sizeof(WCHAR) );
664 ret[end - p] = 0;
665 return ret;
666}
#define wcschr
Definition: compat.h:17
_ACRTIMP wchar_t *__cdecl wcsstr(const wchar_t *, const wchar_t *)
Definition: wcs.c:2998
GLuint GLuint end
Definition: gl.h:1545

Referenced by INTERNET_ConfigureProxy().

◆ get_proxy_autoconfig_url()

static WCHAR * get_proxy_autoconfig_url ( void  )
static

Definition at line 2918 of file internet.c.

2919{
2922 return ret;
2923}
static WCHAR * detect_proxy_autoconfig_url_dhcp(void)
Definition: internet.c:2762
static WCHAR * detect_proxy_autoconfig_url_dns(void)
Definition: internet.c:2869

Referenced by APPINFO_QueryOption(), and query_global_option().

◆ GetInternetSchemeW()

static INTERNET_SCHEME GetInternetSchemeW ( LPCWSTR  lpszScheme,
DWORD  nMaxCmp 
)
static

Definition at line 2027 of file internet.c.

2028{
2029 int i;
2030
2031 TRACE("%s %ld\n",debugstr_wn(lpszScheme, nMaxCmp), nMaxCmp);
2032
2033 if(lpszScheme==NULL)
2035
2036 for (i = 0; i < ARRAY_SIZE(url_schemes); i++)
2037 if (!wcsnicmp(lpszScheme, url_schemes[i], nMaxCmp))
2038 return INTERNET_SCHEME_FIRST + i;
2039
2041}
#define wcsnicmp
Definition: compat.h:14
static const WCHAR * url_schemes[]
Definition: internet.c:2002
#define debugstr_wn
Definition: kernel32.h:33
@ INTERNET_SCHEME_FIRST
Definition: wininet.h:150

Referenced by calc_url_length(), InternetCrackUrlW(), and InternetCreateUrlW().

◆ INET_QueryOption()

DWORD INET_QueryOption ( object_header_t *  hdr,
DWORD  option,
void *  buffer,
DWORD *  size,
BOOL  unicode 
)

Definition at line 3159 of file internet.c.

3160{
3161 switch(option) {
3163 if (!size)
3165
3166 if (*size < sizeof(DWORD_PTR)) {
3167 *size = sizeof(DWORD_PTR);
3169 }
3170 if (!buffer)
3172
3173 *(DWORD_PTR *)buffer = hdr->dwContext;
3174 *size = sizeof(DWORD_PTR);
3175 return ERROR_SUCCESS;
3176
3178 WARN("INTERNET_OPTION_REQUEST_FLAGS\n");
3179 *size = sizeof(DWORD);
3181
3184 WARN("Called on global option %lu\n", option);
3186
3188 TRACE("INTERNET_OPTION_CONNECT_TIMEOUT\n");
3189
3190 if (*size < sizeof(ULONG))
3192
3193 *(ULONG*)buffer = hdr->connect_timeout;
3194 *size = sizeof(ULONG);
3195
3196 return ERROR_SUCCESS;
3197
3199 TRACE("INTERNET_OPTION_SEND_TIMEOUT\n");
3200
3201 if (*size < sizeof(ULONG))
3203
3204 *size = sizeof(ULONG);
3205 *(ULONG *)buffer = hdr->send_timeout;
3206 return ERROR_SUCCESS;
3207
3209 TRACE("INTERNET_OPTION_RECEIVE_TIMEOUT\n");
3210
3211 if (*size < sizeof(ULONG))
3213
3214 *size = sizeof(ULONG);
3215 *(ULONG *)buffer = hdr->receive_timeout;
3216 return ERROR_SUCCESS;
3217
3219 TRACE("INTERNET_OPTION_DATA_SEND_TIMEOUT\n");
3220
3221 if (*size < sizeof(ULONG))
3223
3224 *size = sizeof(ULONG);
3225 *(ULONG *)buffer = hdr->data_send_timeout;
3226 return ERROR_SUCCESS;
3227
3229 TRACE("INTERNET_OPTION_DATA_RECEIVE_TIMEOUT\n");
3230
3231 if (*size < sizeof(ULONG))
3233
3234 *size = sizeof(ULONG);
3235 *(ULONG *)buffer = hdr->data_receive_timeout;
3236 return ERROR_SUCCESS;
3237 }
3238
3239 /* FIXME: we shouldn't call it here */
3240 return query_global_option(option, buffer, size, unicode);
3241}
#define WARN(fmt,...)
Definition: precomp.h:61
static DWORD query_global_option(DWORD option, void *buffer, DWORD *size, BOOL unicode)
Definition: internet.c:2925
#define DWORD_PTR
Definition: treelist.c:76
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define INTERNET_OPTION_DATA_SEND_TIMEOUT
Definition: wininet.h:708
#define INTERNET_OPTION_CONNECT_TIMEOUT
Definition: wininet.h:701
#define INTERNET_OPTION_DATA_RECEIVE_TIMEOUT
Definition: wininet.h:709
#define INTERNET_OPTION_MAX_CONNS_PER_SERVER
Definition: wininet.h:763
#define ERROR_INTERNET_INVALID_OPERATION
Definition: wininet.h:2005
#define INTERNET_OPTION_SEND_TIMEOUT
Definition: wininet.h:704
#define INTERNET_OPTION_RECEIVE_TIMEOUT
Definition: wininet.h:706
#define INTERNET_OPTION_CONTEXT_VALUE
Definition: wininet.h:739
#define ERROR_INTERNET_INCORRECT_HANDLE_TYPE
Definition: wininet.h:2007
#define INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER
Definition: wininet.h:764
#define INTERNET_OPTION_REQUEST_FLAGS
Definition: wininet.h:718

Referenced by APPINFO_QueryOption(), FTPFILE_QueryOption(), FTPFINDNEXT_QueryOption(), FTPSESSION_QueryOption(), and HTTPSESSION_QueryOption().

◆ INET_SetOption()

DWORD INET_SetOption ( object_header_t *  hdr,
DWORD  option,
void *  buf,
DWORD  size 
)

Definition at line 3309 of file internet.c.

3310{
3311 switch(option) {
3313 FIXME("INTERNETOPTION_SETTINGS_CHANGED semi-stub\n");
3315 return ERROR_SUCCESS;
3317 WARN("Not settable option %lu\n", option);
3321 WARN("Called on global option %lu\n", option);
3326 if (!buf || size != sizeof(ULONG)) return ERROR_INVALID_PARAMETER;
3327 hdr->connect_timeout = *(ULONG *)buf;
3328 return ERROR_SUCCESS;
3330 if (!buf || size != sizeof(ULONG)) return ERROR_INVALID_PARAMETER;
3331 hdr->send_timeout = *(ULONG *)buf;
3332 return ERROR_SUCCESS;
3334 if (!buf || size != sizeof(ULONG)) return ERROR_INVALID_PARAMETER;
3335 hdr->receive_timeout = *(ULONG *)buf;
3336 return ERROR_SUCCESS;
3338 if (!buf || size != sizeof(ULONG)) return ERROR_INVALID_PARAMETER;
3339 hdr->data_send_timeout = *(ULONG *)buf;
3340 return ERROR_SUCCESS;
3342 if (!buf || size != sizeof(ULONG)) return ERROR_INVALID_PARAMETER;
3343 hdr->data_receive_timeout = *(ULONG *)buf;
3344 return ERROR_SUCCESS;
3345 }
3346
3348}
@ COLLECT_CONNECTIONS
Definition: internet.h:60
#define ERROR_INTERNET_OPTION_NOT_SETTABLE
Definition: wininet.h:2000
#define ERROR_INTERNET_INVALID_OPTION
Definition: wininet.h:1998
#define INTERNET_OPTION_SETTINGS_CHANGED
Definition: wininet.h:733
#define INTERNET_OPTION_CALLBACK
Definition: wininet.h:700

Referenced by APPINFO_SetOption(), HTTPREQ_SetOption(), HTTPSESSION_SetOption(), and set_global_option().

◆ init_global_proxy()

static void init_global_proxy ( void  )
static

Definition at line 860 of file internet.c.

861{
862 const WCHAR *envproxy;
863
865 if (global_proxy.flags) goto done;
866
868 if (global_proxy.flags & PROXY_TYPE_PROXY || !(envproxy = _wgetenv( L"http_proxy" )))
869 goto done;
870
871 if (parse_proxy_url( &global_proxy, envproxy ))
872 {
874 global_proxy.proxyBypass = wcsdup(_wgetenv( L"no_proxy" ));
875 TRACE("http proxy (from environment) = %s\n", debugstr_w(global_proxy.proxy));
876 TRACE("http proxy bypass (from environment) = %s\n", debugstr_w(global_proxy.proxyBypass));
877 }
878 else
879 {
880 WARN("failed to parse http_proxy value %s\n", debugstr_w(envproxy));
881 }
882
883done:
885}
wchar_t *CDECL _wgetenv(const wchar_t *name)
Definition: environ.c:254
static LONG INTERNET_LoadProxySettings(proxyinfo_t *lpwpi)
Definition: internet.c:753
static BOOL parse_proxy_url(proxyinfo_t *info, const WCHAR *url)
Definition: internet.c:616

Referenced by INTERNET_GetProxySettings().

◆ INTERNET_AllocThreadError()

static LPWITHREADERROR INTERNET_AllocThreadError ( void  )
static

Definition at line 4429 of file internet.c.

4430{
4431 WITHREADERROR *lpwite = malloc(sizeof(*lpwite));
4432
4433 if (lpwite)
4434 {
4435 lpwite->dwError = 0;
4436 lpwite->response[0] = '\0';
4437 }
4438
4439 if (!TlsSetValue(g_dwTlsErrIndex, lpwite))
4440 {
4441 free(lpwite);
4442 return NULL;
4443 }
4444 return lpwite;
4445}
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
Definition: thread.c:1337
CHAR response[MAX_REPLY_LEN]
Definition: internet.c:67
DWORD dwError
Definition: internet.c:66

Referenced by INTERNET_GetResponseBuffer(), and INTERNET_SetLastError().

◆ INTERNET_AsyncCall()

DWORD INTERNET_AsyncCall ( task_header_t *  task)

Definition at line 4534 of file internet.c.

4535{
4536 BOOL bSuccess;
4537
4538 TRACE("\n");
4539
4541 if (!bSuccess)
4542 {
4543 free(task);
4545 }
4546 return ERROR_SUCCESS;
4547}
BOOL WINAPI QueueUserWorkItem(IN LPTHREAD_START_ROUTINE Function, IN PVOID Context, IN ULONG Flags)
Definition: thread.c:1137
static DWORD CALLBACK INTERNET_WorkerThreadFunc(LPVOID lpvParam)
Definition: internet.c:4495
#define ERROR_INTERNET_ASYNC_THREAD_FAILED
Definition: wininet.h:2035
#define WT_EXECUTELONGFUNCTION
Definition: winnt_old.h:1105

Referenced by async_read(), FtpCreateDirectoryW(), FtpDeleteFileW(), FTPFILE_QueryDataAvailable(), FtpFindFirstFileW(), FTPFINDNEXT_FindNextFileW(), FtpGetCurrentDirectoryW(), FtpGetFileW(), FtpOpenFileW(), FtpPutFileW(), FtpRemoveDirectoryW(), FtpRenameFileW(), FtpSetCurrentDirectoryW(), HttpEndRequestW(), HttpSendRequestExW(), HttpSendRequestW(), and InternetOpenUrlW().

◆ INTERNET_ConfigureProxy()

static BOOL INTERNET_ConfigureProxy ( appinfo_t *  lpwai)
static

Definition at line 910 of file internet.c.

911{
912 proxyinfo_t wpi;
913
914 if (INTERNET_GetProxySettings( &wpi ))
915 return FALSE;
916
917 if (wpi.flags & PROXY_TYPE_PROXY)
918 {
919 TRACE("http proxy = %s bypass = %s\n", debugstr_w(wpi.proxy), debugstr_w(wpi.proxyBypass));
920
922 lpwai->proxy = get_http_proxy( wpi.proxy );
923 lpwai->proxyBypass = wpi.proxyBypass;
924 lpwai->proxyUsername = wpi.proxyUsername;
925 lpwai->proxyPassword = wpi.proxyPassword;
926 free( wpi.proxy );
927 return TRUE;
928 }
929
931 FreeProxyInfo(&wpi);
932 return FALSE;
933}
static WCHAR * get_http_proxy(const WCHAR *proxy)
Definition: internet.c:651
static LONG INTERNET_GetProxySettings(proxyinfo_t *lpwpi)
Definition: internet.c:892
#define INTERNET_OPEN_TYPE_DIRECT
Definition: wininet.h:522
#define INTERNET_OPEN_TYPE_PROXY
Definition: wininet.h:523

Referenced by InternetOpenW(), and query_global_option().

◆ INTERNET_FindProxyForProtocol()

WCHAR * INTERNET_FindProxyForProtocol ( LPCWSTR  szProxy,
LPCWSTR  proto 
)

Definition at line 511 of file internet.c.

512{
513 WCHAR *ret = NULL;
514 const WCHAR *ptr;
515
516 TRACE("(%s, %s)\n", debugstr_w(szProxy), debugstr_w(proto));
517
518 /* First, look for the specified protocol (proto=scheme://host:port) */
519 for (ptr = szProxy; ptr && *ptr; )
520 {
522
523 if (!(end = wcschr(ptr, ' ')))
524 end = ptr + lstrlenW(ptr);
525 if ((equal = wcschr(ptr, '=')) && equal < end &&
526 equal - ptr == lstrlenW(proto) &&
528 {
529 ret = strndupW(equal + 1, end - equal - 1);
530 TRACE("found proxy for %s: %s\n", debugstr_w(proto), debugstr_w(ret));
531 return ret;
532 }
533 if (*end == ' ')
534 ptr = end + 1;
535 else
536 ptr = end;
537 }
538
539 /* It wasn't found: look for no protocol */
540 for (ptr = szProxy; ptr && *ptr; )
541 {
542 LPCWSTR end;
543
544 if (!(end = wcschr(ptr, ' ')))
545 end = ptr + lstrlenW(ptr);
546 if (!wcschr(ptr, '='))
547 {
548 ret = strndupW(ptr, end - ptr);
549 TRACE("found proxy for %s: %s\n", debugstr_w(proto), debugstr_w(ret));
550 return ret;
551 }
552 if (*end == ' ')
553 ptr = end + 1;
554 else
555 ptr = end;
556 }
557
558 return NULL;
559}
#define equal(x, y)
Definition: reader.cc:56
static WCHAR * strndupW(LPCWSTR str, int len)
Definition: urlmon_main.h:236

Referenced by HTTP_DealWithProxy().

◆ INTERNET_GetLastError()

DWORD INTERNET_GetLastError ( void  )

Definition at line 4477 of file internet.c.

4478{
4480 if (!lpwite) return 0;
4481 /* TlsGetValue clears last error, so set it again here */
4482 SetLastError(lpwite->dwError);
4483 return lpwite->dwError;
4484}

Referenced by FTP_FtpCreateDirectoryW(), FTP_FtpDeleteFileW(), FTP_FtpFindFirstFileW(), FTP_FtpGetFileW(), FTP_FtpOpenFileW(), FTP_FtpPutFileW(), FTP_FtpRemoveDirectoryW(), FTP_FtpRenameFileW(), FTP_ReceiveRequestData(), HTTP_HandleRedirect(), and InternetConnectW().

◆ INTERNET_GetProxySettings()

static LONG INTERNET_GetProxySettings ( proxyinfo_t *  lpwpi)
static

Definition at line 892 of file internet.c.

893{
895
896 memset(lpwpi, 0, sizeof(*lpwpi));
898 lpwpi->flags = global_proxy.flags;
899 lpwpi->proxy = wcsdup( global_proxy.proxy );
904 return ERROR_SUCCESS;
905}
static void init_global_proxy(void)
Definition: internet.c:860

Referenced by INTERNET_ConfigureProxy().

◆ INTERNET_GetResponseBuffer()

LPSTR INTERNET_GetResponseBuffer ( void  )

Definition at line 4556 of file internet.c.

4557{
4559 if (!lpwite)
4560 lpwite = INTERNET_AllocThreadError();
4561 TRACE("\n");
4562 return lpwite->response;
4563}
static LPWITHREADERROR INTERNET_AllocThreadError(void)
Definition: internet.c:4429

Referenced by FTP_DoPassive(), FTP_FtpGetCurrentDirectoryW(), FTP_GetNextLine(), and FTP_ReceiveResponse().

◆ INTERNET_GetSchemeString()

static LPCWSTR INTERNET_GetSchemeString ( INTERNET_SCHEME  scheme)
static

Definition at line 4821 of file internet.c.

4822{
4823 int index;
4825 return NULL;
4828 return NULL;
4829 return url_schemes[index];
4830}
#define index(s, c)
Definition: various.h:29
GLuint index
Definition: glext.h:6031

Referenced by calc_url_length(), and InternetCreateUrlW().

◆ INTERNET_InternetOpenUrlW()

static HINTERNET INTERNET_InternetOpenUrlW ( appinfo_t *  hIC,
LPCWSTR  lpszUrl,
LPCWSTR  lpszHeaders,
DWORD  dwHeadersLength,
DWORD  dwFlags,
DWORD_PTR  dwContext 
)
static

Definition at line 4222 of file internet.c.

4224{
4225 URL_COMPONENTSW urlComponents = { sizeof(urlComponents) };
4226 WCHAR *host, *user = NULL, *pass = NULL, *path;
4227 HINTERNET client = NULL, client1 = NULL;
4228 DWORD res;
4229
4230 TRACE("(%p, %s, %s, %08lx, %08lx, %08Ix)\n", hIC, debugstr_w(lpszUrl), debugstr_w(lpszHeaders),
4231 dwHeadersLength, dwFlags, dwContext);
4232
4233 urlComponents.dwHostNameLength = 1;
4234 urlComponents.dwUserNameLength = 1;
4235 urlComponents.dwPasswordLength = 1;
4236 urlComponents.dwUrlPathLength = 1;
4237 urlComponents.dwExtraInfoLength = 1;
4238 if(!InternetCrackUrlW(lpszUrl, lstrlenW(lpszUrl), 0, &urlComponents))
4239 return NULL;
4240
4241 if ((urlComponents.nScheme == INTERNET_SCHEME_HTTP || urlComponents.nScheme == INTERNET_SCHEME_HTTPS) &&
4242 urlComponents.dwExtraInfoLength)
4243 {
4244 assert(urlComponents.lpszUrlPath + urlComponents.dwUrlPathLength == urlComponents.lpszExtraInfo);
4245 urlComponents.dwUrlPathLength += urlComponents.dwExtraInfoLength;
4246 }
4247
4248 host = strndupW(urlComponents.lpszHostName, urlComponents.dwHostNameLength);
4249 path = strndupW(urlComponents.lpszUrlPath, urlComponents.dwUrlPathLength);
4250 if(urlComponents.dwUserNameLength)
4251 user = strndupW(urlComponents.lpszUserName, urlComponents.dwUserNameLength);
4252 if(urlComponents.dwPasswordLength)
4253 pass = strndupW(urlComponents.lpszPassword, urlComponents.dwPasswordLength);
4254
4255 switch(urlComponents.nScheme) {
4257 client = FTP_Connect(hIC, host, urlComponents.nPort,
4258 user, pass, dwFlags, dwContext, INET_OPENURL);
4259 if(client == NULL)
4260 break;
4261 client1 = FtpOpenFileW(client, path, GENERIC_READ, dwFlags, dwContext);
4262 if(client1 == NULL) {
4264 break;
4265 }
4266 break;
4267
4269 case INTERNET_SCHEME_HTTPS: {
4270 LPCWSTR accept[2] = { L"*/*", NULL };
4271
4273
4274 /* FIXME: should use pointers, not handles, as handles are not thread-safe */
4275 res = HTTP_Connect(hIC, host, urlComponents.nPort,
4276 user, pass, dwFlags, dwContext, INET_OPENURL, &client);
4277 if(res != ERROR_SUCCESS) {
4279 break;
4280 }
4281
4282 client1 = HttpOpenRequestW(client, NULL, path, NULL, NULL, accept, dwFlags, dwContext);
4283 if(client1 == NULL) {
4285 break;
4286 }
4287 HttpAddRequestHeadersW(client1, lpszHeaders, dwHeadersLength, HTTP_ADDREQ_FLAG_ADD);
4288 if (!HttpSendRequestW(client1, NULL, 0, NULL, 0) &&
4290 InternetCloseHandle(client1);
4291 client1 = NULL;
4292 break;
4293 }
4294 }
4296 /* gopher doesn't seem to be implemented in wine, but it's supposed
4297 * to be supported by InternetOpenUrlA. */
4298 default:
4300 break;
4301 }
4302
4303 TRACE(" %p <--\n", client1);
4304
4305 free(host);
4306 free(path);
4307 free(user);
4308 free(pass);
4309 return client1;
4310}
void user(int argc, const char *argv[])
Definition: cmds.c:1350
#define ERROR_IO_PENDING
Definition: dderror.h:15
#define assert(_expr)
Definition: assert.h:32
HINTERNET WINAPI FtpOpenFileW(HINTERNET hFtpSession, LPCWSTR lpszFileName, DWORD fdwAccess, DWORD dwFlags, DWORD_PTR dwContext)
Definition: ftp.c:1486
HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName, INTERNET_PORT nServerPort, LPCWSTR lpszUserName, LPCWSTR lpszPassword, DWORD dwFlags, DWORD_PTR dwContext, DWORD dwInternalFlags)
Definition: ftp.c:2430
BOOL WINAPI HttpAddRequestHeadersW(HINTERNET hHttpRequest, LPCWSTR lpszHeader, DWORD dwHeaderLength, DWORD dwModifier)
Definition: http.c:1280
BOOL WINAPI HttpSendRequestW(HINTERNET hHttpRequest, LPCWSTR lpszHeaders, DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength)
Definition: http.c:5710
DWORD HTTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName, INTERNET_PORT serverPort, LPCWSTR lpszUserName, LPCWSTR lpszPassword, DWORD dwFlags, DWORD_PTR dwContext, DWORD dwInternalFlags, HINTERNET *ret)
Definition: http.c:5910
HINTERNET WINAPI HttpOpenRequestW(HINTERNET hHttpSession, LPCWSTR lpszVerb, LPCWSTR lpszObjectName, LPCWSTR lpszVersion, LPCWSTR lpszReferrer, LPCWSTR *lpszAcceptTypes, DWORD dwFlags, DWORD_PTR dwContext)
Definition: http.c:3569
BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwFlags, URL_COMPONENTSW *lpUC)
Definition: internet.c:2052
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
Definition: internet.c:1841
#define INET_OPENURL
Definition: internet.h:209
static FILE * client
Definition: client.c:37
SOCKET WSAAPI accept(IN SOCKET s, OUT LPSOCKADDR addr, OUT INT FAR *addrlen)
Definition: socklife.c:23
DWORD dwUrlPathLength
Definition: wininet.h:223
DWORD dwExtraInfoLength
Definition: wininet.h:225
LPWSTR lpszPassword
Definition: wininet.h:220
LPWSTR lpszHostName
Definition: wininet.h:215
DWORD dwUserNameLength
Definition: wininet.h:219
DWORD dwHostNameLength
Definition: wininet.h:216
INTERNET_SCHEME nScheme
Definition: wininet.h:214
LPWSTR lpszUserName
Definition: wininet.h:218
LPWSTR lpszUrlPath
Definition: wininet.h:222
LPWSTR lpszExtraInfo
Definition: wininet.h:224
DWORD dwPasswordLength
Definition: wininet.h:221
INTERNET_PORT nPort
Definition: wininet.h:217
Definition: txthost.c:37
pass
Definition: typegen.h:25
#define INTERNET_SCHEME_FTP
Definition: winhttp.h:49
#define INTERNET_SCHEME_HTTPS
Definition: winhttp.h:48
#define HTTP_ADDREQ_FLAG_ADD
Definition: wininet.h:1707
@ INTERNET_SCHEME_GOPHER
Definition: wininet.h:140
#define ERROR_INTERNET_UNRECOGNIZED_SCHEME
Definition: wininet.h:1995

Referenced by AsyncInternetOpenUrlProc(), and InternetOpenUrlW().

◆ INTERNET_LoadProxySettings()

static LONG INTERNET_LoadProxySettings ( proxyinfo_t *  lpwpi)
static

Definition at line 753 of file internet.c.

754{
755 DWORD type, len, val;
756 HKEY key, con;
757 LONG ret;
758
759 memset( lpwpi, 0, sizeof(*lpwpi) );
760
762 return ret;
763
764 if (!(ret = RegOpenKeyW( key, L"Connections", &con )))
765 {
766 load_connection_settings( con, L"DefaultConnectionSettings", lpwpi );
767 RegCloseKey( con );
768 }
769
770 len = sizeof(DWORD);
771 if (RegQueryValueExW( key, L"ProxyEnable", NULL, &type, (BYTE *)&val, &len ) || type != REG_DWORD)
772 {
773 val = !!(lpwpi->flags & PROXY_TYPE_PROXY);
774 if((ret = RegSetValueExW( key, L"ProxyEnable", 0, REG_DWORD, (BYTE *)&val, sizeof(DWORD) )))
775 {
776 RegCloseKey( key );
777 FreeProxyInfo( lpwpi );
778 return ret;
779 }
780 }
781 else if (val)
782 {
783 lpwpi->flags |= PROXY_TYPE_PROXY;
784 }
785 else
786 {
787 lpwpi->flags &= ~PROXY_TYPE_PROXY;
788 }
789
790 /* figure out how much memory the proxy setting takes */
791 if (!RegQueryValueExW( key, L"ProxyServer", NULL, &type, NULL, &len ) && len && (type == REG_SZ))
792 {
793 LPWSTR szProxy;
794
795 if (!(szProxy = malloc( len )))
796 {
797 RegCloseKey( key );
798 FreeProxyInfo( lpwpi );
799 return ERROR_OUTOFMEMORY;
800 }
801 RegQueryValueExW( key, L"ProxyServer", NULL, &type, (BYTE*)szProxy, &len );
802
803 free( lpwpi->proxy );
804 lpwpi->proxy = szProxy;
805 }
806
807 if (lpwpi->proxy)
808 {
809 TRACE("proxy (from registry%s) = %s\n", lpwpi->flags & PROXY_TYPE_PROXY ? "" : ", disabled",
810 debugstr_w(lpwpi->proxy));
811 }
812 else
813 {
814 TRACE("No proxy server settings in registry.\n");
815 }
816
817 if (!RegQueryValueExW( key, L"ProxyOverride", NULL, &type, NULL, &len ) && len && (type == REG_SZ))
818 {
819 LPWSTR szProxy;
820
821 if (!(szProxy = malloc( len )))
822 {
823 RegCloseKey( key );
824 FreeProxyInfo( lpwpi );
825 return ERROR_OUTOFMEMORY;
826 }
827 RegQueryValueExW( key, L"ProxyOverride", NULL, &type, (BYTE*)szProxy, &len );
828
829 free( lpwpi->proxyBypass );
830 lpwpi->proxyBypass = szProxy;
831 TRACE("http proxy bypass (from registry) = %s\n", debugstr_w(lpwpi->proxyBypass));
832 }
833 else
834 {
835 TRACE("No proxy bypass server settings in registry.\n");
836 }
837
838 if (!RegQueryValueExW( key, L"AutoConfigURL", NULL, &type, NULL, &len ) && len && (type == REG_SZ))
839 {
840 LPWSTR autoconf_url;
841
842 if (!(autoconf_url = malloc( len )))
843 {
844 RegCloseKey( key );
845 FreeProxyInfo( lpwpi );
846 return ERROR_OUTOFMEMORY;
847 }
848 RegQueryValueExW( key, L"AutoConfigURL", NULL, &type, (BYTE*)autoconf_url, &len );
849
851 free( lpwpi->autoconf_url );
852 lpwpi->autoconf_url = autoconf_url;
853 TRACE("AutoConfigURL = %s\n", debugstr_w(lpwpi->autoconf_url));
854 }
855
856 RegCloseKey( key );
857 return ERROR_SUCCESS;
858}
#define REG_SZ
Definition: layer.c:22
#define RegCloseKey(hKey)
Definition: registry.h:49
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
static const WCHAR szInternetSettings[]
Definition: internet.c:119
static LONG load_connection_settings(HKEY key, const WCHAR *connection, proxyinfo_t *lpwpi)
Definition: internet.c:699
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define REG_DWORD
Definition: sdbapi.c:615
Definition: copy.c:22
#define PROXY_TYPE_AUTO_PROXY_URL
Definition: wininet.h:348
#define HKEY_CURRENT_USER
Definition: winreg.h:11

Referenced by init_global_proxy(), InternetSetOptionW(), and query_global_option().

◆ INTERNET_SaveProxySettings()

static LONG INTERNET_SaveProxySettings ( proxyinfo_t *  lpwpi)
static

Definition at line 406 of file internet.c.

407{
408 HKEY key, con;
409 DWORD val;
410 LONG ret;
411
413 return ret;
414
415 if ((ret = RegCreateKeyExW( key, L"Connections", 0, NULL, 0, KEY_WRITE, NULL, &con, NULL )))
416 {
417 RegCloseKey( key );
418 return ret;
419 }
420 ret = save_connection_settings( con, L"DefaultConnectionSettings", lpwpi );
421 RegCloseKey( con );
422 if (ret)
423 {
424 RegCloseKey( key );
425 return ret;
426 }
427
428 val = !!(lpwpi->flags & PROXY_TYPE_PROXY);
429 if ((ret = RegSetValueExW( key, L"ProxyEnable", 0, REG_DWORD, (BYTE*)&val, sizeof(DWORD))))
430 {
431 RegCloseKey( key );
432 return ret;
433 }
434
435 if (lpwpi->proxy)
436 {
437 if ((ret = RegSetValueExW( key, L"ProxyServer", 0, REG_SZ, (BYTE*)lpwpi->proxy,
438 sizeof(WCHAR) * (lstrlenW(lpwpi->proxy) + 1))))
439 {
440 RegCloseKey( key );
441 return ret;
442 }
443 }
444 else
445 {
446 if ((ret = RegDeleteValueW( key, L"ProxyServer" )) && ret != ERROR_FILE_NOT_FOUND)
447 {
448 RegCloseKey( key );
449 return ret;
450 }
451 }
452
453 if (lpwpi->proxyBypass)
454 {
455 if ((ret = RegSetValueExW( key, L"ProxyOverride", 0, REG_SZ, (BYTE*)lpwpi->proxyBypass,
456 sizeof(WCHAR) * (lstrlenW(lpwpi->proxyBypass) + 1))))
457 {
458 RegCloseKey( key );
459 return ret;
460 }
461 }
462 else
463 {
464 if ((ret = RegDeleteValueW( key, L"ProxyOverride" )) && ret != ERROR_FILE_NOT_FOUND)
465 {
466 RegCloseKey( key );
467 return ret;
468 }
469 }
470
471 if (lpwpi->autoconf_url && lpwpi->flags & PROXY_TYPE_AUTO_PROXY_URL)
472 {
473 if ((ret = RegSetValueExW( key, L"AutoConfigURL", 0, REG_SZ, (BYTE*)lpwpi->autoconf_url,
474 sizeof(WCHAR) * (lstrlenW(lpwpi->autoconf_url) + 1))))
475 {
476 RegCloseKey( key );
477 return ret;
478 }
479 }
480 else
481 {
482 if ((ret = RegDeleteValueW( key, L"AutoConfigURL" )) && ret != ERROR_FILE_NOT_FOUND)
483 {
484 RegCloseKey( key );
485 return ret;
486 }
487 }
488
490 return ERROR_SUCCESS;
491}
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2330
static LONG save_connection_settings(HKEY key, const WCHAR *connection, proxyinfo_t *lpwpi)
Definition: internet.c:371
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define KEY_WRITE
Definition: nt_native.h:1034

Referenced by InternetSetOptionW().

◆ INTERNET_SetLastError()

◆ INTERNET_WorkerThreadFunc()

static DWORD CALLBACK INTERNET_WorkerThreadFunc ( LPVOID  lpvParam)
static

Definition at line 4495 of file internet.c.

4496{
4497 task_header_t *task = lpvParam;
4498
4499 TRACE("\n");
4500
4501 task->proc(task);
4502 WININET_Release(task->hdr);
4503 free(task);
4504
4506 {
4509 }
4510 return TRUE;
4511}
BOOL WININET_Release(object_header_t *info)
Definition: internet.c:244

Referenced by INTERNET_AsyncCall().

◆ InternetAttemptConnect()

DWORD WINAPI InternetAttemptConnect ( DWORD  dwReserved)

Definition at line 2368 of file internet.c.

2369{
2370 FIXME("Stub\n");
2371 return ERROR_SUCCESS;
2372}

◆ InternetAutodial()

BOOL WINAPI InternetAutodial ( DWORD  dwFlags,
HWND  hwndParent 
)

Definition at line 4701 of file internet.c.

4702{
4703 FIXME("STUB\n");
4704
4705 /* Tell that we are connected to the internet. */
4706 return TRUE;
4707}

◆ InternetAutodialHangup()

BOOL WINAPI InternetAutodialHangup ( DWORD  dwReserved)

Definition at line 4721 of file internet.c.

4722{
4723 FIXME("STUB\n");
4724
4725 /* we didn't dial, we don't disconnect */
4726 return TRUE;
4727}

◆ InternetCanonicalizeUrlA()

BOOL WINAPI InternetCanonicalizeUrlA ( LPCSTR  lpszUrl,
LPSTR  lpszBuffer,
LPDWORD  lpdwBufferLength,
DWORD  dwFlags 
)

Definition at line 2411 of file internet.c.

2413{
2414 HRESULT hr;
2415
2416 TRACE("(%s, %p, %p, 0x%08lx) buffer length: %ld\n", debugstr_a(lpszUrl), lpszBuffer,
2418
2420 hr = UrlCanonicalizeA(lpszUrl, lpszBuffer, lpdwBufferLength, dwFlags);
2423
2424 return hr == S_OK;
2425}
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT hr
Definition: delayimp.cpp:582
HRESULT WINAPI UrlCanonicalizeA(const char *src_url, char *canonicalized, DWORD *canonicalized_len, DWORD flags)
Definition: path.c:3518
static DWORD convert_url_canonicalization_flags(DWORD dwFlags)
Definition: internet.c:2386
#define debugstr_a
Definition: kernel32.h:31
#define E_POINTER
Definition: winerror.h:3480
_In_ _In_opt_ _Out_writes_bytes_to_opt_ lpdwBufferLength _Inout_ LPDWORD lpdwBufferLength
Definition: winhttp.h:1018

Referenced by InternetCanonicalizeUrl_test(), InternetOpenUrlA_test(), and test_InternetCanonicalizeUrlA().

◆ InternetCanonicalizeUrlW()

BOOL WINAPI InternetCanonicalizeUrlW ( LPCWSTR  lpszUrl,
LPWSTR  lpszBuffer,
LPDWORD  lpdwBufferLength,
DWORD  dwFlags 
)

Definition at line 2437 of file internet.c.

2439{
2440 HRESULT hr;
2441
2442 TRACE("(%s, %p, %p, 0x%08lx) buffer length: %ld\n", debugstr_w(lpszUrl), lpszBuffer,
2444
2446 hr = UrlCanonicalizeW(lpszUrl, lpszBuffer, lpdwBufferLength, dwFlags);
2449
2450 return hr == S_OK;
2451}
HRESULT WINAPI UrlCanonicalizeW(const WCHAR *src_url, WCHAR *canonicalized, DWORD *canonicalized_len, DWORD flags)
Definition: path.c:4128

Referenced by InternetCrackUrlW(), and SetFriendlyUrl().

◆ InternetCheckConnectionA()

BOOL WINAPI InternetCheckConnectionA ( LPCSTR  lpszUrl,
DWORD  dwFlags,
DWORD  dwReserved 
)

Definition at line 4196 of file internet.c.

4197{
4198 WCHAR *url = NULL;
4199 BOOL rc;
4200
4201 if(lpszUrl) {
4202 url = strdupAtoW(lpszUrl);
4203 if(!url)
4204 return FALSE;
4205 }
4206
4208
4209 free(url);
4210 return rc;
4211}
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:61
BOOL WINAPI InternetCheckConnectionW(LPCWSTR lpszUrl, DWORD dwFlags, DWORD dwReserved)
Definition: internet.c:4080
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95

◆ InternetCheckConnectionW()

BOOL WINAPI InternetCheckConnectionW ( LPCWSTR  lpszUrl,
DWORD  dwFlags,
DWORD  dwReserved 
)

Definition at line 4080 of file internet.c.

4081{
4082/*
4083 * this is a kludge which runs the resident ping program and reads the output.
4084 *
4085 * Anyone have a better idea?
4086 */
4087
4088 BOOL rc = FALSE;
4089 static const CHAR ping[] = "ping -c 1 ";
4090 static const CHAR redirect[] = " >/dev/null 2>/dev/null";
4091 WCHAR *host;
4092 DWORD len, host_len;
4094 int status = -1;
4095
4096 FIXME("(%s %lx %lx)\n", debugstr_w(lpszUrl), dwFlags, dwReserved);
4097
4098 /*
4099 * Crack or set the Address
4100 */
4101 if (lpszUrl == NULL)
4102 {
4103 /*
4104 * According to the doc we are supposed to use the ip for the next
4105 * server in the WnInet internal server database. I have
4106 * no idea what that is or how to get it.
4107 *
4108 * So someone needs to implement this.
4109 */
4110 FIXME("Unimplemented with URL of NULL\n");
4111 return TRUE;
4112 }
4113 else
4114 {
4116
4118
4119 if (!InternetCrackUrlW(lpszUrl,0,0,&components))
4120 goto End;
4121
4122 host = components.lpszHostName;
4123 host_len = components.dwHostNameLength;
4124 port = components.nPort;
4125 TRACE("host name: %s port: %d\n",debugstr_wn(host, host_len), port);
4126 }
4127
4129 {
4130 struct sockaddr_storage saddr;
4131 int sa_len = sizeof(saddr);
4132 WCHAR *host_z;
4133 int fd;
4134 BOOL b;
4135
4136 host_z = strndupW(host, host_len);
4137 if (!host_z)
4138 return FALSE;
4139
4140 b = GetAddress(host_z, port, (struct sockaddr *)&saddr, &sa_len, NULL);
4141 free(host_z);
4142 if(!b)
4143 goto End;
4144 init_winsock();
4145 fd = socket(saddr.ss_family, SOCK_STREAM, 0);
4146 if (fd != -1)
4147 {
4148 if (connect(fd, (struct sockaddr *)&saddr, sa_len) == 0)
4149 rc = TRUE;
4150 closesocket(fd);
4151 }
4152 }
4153 else
4154 {
4155 /*
4156 * Build our ping command
4157 */
4158 char *command;
4159
4160 len = WideCharToMultiByte(CP_UNIXCP, 0, host, host_len, NULL, 0, NULL, NULL);
4161 command = malloc(strlen(ping) + len + strlen(redirect) + 1);
4162 strcpy(command, ping);
4163 WideCharToMultiByte(CP_UNIXCP, 0, host, host_len, command+sizeof(ping)-1, len, NULL, NULL);
4164 strcpy(command+sizeof(ping)-1+len, redirect);
4165
4166 TRACE("Ping command is : %s\n",command);
4167
4169 free(command);
4170
4171 TRACE("Ping returned a code of %i\n",status);
4172
4173 /* Ping return code of 0 indicates success */
4174 if (status == 0)
4175 rc = TRUE;
4176 }
4177
4178End:
4179 if (rc == FALSE)
4181
4182 return rc;
4183}
#define CP_UNIXCP
Definition: compat.h:79
_ACRTIMP int __cdecl system(const char *)
Definition: process.c:1297
void init_winsock(void)
Definition: dpnet_main.c:55
#define SOCK_STREAM
Definition: tcpip.h:118
GLenum GLenum GLuint components
Definition: glext.h:9620
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
BOOL GetAddress(const WCHAR *, INTERNET_PORT, SOCKADDR *, int *, char *)
Definition: utility.c:47
#define b
Definition: ke_i.h:79
#define closesocket
Definition: ncftp.h:477
char CHAR
Definition: pedump.c:57
static int fd
Definition: io.c:51
Definition: ps.c:97
#define ERROR_NOT_CONNECTED
Definition: winerror.h:1566
WORD INTERNET_PORT
Definition: winhttp.h:43
#define FLAG_ICC_FORCE_CONNECTION
Definition: wininet.h:1904

Referenced by InternetCheckConnectionA().

◆ InternetCloseHandle()

BOOL WINAPI InternetCloseHandle ( HINTERNET  hInternet)

Definition at line 1841 of file internet.c.

1842{
1844
1845 TRACE("%p\n", hInternet);
1846
1847 obj = get_handle_object( hInternet );
1848 if (!obj) {
1850 return FALSE;
1851 }
1852
1855
1856 return TRUE;
1857}
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
static void invalidate_handle(object_header_t *info)
Definition: internet.c:226
object_header_t * get_handle_object(HINTERNET hinternet)
Definition: internet.c:209

Referenced by _close_request(), AsyncInetCancel(), AsyncInetCleanUp(), AsyncInetFree(), can_do_https(), close_async_handle(), CRYPT_Connect(), get_internet_session(), HTTP_RetrieveEncodedObjectW(), HttpHeaders_test(), HttpSendRequestEx_test(), INTERNET_InternetOpenUrlW(), InternetLockRequestFile_test(), InternetOpenRequest_test(), InternetOpenUrlA_test(), InternetReadFile_chunked_test(), InternetSetFilePointer_test(), CDownloadManager::PerformDownloadAndInstall(), process_detach(), protocol_close_connection(), rpcrt4_ncacn_http_close(), START_TEST(), test_accept_encoding(), test_async_HttpSendRequestEx(), test_basic_auth_credentials_cached_manual(), test_basic_auth_credentials_different(), test_basic_auth_credentials_end_session(), test_basic_auth_credentials_manual(), test_basic_auth_credentials_reuse(), test_basic_authentication(), test_bogus_accept_types_array(), test_cache_control_verb(), test_cache_read_gzipped(), test_cert_string(), test_concurrent_header_access(), test_connect(), test_connection_header(), test_cookie_header(), test_default_service_port(), test_find_first_file(), test_header_handling_order(), test_header_override(), test_http_cache(), test_HttpSendRequestW(), test_InternetCloseHandle(), test_InternetErrorDlg(), test_InternetQueryOptionA(), test_InternetSetOption(), test_large_header(), test_no_cache(), test_not_modified(), test_null(), test_open_url_async(), test_openfile(), test_Option_PerConnectionOption(), test_Option_PerConnectionOptionA(), test_options(), test_proxy_direct(), test_secure_connection(), test_status_callbacks(), test_user_agent_header(), verify_cert_revocation_with_ocsp(), and CWebServiceWinInet::~CWebServiceWinInet().

◆ InternetCombineUrlA()

BOOL WINAPI InternetCombineUrlA ( LPCSTR  lpszBaseUrl,
LPCSTR  lpszRelativeUrl,
LPSTR  lpszBuffer,
LPDWORD  lpdwBufferLength,
DWORD  dwFlags 
)

Definition at line 4740 of file internet.c.

4743{
4744 HRESULT hr=S_OK;
4745
4746 TRACE("(%s, %s, %p, %p, 0x%08lx)\n", debugstr_a(lpszBaseUrl), debugstr_a(lpszRelativeUrl), lpszBuffer, lpdwBufferLength, dwFlags);
4747
4748 /* Flip this bit to correspond to URL_ESCAPE_UNSAFE */
4750 hr=UrlCombineA(lpszBaseUrl,lpszRelativeUrl,lpszBuffer,lpdwBufferLength,dwFlags);
4751
4752 return (hr==S_OK);
4753}
HRESULT WINAPI UrlCombineA(const char *base, const char *relative, char *combined, DWORD *combined_len, DWORD flags)
Definition: path.c:4908

◆ InternetCombineUrlW()

BOOL WINAPI InternetCombineUrlW ( LPCWSTR  lpszBaseUrl,
LPCWSTR  lpszRelativeUrl,
LPWSTR  lpszBuffer,
LPDWORD  lpdwBufferLength,
DWORD  dwFlags 
)

Definition at line 4766 of file internet.c.

4769{
4770 HRESULT hr=S_OK;
4771
4772 TRACE("(%s, %s, %p, %p, 0x%08lx)\n", debugstr_w(lpszBaseUrl), debugstr_w(lpszRelativeUrl), lpszBuffer, lpdwBufferLength, dwFlags);
4773
4774 /* Flip this bit to correspond to URL_ESCAPE_UNSAFE */
4776 hr=UrlCombineW(lpszBaseUrl,lpszRelativeUrl,lpszBuffer,lpdwBufferLength,dwFlags);
4777
4778 return (hr==S_OK);
4779}
HRESULT WINAPI UrlCombineW(const WCHAR *baseW, const WCHAR *relativeW, WCHAR *combined, DWORD *combined_len, DWORD flags)
Definition: path.c:4948

Referenced by get_redirect_url().

◆ InternetConfirmZoneCrossingA()

DWORD WINAPI InternetConfirmZoneCrossingA ( HWND  hWnd,
LPSTR  szUrlPrev,
LPSTR  szUrlNew,
BOOL  bPost 
)

Definition at line 5177 of file internet.c.

5178{
5179 FIXME("(%p, %s, %s, %x) stub\n", hWnd, debugstr_a(szUrlPrev), debugstr_a(szUrlNew), bPost);
5180 return ERROR_SUCCESS;
5181}
HWND hWnd
Definition: settings.c:17

◆ InternetConfirmZoneCrossingW()

DWORD WINAPI InternetConfirmZoneCrossingW ( HWND  hWnd,
LPWSTR  szUrlPrev,
LPWSTR  szUrlNew,
BOOL  bPost 
)

Definition at line 5187 of file internet.c.

5188{
5189 FIXME("(%p, %s, %s, %x) stub\n", hWnd, debugstr_w(szUrlPrev), debugstr_w(szUrlNew), bPost);
5190 return ERROR_SUCCESS;
5191}

◆ InternetConnectA()

HINTERNET WINAPI InternetConnectA ( HINTERNET  hInternet,
LPCSTR  lpszServerName,
INTERNET_PORT  nServerPort,
LPCSTR  lpszUserName,
LPCSTR  lpszPassword,
DWORD  dwService,
DWORD  dwFlags,
DWORD_PTR  dwContext 
)

Definition at line 1748 of file internet.c.

1752{
1753 HINTERNET rc = NULL;
1754 LPWSTR szServerName;
1755 LPWSTR szUserName;
1756 LPWSTR szPassword;
1757
1758 szServerName = strdupAtoW(lpszServerName);
1759 szUserName = strdupAtoW(lpszUserName);
1760 szPassword = strdupAtoW(lpszPassword);
1761
1762 rc = InternetConnectW(hInternet, szServerName, nServerPort,
1763 szUserName, szPassword, dwService, dwFlags, dwContext);
1764
1765 free(szServerName);
1766 free(szUserName);
1767 free(szPassword);
1768 return rc;
1769}
HINTERNET WINAPI InternetConnectW(HINTERNET hInternet, LPCWSTR lpszServerName, INTERNET_PORT nServerPort, LPCWSTR lpszUserName, LPCWSTR lpszPassword, DWORD dwService, DWORD dwFlags, DWORD_PTR dwContext)
Definition: internet.c:1685
_In_opt_ LPSTR _In_opt_ LPSTR lpszPassword
Definition: winbase.h:2442

Referenced by _open_simple_request(), can_do_https(), CWebServiceWinInet::DoRequest(), HttpHeaders_test(), HttpSendRequestEx_test(), InternetOpenRequest_test(), InternetReadFile_chunked_test(), InternetReadFile_test(), InternetReadFileExA_test(), InternetSetFilePointer_test(), open_socket_request(), START_TEST(), test_accept_encoding(), test_async_HttpSendRequestEx(), test_async_read(), test_basic_auth_credentials_cached_manual(), test_basic_auth_credentials_different(), test_basic_auth_credentials_end_session(), test_basic_auth_credentials_manual(), test_basic_auth_credentials_reuse(), test_basic_authentication(), test_bogus_accept_types_array(), test_cache_control_verb(), test_cache_read(), test_cache_read_gzipped(), test_cert_string(), test_concurrent_header_access(), test_conn_close(), test_connect(), test_connection_closing(), test_connection_header(), test_cookie_header(), test_default_service_port(), test_header_handling_order(), test_header_override(), test_http_cache(), test_HttpSendRequestW(), test_InternetCloseHandle(), test_InternetErrorDlg(), test_InternetQueryOptionA(), test_InternetSetOption(), test_large_header(), test_no_cache(), test_no_content(), test_not_modified(), test_options(), test_proxy_direct(), test_secure_connection(), test_security_flags(), test_status_callbacks(), test_successive_HttpSendRequest(), and test_user_agent_header().

◆ InternetConnectW()

HINTERNET WINAPI InternetConnectW ( HINTERNET  hInternet,
LPCWSTR  lpszServerName,
INTERNET_PORT  nServerPort,
LPCWSTR  lpszUserName,
LPCWSTR  lpszPassword,
DWORD  dwService,
DWORD  dwFlags,
DWORD_PTR  dwContext 
)

Definition at line 1685 of file internet.c.

1689{
1690 appinfo_t *hIC;
1691 HINTERNET rc = NULL;
1693
1694 TRACE("(%p, %s, %u, %s, %p, %lu, %lx, %Ix)\n", hInternet, debugstr_w(lpszServerName),
1695 nServerPort, debugstr_w(lpszUserName), lpszPassword, dwService, dwFlags, dwContext);
1696
1697 if (!lpszServerName)
1698 {
1700 return NULL;
1701 }
1702
1703 hIC = (appinfo_t*)get_handle_object( hInternet );
1704 if ( (hIC == NULL) || (hIC->hdr.htype != WH_HINIT) )
1705 {
1707 goto lend;
1708 }
1709
1710 switch (dwService)
1711 {
1713 rc = FTP_Connect(hIC, lpszServerName, nServerPort,
1714 lpszUserName, lpszPassword, dwFlags, dwContext, 0);
1715 if(!rc)
1717 break;
1718
1720 res = HTTP_Connect(hIC, lpszServerName, nServerPort,
1721 lpszUserName, lpszPassword, dwFlags, dwContext, 0, &rc);
1722 break;
1723
1725 default:
1726 break;
1727 }
1728lend:
1729 if( hIC )
1730 WININET_Release( &hIC->hdr );
1731
1732 TRACE("returning %p\n", rc);
1734 return rc;
1735}
DWORD INTERNET_GetLastError(void)
Definition: internet.c:4477
@ WH_HINIT
Definition: internet.h:200
WH_TYPE htype
Definition: internet.h:240
object_header_t hdr
Definition: internet.h:263
#define INTERNET_SERVICE_FTP
Definition: wininet.h:560
#define INTERNET_SERVICE_HTTP
Definition: wininet.h:562
#define INTERNET_SERVICE_GOPHER
Definition: wininet.h:561

Referenced by CRYPT_Connect(), HttpProtocol_open_request(), InternetConnectA(), rpcrt4_http_internet_connect(), test_null(), test_secure_connection(), and verify_cert_revocation_with_ocsp().

◆ InternetCrackUrlA()

BOOL WINAPI InternetCrackUrlA ( const char *  url,
DWORD  url_length,
DWORD  flags,
URL_COMPONENTSA *  ret_comp 
)

Definition at line 1933 of file internet.c.

1934{
1935 WCHAR *host = NULL, *user = NULL, *pass = NULL, *path = NULL, *scheme = NULL, *extra = NULL;
1936 URL_COMPONENTSW comp;
1937 WCHAR *url_w = NULL;
1938 BOOL ret;
1939
1940 TRACE("(%s %lu %lx %p)\n", url_length ? debugstr_an(url, url_length) : debugstr_a(url), url_length, flags, ret_comp);
1941
1942 if (!url || !*url || !ret_comp || ret_comp->dwStructSize != sizeof(URL_COMPONENTSA)) {
1944 return FALSE;
1945 }
1946
1947 comp.dwStructSize = sizeof(comp);
1948
1950 &comp.lpszHostName, &comp.dwHostNameLength, &host)
1952 &comp.lpszUserName, &comp.dwUserNameLength, &user)
1954 &comp.lpszPassword, &comp.dwPasswordLength, &pass)
1955 && set_url_component_AtoW(ret_comp->lpszUrlPath, ret_comp->dwUrlPathLength,
1956 &comp.lpszUrlPath, &comp.dwUrlPathLength, &path)
1957 && set_url_component_AtoW(ret_comp->lpszScheme, ret_comp->dwSchemeLength,
1958 &comp.lpszScheme, &comp.dwSchemeLength, &scheme)
1960 &comp.lpszExtraInfo, &comp.dwExtraInfoLength, &extra);
1961
1962 if(ret && !(url_w = strndupAtoW(url, url_length ? url_length : -1, &url_length))) {
1964 ret = FALSE;
1965 }
1966
1967 if (ret && (ret = InternetCrackUrlW(url_w, url_length, flags, &comp))) {
1968 ret_comp->nScheme = comp.nScheme;
1969 ret_comp->nPort = comp.nPort;
1970
1972 &ret_comp->lpszHostName, &ret_comp->dwHostNameLength, url)
1974 &ret_comp->lpszUserName, &ret_comp->dwUserNameLength, url)
1976 &ret_comp->lpszPassword, &ret_comp->dwPasswordLength, url)
1978 &ret_comp->lpszUrlPath, &ret_comp->dwUrlPathLength, url)
1980 &ret_comp->lpszScheme, &ret_comp->dwSchemeLength, url)
1982 &ret_comp->lpszExtraInfo, &ret_comp->dwExtraInfoLength, url);
1983
1984 if(ret)
1985 TRACE("%s: scheme(%s) host(%s) path(%s) extra(%s)\n", debugstr_a(url),
1986 debugstr_an(ret_comp->lpszScheme, ret_comp->dwSchemeLength),
1987 debugstr_an(ret_comp->lpszHostName, ret_comp->dwHostNameLength),
1988 debugstr_an(ret_comp->lpszUrlPath, ret_comp->dwUrlPathLength),
1989 debugstr_an(ret_comp->lpszExtraInfo, ret_comp->dwExtraInfoLength));
1990 }
1991
1992 free(host);
1993 free(user);
1994 free(pass);
1995 free(path);
1996 free(scheme);
1997 free(extra);
1998 free(url_w);
1999 return ret;
2000}
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
static BOOL set_url_component_WtoA(const WCHAR *comp_w, DWORD length, const WCHAR *url_w, char **comp, DWORD *ret_length, const char *url_a)
Definition: internet.c:1884
static BOOL set_url_component_AtoW(const char *comp_a, DWORD len_a, WCHAR **comp_w, DWORD *len_w, WCHAR **buf)
Definition: internet.c:1911
@ extra
Definition: id3.c:95
static WCHAR * strndupAtoW(const char *str, int len_a, DWORD *len_w)
Definition: internet.h:112
DWORD dwStructSize
Definition: wininet.h:193
DWORD dwStructSize
Definition: wininet.h:211
LPWSTR lpszScheme
Definition: wininet.h:212
DWORD dwSchemeLength
Definition: wininet.h:213

Referenced by InternetCrackUrl_test(), test_crack_url(), test_long_url(), urlcache_decode_url(), and urlcache_entry_create().

◆ InternetCrackUrlW()

BOOL WINAPI InternetCrackUrlW ( const WCHAR *  lpszUrl,
DWORD  dwUrlLength,
DWORD  dwFlags,
URL_COMPONENTSW *  lpUC 
)

Definition at line 2052 of file internet.c.

2053{
2054 /*
2055 * RFC 1808
2056 * <protocol>:[//<net_loc>][/path][;<params>][?<query>][#<fragment>]
2057 *
2058 */
2059 LPCWSTR lpszParam = NULL;
2060 BOOL found_colon = FALSE;
2061 LPCWSTR lpszap;
2062 LPCWSTR lpszcp = NULL, lpszNetLoc;
2063
2064 TRACE("(%s %lu %lx %p)\n",
2065 lpszUrl ? debugstr_wn(lpszUrl, dwUrlLength ? dwUrlLength : lstrlenW(lpszUrl)) : "(null)",
2066 dwUrlLength, dwFlags, lpUC);
2067
2068 if (!lpszUrl || !*lpszUrl || !lpUC)
2069 {
2071 return FALSE;
2072 }
2073
2074 if (!dwUrlLength)
2075 dwUrlLength = lstrlenW(lpszUrl);
2076 else {
2077 /* Windows stops at a null, regardless of what dwUrlLength says. */
2078 dwUrlLength = wcsnlen(lpszUrl, dwUrlLength);
2079 }
2080
2081 if (dwFlags & ICU_DECODE)
2082 {
2083 WCHAR *url_tmp, *buffer;
2084 DWORD len = dwUrlLength + 1;
2085 BOOL ret;
2086
2087 if (!(url_tmp = strndupW(lpszUrl, dwUrlLength)))
2088 {
2090 return FALSE;
2091 }
2092
2093 buffer = url_tmp;
2096 {
2097 buffer = malloc(len * sizeof(WCHAR));
2098 if (!buffer)
2099 {
2101 free(url_tmp);
2102 return FALSE;
2103 }
2105 }
2106 if (ret)
2108
2109 if (buffer != url_tmp) free(buffer);
2110 free(url_tmp);
2111 return ret;
2112 }
2113 lpszap = lpszUrl;
2114
2115 /* Determine if the URI is absolute. */
2116 while (lpszap - lpszUrl < dwUrlLength)
2117 {
2118 if (iswalnum(*lpszap) || *lpszap == '+' || *lpszap == '.' || *lpszap == '-')
2119 {
2120 lpszap++;
2121 continue;
2122 }
2123 if (*lpszap == ':')
2124 {
2125 found_colon = TRUE;
2126 lpszcp = lpszap;
2127 }
2128 else
2129 {
2130 lpszcp = lpszUrl; /* Relative url */
2131 }
2132
2133 break;
2134 }
2135
2136 if(!found_colon){
2138 return FALSE;
2139 }
2140
2143
2144 /* Parse <params> */
2145 lpszParam = wmemchr(lpszap, '?', dwUrlLength - (lpszap - lpszUrl));
2146 if(!lpszParam)
2147 lpszParam = wmemchr(lpszap, '#', dwUrlLength - (lpszap - lpszUrl));
2148
2150 lpszParam, lpszParam ? dwUrlLength-(lpszParam-lpszUrl) : 0))
2151 return FALSE;
2152
2153
2154 /* Get scheme first. */
2155 lpUC->nScheme = GetInternetSchemeW(lpszUrl, lpszcp - lpszUrl);
2156 if(!set_url_component(&lpUC->lpszScheme, &lpUC->dwSchemeLength, lpszUrl, lpszcp - lpszUrl))
2157 return FALSE;
2158
2159 /* Eat ':' in protocol. */
2160 lpszcp++;
2161
2162 /* double slash indicates the net_loc portion is present */
2163 if ((lpszcp[0] == '/') && (lpszcp[1] == '/'))
2164 {
2165 lpszcp += 2;
2166
2167 lpszNetLoc = wmemchr(lpszcp, '/', dwUrlLength - (lpszcp - lpszUrl));
2168 if (lpszParam)
2169 {
2170 if (lpszNetLoc)
2171 lpszNetLoc = min(lpszNetLoc, lpszParam);
2172 else
2173 lpszNetLoc = lpszParam;
2174 }
2175 else if (!lpszNetLoc)
2176 lpszNetLoc = lpszcp + dwUrlLength-(lpszcp-lpszUrl);
2177
2178 /* Parse net-loc */
2179 if (lpszNetLoc)
2180 {
2181 LPCWSTR lpszHost;
2182 LPCWSTR lpszPort;
2183
2184 /* [<user>[<:password>]@]<host>[:<port>] */
2185 /* First find the user and password if they exist */
2186
2187 lpszHost = wmemchr(lpszcp, '@', dwUrlLength - (lpszcp - lpszUrl));
2188 if (lpszHost == NULL || lpszHost > lpszNetLoc)
2189 {
2190 /* username and password not specified. */
2193 }
2194 else /* Parse out username and password */
2195 {
2196 LPCWSTR lpszUser = lpszcp;
2197 LPCWSTR lpszPasswd = lpszHost;
2198
2199 while (lpszcp < lpszHost)
2200 {
2201 if (*lpszcp == ':')
2202 lpszPasswd = lpszcp;
2203
2204 lpszcp++;
2205 }
2206
2207 if(!set_url_component(&lpUC->lpszUserName, &lpUC->dwUserNameLength, lpszUser, lpszPasswd - lpszUser))
2208 return FALSE;
2209
2210 if (lpszPasswd != lpszHost)
2211 lpszPasswd++;
2213 lpszPasswd == lpszHost ? NULL : lpszPasswd, lpszHost - lpszPasswd))
2214 return FALSE;
2215
2216 lpszcp++; /* Advance to beginning of host */
2217 }
2218
2219 /* Parse <host><:port> */
2220
2221 lpszHost = lpszcp;
2222 lpszPort = lpszNetLoc;
2223
2224 /* special case for res:// URLs: there is no port here, so the host is the
2225 entire string up to the first '/' */
2226 if(lpUC->nScheme==INTERNET_SCHEME_RES)
2227 {
2228 if(!set_url_component(&lpUC->lpszHostName, &lpUC->dwHostNameLength, lpszHost, lpszPort - lpszHost))
2229 return FALSE;
2230 lpszcp=lpszNetLoc;
2231 }
2232 else
2233 {
2234 while (lpszcp < lpszNetLoc)
2235 {
2236 if (*lpszcp == ':')
2237 lpszPort = lpszcp;
2238
2239 lpszcp++;
2240 }
2241
2242 /* If the scheme is "file" and the host is just one letter, it's not a host */
2243 if(lpUC->nScheme==INTERNET_SCHEME_FILE && lpszPort <= lpszHost+1)
2244 {
2245 lpszcp=lpszHost;
2247 }
2248 else
2249 {
2250 if(!set_url_component(&lpUC->lpszHostName, &lpUC->dwHostNameLength, lpszHost, lpszPort - lpszHost))
2251 return FALSE;
2252 if (lpszPort != lpszNetLoc)
2253 lpUC->nPort = wcstol(++lpszPort, NULL, 10);
2254 else switch (lpUC->nScheme)
2255 {
2258 break;
2261 break;
2264 break;
2265 default:
2266 break;
2267 }
2268 }
2269 }
2270 }
2271 }
2272 else
2273 {
2277 }
2278
2279 /* Here lpszcp points to:
2280 *
2281 * <protocol>:[//<net_loc>][/path][;<params>][?<query>][#<fragment>]
2282 * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2283 */
2284 if (lpszcp != 0 && lpszcp - lpszUrl < dwUrlLength && (!lpszParam || lpszcp <= lpszParam))
2285 {
2286 DWORD len;
2287
2288 /* Only truncate the parameter list if it's already been saved
2289 * in lpUC->lpszExtraInfo.
2290 */
2291 if (lpszParam && lpUC->dwExtraInfoLength && lpUC->lpszExtraInfo)
2292 len = lpszParam - lpszcp;
2293 else
2294 {
2295 /* Leave the parameter list in lpszUrlPath. Strip off any trailing
2296 * newlines if necessary.
2297 */
2298 LPWSTR lpsznewline = wmemchr(lpszcp, '\n', dwUrlLength - (lpszcp - lpszUrl));
2299 if (lpsznewline != NULL)
2300 len = lpsznewline - lpszcp;
2301 else
2302 len = dwUrlLength-(lpszcp-lpszUrl);
2303 }
2304 if (lpUC->dwUrlPathLength && lpUC->lpszUrlPath &&
2306 {
2307 WCHAR tmppath[MAX_PATH];
2308 if (*lpszcp == '/')
2309 {
2310 len = MAX_PATH;
2311 PathCreateFromUrlW(lpszUrl, tmppath, &len, 0);
2312 }
2313 else
2314 {
2315 WCHAR *iter;
2316 memcpy(tmppath, lpszcp, len * sizeof(WCHAR));
2317 tmppath[len] = '\0';
2318
2319 iter = tmppath;
2320 while (*iter) {
2321 if (*iter == '/')
2322 *iter = '\\';
2323 ++iter;
2324 }
2325 }
2326 /* if ends in \. or \.. append a backslash */
2327 if (tmppath[len - 1] == '.' &&
2328 (tmppath[len - 2] == '\\' ||
2329 (tmppath[len - 2] == '.' && tmppath[len - 3] == '\\')))
2330 {
2331 if (len < MAX_PATH - 1)
2332 {
2333 tmppath[len] = '\\';
2334 tmppath[len+1] = '\0';
2335 ++len;
2336 }
2337 }
2338 if(!set_url_component(&lpUC->lpszUrlPath, &lpUC->dwUrlPathLength, tmppath, len))
2339 return FALSE;
2340 }
2341 else if(!set_url_component(&lpUC->lpszUrlPath, &lpUC->dwUrlPathLength, lpszcp, len))
2342 return FALSE;
2343 }
2344 else
2345 {
2346 set_url_component(&lpUC->lpszUrlPath, &lpUC->dwUrlPathLength, lpszcp, 0);
2347 }
2348
2349 TRACE("%s: scheme(%s) host(%s) path(%s) extra(%s)\n", debugstr_wn(lpszUrl,dwUrlLength),
2354
2355 return TRUE;
2356}
#define MAX_PATH
Definition: compat.h:34
HRESULT WINAPI PathCreateFromUrlW(const WCHAR *url, WCHAR *path, DWORD *pcchPath, DWORD dwReserved)
Definition: path.c:3049
_ACRTIMP __msvcrt_long __cdecl wcstol(const wchar_t *, wchar_t **, int)
Definition: wcs.c:2752
_ACRTIMP size_t __cdecl wcsnlen(const wchar_t *, size_t)
Definition: wcs.c:2925
static wchar_t * wmemchr(const wchar_t *s, wchar_t c, size_t n)
Definition: wchar.h:48
static BOOL set_url_component(WCHAR **component, DWORD *component_length, const WCHAR *value, DWORD len)
Definition: internet.c:1859
BOOL WINAPI InternetCanonicalizeUrlW(LPCWSTR lpszUrl, LPWSTR lpszBuffer, LPDWORD lpdwBufferLength, DWORD dwFlags)
Definition: internet.c:2437
#define min(a, b)
Definition: monoChain.cc:55
#define iswalnum(_c)
Definition: ctype.h:671
#define INTERNET_DEFAULT_HTTP_PORT
Definition: winhttp.h:41
#define INTERNET_DEFAULT_HTTPS_PORT
Definition: winhttp.h:42
#define INTERNET_DEFAULT_FTP_PORT
Definition: wininet.h:38
@ INTERNET_SCHEME_FILE
Definition: wininet.h:143
@ INTERNET_SCHEME_RES
Definition: wininet.h:149
#define INTERNET_INVALID_PORT_NUMBER
Definition: wininet.h:36

Referenced by cookie_parse_url(), CRYPT_CrackUrl(), CRYPT_GetRetrieveFunction(), File_RetrieveEncodedObjectW(), get_redirect_url(), get_url_components(), HTTP_DealWithProxy(), HTTP_HandleRedirect(), INTERNET_InternetOpenUrlW(), InternetCheckConnectionW(), InternetCrackUrlA(), InternetCrackUrlW(), InternetCrackUrlW_test(), InternetGetSecurityInfoByURLW(), IsUrlValid(), parse_proxy_url(), CDownloadManager::PerformDownloadAndInstall(), test_crack_url(), urlcache_encode_url(), and verify_cert_revocation_with_ocsp().

◆ InternetCreateUrlA()

BOOL WINAPI InternetCreateUrlA ( LPURL_COMPONENTSA  lpUrlComponents,
DWORD  dwFlags,
LPSTR  lpszUrl,
LPDWORD  lpdwUrlLength 
)

Definition at line 4986 of file internet.c.

4988{
4989 BOOL ret;
4990 LPWSTR urlW = NULL;
4991 URL_COMPONENTSW urlCompW;
4992
4993 TRACE("(%p,%ld,%p,%p)\n", lpUrlComponents, dwFlags, lpszUrl, lpdwUrlLength);
4994
4995 if (!lpUrlComponents || lpUrlComponents->dwStructSize != sizeof(URL_COMPONENTSW) || !lpdwUrlLength)
4996 {
4998 return FALSE;
4999 }
5000
5001 convert_urlcomp_atow(lpUrlComponents, &urlCompW);
5002
5003 if (lpszUrl)
5004 urlW = malloc(*lpdwUrlLength * sizeof(WCHAR));
5005
5006 ret = InternetCreateUrlW(&urlCompW, dwFlags, urlW, lpdwUrlLength);
5007
5009 *lpdwUrlLength /= sizeof(WCHAR);
5010
5011 /* on success, lpdwUrlLength points to the size of urlW in WCHARS
5012 * minus one, so add one to leave room for NULL terminator
5013 */
5014 if (ret)
5015 WideCharToMultiByte(CP_ACP, 0, urlW, -1, lpszUrl, *lpdwUrlLength + 1, NULL, NULL);
5016
5017 free(urlCompW.lpszScheme);
5018 free(urlCompW.lpszHostName);
5019 free(urlCompW.lpszUserName);
5020 free(urlCompW.lpszPassword);
5021 free(urlCompW.lpszUrlPath);
5022 free(urlCompW.lpszExtraInfo);
5023 free(urlW);
5024 return ret;
5025}
BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags, LPWSTR lpszUrl, LPDWORD lpdwUrlLength)
Definition: internet.c:5050
static void convert_urlcomp_atow(LPURL_COMPONENTSA lpUrlComponents, LPURL_COMPONENTSW urlCompW)
Definition: internet.c:4916

Referenced by InternetCreateUrlA_test().

◆ InternetCreateUrlW()

BOOL WINAPI InternetCreateUrlW ( LPURL_COMPONENTSW  lpUrlComponents,
DWORD  dwFlags,
LPWSTR  lpszUrl,
LPDWORD  lpdwUrlLength 
)

Definition at line 5050 of file internet.c.

5052{
5053 DWORD dwLen;
5054 INTERNET_SCHEME nScheme;
5055
5056 static const WCHAR slashSlashW[] = {'/','/'};
5057
5058 TRACE("(%p,%ld,%p,%p)\n", lpUrlComponents, dwFlags, lpszUrl, lpdwUrlLength);
5059
5060 if (!lpUrlComponents || lpUrlComponents->dwStructSize != sizeof(URL_COMPONENTSW) || !lpdwUrlLength)
5061 {
5063 return FALSE;
5064 }
5065
5066 if (!calc_url_length(lpUrlComponents, &dwLen))
5067 return FALSE;
5068
5069 if (!lpszUrl || *lpdwUrlLength < dwLen)
5070 {
5071 *lpdwUrlLength = (dwLen + 1) * sizeof(WCHAR);
5073 return FALSE;
5074 }
5075
5076 *lpdwUrlLength = dwLen;
5077 lpszUrl[0] = 0x00;
5078
5079 dwLen = 0;
5080
5081 if (lpUrlComponents->lpszScheme)
5082 {
5083 dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, Scheme);
5084 memcpy(lpszUrl, lpUrlComponents->lpszScheme, dwLen * sizeof(WCHAR));
5085 lpszUrl += dwLen;
5086
5087 nScheme = GetInternetSchemeW(lpUrlComponents->lpszScheme, dwLen);
5088 }
5089 else
5090 {
5092 nScheme = lpUrlComponents->nScheme;
5093
5094 if (nScheme == INTERNET_SCHEME_DEFAULT)
5095 nScheme = INTERNET_SCHEME_HTTP;
5096
5098 dwLen = lstrlenW(scheme);
5099 memcpy(lpszUrl, scheme, dwLen * sizeof(WCHAR));
5100 lpszUrl += dwLen;
5101 }
5102
5103 /* all schemes are followed by at least a colon */
5104 *lpszUrl = ':';
5105 lpszUrl++;
5106
5107 if (!scheme_is_opaque(nScheme) || lpUrlComponents->lpszHostName)
5108 {
5109 memcpy(lpszUrl, slashSlashW, sizeof(slashSlashW));
5110 lpszUrl += ARRAY_SIZE(slashSlashW);
5111 }
5112
5113 if (lpUrlComponents->lpszUserName)
5114 {
5115 dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, UserName);
5116 memcpy(lpszUrl, lpUrlComponents->lpszUserName, dwLen * sizeof(WCHAR));
5117 lpszUrl += dwLen;
5118
5119 if (lpUrlComponents->lpszPassword)
5120 {
5121 *lpszUrl = ':';
5122 lpszUrl++;
5123
5124 dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, Password);
5125 memcpy(lpszUrl, lpUrlComponents->lpszPassword, dwLen * sizeof(WCHAR));
5126 lpszUrl += dwLen;
5127 }
5128
5129 *lpszUrl = '@';
5130 lpszUrl++;
5131 }
5132
5133 if (lpUrlComponents->lpszHostName)
5134 {
5135 dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, HostName);
5136 memcpy(lpszUrl, lpUrlComponents->lpszHostName, dwLen * sizeof(WCHAR));
5137 lpszUrl += dwLen;
5138
5139 if (!url_uses_default_port(nScheme, lpUrlComponents->nPort))
5140 {
5141 *lpszUrl++ = ':';
5142 _ltow(lpUrlComponents->nPort, lpszUrl, 10);
5143 lpszUrl += lstrlenW(lpszUrl);
5144 }
5145
5146 /* add slash between hostname and path if necessary */
5147 if (lpUrlComponents->lpszUrlPath && *lpUrlComponents->lpszUrlPath != '/')
5148 {
5149 *lpszUrl = '/';
5150 lpszUrl++;
5151 }
5152 }
5153
5154 if (lpUrlComponents->lpszUrlPath)
5155 {
5156 dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, UrlPath);
5157 memcpy(lpszUrl, lpUrlComponents->lpszUrlPath, dwLen * sizeof(WCHAR));
5158 lpszUrl += dwLen;
5159 }
5160
5161 if (lpUrlComponents->lpszExtraInfo)
5162 {
5163 dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, ExtraInfo);
5164 memcpy(lpszUrl, lpUrlComponents->lpszExtraInfo, dwLen * sizeof(WCHAR));
5165 lpszUrl += dwLen;
5166 }
5167
5168 *lpszUrl = '\0';
5169
5170 return TRUE;
5171}
static BOOL calc_url_length(LPURL_COMPONENTSW lpUrlComponents, LPDWORD lpdwUrlLength)
Definition: internet.c:4835

Referenced by FTP_FtpOpenFileW(), get_redirect_url(), HTMLLocation_get_href(), InternetCreateUrlA(), and set_auth_cookie().

◆ InternetDialA()

DWORD WINAPI InternetDialA ( HWND  hwndParent,
LPSTR  lpszConnectoid,
DWORD  dwFlags,
DWORD_PTR *  lpdwConnection,
DWORD  dwReserved 
)

Definition at line 5281 of file internet.c.

5283{
5284 FIXME("(%p, %p, 0x%08lx, %p, 0x%08lx) stub\n", hwndParent, lpszConnectoid, dwFlags,
5285 lpdwConnection, dwReserved);
5286 return ERROR_SUCCESS;
5287}
static HWND hwndParent
Definition: cryptui.c:299

◆ InternetDialW()

DWORD WINAPI InternetDialW ( HWND  hwndParent,
LPWSTR  lpszConnectoid,
DWORD  dwFlags,
DWORD_PTR *  lpdwConnection,
DWORD  dwReserved 
)

Definition at line 5289 of file internet.c.

5291{
5292 FIXME("(%p, %p, 0x%08lx, %p, 0x%08lx) stub\n", hwndParent, lpszConnectoid, dwFlags,
5293 lpdwConnection, dwReserved);
5294 return ERROR_SUCCESS;
5295}

◆ InternetFindNextFileA()

BOOL WINAPI InternetFindNextFileA ( HINTERNET  hFind,
LPVOID  lpvFindData 
)

Definition at line 1782 of file internet.c.

1783{
1784 BOOL ret;
1786
1787 ret = InternetFindNextFileW(hFind, lpvFindData?&fd:NULL);
1788 if(lpvFindData)
1790 return ret;
1791}
BOOL WINAPI InternetFindNextFileW(HINTERNET hFind, LPVOID lpvFindData)
Definition: internet.c:1803
static void WININET_find_data_WtoA(LPWIN32_FIND_DATAW dataW, LPWIN32_FIND_DATAA dataA)
Definition: internet.h:180

◆ InternetFindNextFileW()

BOOL WINAPI InternetFindNextFileW ( HINTERNET  hFind,
LPVOID  lpvFindData 
)

Definition at line 1803 of file internet.c.

1804{
1806 DWORD res;
1807
1808 TRACE("\n");
1809
1810 hdr = get_handle_object(hFind);
1811 if(!hdr) {
1812 WARN("Invalid handle\n");
1814 return FALSE;
1815 }
1816
1817 if(hdr->vtbl->FindNextFileW) {
1818 res = hdr->vtbl->FindNextFileW(hdr, lpvFindData);
1819 }else {
1820 WARN("Handle doesn't support NextFile\n");
1822 }
1823
1825
1826 if(res != ERROR_SUCCESS)
1828 return res == ERROR_SUCCESS;
1829}

Referenced by InternetFindNextFileA().

◆ InternetGetConnectedState()

BOOL WINAPI InternetGetConnectedState ( LPDWORD  lpdwStatus,
DWORD  dwReserved 
)

Definition at line 1534 of file internet.c.

1535{
1536 TRACE("(%p, 0x%08lx)\n", lpdwStatus, dwReserved);
1537
1538 return InternetGetConnectedStateExW(lpdwStatus, NULL, 0, dwReserved);
1539}
BOOL WINAPI InternetGetConnectedStateExW(LPDWORD lpdwStatus, LPWSTR lpszConnectionName, DWORD dwNameLen, DWORD dwReserved)
Definition: internet.c:1569

◆ InternetGetConnectedStateExA()

BOOL WINAPI InternetGetConnectedStateExA ( LPDWORD  lpdwStatus,
LPSTR  lpszConnectionName,
DWORD  dwNameLen,
DWORD  dwReserved 
)

Definition at line 1649 of file internet.c.

1651{
1652 LPWSTR lpwszConnectionName = NULL;
1653 BOOL rc;
1654
1655 TRACE("(%p, %p, %ld, 0x%08lx)\n", lpdwStatus, lpszConnectionName, dwNameLen, dwReserved);
1656
1657 if (lpszConnectionName && dwNameLen > 0)
1658 lpwszConnectionName = malloc(dwNameLen * sizeof(WCHAR));
1659
1660 rc = InternetGetConnectedStateExW(lpdwStatus,lpwszConnectionName, dwNameLen,
1661 dwReserved);
1662 if (rc && lpwszConnectionName)
1663 {
1664 WideCharToMultiByte(CP_ACP,0,lpwszConnectionName,-1,lpszConnectionName,
1665 dwNameLen, NULL, NULL);
1666 /* Yes, blindly truncate double-byte characters */
1667 lpszConnectionName[dwNameLen - 1] = '\0';
1668 }
1669
1670 free(lpwszConnectionName);
1671 return rc;
1672}

◆ InternetGetConnectedStateExW()

BOOL WINAPI InternetGetConnectedStateExW ( LPDWORD  lpdwStatus,
LPWSTR  lpszConnectionName,
DWORD  dwNameLen,
DWORD  dwReserved 
)

Definition at line 1569 of file internet.c.

1571{
1572 IP_ADAPTER_ADDRESSES *buf = NULL, *aa;
1573 ULONG size = 0;
1574 DWORD status;
1575
1576 TRACE("(%p, %p, %ld, 0x%08lx)\n", lpdwStatus, lpszConnectionName, dwNameLen, dwReserved);
1577
1578 /* Must be zero */
1579 if(dwReserved)
1580 {
1582 return FALSE;
1583 }
1584
1585 for (;;)
1586 {
1587 ULONG flags = GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_DNS_SERVER |
1588 GAA_FLAG_SKIP_FRIENDLY_NAME | GAA_FLAG_INCLUDE_GATEWAYS;
1589 ULONG errcode = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, buf, &size);
1590
1591 if (errcode == ERROR_SUCCESS)
1592 break;
1593 free(buf);
1597 {
1598 if (errcode != ERROR_NO_DATA)
1599 {
1601 return FALSE;
1602 }
1603 buf = NULL;
1604 break;
1605 }
1606 }
1607
1609 for (aa = buf; aa; aa = aa->Next)
1610 {
1611 /* Connected, but not necessarily to internet */
1612 if (aa->FirstUnicastAddress)
1614
1615 /* Connected to internet */
1616 if (aa->FirstGatewayAddress)
1617 {
1618 WARN("always returning LAN connection.\n");
1619 status &= ~INTERNET_CONNECTION_OFFLINE;
1621 break;
1622 }
1623 }
1624 free(buf);
1625
1626 if (lpdwStatus) *lpdwStatus = status;
1627
1628 /* When the buffer size is zero LoadStringW fills the buffer with a pointer to
1629 * the resource, avoid it as we must not change the buffer in this case */
1630 if (lpszConnectionName && dwNameLen)
1631 {
1632 *lpszConnectionName = '\0';
1634 LoadStringW(WININET_hModule, IDS_LANCONNECTION, lpszConnectionName, dwNameLen);
1635 }
1636
1638 {
1640 return FALSE;
1641 }
1642 return TRUE;
1643}
#define IDS_LANCONNECTION
Definition: resource.h:38
int errcode
Definition: crtdefs.h:222
#define LoadStringW
Definition: utils.h:64
#define ERROR_NO_DATA
Definition: winerror.h:406
#define INTERNET_CONNECTION_MODEM
Definition: wininet.h:2538
#define INTERNET_CONNECTION_OFFLINE
Definition: wininet.h:2543
#define INTERNET_CONNECTION_LAN
Definition: wininet.h:2539
#define INTERNET_CONNECTION_PROXY
Definition: wininet.h:2540
#define INTERNET_RAS_INSTALLED
Definition: wininet.h:2542

Referenced by InternetGetConnectedState(), and InternetGetConnectedStateExA().

◆ InternetGetLastResponseInfoA()

BOOL WINAPI InternetGetLastResponseInfoA ( LPDWORD  lpdwError,
LPSTR  lpszBuffer,
LPDWORD  lpdwBufferLength 
)

Definition at line 1442 of file internet.c.

1444{
1446
1447 TRACE("(%p, %p, %p)\n", lpdwError, lpszBuffer, lpdwBufferLength);
1448
1449 if (!lpdwError || !lpdwBufferLength)
1450 {
1452 return FALSE;
1453 }
1454 if (lpwite)
1455 {
1456 if (lpszBuffer == NULL || *lpdwBufferLength < strlen(lpwite->response))
1457 {
1458 *lpdwBufferLength = strlen(lpwite->response);
1460 return FALSE;
1461 }
1462 *lpdwError = lpwite->dwError;
1463 if (*lpdwBufferLength)
1464 {
1465 memcpy(lpszBuffer, lpwite->response, *lpdwBufferLength);
1466 lpszBuffer[*lpdwBufferLength - 1] = 0;
1467 *lpdwBufferLength = strlen(lpszBuffer);
1468 }
1469 }
1470 else
1471 {
1472 *lpdwError = 0;
1473 *lpdwBufferLength = 0;
1474 }
1475
1476 return TRUE;
1477}

Referenced by test_command(), and trace_extended_error().

◆ InternetGetLastResponseInfoW()

BOOL WINAPI InternetGetLastResponseInfoW ( LPDWORD  lpdwError,
LPWSTR  lpszBuffer,
LPDWORD  lpdwBufferLength 
)

Definition at line 1489 of file internet.c.

1491{
1493
1494 TRACE("(%p, %p, %p)\n", lpdwError, lpszBuffer, lpdwBufferLength);
1495
1496 if (!lpdwError || !lpdwBufferLength)
1497 {
1499 return FALSE;
1500 }
1501 if (lpwite)
1502 {
1503 int required_size = MultiByteToWideChar(CP_ACP, 0, lpwite->response, -1, NULL, 0) - 1;
1504 if (lpszBuffer == NULL || *lpdwBufferLength < required_size)
1505 {
1506 *lpdwBufferLength = required_size;
1508 return FALSE;
1509 }
1510 *lpdwError = lpwite->dwError;
1511 if (*lpdwBufferLength)
1512 *lpdwBufferLength = MultiByteToWideChar(CP_ACP, 0, lpwite->response, -1, lpszBuffer, *lpdwBufferLength);
1513 }
1514 else
1515 {
1516 *lpdwError = 0;
1517 *lpdwBufferLength = 0;
1518 }
1519
1520 return TRUE;
1521}

◆ InternetGetSecurityInfoByURLA()

BOOL WINAPI InternetGetSecurityInfoByURLA ( LPSTR  lpszURL,
PCCERT_CHAIN_CONTEXT *  ppCertChain,
DWORD *  pdwSecureFlags 
)

Definition at line 5221 of file internet.c.

5222{
5223 WCHAR *url;
5224 BOOL res;
5225
5226 TRACE("(%s %p %p)\n", debugstr_a(lpszURL), ppCertChain, pdwSecureFlags);
5227
5228 url = strdupAtoW(lpszURL);
5229 if(!url)
5230 return FALSE;
5231
5232 res = InternetGetSecurityInfoByURLW(url, ppCertChain, pdwSecureFlags);
5233 free(url);
5234 return res;
5235}
BOOL WINAPI InternetGetSecurityInfoByURLW(LPCWSTR lpszURL, PCCERT_CHAIN_CONTEXT *ppCertChain, DWORD *pdwSecureFlags)
Definition: internet.c:5240

◆ InternetGetSecurityInfoByURLW()

BOOL WINAPI InternetGetSecurityInfoByURLW ( LPCWSTR  lpszURL,
PCCERT_CHAIN_CONTEXT *  ppCertChain,
DWORD *  pdwSecureFlags 
)

Definition at line 5240 of file internet.c.

5241{
5242 URL_COMPONENTSW url = {sizeof(url)};
5244 BOOL res;
5245
5246 TRACE("(%s %p %p)\n", debugstr_w(lpszURL), ppCertChain, pdwSecureFlags);
5247
5248 if (!ppCertChain && !pdwSecureFlags) {
5250 return FALSE;
5251 }
5252
5253 url.dwHostNameLength = 1;
5254 res = InternetCrackUrlW(lpszURL, 0, 0, &url);
5255 if(!res || url.nScheme != INTERNET_SCHEME_HTTPS) {
5257 return FALSE;
5258 }
5259
5260 server = get_server(substr(url.lpszHostName, url.dwHostNameLength), url.nPort, TRUE, FALSE);
5261 if(!server) {
5263 return FALSE;
5264 }
5265
5266 if(server->cert_chain) {
5267 if(pdwSecureFlags)
5268 *pdwSecureFlags = server->security_flags & _SECURITY_ERROR_FLAGS_MASK;
5269
5270 if(ppCertChain && !(*ppCertChain = CertDuplicateCertificateChain(server->cert_chain)))
5271 res = FALSE;
5272 }else {
5274 res = FALSE;
5275 }
5276
5278 return res;
5279}
static nis_server * get_server(struct sockaddr_in *sin, char *host, nis_server *srv, eps, int maxep)
Definition: auth_time.c:143
PCCERT_CHAIN_CONTEXT WINAPI CertDuplicateCertificateChain(PCCERT_CHAIN_CONTEXT pChainContext)
Definition: chain.c:2944
void server_release(server_t *server)
Definition: http.c:148
static substr_t substr(const WCHAR *str, size_t len)
Definition: internet.h:169
#define _SECURITY_ERROR_FLAGS_MASK
Definition: internet.h:445
static rfbScreenInfoPtr server
Definition: vnc.c:74
#define ERROR_INTERNET_ITEM_NOT_FOUND
Definition: wininet.h:2017

Referenced by InternetGetSecurityInfoByURLA().

◆ InternetGoOnlineA()

BOOL WINAPI InternetGoOnlineA ( LPSTR  lpszURL,
HWND  hwndParent,
DWORD  dwReserved 
)

Definition at line 5297 of file internet.c.

5298{
5299 FIXME("(%s, %p, 0x%08lx) stub\n", debugstr_a(lpszURL), hwndParent, dwReserved);
5300 return TRUE;
5301}

◆ InternetGoOnlineW()

BOOL WINAPI InternetGoOnlineW ( LPWSTR  lpszURL,
HWND  hwndParent,
DWORD  dwReserved 
)

Definition at line 5303 of file internet.c.

5304{
5305 FIXME("(%s, %p, 0x%08lx) stub\n", debugstr_w(lpszURL), hwndParent, dwReserved);
5306 return TRUE;
5307}

◆ InternetHangUp()

DWORD WINAPI InternetHangUp ( DWORD_PTR  dwConnection,
DWORD  dwReserved 
)

Definition at line 5309 of file internet.c.

5310{
5311 FIXME("(0x%08Ix, 0x%08lx) stub\n", dwConnection, dwReserved);
5312 return ERROR_SUCCESS;
5313}

◆ InternetInitializeAutoProxyDll()

BOOL WINAPI InternetInitializeAutoProxyDll ( DWORD  dwReserved)

Definition at line 573 of file internet.c.

574{
575 FIXME("STUB\n");
577 return FALSE;
578}

◆ InternetLockRequestFile()

BOOL WINAPI InternetLockRequestFile ( HINTERNET  hInternet,
HANDLE *  lphLockReqHandle 
)

Definition at line 4651 of file internet.c.

4652{
4653 req_file_t *req_file = NULL;
4655 DWORD res;
4656
4657 TRACE("(%p %p)\n", hInternet, lphLockReqHandle);
4658
4659 hdr = get_handle_object(hInternet);
4660 if (!hdr) {
4662 return FALSE;
4663 }
4664
4665 if(hdr->vtbl->LockRequestFile) {
4666 res = hdr->vtbl->LockRequestFile(hdr, &req_file);
4667 }else {
4668 WARN("wrong handle\n");
4670 }
4671
4673
4674 *lphLockReqHandle = req_file;
4675 if(res != ERROR_SUCCESS)
4677 return res == ERROR_SUCCESS;
4678}

Referenced by InternetLockRequestFile_test(), and protocol_lock_request().

◆ InternetOpenA()

HINTERNET WINAPI InternetOpenA ( LPCSTR  lpszAgent,
DWORD  dwAccessType,
LPCSTR  lpszProxy,
LPCSTR  lpszProxyBypass,
DWORD  dwFlags 
)

Definition at line 1411 of file internet.c.

1413{
1414 WCHAR *szAgent, *szProxy, *szBypass;
1415 HINTERNET rc;
1416
1417 TRACE("(%s, 0x%08lx, %s, %s, 0x%08lx)\n", debugstr_a(lpszAgent),
1418 dwAccessType, debugstr_a(lpszProxy), debugstr_a(lpszProxyBypass), dwFlags);
1419
1420 szAgent = strdupAtoW(lpszAgent);
1421 szProxy = strdupAtoW(lpszProxy);
1422 szBypass = strdupAtoW(lpszProxyBypass);
1423
1424 rc = InternetOpenW(szAgent, dwAccessType, szProxy, szBypass, dwFlags);
1425
1426 free(szAgent);
1427 free(szProxy);
1428 free(szBypass);
1429 return rc;
1430}
HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
Definition: internet.c:1334

Referenced by _open_simple_request(), can_do_https(), HttpHeaders_test(), HttpSendRequestEx_test(), InternetOpenRequest_test(), InternetOpenUrlA_test(), InternetReadFile_chunked_test(), InternetReadFile_test(), InternetReadFileExA_test(), InternetSetFilePointer_test(), open_socket_request(), START_TEST(), test_accept_encoding(), test_async_HttpSendRequestEx(), test_async_read(), test_basic_auth_credentials_cached_manual(), test_basic_auth_credentials_different(), test_basic_auth_credentials_end_session(), test_basic_auth_credentials_manual(), test_basic_auth_credentials_reuse(), test_basic_authentication(), test_bogus_accept_types_array(), test_cache_control_verb(), test_cache_read(), test_cache_read_gzipped(), test_cert_string(), test_concurrent_header_access(), test_conn_close(), test_connection_closing(), test_connection_header(), test_cookie_header(), test_default_service_port(), test_header_handling_order(), test_header_override(), test_http_cache(), test_HttpSendRequestW(), test_InternetCloseHandle(), test_InternetErrorDlg(), test_InternetQueryOptionA(), test_InternetSetOption(), test_large_header(), test_no_cache(), test_no_content(), test_not_modified(), test_open_url_async(), test_Option_PerConnectionOption(), test_Option_PerConnectionOptionA(), test_options(), test_proxy_direct(), test_secure_connection(), test_security_flags(), test_successive_HttpSendRequest(), and test_user_agent_header().

◆ InternetOpenUrlA()

HINTERNET WINAPI InternetOpenUrlA ( HINTERNET  hInternet,
LPCSTR  lpszUrl,
LPCSTR  lpszHeaders,
DWORD  dwHeadersLength,
DWORD  dwFlags,
DWORD_PTR  dwContext 
)

Definition at line 4398 of file internet.c.

4400{
4401 HINTERNET rc = NULL;
4402 LPWSTR szUrl = NULL;
4403 WCHAR *headers = NULL;
4404
4405 TRACE("\n");
4406
4407 if(lpszUrl) {
4408 szUrl = strdupAtoW(lpszUrl);
4409 if(!szUrl)
4410 return NULL;
4411 }
4412
4413 if(lpszHeaders) {
4414 headers = strndupAtoW(lpszHeaders, dwHeadersLength, &dwHeadersLength);
4415 if(!headers) {
4416 free(szUrl);
4417 return NULL;
4418 }
4419 }
4420
4421 rc = InternetOpenUrlW(hInternet, szUrl, headers, dwHeadersLength, dwFlags, dwContext);
4422
4423 free(szUrl);
4424 free(headers);
4425 return rc;
4426}
HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
Definition: internet.c:4341
vector< Header * > headers
Definition: sdkparse.cpp:39

Referenced by InternetOpenUrlA_test(), and test_open_url_async().

◆ InternetOpenUrlW()

HINTERNET WINAPI InternetOpenUrlW ( HINTERNET  hInternet,
LPCWSTR  lpszUrl,
LPCWSTR  lpszHeaders,
DWORD  dwHeadersLength,
DWORD  dwFlags,
DWORD_PTR  dwContext 
)

Definition at line 4341 of file internet.c.

4343{
4344 HINTERNET ret = NULL;
4345 appinfo_t *hIC = NULL;
4346
4347 if (TRACE_ON(wininet)) {
4348 TRACE("(%p, %s, %s, %08lx, %08lx, %08Ix)\n", hInternet, debugstr_w(lpszUrl), debugstr_w(lpszHeaders),
4349 dwHeadersLength, dwFlags, dwContext);
4350 TRACE(" flags :");
4352 }
4353
4354 if (!lpszUrl)
4355 {
4357 goto lend;
4358 }
4359
4360 hIC = (appinfo_t*)get_handle_object( hInternet );
4361 if (NULL == hIC || hIC->hdr.htype != WH_HINIT) {
4363 goto lend;
4364 }
4365
4366 if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) {
4368
4370 task->url = wcsdup(lpszUrl);
4371 task->headers = wcsdup(lpszHeaders);
4372 task->headers_len = dwHeadersLength;
4373 task->flags = dwFlags;
4374 task->context = dwContext;
4375
4376 INTERNET_AsyncCall(&task->hdr);
4378 } else {
4379 ret = INTERNET_InternetOpenUrlW(hIC, lpszUrl, lpszHeaders, dwHeadersLength, dwFlags, dwContext);
4380 }
4381
4382 lend:
4383 if( hIC )
4384 WININET_Release( &hIC->hdr );
4385 TRACE(" %p <--\n", ret);
4386
4387 return ret;
4388}
#define TRACE_ON(x)
Definition: compat.h:75
DWORD INTERNET_AsyncCall(task_header_t *task)
Definition: internet.c:4534
static void dump_INTERNET_FLAGS(DWORD dwFlags)
Definition: internet.c:944
void * alloc_async_task(object_header_t *hdr, async_task_proc_t proc, size_t size)
Definition: internet.c:4513
static void AsyncInternetOpenUrlProc(task_header_t *hdr)
Definition: internet.c:4329

Referenced by AsyncInetDownload(), FtpProtocol_open_request(), GopherProtocol_open_request(), InternetOpenUrlA(), CDownloadManager::PerformDownloadAndInstall(), and test_null().

◆ InternetOpenW()

HINTERNET WINAPI InternetOpenW ( LPCWSTR  lpszAgent,
DWORD  dwAccessType,
LPCWSTR  lpszProxy,
LPCWSTR  lpszProxyBypass,
DWORD  dwFlags 
)

Definition at line 1334 of file internet.c.

1336{
1337 appinfo_t *lpwai = NULL;
1338
1339#ifdef __REACTOS__
1340 init_winsock();
1341#endif
1342 if (TRACE_ON(wininet)) {
1343#define FE(x) { x, #x }
1344 static const wininet_flag_info access_type[] = {
1349 };
1350#undef FE
1351 DWORD i;
1352 const char *access_type_str = "Unknown";
1353
1354 TRACE("(%s, %li, %s, %s, %li)\n", debugstr_w(lpszAgent), dwAccessType,
1355 debugstr_w(lpszProxy), debugstr_w(lpszProxyBypass), dwFlags);
1356 for (i = 0; i < ARRAY_SIZE(access_type); i++) {
1357 if (access_type[i].val == dwAccessType) {
1358 access_type_str = access_type[i].name;
1359 break;
1360 }
1361 }
1362 TRACE(" access type : %s\n", access_type_str);
1363 TRACE(" flags :");
1365 }
1366
1367 /* Clear any error information */
1369
1370 if((dwAccessType == INTERNET_OPEN_TYPE_PROXY) && !lpszProxy) {
1372 return NULL;
1373 }
1374
1375 lpwai = alloc_object(NULL, &APPINFOVtbl, sizeof(appinfo_t));
1376 if (!lpwai) {
1378 return NULL;
1379 }
1380
1381 lpwai->hdr.htype = WH_HINIT;
1382 lpwai->hdr.dwFlags = dwFlags;
1383 lpwai->accessType = dwAccessType;
1384 lpwai->proxyUsername = NULL;
1385 lpwai->proxyPassword = NULL;
1386
1387 lpwai->agent = wcsdup(lpszAgent);
1388 if(dwAccessType == INTERNET_OPEN_TYPE_PRECONFIG)
1389 INTERNET_ConfigureProxy( lpwai );
1390 else if(dwAccessType == INTERNET_OPEN_TYPE_PROXY) {
1391 lpwai->proxy = wcsdup(lpszProxy);
1392 lpwai->proxyBypass = wcsdup(lpszProxyBypass);
1393 }
1394
1395 TRACE("returning %p\n", lpwai);
1396
1397 return lpwai->hdr.hInternet;
1398}
static BOOL INTERNET_ConfigureProxy(appinfo_t *lpwai)
Definition: internet.c:910
static const object_vtbl_t APPINFOVtbl
Definition: internet.c:1312
void * alloc_object(object_header_t *parent, const object_vtbl_t *vtbl, size_t size)
Definition: internet.c:124
HINTERNET hInternet
Definition: internet.h:242
const char * name
Definition: internet.h:436
#define INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY
Definition: wininet.h:524
#define INTERNET_OPEN_TYPE_PRECONFIG
Definition: wininet.h:521

Referenced by AsyncInetDownload(), create_internet_session(), CRYPT_Connect(), CWebServiceWinInet::CWebServiceWinInet(), InternetOpenA(), CDownloadManager::PerformDownloadAndInstall(), rpcrt4_http_internet_connect(), test_null(), test_proxy_direct(), test_secure_connection(), and verify_cert_revocation_with_ocsp().

◆ InternetQueryDataAvailable()

BOOL WINAPI InternetQueryDataAvailable ( HINTERNET  hFile,
LPDWORD  lpdwNumberOfBytesAvailable,
DWORD  dwFlags,
DWORD_PTR  dwContext 
)

Definition at line 4578 of file internet.c.

4581{
4583 DWORD res;
4584
4585 TRACE("(%p %p %lx %Ix)\n", hFile, lpdwNumberOfBytesAvailable, dwFlags, dwContext);
4586
4588 if (!hdr) {
4590 return FALSE;
4591 }
4592
4593 if(hdr->vtbl->QueryDataAvailable) {
4594 res = hdr->vtbl->QueryDataAvailable(hdr, lpdwNumberOfBytesAvailable, dwFlags, dwContext);
4595 }else {
4596 WARN("wrong handle\n");
4598 }
4599
4601
4602 if(res != ERROR_SUCCESS)
4604 return res == ERROR_SUCCESS;
4605}
_In_ HANDLE hFile
Definition: mswsock.h:90

Referenced by _async_query_data_available(), _expect_data_available(), CRYPT_DownloadObject(), CWebServiceWinInet::DoRequest(), InternetReadFile_chunked_test(), InternetReadFile_test(), protocol_continue(), protocol_read(), protocol_syncbinding(), rpcrt4_ncacn_http_wait_for_incoming_data(), test_cache_read(), test_conn_close(), and test_not_modified().

◆ InternetQueryFortezzaStatus()

BOOL WINAPI InternetQueryFortezzaStatus ( DWORD *  a,
DWORD_PTR  b 
)

Definition at line 5329 of file internet.c.

5330{
5331 FIXME("(%p, %08Ix) stub\n", a, b);
5332 return FALSE;
5333}
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ InternetQueryOptionA()

◆ InternetQueryOptionW()

BOOL WINAPI InternetQueryOptionW ( HINTERNET  hInternet,
DWORD  dwOption,
LPVOID  lpBuffer,
LPDWORD  lpdwBufferLength 
)

Definition at line 3253 of file internet.c.

3255{
3258
3259 TRACE("%p %ld %p %p\n", hInternet, dwOption, lpBuffer, lpdwBufferLength);
3260
3261 if(hInternet) {
3262 hdr = get_handle_object(hInternet);
3263 if (hdr) {
3264 res = hdr->vtbl->QueryOption(hdr, dwOption, lpBuffer, lpdwBufferLength, TRUE);
3266 }
3267 }else {
3269 }
3270
3271 if(res != ERROR_SUCCESS)
3273 return res == ERROR_SUCCESS;
3274}

Referenced by _test_http_version(), _test_request_flags(), _test_secflags_option(), HttpInfo_QueryOption(), start_downloading(), test_InternetSetOption(), test_Option_PerConnectionOption(), test_pac(), test_proxy_direct(), test_secure_connection(), test_security_flags(), and WININET_InvalidCertificateDialog().

◆ InternetReadFile()

BOOL WINAPI InternetReadFile ( HINTERNET  hFile,
LPVOID  lpBuffer,
DWORD  dwNumOfBytesToRead,
LPDWORD  pdwNumOfBytesRead 
)

Definition at line 2609 of file internet.c.

2611{
2614
2615 TRACE("%p %p %ld %p\n", hFile, lpBuffer, dwNumOfBytesToRead, pdwNumOfBytesRead);
2616
2617 if (!lpBuffer || !pdwNumOfBytesRead)
2618 {
2620 if (pdwNumOfBytesRead) *pdwNumOfBytesRead = 0;
2621 return FALSE;
2622 }
2623
2625 if (!hdr) {
2627 return FALSE;
2628 }
2629
2630 if(hdr->vtbl->ReadFile) {
2631 res = hdr->vtbl->ReadFile(hdr, lpBuffer, dwNumOfBytesToRead, pdwNumOfBytesRead, 0, 0);
2632 if(res == ERROR_IO_PENDING)
2633 *pdwNumOfBytesRead = 0;
2634 }
2635
2637
2638 TRACE("-- %s (%lu) (bytes read: %ld)\n", res == ERROR_SUCCESS ? "TRUE": "FALSE", res,
2639 pdwNumOfBytesRead ? *pdwNumOfBytesRead : -1);
2640
2642 return res == ERROR_SUCCESS;
2643}

Referenced by _read_expect_sync_data_len(), _receive_simple_request(), AsyncInetReadFileLoop(), CWebServiceWinInet::DoRequest(), HttpSendRequestEx_test(), InternetOpenUrlA_test(), InternetReadFile_chunked_test(), InternetReadFile_test(), InternetSetFilePointer_test(), CDownloadManager::PerformDownloadAndInstall(), protocol_read(), read_expect_async(), test_async_read(), test_basic_request(), test_cache_read(), test_cache_read_gzipped(), test_conn_close(), test_head_request(), test_http_cache(), test_no_cache(), test_response_without_headers(), test_security_flags(), and verify_cert_revocation_with_ocsp().

◆ InternetReadFileExA()

BOOL WINAPI InternetReadFileExA ( HINTERNET  hFile,
LPINTERNET_BUFFERSA  lpBuffersOut,
DWORD  dwFlags,
DWORD_PTR  dwContext 
)

Definition at line 2672 of file internet.c.

2674{
2677
2678 TRACE("(%p %p 0x%lx 0x%Ix)\n", hFile, lpBuffersOut, dwFlags, dwContext);
2679
2680 if (lpBuffersOut->dwStructSize != sizeof(*lpBuffersOut)) {
2682 return FALSE;
2683 }
2684
2686 if (!hdr) {
2688 return FALSE;
2689 }
2690
2691 if(hdr->vtbl->ReadFile)
2692 res = hdr->vtbl->ReadFile(hdr, lpBuffersOut->lpvBuffer, lpBuffersOut->dwBufferLength,
2693 &lpBuffersOut->dwBufferLength, dwFlags, dwContext);
2694
2696
2697 TRACE("-- %s (%lu, bytes read: %ld)\n", res == ERROR_SUCCESS ? "TRUE": "FALSE",
2698 res, lpBuffersOut->dwBufferLength);
2699
2700 if(res != ERROR_SUCCESS)
2702 return res == ERROR_SUCCESS;
2703}
DWORD dwStructSize
Definition: wininet.h:259
DWORD dwBufferLength
Definition: wininet.h:265
LPVOID lpvBuffer
Definition: wininet.h:264

Referenced by CRYPT_DownloadObject(), InternetReadFileExA_test(), and test_async_read().

◆ InternetReadFileExW()

BOOL WINAPI InternetReadFileExW ( HINTERNET  hFile,
LPINTERNET_BUFFERSW  lpBuffer,
DWORD  dwFlags,
DWORD_PTR  dwContext 
)

Definition at line 2710 of file internet.c.

2712{
2715
2716 TRACE("(%p %p 0x%lx 0x%Ix)\n", hFile, lpBuffer, dwFlags, dwContext);
2717
2718 if (!lpBuffer || lpBuffer->dwStructSize != sizeof(*lpBuffer)) {
2720 return FALSE;
2721 }
2722
2724 if (!hdr) {
2726 return FALSE;
2727 }
2728
2729 if(hdr->vtbl->ReadFile)
2730 res = hdr->vtbl->ReadFile(hdr, lpBuffer->lpvBuffer, lpBuffer->dwBufferLength, &lpBuffer->dwBufferLength,
2731 dwFlags, dwContext);
2732
2734
2735 TRACE("-- %s (%lu, bytes read: %ld)\n", res == ERROR_SUCCESS ? "TRUE": "FALSE",
2736 res, lpBuffer->dwBufferLength);
2737
2738 if(res != ERROR_SUCCESS)
2740 return res == ERROR_SUCCESS;
2741}

Referenced by _readex_expect_async(), _readex_expect_sync_data_len(), InternetReadFileExA_test(), and rpcrt4_http_async_read().

◆ InternetSetFilePointer()

DWORD WINAPI InternetSetFilePointer ( HINTERNET  hFile,
LONG  lDistanceToMove,
PVOID  pReserved,
DWORD  dwMoveContext,
DWORD_PTR  dwContext 
)

Definition at line 2534 of file internet.c.

2536{
2538 DWORD res;
2539
2540 TRACE("(%p %ld %p %ld %Ix)\n", hFile, lDistanceToMove, pReserved, dwMoveContext, dwContext);
2541
2543 if(!hdr) {
2546 }
2547
2548 if(hdr->vtbl->SetFilePointer) {
2549 res = hdr->vtbl->SetFilePointer(hdr, lDistanceToMove, dwMoveContext);
2550 }else {
2553 }
2554
2556 return res;
2557}
#define INVALID_SET_FILE_POINTER
Definition: compat.h:732
_Out_ PVOID pReserved
Definition: netsh.h:77

Referenced by InternetReadFile_test(), InternetSetFilePointer_test(), and test_file_pointer().

◆ InternetSetOptionA()

BOOL WINAPI InternetSetOptionA ( HINTERNET  hInternet,
DWORD  dwOption,
LPVOID  lpBuffer,
DWORD  dwBufferLength 
)

Definition at line 3727 of file internet.c.

3729{
3730 LPVOID wbuffer;
3731 DWORD wlen;
3732 BOOL r;
3733
3734 switch( dwOption )
3735 {
3737 {
3740 DWORD proxlen, prbylen;
3741 LPWSTR prox, prby;
3742
3743 proxlen = MultiByteToWideChar( CP_ACP, 0, pi->lpszProxy, -1, NULL, 0);
3744 prbylen= MultiByteToWideChar( CP_ACP, 0, pi->lpszProxyBypass, -1, NULL, 0);
3745 wlen = sizeof(*piw) + proxlen + prbylen;
3746 wbuffer = malloc( wlen * sizeof(WCHAR) );
3747 piw = (LPINTERNET_PROXY_INFOW) wbuffer;
3748 piw->dwAccessType = pi->dwAccessType;
3749 prox = (LPWSTR) &piw[1];
3750 prby = &prox[proxlen+1];
3751 MultiByteToWideChar( CP_ACP, 0, pi->lpszProxy, -1, prox, proxlen);
3752 MultiByteToWideChar( CP_ACP, 0, pi->lpszProxyBypass, -1, prby, prbylen);
3753 piw->lpszProxy = prox;
3754 piw->lpszProxyBypass = prby;
3755 }
3756 break;
3762 wlen = MultiByteToWideChar( CP_ACP, 0, lpBuffer, -1, NULL, 0 );
3763 if (!(wbuffer = malloc( wlen * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
3764 MultiByteToWideChar( CP_ACP, 0, lpBuffer, -1, wbuffer, wlen );
3765 break;
3767 unsigned int i;
3770 wlen = sizeof(INTERNET_PER_CONN_OPTION_LISTW);
3771 wbuffer = malloc( wlen );
3772 listW = wbuffer;
3773
3774 listW->dwSize = sizeof(INTERNET_PER_CONN_OPTION_LISTW);
3775 if (listA->pszConnection)
3776 {
3777 wlen = MultiByteToWideChar( CP_ACP, 0, listA->pszConnection, -1, NULL, 0 );
3778 listW->pszConnection = malloc( wlen * sizeof(WCHAR) );
3779 MultiByteToWideChar( CP_ACP, 0, listA->pszConnection, -1, listW->pszConnection, wlen );
3780 }
3781 else
3782 listW->pszConnection = NULL;
3783 listW->dwOptionCount = listA->dwOptionCount;
3784 listW->dwOptionError = listA->dwOptionError;
3785 listW->pOptions = malloc( sizeof(INTERNET_PER_CONN_OPTIONW) * listA->dwOptionCount );
3786
3787 for (i = 0; i < listA->dwOptionCount; ++i) {
3788 INTERNET_PER_CONN_OPTIONA *optA = listA->pOptions + i;
3789 INTERNET_PER_CONN_OPTIONW *optW = listW->pOptions + i;
3790
3791 optW->dwOption = optA->dwOption;
3792
3793 switch (optA->dwOption) {
3799 if (optA->Value.pszValue)
3800 {
3801 wlen = MultiByteToWideChar( CP_ACP, 0, optA->Value.pszValue, -1, NULL, 0 );
3802 optW->Value.pszValue = malloc( wlen * sizeof(WCHAR) );
3803 MultiByteToWideChar( CP_ACP, 0, optA->Value.pszValue, -1, optW->Value.pszValue, wlen );
3804 }
3805 else
3806 optW->Value.pszValue = NULL;
3807 break;
3811 optW->Value.dwValue = optA->Value.dwValue;
3812 break;
3814 optW->Value.ftValue = optA->Value.ftValue;
3815 break;
3816 default:
3817 WARN("Unknown PER_CONN dwOption: %ld, guessing at conversion to Wide\n", optA->dwOption);
3818 optW->Value.dwValue = optA->Value.dwValue;
3819 break;
3820 }
3821 }
3822 }
3823 break;
3824 default:
3825 wbuffer = lpBuffer;
3826 wlen = dwBufferLength;
3827 }
3828
3829 r = InternetSetOptionW(hInternet,dwOption, wbuffer, wlen);
3830
3831 if( lpBuffer != wbuffer )
3832 {
3834 {
3836 unsigned int i;
3837 for (i = 0; i < list->dwOptionCount; ++i) {
3838 INTERNET_PER_CONN_OPTIONW *opt = list->pOptions + i;
3839 switch (opt->dwOption) {
3845 free( opt->Value.pszValue );
3846 break;
3847 default:
3848 break;
3849 }
3850 }
3851 free( list->pOptions );
3852 }
3853 free( wbuffer );
3854 }
3855
3856 return r;
3857}
Definition: list.h:39
BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength)
Definition: internet.c:3457
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
LPCWSTR lpszProxyBypass
Definition: wininet.h:168
union _INTERNET_PER_CONN_OPTIONW::@4113 Value
#define INTERNET_OPTION_PROXY_PASSWORD
Definition: wininet.h:738
#define INTERNET_OPTION_PROXY_USERNAME
Definition: wininet.h:737
#define INTERNET_OPTION_PASSWORD
Definition: wininet.h:723
struct _INTERNET_PER_CONN_OPTION_LISTW INTERNET_PER_CONN_OPTION_LISTW
#define INTERNET_OPTION_USERNAME
Definition: wininet.h:722
#define LPINTERNET_PROXY_INFOA
Definition: wininet_test.h:82
#define LPINTERNET_PROXY_INFOW
Definition: wininet_test.h:83

Referenced by InternetReadFile_test(), InternetSetOptionExA(), test_async_HttpSendRequestEx(), test_basic_auth_credentials_cached_manual(), test_basic_auth_credentials_end_session(), test_basic_auth_credentials_manual(), test_cache_read_gzipped(), test_end_browser_session(), test_InternetCanonicalizeUrlA(), test_InternetQueryOptionA(), test_InternetSetOption(), test_max_conns(), test_open_url_async(), test_Option_PerConnectionOptionA(), test_options(), test_proxy_direct(), test_security_flags(), and test_user_agent_header().

◆ InternetSetOptionExA()

BOOL WINAPI InternetSetOptionExA ( HINTERNET  hInternet,
DWORD  dwOption,
LPVOID  lpBuffer,
DWORD  dwBufferLength,
DWORD  dwFlags 
)

Definition at line 3863 of file internet.c.

3865{
3866 FIXME("Flags %08lx ignored\n", dwFlags);
3867 return InternetSetOptionA( hInternet, dwOption, lpBuffer, dwBufferLength );
3868}
BOOL WINAPI InternetSetOptionA(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength)
Definition: internet.c:3727

◆ InternetSetOptionExW()

BOOL WINAPI InternetSetOptionExW ( HINTERNET  hInternet,
DWORD  dwOption,
LPVOID  lpBuffer,
DWORD  dwBufferLength,
DWORD  dwFlags 
)

Definition at line 3873 of file internet.c.

3875{
3876 FIXME("Flags %08lx ignored\n", dwFlags);
3877 if( dwFlags & ~ISO_VALID_FLAGS )
3878 {
3880 return FALSE;
3881 }
3882 return InternetSetOptionW( hInternet, dwOption, lpBuffer, dwBufferLength );
3883}
#define ISO_VALID_FLAGS
Definition: wininet.h:699

◆ InternetSetOptionW()

BOOL WINAPI InternetSetOptionW ( HINTERNET  hInternet,
DWORD  dwOption,
LPVOID  lpBuffer,
DWORD  dwBufferLength 
)

Definition at line 3457 of file internet.c.

3459{
3460 object_header_t *lpwhh;
3461 BOOL ret = TRUE;
3462 DWORD res;
3463
3464 TRACE("(%p %ld %p %ld)\n", hInternet, dwOption, lpBuffer, dwBufferLength);
3465
3466 lpwhh = (object_header_t*) get_handle_object( hInternet );
3467 if(lpwhh)
3468 res = lpwhh->vtbl->SetOption(lpwhh, dwOption, lpBuffer, dwBufferLength);
3469 else
3470 res = set_global_option(dwOption, lpBuffer, dwBufferLength);
3471
3473 if(lpwhh)
3474 WININET_Release(lpwhh);
3475
3476 if(res != ERROR_SUCCESS)
3478
3479 return res == ERROR_SUCCESS;
3480 }
3481
3482 switch (dwOption)
3483 {
3485 {
3487 FIXME("Option INTERNET_OPTION_HTTP_VERSION(%ld,%ld): STUB\n",pVersion->dwMajorVersion,pVersion->dwMinorVersion);
3488 }
3489 break;
3491 {
3492 if(!lpwhh) {
3494 return FALSE;
3499 ret = FALSE;
3500 } else if(dwBufferLength != sizeof(ULONG)) {
3502 ret = FALSE;
3503 } else {
3504 TRACE("INTERNET_OPTION_ERROR_MASK: %lx\n", *(ULONG*)lpBuffer);
3505 lpwhh->ErrorMask = *(ULONG*)lpBuffer;
3506 }
3507 }
3508 break;
3510 {
3512
3513 if (!lpBuffer || dwBufferLength < sizeof(INTERNET_PROXY_INFOW))
3514 {
3516 return FALSE;
3517 }
3518 if (!hInternet)
3519 {
3522 if (info->dwAccessType == INTERNET_OPEN_TYPE_PROXY)
3523 {
3525 global_proxy.proxy = wcsdup(info->lpszProxy);
3526 global_proxy.proxyBypass = wcsdup(info->lpszProxyBypass);
3527 }
3528 else
3529 {
3532 }
3534 }
3535 else
3536 {
3537 /* In general, each type of object should handle
3538 * INTERNET_OPTION_PROXY directly. This FIXME ensures it doesn't
3539 * get silently dropped.
3540 */
3541 FIXME("INTERNET_OPTION_PROXY unimplemented\n");
3543 ret = FALSE;
3544 }
3545 break;
3546 }
3548 {
3550 FIXME("Option INTERNET_OPTION_CODEPAGE (%ld): STUB\n", codepage);
3551 }
3552 break;
3554 {
3556 FIXME("Option INTERNET_OPTION_REQUEST_PRIORITY (%ld): STUB\n", priority);
3557 }
3558 break;
3560 FIXME("Option INTERNET_OPTION_RESET_URLCACHE_SESSION: STUB\n");
3561 break;
3563 FIXME("Option INTERNET_OPTION_END_BROWSER_SESSION: semi-stub\n");
3564 free_cookie();
3566 break;
3568 FIXME("Option INTERNET_OPTION_CONNECTED_STATE: STUB\n");
3569 break;
3571 TRACE("Option INTERNET_OPTION_DISABLE_PASSPORT_AUTH: harmless stub, since not enabled\n");
3572 break;
3574 FIXME("Option INTERNET_OPTION_IGNORE_OFFLINE: STUB\n");
3575 break;
3577 {
3578 ULONG retries = *(ULONG *)lpBuffer;
3579 FIXME("INTERNET_OPTION_CONNECT_RETRIES %ld\n", retries);
3580 break;
3581 }
3583 {
3584 if (!lpwhh)
3585 {
3587 return FALSE;
3588 }
3589 if (!lpBuffer || dwBufferLength != sizeof(DWORD_PTR))
3590 {
3592 ret = FALSE;
3593 }
3594 else
3595 lpwhh->dwContext = *(DWORD_PTR *)lpBuffer;
3596 break;
3597 }
3599 FIXME("Option INTERNET_OPTION_SECURITY_FLAGS; STUB\n");
3600 break;
3602 FIXME("Option INTERNET_OPTION_DISABLE_AUTODIAL; STUB\n");
3603 break;
3605 if (!lpwhh)
3606 {
3608 return FALSE;
3609 }
3610 if (!lpBuffer || dwBufferLength != sizeof(BOOL))
3611 {
3613 ret = FALSE;
3614 }
3615 else
3616 lpwhh->decoding = *(BOOL *)lpBuffer;
3617 break;
3619 FIXME("INTERNET_OPTION_COOKIES_3RD_PARTY; STUB\n");
3621 ret = FALSE;
3622 break;
3624 FIXME("INTERNET_OPTION_SEND_UTF8_SERVERNAME_TO_PROXY; STUB\n");
3626 ret = FALSE;
3627 break;
3629 FIXME("INTERNET_OPTION_CODEPAGE_PATH; STUB\n");
3631 ret = FALSE;
3632 break;
3634 FIXME("INTERNET_OPTION_CODEPAGE_EXTRA; STUB\n");
3636 ret = FALSE;
3637 break;
3639 FIXME("INTERNET_OPTION_IDN; STUB\n");
3641 ret = FALSE;
3642 break;
3645 ret = FALSE;
3646 break;
3649 LONG res;
3650 unsigned int i;
3652
3653 if (INTERNET_LoadProxySettings(&pi)) return FALSE;
3654
3655 for (i = 0; i < con->dwOptionCount; i++) {
3657
3658 switch (option->dwOption) {
3660 free(pi.proxy);
3661 pi.proxy = wcsdup(option->Value.pszValue);
3662 break;
3663
3665 if(option->Value.dwValue & ~(PROXY_TYPE_PROXY | PROXY_TYPE_DIRECT))
3666 FIXME("Unhandled flags: 0x%lx\n", option->Value.dwValue);
3667 pi.flags = option->Value.dwValue;
3668 break;
3669
3671 free(pi.proxyBypass);
3672 pi.proxyBypass = wcsdup(option->Value.pszValue);
3673 break;
3674
3676 free(pi.autoconf_url);
3677 pi.autoconf_url = wcsdup(option->Value.pszValue);
3678 break;
3679
3685 FIXME("Unhandled dwOption %ld\n", option->dwOption);
3686 break;
3687
3688 default:
3689 FIXME("Unknown dwOption %ld\n", option->dwOption);
3691 break;
3692 }
3693 }
3694
3697
3698 FreeProxyInfo(&pi);
3699
3700 ret = (res == ERROR_SUCCESS);
3701 break;
3702 }
3703 default:
3704 FIXME("Option %ld STUB\n",dwOption);
3706 ret = FALSE;
3707 break;
3708 }
3709
3710 if(lpwhh)
3711 WININET_Release( lpwhh );
3712
3713 return ret;
3714}
void free_authorization_cache(void)
Definition: http.c:926
static void free_global_proxy(void)
Definition: internet.c:608
static DWORD set_global_option(DWORD option, void *buf, DWORD size)
Definition: internet.c:3350
static LONG INTERNET_SaveProxySettings(proxyinfo_t *lpwpi)
Definition: internet.c:406
static int priority
Definition: timer.c:163
DWORD dwMinorVersion
Definition: winhttp.h:681
DWORD dwMajorVersion
Definition: winhttp.h:680
const object_vtbl_t * vtbl
Definition: internet.h:241
DWORD_PTR dwContext
Definition: internet.h:250
DWORD(* SetOption)(object_header_t *, DWORD, void *, DWORD)
Definition: internet.h:227
int codepage
Definition: win_iconv.c:156
#define INTERNET_OPTION_CONNECTED_STATE
Definition: wininet.h:744
#define INTERNET_ERROR_MASK_COMBINED_SEC_CERT
Definition: wininet.h:125
#define INTERNET_OPTION_CODEPAGE
Definition: wininet.h:760
#define INTERNET_OPTION_SECURITY_FLAGS
Definition: wininet.h:725
#define INTERNET_OPTION_CONNECT_RETRIES
Definition: wininet.h:702
#define INTERNET_ERROR_MASK_INSERT_CDROM
Definition: wininet.h:124
#define INTERNET_OPTION_IGNORE_OFFLINE
Definition: wininet.h:767
#define INTERNET_OPTION_IDN
Definition: wininet.h:792
#define INTERNET_ERROR_MASK_LOGIN_FAILURE_DISPLAY_ENTITY_BODY
Definition: wininet.h:127
#define INTERNET_OPTION_COOKIES_3RD_PARTY
Definition: wininet.h:776
#define INTERNET_OPTION_CODEPAGE_PATH
Definition: wininet.h:790
#define INTERNET_OPTION_RESET_URLCACHE_SESSION
Definition: wininet.h:754
#define INTERNET_OPTION_DISABLE_PASSPORT_AUTH
Definition: wininet.h:777
#define INTERNET_OPTION_DISABLE_AUTODIAL
Definition: wininet.h:762
#define INTERNET_OPTION_ERROR_MASK
Definition: wininet.h:755
#define INTERNET_OPTION_CODEPAGE_EXTRA
Definition: wininet.h:791
#define INTERNET_OPTION_POLICY
Definition: wininet.h:742
#define INTERNET_OPTION_HTTP_VERSION
Definition: wininet.h:753
#define ERROR_INTERNET_BAD_OPTION_LENGTH
Definition: wininet.h:1999
#define INTERNET_OPTION_HTTP_DECODING
Definition: wininet.h:758
#define INTERNET_OPTION_REQUEST_PRIORITY
Definition: wininet.h:752
#define INTERNET_OPTION_END_BROWSER_SESSION
Definition: wininet.h:736
#define INTERNET_OPTION_SEND_UTF8_SERVERNAME_TO_PROXY
Definition: wininet.h:778

Referenced by _set_secflags(), HTTP_RetrieveEncodedObjectW(), HttpProtocol_open_request(), InternetSetOptionA(), InternetSetOptionExW(), set_security_flag(), test_InternetSetOption(), test_Option_PerConnectionOption(), test_pac(), test_security_flags(), and update_user_agent().

◆ InternetSetStatusCallbackA()

INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackA ( HINTERNET  hInternet,
INTERNET_STATUS_CALLBACK  lpfnIntCB 
)

Definition at line 2480 of file internet.c.

2482{
2484 object_header_t *lpwh;
2485
2486 TRACE("%p\n", hInternet);
2487
2488 if (!(lpwh = get_handle_object(hInternet)))
2490
2491 retVal = set_status_callback(lpwh, lpfnIntCB, FALSE);
2492
2493 WININET_Release( lpwh );
2494 return retVal;
2495}
static INTERNET_STATUS_CALLBACK set_status_callback(object_header_t *lpwh, INTERNET_STATUS_CALLBACK callback, BOOL unicode)
Definition: internet.c:2455
VOID(CALLBACK * INTERNET_STATUS_CALLBACK)(_In_ HINTERNET, _In_opt_ DWORD_PTR, _In_ DWORD, _In_opt_ LPVOID, _In_ DWORD)
Definition: wininet.h:859
#define INTERNET_INVALID_STATUS_CALLBACK
Definition: wininet.h:915

◆ InternetSetStatusCallbackW()

INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackW ( HINTERNET  hInternet,
INTERNET_STATUS_CALLBACK  lpfnIntCB 
)

Definition at line 2508 of file internet.c.

2510{
2512 object_header_t *lpwh;
2513
2514 TRACE("%p\n", hInternet);
2515
2516 if (!(lpwh = get_handle_object(hInternet)))
2518
2519 retVal = set_status_callback(lpwh, lpfnIntCB, TRUE);
2520
2521 WININET_Release( lpwh );
2522 return retVal;
2523}

Referenced by AsyncInetDownload(), create_internet_session(), CRYPT_Connect(), and rpcrt4_http_internet_connect().

◆ InternetTimeFromSystemTimeA()

BOOL WINAPI InternetTimeFromSystemTimeA ( const SYSTEMTIME *  time,
DWORD  format,
LPSTR  string,
DWORD  size 
)

Definition at line 3901 of file internet.c.

3902{
3903 BOOL ret;
3905
3906 TRACE( "%p 0x%08lx %p 0x%08lx\n", time, format, string, size );
3907
3908 if (!time || !string || format != INTERNET_RFC1123_FORMAT)
3909 {
3911 return FALSE;
3912 }
3913
3914 if (size < INTERNET_RFC1123_BUFSIZE * sizeof(*string))
3915 {
3917 return FALSE;
3918 }
3919
3921 if (ret) WideCharToMultiByte( CP_ACP, 0, stringW, -1, string, size, NULL, NULL );
3922
3923 return ret;
3924}
BOOL WINAPI InternetTimeFromSystemTimeW(const SYSTEMTIME *time, DWORD format, LPWSTR string, DWORD size)
Definition: internet.c:3929
__u16 time
Definition: mkdosfs.c:8
static const WCHAR stringW[]
Definition: reg.c:42
#define INTERNET_RFC1123_FORMAT
Definition: wininet.h:407
#define INTERNET_RFC1123_BUFSIZE
Definition: wininet.h:408

◆ InternetTimeFromSystemTimeW()

BOOL WINAPI InternetTimeFromSystemTimeW ( const SYSTEMTIME *  time,
DWORD  format,
LPWSTR  string,
DWORD  size 
)

Definition at line 3929 of file internet.c.

3930{
3931 TRACE( "%p 0x%08lx %p 0x%08lx\n", time, format, string, size );
3932
3933 if (!time || !string || format != INTERNET_RFC1123_FORMAT)
3934 {
3936 return FALSE;
3937 }
3938
3939 if (size < INTERNET_RFC1123_BUFSIZE * sizeof(*string))
3940 {
3942 return FALSE;
3943 }
3944
3945 swprintf( string, size, L"%s, %02d %s %4d %02d:%02d:%02d GMT",
3946 WININET_wkday[time->wDayOfWeek],
3947 time->wDay,
3948 WININET_month[time->wMonth - 1],
3949 time->wYear,
3950 time->wHour,
3951 time->wMinute,
3952 time->wSecond );
3953
3954 return TRUE;
3955}
static const WCHAR WININET_month[12][4]
Definition: internet.c:3888
static const WCHAR WININET_wkday[7][4]
Definition: internet.c:3885
#define swprintf
Definition: winemm.h:209

Referenced by InternetTimeFromSystemTimeA().

◆ InternetTimeToSystemTimeA()

BOOL WINAPI InternetTimeToSystemTimeA ( LPCSTR  string,
SYSTEMTIME *  time,
DWORD  reserved 
)

Definition at line 3960 of file internet.c.

3961{
3962 BOOL ret = FALSE;
3963 WCHAR *stringW;
3964
3965 TRACE( "%s %p 0x%08lx\n", debugstr_a(string), time, reserved );
3966
3967 stringW = strdupAtoW( string );
3968 if (stringW)
3969 {
3971 free( stringW );
3972 }
3973 return ret;
3974}
BOOL WINAPI InternetTimeToSystemTimeW(LPCWSTR string, SYSTEMTIME *time, DWORD reserved)
Definition: internet.c:3979
r reserved
Definition: btrfs.c:3006

◆ InternetTimeToSystemTimeW()

BOOL WINAPI InternetTimeToSystemTimeW ( LPCWSTR  string,
SYSTEMTIME *  time,
DWORD  reserved 
)

Definition at line 3979 of file internet.c.

3980{
3981 unsigned int i;
3982 const WCHAR *s = string;
3983 WCHAR *end;
3984
3985 TRACE( "%s %p 0x%08lx\n", debugstr_w(string), time, reserved );
3986
3987 if (!string || !time) return FALSE;
3988
3989 /* Windows does this too */
3991
3992 /* Convert an RFC1123 time such as 'Fri, 07 Jan 2005 12:06:35 GMT' into
3993 * a SYSTEMTIME structure.
3994 */
3995
3996 while (*s && !iswalpha(*s) && !is_time_digit(*s)) s++;
3997 if (*s == '\0') return TRUE;
3998 time->wDayOfWeek = 7;
3999
4000 if (iswalpha(*s))
4001 {
4002 if (s[1] == '\0' || s[2] == '\0') return TRUE;
4003 for (i = 0; i < 7; i++)
4004 {
4005 if (!wcsnicmp(WININET_wkday[i], s, 3))
4006 {
4007 time->wDayOfWeek = i;
4008 break;
4009 }
4010 }
4011 }
4012 else if (is_time_digit(*s))
4013 {
4014 time->wDayOfWeek = wcstol(s, &end, 10);
4015 s = end;
4016 }
4017 if (time->wDayOfWeek > 6) return TRUE;
4018
4019 while (*s && !is_time_digit(*s)) s++;
4020 time->wDay = wcstol( s, &end, 10 );
4021 s = end;
4022
4023 while (*s && !iswalpha(*s) && !is_time_digit(*s)) s++;
4024 if (*s == '\0') return TRUE;
4025 time->wMonth = 0;
4026
4027 if (iswalpha(*s))
4028 {
4029 if (s[1] == '\0' || s[2] == '\0') return TRUE;
4030 for (i = 0; i < 12; i++)
4031 {
4032 if (!wcsnicmp(WININET_month[i], s, 3))
4033 {
4034 time->wMonth = i + 1;
4035 break;
4036 }
4037 }
4038 }
4039 else if (is_time_digit(*s))
4040 {
4041 time->wMonth = wcstol(s, &end, 10);
4042 s = end;
4043 }
4044 if (time->wMonth == 0) return TRUE;
4045
4046 while (*s && !is_time_digit(*s)) s++;
4047 if (*s == '\0') return TRUE;
4048 time->wYear = wcstol( s, &end, 10 );
4049 s = end;
4050
4051 while (*s && !is_time_digit(*s)) s++;
4052 if (*s == '\0') return TRUE;
4053 time->wHour = wcstol( s, &end, 10 );
4054 s = end;
4055
4056 while (*s && !is_time_digit(*s)) s++;
4057 if (*s == '\0') return TRUE;
4058 time->wMinute = wcstol( s, &end, 10 );
4059 s = end;
4060
4061 while (*s && !is_time_digit(*s)) s++;
4062 if (*s == '\0') return TRUE;
4063 time->wSecond = wcstol( s, &end, 10 );
4064 s = end;
4065
4066 time->wMilliseconds = 0;
4067 return TRUE;
4068}
VOID WINAPI GetSystemTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:304
static BOOL is_time_digit(const WCHAR c)
Definition: internet.c:3893
GLdouble s
Definition: gl.h:2039
char string[160]
Definition: util.h:11
#define iswalpha(_c)
Definition: ctype.h:664

Referenced by HTTP_HttpQueryInfoW(), InternetTimeToSystemTimeA(), and set_cookie().

◆ InternetUnlockRequestFile()

BOOL WINAPI InternetUnlockRequestFile ( HANDLE  hLockHandle)

Definition at line 4680 of file internet.c.

4681{
4682 TRACE("(%p)\n", hLockHandle);
4683
4684 req_file_release(hLockHandle);
4685 return TRUE;
4686}

Referenced by InternetLockRequestFile_test(), and protocol_unlock_request().

◆ InternetWriteFile()

BOOL WINAPI InternetWriteFile ( HINTERNET  hFile,
LPCVOID  lpBuffer,
DWORD  dwNumOfBytesToWrite,
LPDWORD  lpdwNumOfBytesWritten 
)

Definition at line 2569 of file internet.c.

2571{
2572 object_header_t *lpwh;
2573 BOOL res;
2574
2575 TRACE("(%p %p %ld %p)\n", hFile, lpBuffer, dwNumOfBytesToWrite, lpdwNumOfBytesWritten);
2576
2577 lpwh = get_handle_object( hFile );
2578 if (!lpwh) {
2579 WARN("Invalid handle\n");
2581 return FALSE;
2582 }
2583
2584 if(lpwh->vtbl->WriteFile) {
2585 res = lpwh->vtbl->WriteFile(lpwh, lpBuffer, dwNumOfBytesToWrite, lpdwNumOfBytesWritten);
2586 }else {
2587 WARN("No Writefile method.\n");
2589 }
2590
2591 WININET_Release( lpwh );
2592
2593 if(res != ERROR_SUCCESS)
2595 return res == ERROR_SUCCESS;
2596}
DWORD(* WriteFile)(object_header_t *, const void *, DWORD, DWORD *)
Definition: internet.h:230

Referenced by HttpSendRequestEx_test(), rpcrt4_http_keep_connection_active_timer_proc(), rpcrt4_http_prepare_in_pipe(), rpcrt4_ncacn_http_receive_fragment(), rpcrt4_ncacn_http_write(), test_async_HttpSendRequestEx(), and write_post_stream().

◆ invalidate_handle()

static void invalidate_handle ( object_header_t *  info)
static

Definition at line 226 of file internet.c.

227{
229
230 if(!info->valid_handle)
231 return;
232 info->valid_handle = FALSE;
233
234 /* Free all children as native does */
236 {
237 TRACE("invalidating child handle %p for parent %p\n", child->hInternet, info);
239 }
240
242}
uint32_t entry
Definition: isohybrid.c:63
static HWND child
Definition: cursoricon.c:298
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:242
PSYMCRYPT_PARALLEL_HASH_OPERATION next

Referenced by InternetCloseHandle(), invalidate_handle(), and WININET_Release().

◆ is_domain_suffix()

static BOOL is_domain_suffix ( const char *  domain,
const char *  suffix 
)
static

Definition at line 2835 of file internet.c.

2836{
2837 int len_domain = strlen( domain ), len_suffix = strlen( suffix );
2838
2839 if (len_suffix > len_domain) return FALSE;
2840 if (!stricmp( domain + len_domain - len_suffix, suffix )) return TRUE;
2841 return FALSE;
2842}
#define stricmp(_String1, _String2)
Definition: compat.h:24

Referenced by detect_proxy_autoconfig_url_dns().

◆ is_time_digit()

static BOOL is_time_digit ( const WCHAR  c)
inlinestatic

Definition at line 3893 of file internet.c.

3894{
3895 return c >= '0' && c <= '9';
3896}
const GLubyte * c
Definition: glext.h:8905

Referenced by InternetTimeToSystemTimeW().

◆ load_connection_settings()

static LONG load_connection_settings ( HKEY  key,
const WCHAR *  connection,
proxyinfo_t *  lpwpi 
)
static

Definition at line 699 of file internet.c.

700{
702 DWORD type, pos, size = 0;
703 LONG res;
704
706 (!res && !settings))
707 {
708 connection_settings *new_settings = realloc(settings, size);
709 if(!new_settings)
710 {
711 free( settings );
712 return ERROR_OUTOFMEMORY;
713 }
714 settings = new_settings;
715 }
716
717 memset(lpwpi, 0, sizeof(*lpwpi));
719 {
721 free( settings );
722 return ERROR_SUCCESS;
723 }
724
725 lpwpi->flags = settings->flags;
727 pos = 0;
729 if (!res)
731 if (!res)
733 free( settings );
734 if (res)
735 {
736 FreeProxyInfo( lpwpi );
737 return res;
738 }
739 return ERROR_SUCCESS;
740}
HINTERNET connection
Definition: port.c:65
static LONG connection_settings_read(const connection_settings *settings, DWORD *pos, DWORD size, WCHAR **str)
Definition: internet.c:668
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define REG_BINARY
Definition: nt_native.h:1499
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by INTERNET_LoadProxySettings().

◆ parse_proxy_url()

static BOOL parse_proxy_url ( proxyinfo_t *  info,
const WCHAR *  url 
)
static

Definition at line 616 of file internet.c.

617{
618 URL_COMPONENTSW uc = {sizeof(uc)};
619
620 uc.dwHostNameLength = 1;
621 uc.dwUserNameLength = 1;
622 uc.dwPasswordLength = 1;
623
624 if (!InternetCrackUrlW( url, 0, 0, &uc )) return FALSE;
625 if (!uc.dwHostNameLength)
626 {
627 if (!(info->proxy = wcsdup( url ))) return FALSE;
628 info->proxyUsername = NULL;
629 info->proxyPassword = NULL;
630 return TRUE;
631 }
632 if (!(info->proxy = malloc( (uc.dwHostNameLength + 12) * sizeof(WCHAR) ))) return FALSE;
633 swprintf( info->proxy, uc.dwHostNameLength + 12, L"%.*s:%u", uc.dwHostNameLength, uc.lpszHostName, uc.nPort );
634
635 if (!uc.dwUserNameLength) info->proxyUsername = NULL;
636 else if (!(info->proxyUsername = strndupW( uc.lpszUserName, uc.dwUserNameLength )))
637 {
638 free( info->proxy );
639 return FALSE;
640 }
641 if (!uc.dwPasswordLength) info->proxyPassword = NULL;
642 else if (!(info->proxyPassword = strndupW( uc.lpszPassword, uc.dwPasswordLength )))
643 {
644 free( info->proxyUsername );
645 free( info->proxy );
646 return FALSE;
647 }
648 return TRUE;
649}

Referenced by init_global_proxy().

◆ PrivacyGetZonePreferenceW()

DWORD WINAPI PrivacyGetZonePreferenceW ( DWORD  zone,
DWORD  type,
LPDWORD  template,
LPWSTR  preference,
LPDWORD  length 
)

Definition at line 5209 of file internet.c.

5211{
5212 FIXME( "%lx %lx %p %p %p: stub\n", zone, type, template, preference, length );
5213
5214 if (template) *template = zone_preference;
5215 return 0;
5216}
static DWORD zone_preference
Definition: internet.c:5193
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
DWORD zone
Definition: sec_mgr.c:1728

◆ PrivacySetZonePreferenceW()

DWORD WINAPI PrivacySetZonePreferenceW ( DWORD  zone,
DWORD  type,
DWORD  template,
LPCWSTR  preference 
)

Definition at line 5198 of file internet.c.

5199{
5200 FIXME( "%lx %lx %lx %s: stub\n", zone, type, template, debugstr_w(preference) );
5201
5202 zone_preference = template;
5203 return 0;
5204}

◆ query_global_option()

static DWORD query_global_option ( DWORD  option,
void *  buffer,
DWORD *  size,
BOOL  unicode 
)
static

Definition at line 2925 of file internet.c.

2926{
2927 /* FIXME: This function currently handles more options than it should. Options requiring
2928 * proper handles should be moved to proper functions */
2929 switch(option) {
2931 if (*size < sizeof(HTTP_VERSION_INFO))
2933
2934 /*
2935 * Presently hardcoded to 1.1
2936 */
2937 ((HTTP_VERSION_INFO*)buffer)->dwMajorVersion = 1;
2938 ((HTTP_VERSION_INFO*)buffer)->dwMinorVersion = 1;
2939 *size = sizeof(HTTP_VERSION_INFO);
2940
2941 return ERROR_SUCCESS;
2942
2944 FIXME("INTERNET_OPTION_CONNECTED_STATE: semi-stub\n");
2945
2946 if (*size < sizeof(ULONG))
2948
2950 *size = sizeof(ULONG);
2951
2952 return ERROR_SUCCESS;
2953
2954 case INTERNET_OPTION_PROXY: {
2955 appinfo_t ai;
2956 BOOL ret;
2957
2958 TRACE("Getting global proxy info\n");
2959 memset(&ai, 0, sizeof(appinfo_t));
2961
2962 ret = APPINFO_QueryOption(&ai.hdr, INTERNET_OPTION_PROXY, buffer, size, unicode); /* FIXME */
2963 APPINFO_Destroy(&ai.hdr);
2964 return ret;
2965 }
2966
2968 TRACE("INTERNET_OPTION_MAX_CONNS_PER_SERVER\n");
2969
2970 if (*size < sizeof(ULONG))
2972
2973 *(ULONG*)buffer = max_conns;
2974 *size = sizeof(ULONG);
2975
2976 return ERROR_SUCCESS;
2977
2979 TRACE("INTERNET_OPTION_MAX_CONNS_1_0_SERVER\n");
2980
2981 if (*size < sizeof(ULONG))
2983
2985 *size = sizeof(ULONG);
2986
2987 return ERROR_SUCCESS;
2988
2990 FIXME("INTERNET_OPTION_SECURITY_FLAGS: Stub\n");
2991 return ERROR_SUCCESS;
2992
2994 static const INTERNET_VERSION_INFO info = { 1, 2 };
2995
2996 TRACE("INTERNET_OPTION_VERSION\n");
2997
2998 if (*size < sizeof(INTERNET_VERSION_INFO))
3000
3001 memcpy(buffer, &info, sizeof(info));
3002 *size = sizeof(info);
3003
3004 return ERROR_SUCCESS;
3005 }
3006
3008 WCHAR *url = NULL;
3013 LONG ret;
3014
3016 return ret;
3017
3018 TRACE("INTERNET_OPTION_PER_CONNECTION_OPTION\n");
3019
3020 if (*size < sizeof(INTERNET_PER_CONN_OPTION_LISTW)) {
3021 FreeProxyInfo(&pi);
3023 }
3024
3025 if (pi.flags & PROXY_TYPE_AUTO_DETECT)
3027
3028 for (i = 0; i < con->dwOptionCount; i++) {
3030 INTERNET_PER_CONN_OPTIONA *optionA = conA->pOptions + i;
3031
3032 switch (optionW->dwOption) {
3034 optionW->Value.dwValue = pi.flags;
3035 break;
3036
3038 if (unicode)
3039 optionW->Value.pszValue = copy_optionW(pi.proxy);
3040 else
3041 optionA->Value.pszValue = copy_optionA(pi.proxy);
3042 break;
3043
3045 if (unicode)
3046 optionW->Value.pszValue = copy_optionW(pi.proxyBypass);
3047 else
3048 optionA->Value.pszValue = copy_optionA(pi.proxyBypass);
3049 break;
3050
3052 if (unicode)
3053 optionW->Value.pszValue = copy_optionW(pi.autoconf_url);
3054 else
3055 optionA->Value.pszValue = copy_optionA(pi.autoconf_url);
3056 break;
3057
3059 optionW->Value.dwValue = AUTO_PROXY_FLAG_ALWAYS_DETECT;
3060 break;
3061
3063 if (unicode)
3064 optionW->Value.pszValue = copy_optionW(url);
3065 else
3066 optionA->Value.pszValue = copy_optionA(url);
3067 break;
3068
3072 FIXME("Unhandled dwOption %ld\n", optionW->dwOption);
3073 memset(&optionW->Value, 0, sizeof(optionW->Value));
3074 break;
3075
3076#ifdef __REACTOS__
3078 WARN("Unhandled dwOption %d\n", optionW->dwOption);
3079 break;
3080
3081#endif
3082 default:
3083 FIXME("Unknown dwOption %ld\n", optionW->dwOption);
3085 break;
3086 }
3087 }
3088 free(url);
3089 FreeProxyInfo(&pi);
3090
3091 return res;
3092 }
3095 *size = 0;
3100 TRACE("INTERNET_OPTION_CONNECT_TIMEOUT\n");
3101
3102 if (*size < sizeof(ULONG))
3104
3106 *size = sizeof(ULONG);
3107
3108 return ERROR_SUCCESS;
3109
3111 TRACE("INTERNET_OPTION_SEND_TIMEOUT\n");
3112
3113 if (*size < sizeof(ULONG))
3115
3117 *size = sizeof(ULONG);
3118
3119 return ERROR_SUCCESS;
3120
3122 TRACE("INTERNET_OPTION_RECEIVE_TIMEOUT\n");
3123
3124 if (*size < sizeof(ULONG))
3126
3128 *size = sizeof(ULONG);
3129
3130 return ERROR_SUCCESS;
3131
3133 TRACE("INTERNET_OPTION_DATA_SEND_TIMEOUT\n");
3134
3135 if (*size < sizeof(ULONG))
3137
3139 *size = sizeof(ULONG);
3140
3141 return ERROR_SUCCESS;
3142
3144 TRACE("INTERNET_OPTION_DATA_RECEIVE_TIMEOUT\n");
3145
3146 if (*size < sizeof(ULONG))
3148
3150 *size = sizeof(ULONG);
3151
3152 return ERROR_SUCCESS;
3153 }
3154
3155 FIXME("Stub for %ld\n", option);
3157}
static ULONG max_conns
Definition: internet.c:111
static DWORD APPINFO_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
Definition: internet.c:1042
static ULONG max_1_0_conns
Definition: internet.c:111
static VOID APPINFO_Destroy(object_header_t *hdr)
Definition: internet.c:998
#define INTERNET_PER_CONN_FLAGS_UI
Definition: wininet.h:343
#define INTERNET_OPTION_VERSION
Definition: wininet.h:734
#define INTERNET_STATE_CONNECTED
Definition: wininet.h:909

Referenced by INET_QueryOption(), InternetQueryOptionA(), and InternetQueryOptionW().

◆ req_file_release()

void req_file_release ( req_file_t *  req_file)

Definition at line 4634 of file internet.c.

4635{
4636 if(InterlockedDecrement(&req_file->ref))
4637 return;
4638
4639 if(!req_file->is_committed)
4640 DeleteFileW(req_file->file_name);
4641 if(req_file->file_handle && req_file->file_handle != INVALID_HANDLE_VALUE)
4642 CloseHandle(req_file->file_handle);
4643 free(req_file->file_name);
4644 free(req_file->url);
4645 free(req_file);
4646}
#define InterlockedDecrement
Definition: armddk.h:52
#define CloseHandle
Definition: compat.h:739
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
WCHAR * url
Definition: internet.h:217
BOOL is_committed
Definition: internet.h:218

Referenced by create_cache_entry(), create_req_file(), HTTPREQ_Destroy(), and InternetUnlockRequestFile().

◆ ResumeSuspendedDownload()

BOOL WINAPI ResumeSuspendedDownload ( HINTERNET  hInternet,
DWORD  dwError 
)

Definition at line 5323 of file internet.c.

5324{
5325 FIXME("(%p, 0x%08lx) stub\n", hInternet, dwError);
5326 return FALSE;
5327}

◆ reverse_lookup()

static int reverse_lookup ( const struct addrinfo *  ai,
char *  hostname,
size_t  len 
)
static

Definition at line 2844 of file internet.c.

2845{
2846 return getnameinfo( ai->ai_addr, ai->ai_addrlen, hostname, len, NULL, 0, 0 );
2847}
size_t ai_addrlen
Definition: ws2def.h:675
struct sockaddr * ai_addr
Definition: ws2def.h:677
#define getnameinfo
Definition: wspiapi.h:45

Referenced by build_wpad_url().

◆ save_connection_settings()

static LONG save_connection_settings ( HKEY  key,
const WCHAR *  connection,
proxyinfo_t *  lpwpi 
)
static

Definition at line 371 of file internet.c.

372{
374 DWORD size = 0, pos = 0;
375 LONG ret;
376
380 size += sizeof(DWORD) * 10; /* unknown fields */
381
383 if (!settings)
384 return ERROR_OUTOFMEMORY;
385
387 settings->flags = lpwpi->flags;
391
394 free(settings);
395 return ret;
396}
#define CONNECTION_SETTINGS_VERSION
Definition: internet.c:96
static void connection_settings_write(connection_settings *settings, DWORD *pos, DWORD size, const WCHAR *str)
Definition: internet.c:356

Referenced by INTERNET_SaveProxySettings().

◆ scheme_is_opaque()

static BOOL scheme_is_opaque ( INTERNET_SCHEME  nScheme)
inlinestatic

Definition at line 4812 of file internet.c.

4813{
4814 return (nScheme != INTERNET_SCHEME_FTP) &&
4815 (nScheme != INTERNET_SCHEME_GOPHER) &&
4816 (nScheme != INTERNET_SCHEME_HTTP) &&
4817 (nScheme != INTERNET_SCHEME_HTTPS) &&
4818 (nScheme != INTERNET_SCHEME_FILE);
4819}

Referenced by calc_url_length(), and InternetCreateUrlW().

◆ set_global_option()

static DWORD set_global_option ( DWORD  option,
void *  buf,
DWORD  size 
)
static

Definition at line 3350 of file internet.c.

3351{
3352 switch(option) {
3354 WARN("Not global option %lu\n", option);
3356
3358 TRACE("INTERNET_OPTION_MAX_CONNS_PER_SERVER\n");
3359
3360 if(size != sizeof(max_conns))
3362 if(!*(ULONG*)buf)
3363 return ERROR_BAD_ARGUMENTS;
3364
3365 max_conns = *(ULONG*)buf;
3366 return ERROR_SUCCESS;
3367
3369 TRACE("INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER\n");
3370
3371 if(size != sizeof(max_1_0_conns))
3373 if(!*(ULONG*)buf)
3374 return ERROR_BAD_ARGUMENTS;
3375
3376 max_1_0_conns = *(ULONG*)buf;
3377 return ERROR_SUCCESS;
3378
3380 TRACE("INTERNET_OPTION_CONNECT_TIMEOUT\n");
3381
3382 if(size != sizeof(connect_timeout))
3384 if(!*(ULONG*)buf)
3385 return ERROR_BAD_ARGUMENTS;
3386
3388 return ERROR_SUCCESS;
3389
3391 TRACE("INTERNET_OPTION_SEND_TIMEOUT\n");
3392
3393 if(size != sizeof(send_timeout))
3395 if(!*(ULONG*)buf)
3396 return ERROR_BAD_ARGUMENTS;
3397
3398 send_timeout = *(ULONG*)buf;
3399 return ERROR_SUCCESS;
3400
3402 TRACE("INTERNET_OPTION_RECEIVE_TIMEOUT\n");
3403
3404 if(size != sizeof(receive_timeout))
3406 if(!*(ULONG*)buf)
3407 return ERROR_BAD_ARGUMENTS;
3408
3410 return ERROR_SUCCESS;
3411
3413 TRACE("INTERNET_OPTION_DATA_SEND_TIMEOUT\n");
3414
3415 if(size != sizeof(data_send_timeout))
3417 if(!*(ULONG*)buf)
3418 return ERROR_BAD_ARGUMENTS;
3419
3421 return ERROR_SUCCESS;
3422
3424 TRACE("INTERNET_OPTION_DATA_RECEIVE_TIMEOUT\n");
3425
3426 if(size != sizeof(data_receive_timeout))
3428 if(!*(ULONG*)buf)
3429 return ERROR_BAD_ARGUMENTS;
3430
3432 return ERROR_SUCCESS;
3433
3435 FIXME("INTERNET_OPTION_SUPPRESS_BEHAVIOR stub\n");
3436
3437 if(size != sizeof(ULONG))
3439
3440 FIXME("%08lx\n", *(ULONG*)buf);
3441 return ERROR_SUCCESS;
3442 }
3443
3444 return INET_SetOption(NULL, option, buf, size);
3445}
#define ERROR_BAD_ARGUMENTS
Definition: winerror.h:354
#define INTERNET_OPTION_SUPPRESS_BEHAVIOR
Definition: wininet.h:771

Referenced by InternetSetOptionW().

◆ set_status_callback()

static INTERNET_STATUS_CALLBACK set_status_callback ( object_header_t *  lpwh,
INTERNET_STATUS_CALLBACK  callback,
BOOL  unicode 
)
static

Definition at line 2455 of file internet.c.

2457{
2459
2460 if (unicode) lpwh->dwInternalFlags |= INET_CALLBACKW;
2461 else lpwh->dwInternalFlags &= ~INET_CALLBACKW;
2462
2463 ret = lpwh->lpfnStatusCB;
2464 lpwh->lpfnStatusCB = callback;
2465
2466 return ret;
2467}
static IPrintDialogCallback callback
Definition: printdlg.c:325
DWORD dwInternalFlags
Definition: internet.h:253
INTERNET_STATUS_CALLBACK lpfnStatusCB
Definition: internet.h:256

Referenced by InternetSetStatusCallbackA(), and InternetSetStatusCallbackW().

◆ set_url_component()

static BOOL set_url_component ( WCHAR **  component,
DWORD *  component_length,
const WCHAR *  value,
DWORD  len 
)
static

Definition at line 1859 of file internet.c.

1860{
1861 TRACE("%s (%ld)\n", debugstr_wn(value, len), len);
1862
1863 if (!*component_length)
1864 return TRUE;
1865
1866 if (!*component) {
1867 *(const WCHAR**)component = value;
1868 *component_length = len;
1869 return TRUE;
1870 }
1871
1872 if (*component_length < len+1) {
1874 return FALSE;
1875 }
1876
1877 *component_length = len;
1878 if(len)
1879 memcpy(*component, value, len*sizeof(WCHAR));
1880 (*component)[len] = 0;
1881 return TRUE;
1882}

Referenced by InternetCrackUrlW().

◆ set_url_component_AtoW()

static BOOL set_url_component_AtoW ( const char *  comp_a,
DWORD  len_a,
WCHAR **  comp_w,
DWORD *  len_w,
WCHAR **  buf 
)
static

Definition at line 1911 of file internet.c.

1912{
1913 *len_w = len_a;
1914
1915 if(!comp_a) {
1916 *comp_w = NULL;
1917 return TRUE;
1918 }
1919
1920 if(!(*comp_w = *buf = malloc(len_a * sizeof(WCHAR)))) {
1922 return FALSE;
1923 }
1924
1925 return TRUE;
1926}

Referenced by InternetCrackUrlA().

◆ set_url_component_WtoA()

static BOOL set_url_component_WtoA ( const WCHAR *  comp_w,
DWORD  length,
const WCHAR *  url_w,
char **  comp,
DWORD *  ret_length,
const char *  url_a 
)
static

Definition at line 1884 of file internet.c.

1886{
1887 size_t size, ret_size = *ret_length;
1888
1889 if (!*ret_length)
1890 return TRUE;
1891 size = WideCharToMultiByte(CP_ACP, 0, comp_w, length, NULL, 0, NULL, NULL);
1892
1893 if (!*comp) {
1894 *comp = comp_w ? (char*)url_a + WideCharToMultiByte(CP_ACP, 0, url_w, comp_w-url_w, NULL, 0, NULL, NULL) : NULL;
1895 *ret_length = size;
1896 return TRUE;
1897 }
1898
1899 if (size+1 > ret_size) {
1901 *ret_length = size+1;
1902 return FALSE;
1903 }
1904
1905 *ret_length = size;
1906 WideCharToMultiByte(CP_ACP, 0, comp_w, length, *comp, ret_size-1, NULL, NULL);
1907 (*comp)[size] = 0;
1908 return TRUE;
1909}
static void ULONG ULONG * ret_size
Definition: time.c:40

Referenced by InternetCrackUrlA().

◆ ShowClientAuthCerts()

DWORD WINAPI ShowClientAuthCerts ( HWND  parent)

Definition at line 5335 of file internet.c.

5336{
5337 FIXME("%p: stub\n", parent);
5338 return 0;
5339}

◆ url_uses_default_port()

static BOOL url_uses_default_port ( INTERNET_SCHEME  nScheme,
INTERNET_PORT  nPort 
)
static

Definition at line 4789 of file internet.c.

4790{
4791 if ((nScheme == INTERNET_SCHEME_HTTP) &&
4792 (nPort == INTERNET_DEFAULT_HTTP_PORT))
4793 return TRUE;
4794 if ((nScheme == INTERNET_SCHEME_HTTPS) &&
4795 (nPort == INTERNET_DEFAULT_HTTPS_PORT))
4796 return TRUE;
4797 if ((nScheme == INTERNET_SCHEME_FTP) &&
4798 (nPort == INTERNET_DEFAULT_FTP_PORT))
4799 return TRUE;
4800 if ((nScheme == INTERNET_SCHEME_GOPHER) &&
4802 return TRUE;
4803
4804 if (nPort == INTERNET_INVALID_PORT_NUMBER)
4805 return TRUE;
4806
4807 return FALSE;
4808}
#define INTERNET_DEFAULT_GOPHER_PORT
Definition: wininet.h:39

Referenced by calc_url_length(), and InternetCreateUrlW().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wininet  )

◆ WININET_AddRef()

object_header_t * WININET_AddRef ( object_header_t *  info)

Definition at line 202 of file internet.c.

203{
205 TRACE("%p -> refcount = %ld\n", info, refs );
206 return info;
207}
#define InterlockedIncrement
Definition: armddk.h:53
LONG refs
Definition: port.c:62

Referenced by alloc_async_task(), FTP_Connect(), FTP_FtpOpenFileW(), FTP_ReceiveFileList(), get_handle_object(), HTTP_Connect(), and HTTP_HttpOpenRequestW().

◆ WININET_Release()

BOOL WININET_Release ( object_header_t *  info)

Definition at line 244 of file internet.c.

245{
247 TRACE( "object %p refcount = %ld\n", info, refs );
248 if( !refs )
249 {
251 if ( info->vtbl->CloseConnection )
252 {
253 TRACE( "closing connection %p\n", info);
254 info->vtbl->CloseConnection( info );
255 }
256 /* Don't send a callback if this is a session handle created with InternetOpenUrl */
257 if ((info->htype != WH_HHTTPSESSION && info->htype != WH_HFTPSESSION)
258 || !(info->dwInternalFlags & INET_OPENURL))
259 {
260 INTERNET_SendCallback(info, info->dwContext,
262 sizeof(HINTERNET));
263 }
264 TRACE( "destroying object %p\n", info);
265 if ( info->htype != WH_HINIT )
266 list_remove( &info->entry );
267 info->vtbl->Destroy( info );
268
269 if(info->hInternet) {
270 UINT_PTR handle = (UINT_PTR)info->hInternet;
271
273
275 if(next_handle > handle)
277
279 }
280
281 free(info);
282 }
283 return TRUE;
284}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext, DWORD dwInternetStatus, LPVOID lpvStatusInfo, DWORD dwStatusInfoLength)
@ WH_HHTTPSESSION
Definition: internet.h:203
@ WH_HFTPSESSION
Definition: internet.h:201
#define INTERNET_STATUS_HANDLE_CLOSING
Definition: wininet.h:896

Referenced by FTP_Connect(), FtpCommandW(), FtpCreateDirectoryW(), FtpDeleteFileW(), FTPFILE_Destroy(), FtpFindFirstFileW(), FTPFINDNEXT_Destroy(), FtpGetCurrentDirectoryW(), FtpGetFileW(), FtpOpenFileW(), FtpPutFileW(), FtpRemoveDirectoryW(), FtpRenameFileW(), FTPSESSION_Destroy(), FtpSetCurrentDirectoryW(), HTTP_HttpOpenRequestW(), HttpAddRequestHeadersW(), HttpEndRequestW(), HttpOpenRequestW(), HttpQueryInfoW(), HTTPREQ_Destroy(), HttpSendRequestExW(), HttpSendRequestW(), HTTPSESSION_Destroy(), INTERNET_WorkerThreadFunc(), InternetCloseHandle(), InternetConnectW(), InternetErrorDlg(), InternetFindNextFileW(), InternetLockRequestFile(), InternetOpenUrlW(), InternetQueryDataAvailable(), InternetQueryOptionA(), InternetQueryOptionW(), InternetReadFile(), InternetReadFileExA(), InternetReadFileExW(), InternetSetFilePointer(), InternetSetOptionW(), InternetSetStatusCallbackA(), InternetSetStatusCallbackW(), InternetWriteFile(), and invalidate_handle().

Variable Documentation

◆ APPINFOVtbl

const object_vtbl_t APPINFOVtbl
static
Initial value:
= {
}
static DWORD APPINFO_SetOption(object_header_t *hdr, DWORD option, void *buf, DWORD size)
Definition: internet.c:1248

Definition at line 1312 of file internet.c.

Referenced by InternetOpenW().

◆ connect_timeout

ULONG connect_timeout = 60000
static

◆ data_receive_timeout

ULONG data_receive_timeout = 60000
static

Definition at line 116 of file internet.c.

Referenced by alloc_object(), query_global_option(), and set_global_option().

◆ data_send_timeout

ULONG data_send_timeout = 60000
static

Definition at line 115 of file internet.c.

Referenced by alloc_object(), query_global_option(), and set_global_option().

◆ g_dwTlsErrIndex

◆ global_proxy

◆ handle_table

Definition at line 82 of file internet.c.

◆ handle_table_size

UINT_PTR handle_table_size
static

Definition at line 84 of file internet.c.

Referenced by alloc_object(), and get_handle_object().

◆ max_1_0_conns

ULONG max_1_0_conns = 4
static

Definition at line 111 of file internet.c.

Referenced by query_global_option(), and set_global_option().

◆ max_conns

ULONG max_conns = 2
static

Definition at line 111 of file internet.c.

Referenced by query_global_option(), and set_global_option().

◆ next_handle

UINT_PTR next_handle
static

Definition at line 83 of file internet.c.

Referenced by alloc_object(), and WININET_Release().

◆ receive_timeout

ULONG receive_timeout = 60000
static

◆ send_timeout

ULONG send_timeout = 60000
static

◆ szInternetSettings

const WCHAR szInternetSettings[]
static
Initial value:
=
L"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"

Definition at line 119 of file internet.c.

Referenced by INTERNET_LoadProxySettings(), and INTERNET_SaveProxySettings().

◆ url_schemes

const WCHAR* url_schemes[]
static
Initial value:
=
{
L"ftp",
L"gopher",
L"http",
L"https",
L"file",
L"news",
L"mailto",
L"socks",
L"javascript",
L"vbscript",
L"res"
}

Definition at line 2002 of file internet.c.

Referenced by GetInternetSchemeW(), and INTERNET_GetSchemeString().

◆ WININET_cs

◆ WININET_cs_debug

CRITICAL_SECTION_DEBUG WININET_cs_debug
static
Initial value:
=
{
0, 0, &WININET_cs,
0, 0, { (DWORD_PTR)(__FILE__ ": WININET_cs") }
}
static CRITICAL_SECTION_DEBUG WININET_cs_debug
Definition: internet.c:74

Definition at line 74 of file internet.c.

◆ WININET_hModule

◆ WININET_month

const WCHAR WININET_month[12][4]
static
Initial value:
=
{ L"Jan", L"Feb", L"Mar", L"Apr",
L"May", L"Jun", L"Jul", L"Aug",
L"Sep", L"Oct", L"Nov", L"Dec"}

Definition at line 3888 of file internet.c.

Referenced by InternetTimeFromSystemTimeW(), and InternetTimeToSystemTimeW().

◆ WININET_wkday

const WCHAR WININET_wkday[7][4]
static
Initial value:
=
{ L"Sun", L"Mon", L"Tue", L"Wed",
L"Thu", L"Fri", L"Sat"}

Definition at line 3885 of file internet.c.

Referenced by InternetTimeFromSystemTimeW(), and InternetTimeToSystemTimeW().

◆ zone_preference

DWORD zone_preference = 3
static

Definition at line 5193 of file internet.c.

Referenced by PrivacyGetZonePreferenceW(), and PrivacySetZonePreferenceW().