ReactOS 0.4.16-dev-2491-g3dc6630
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 "wine/exception.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  open_url_task_t
 

Macros

#define NO_SHLWAPI_STREAM
 
#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 WITHREADERRORLPWITHREADERROR
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wininet)
 
voidalloc_object (object_header_t *parent, const object_vtbl_t *vtbl, size_t size)
 
object_header_tWININET_AddRef (object_header_t *info)
 
object_header_tget_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 LONG INTERNET_SaveProxySettings (proxyinfo_t *lpwpi)
 
WCHARINTERNET_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 LONG INTERNET_LoadProxySettings (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 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 WCHARdetect_proxy_autoconfig_url_dhcp (void)
 
static charget_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 WCHARbuild_wpad_url (const char *hostname, const struct addrinfo *ai)
 
static WCHARdetect_proxy_autoconfig_url_dns (void)
 
static WCHARget_proxy_autoconfig_url (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)
 
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)
 
voidalloc_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 const WCHAR szInternetSettings []
 
static proxyinfo_tglobal_proxy
 
static const object_vtbl_t APPINFOVtbl
 
static const WCHARurl_schemes []
 
static const WCHAR WININET_wkday [7][4]
 
static const WCHAR WININET_month [12][4]
 
static DWORD zone_preference = 3
 

Macro Definition Documentation

◆ 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 4164 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 4166 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:1592

Definition at line 4168 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 3895 of file internet.c.

3896{
3898
3899 task = heap_alloc(size);
3900 if(!task)
3901 return NULL;
3902
3903 task->hdr = WININET_AddRef(hdr);
3904 task->proc = proc;
3905 return task;
3906}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
DWORD task
Definition: delayimp.cpp:484
#define NULL
Definition: types.h:112
object_header_t * WININET_AddRef(object_header_t *info)
Definition: internet.c:169
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 103 of file internet.c.

104{
105 UINT_PTR handle = 0, num;
108 BOOL res = TRUE;
109
110 ret = heap_alloc_zero(size);
111 if(!ret)
112 return NULL;
113
114 list_init(&ret->children);
115
117
118 if(!handle_table_size) {
119 num = 16;
120 p = heap_alloc_zero(sizeof(handle_table[0]) * num);
121 if(p) {
122 handle_table = p;
124 next_handle = 1;
125 }else {
126 res = FALSE;
127 }
128 }else if(next_handle == handle_table_size) {
130 p = heap_realloc_zero(handle_table, sizeof(handle_table[0]) * num);
131 if(p) {
132 handle_table = p;
134 }else {
135 res = FALSE;
136 }
137 }
138
139 if(res) {
142 ERR("handle isn't free but should be\n");
144 ret->valid_handle = TRUE;
145
147 next_handle++;
148 }
149
151
152 if(!res) {
153 heap_free(ret);
154 return NULL;
155 }
156
157 ret->vtbl = vtbl;
158 ret->refs = 1;
159 ret->hInternet = (HINTERNET)handle;
160
161 if(parent) {
162 ret->lpfnStatusCB = parent->lpfnStatusCB;
163 ret->dwInternalFlags = parent->dwInternalFlags & INET_CALLBACKW;
164 }
165
166 return ret;
167}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
static void list_init(struct list_entry *head)
Definition: list.h:51
#define ERR(fmt,...)
Definition: precomp.h:57
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static UINT_PTR next_handle
Definition: internet.c:85
static CRITICAL_SECTION WININET_cs
Definition: internet.c:75
static UINT_PTR handle_table_size
Definition: internet.c:86
return ret
Definition: mutex.c:146
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:244
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
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 775 of file internet.c.

776{
777 appinfo_t *lpwai = (appinfo_t*)hdr;
778
779 TRACE("%p\n",lpwai);
780
781 heap_free(lpwai->agent);
782 heap_free(lpwai->proxy);
783 heap_free(lpwai->proxyBypass);
784 heap_free(lpwai->proxyUsername);
785 heap_free(lpwai->proxyPassword);
786}
#define TRACE(s)
Definition: solgame.cpp:4
LPWSTR proxy
Definition: internet.h:293
LPWSTR proxyBypass
Definition: internet.h:294
LPWSTR agent
Definition: internet.h:292
LPWSTR proxyPassword
Definition: internet.h:296
LPWSTR proxyUsername
Definition: internet.h:295

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 788 of file internet.c.

789{
790 appinfo_t *ai = (appinfo_t*)hdr;
791
792 switch(option) {
794 TRACE("INTERNET_OPTION_HANDLE_TYPE\n");
795
796 if (*size < sizeof(ULONG))
798
799 *size = sizeof(DWORD);
801 return ERROR_SUCCESS;
802
805
806 TRACE("INTERNET_OPTION_USER_AGENT\n");
807
808 bufsize = *size;
809
810 if (unicode) {
811 DWORD len = ai->agent ? lstrlenW(ai->agent) : 0;
812
813 *size = (len + 1) * sizeof(WCHAR);
814 if(!buffer || bufsize < *size)
816
817 if (ai->agent)
818 lstrcpyW(buffer, ai->agent);
819 else
820 *(WCHAR *)buffer = 0;
821 /* If the buffer is copied, the returned length doesn't include
822 * the NULL terminator.
823 */
824 *size = len;
825 }else {
826 if (ai->agent)
827 *size = WideCharToMultiByte(CP_ACP, 0, ai->agent, -1, NULL, 0, NULL, NULL);
828 else
829 *size = 1;
830 if(!buffer || bufsize < *size)
832
833 if (ai->agent)
835 else
836 *(char *)buffer = 0;
837 /* If the buffer is copied, the returned length doesn't include
838 * the NULL terminator.
839 */
840 *size -= 1;
841 }
842
843 return ERROR_SUCCESS;
844 }
845
847 if(!size) return ERROR_INVALID_PARAMETER;
848 if (unicode) {
850 DWORD proxyBytesRequired = 0, proxyBypassBytesRequired = 0;
851 LPWSTR proxy, proxy_bypass;
852
853 if (ai->proxy)
854 proxyBytesRequired = (lstrlenW(ai->proxy) + 1) * sizeof(WCHAR);
855 if (ai->proxyBypass)
856 proxyBypassBytesRequired = (lstrlenW(ai->proxyBypass) + 1) * sizeof(WCHAR);
857 if (!pi || *size < sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired + proxyBypassBytesRequired)
858 {
859 *size = sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired + proxyBypassBytesRequired;
861 }
863 proxy_bypass = (LPWSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired);
864
865 pi->dwAccessType = ai->accessType;
866 pi->lpszProxy = NULL;
867 pi->lpszProxyBypass = NULL;
868 if (ai->proxy) {
869 lstrcpyW(proxy, ai->proxy);
870 pi->lpszProxy = proxy;
871 }
872
873 if (ai->proxyBypass) {
874 lstrcpyW(proxy_bypass, ai->proxyBypass);
875 pi->lpszProxyBypass = proxy_bypass;
876 }
877
878 *size = sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired + proxyBypassBytesRequired;
879 return ERROR_SUCCESS;
880 }else {
882 DWORD proxyBytesRequired = 0, proxyBypassBytesRequired = 0;
883 LPSTR proxy, proxy_bypass;
884
885 if (ai->proxy)
886 proxyBytesRequired = WideCharToMultiByte(CP_ACP, 0, ai->proxy, -1, NULL, 0, NULL, NULL);
887 if (ai->proxyBypass)
888 proxyBypassBytesRequired = WideCharToMultiByte(CP_ACP, 0, ai->proxyBypass, -1,
889 NULL, 0, NULL, NULL);
890 if (!pi || *size < sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired + proxyBypassBytesRequired)
891 {
892 *size = sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired + proxyBypassBytesRequired;
894 }
896 proxy_bypass = (LPSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired);
897
898 pi->dwAccessType = ai->accessType;
899 pi->lpszProxy = NULL;
900 pi->lpszProxyBypass = NULL;
901 if (ai->proxy) {
902 WideCharToMultiByte(CP_ACP, 0, ai->proxy, -1, proxy, proxyBytesRequired, NULL, NULL);
903 pi->lpszProxy = proxy;
904 }
905
906 if (ai->proxyBypass) {
907 WideCharToMultiByte(CP_ACP, 0, ai->proxyBypass, -1, proxy_bypass,
908 proxyBypassBytesRequired, NULL, NULL);
909 pi->lpszProxyBypass = proxy_bypass;
910 }
911
912 *size = sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired + proxyBypassBytesRequired;
913 return ERROR_SUCCESS;
914 }
915
917 TRACE("INTERNET_OPTION_CONNECT_TIMEOUT\n");
918
919 if (*size < sizeof(ULONG))
921
923 *size = sizeof(ULONG);
924
925 return ERROR_SUCCESS;
926 }
927
928 return INET_QueryOption(hdr, option, buffer, size, unicode);
929}
#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
DWORD INET_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
Definition: internet.c:2654
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
static PROCESS_INFORMATION pi
Definition: debugger.c:2303
#define DWORD
Definition: nt_native.h:44
DWORD accessType
Definition: internet.h:297
DWORD connect_timeout
Definition: internet.h:298
Definition: getopt.h:109
unsigned char * LPBYTE
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define INTERNET_OPTION_USER_AGENT
Definition: wininet.h:735
#define INTERNET_OPTION_CONNECT_TIMEOUT
Definition: wininet.h:701
#define INTERNET_HANDLE_TYPE_INTERNET
Definition: wininet.h:802
#define INTERNET_OPTION_PROXY
Definition: wininet.h:732
#define INTERNET_OPTION_HANDLE_TYPE
Definition: wininet.h:710
#define INTERNET_PROXY_INFOA
Definition: wininet_test.h:55
#define INTERNET_PROXY_INFOW
Definition: wininet_test.h:56
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
char * LPSTR
Definition: xmlstorage.h:182

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 931 of file internet.c.

932{
933 appinfo_t *ai = (appinfo_t*)hdr;
934
935 switch(option) {
937 TRACE("INTERNET_OPTION_CONNECT_TIMEOUT\n");
938
939 if(size != sizeof(connect_timeout))
941 if(!*(ULONG*)buf)
942 return ERROR_BAD_ARGUMENTS;
943
944 ai->connect_timeout = *(ULONG*)buf;
945 return ERROR_SUCCESS;
947 heap_free(ai->agent);
948 if (!(ai->agent = heap_strdupW(buf))) return ERROR_OUTOFMEMORY;
949 return ERROR_SUCCESS;
951 FIXME("INTERNET_OPTION_REFRESH\n");
952 return ERROR_SUCCESS;
953 }
954
955 return INET_SetOption(hdr, option, buf, size);
956}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: edit.c:4320
DWORD INET_SetOption(object_header_t *hdr, DWORD option, void *buf, DWORD size)
Definition: internet.c:2753
static ULONG connect_timeout
Definition: internet.c:98
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define ERROR_BAD_ARGUMENTS
Definition: winerror.h:354
#define INTERNET_OPTION_REFRESH
Definition: wininet.h:731
#define ERROR_INTERNET_BAD_OPTION_LENGTH
Definition: wininet.h:1999

◆ AsyncInternetOpenUrlProc()

static void AsyncInternetOpenUrlProc ( task_header_t hdr)
static

Definition at line 3711 of file internet.c.

3712{
3714
3715 TRACE("%p\n", task->hdr.hdr);
3716
3717 INTERNET_InternetOpenUrlW((appinfo_t*)task->hdr.hdr, task->url, task->headers,
3718 task->headers_len, task->flags, task->context);
3719 heap_free(task->url);
3720 heap_free(task->headers);
3721}
static HINTERNET INTERNET_InternetOpenUrlW(appinfo_t *hIC, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
Definition: internet.c:3604

Referenced by InternetOpenUrlW().

◆ build_wpad_url()

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

Definition at line 2385 of file internet.c.

2386{
2387 char name[NI_MAXHOST];
2388 WCHAR *ret, *p;
2389 int len;
2390
2391 while (ai && ai->ai_family != AF_INET && ai->ai_family != AF_INET6) ai = ai->ai_next;
2392 if (!ai) return NULL;
2393
2394 if (!reverse_lookup( ai, name, sizeof(name) )) hostname = name;
2395
2396 len = lstrlenW( L"http://" ) + strlen( hostname ) + lstrlenW( L"/wpad.dat" );
2397 if (!(ret = p = GlobalAlloc( 0, (len + 1) * sizeof(WCHAR) ))) return NULL;
2398 lstrcpyW( p, L"http://" );
2399 p += lstrlenW( L"http://" );
2400 while (*hostname) { *p++ = *hostname++; }
2401 lstrcpyW( p, L"/wpad.dat" );
2402 return ret;
2403}
char * hostname
Definition: ftp.c:88
static int reverse_lookup(const struct addrinfo *ai, char *hostname, size_t len)
Definition: internet.c:2380
#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 4217 of file internet.c.

4219{
4220 INTERNET_SCHEME nScheme;
4221
4222 *lpdwUrlLength = 0;
4223
4224 if (lpUrlComponents->lpszScheme)
4225 {
4226 DWORD dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, Scheme);
4227 *lpdwUrlLength += dwLen;
4228 nScheme = GetInternetSchemeW(lpUrlComponents->lpszScheme, dwLen);
4229 }
4230 else
4231 {
4233
4234 nScheme = lpUrlComponents->nScheme;
4235
4236 if (nScheme == INTERNET_SCHEME_DEFAULT)
4237 nScheme = INTERNET_SCHEME_HTTP;
4239 *lpdwUrlLength += lstrlenW(scheme);
4240 }
4241
4242 (*lpdwUrlLength)++; /* ':' */
4243 if (!scheme_is_opaque(nScheme) || lpUrlComponents->lpszHostName)
4244 *lpdwUrlLength += strlen("//");
4245
4246 if (lpUrlComponents->lpszUserName)
4247 {
4248 *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, UserName);
4249 *lpdwUrlLength += strlen("@");
4250 }
4251 else
4252 {
4253 if (lpUrlComponents->lpszPassword)
4254 {
4256 return FALSE;
4257 }
4258 }
4259
4260 if (lpUrlComponents->lpszPassword)
4261 {
4262 *lpdwUrlLength += strlen(":");
4263 *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, Password);
4264 }
4265
4266 if (lpUrlComponents->lpszHostName)
4267 {
4268 *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, HostName);
4269
4270 if (!url_uses_default_port(nScheme, lpUrlComponents->nPort))
4271 {
4273
4274 _ltow(lpUrlComponents->nPort, port, 10);
4275 *lpdwUrlLength += lstrlenW(port);
4276 *lpdwUrlLength += strlen(":");
4277 }
4278
4279 if (lpUrlComponents->lpszUrlPath && *lpUrlComponents->lpszUrlPath != '/')
4280 (*lpdwUrlLength)++; /* '/' */
4281 }
4282
4283 if (lpUrlComponents->lpszUrlPath)
4284 *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, UrlPath);
4285
4286 if (lpUrlComponents->lpszExtraInfo)
4287 *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, ExtraInfo);
4288
4289 return TRUE;
4290}
_ACRTIMP wchar_t *__cdecl _ltow(__msvcrt_long, wchar_t *, int)
Definition: string.c:2143
USHORT port
Definition: uri.c:228
static LPCWSTR INTERNET_GetSchemeString(INTERNET_SCHEME scheme)
Definition: internet.c:4203
static INTERNET_SCHEME GetInternetSchemeW(LPCWSTR lpszScheme, DWORD nMaxCmp)
Definition: internet.c:1600
#define URL_GET_COMP_LENGTH(url, component)
Definition: internet.c:4166
void INTERNET_SetLastError(DWORD dwError)
Definition: internet.c:3838
static BOOL scheme_is_opaque(INTERNET_SCHEME nScheme)
Definition: internet.c:4194
static BOOL url_uses_default_port(INTERNET_SCHEME nScheme, INTERNET_PORT nPort)
Definition: internet.c:4171
#define MAX_WORD_DIGITS
Definition: internet.c:4164
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
#define INTERNET_SCHEME_HTTP
Definition: winhttp.h:47
INTERNET_SCHEME
Definition: wininet.h:135
@ INTERNET_SCHEME_DEFAULT
Definition: wininet.h:138
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by InternetCreateUrlW().

◆ convert_url_canonicalization_flags()

static DWORD convert_url_canonicalization_flags ( DWORD  dwFlags)
static

Definition at line 1953 of file internet.c.

1954{
1956
1957 if (dwFlags & ICU_BROWSER_MODE) dwUrlFlags |= URL_BROWSER_MODE;
1958 if (dwFlags & ICU_DECODE) dwUrlFlags |= URL_UNESCAPE;
1959 if (dwFlags & ICU_ENCODE_PERCENT) dwUrlFlags |= URL_ESCAPE_PERCENT;
1961 /* Flip this bit to correspond to URL_ESCAPE_UNSAFE */
1962 if (dwFlags & ICU_NO_ENCODE) dwUrlFlags ^= URL_ESCAPE_UNSAFE;
1963 if (dwFlags & ICU_NO_META) dwUrlFlags |= URL_NO_META;
1964
1965 return dwUrlFlags;
1966}
_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 4292 of file internet.c.

4293{
4294 INT len;
4295
4296 ZeroMemory(urlCompW, sizeof(URL_COMPONENTSW));
4297
4298 urlCompW->dwStructSize = sizeof(URL_COMPONENTSW);
4299 urlCompW->dwSchemeLength = lpUrlComponents->dwSchemeLength;
4300 urlCompW->nScheme = lpUrlComponents->nScheme;
4301 urlCompW->dwHostNameLength = lpUrlComponents->dwHostNameLength;
4302 urlCompW->nPort = lpUrlComponents->nPort;
4303 urlCompW->dwUserNameLength = lpUrlComponents->dwUserNameLength;
4304 urlCompW->dwPasswordLength = lpUrlComponents->dwPasswordLength;
4305 urlCompW->dwUrlPathLength = lpUrlComponents->dwUrlPathLength;
4306 urlCompW->dwExtraInfoLength = lpUrlComponents->dwExtraInfoLength;
4307
4308 if (lpUrlComponents->lpszScheme)
4309 {
4310 len = URL_GET_COMP_LENGTHA(lpUrlComponents, Scheme) + 1;
4311 urlCompW->lpszScheme = heap_alloc(len * sizeof(WCHAR));
4312 MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszScheme,
4313 -1, urlCompW->lpszScheme, len);
4314 }
4315
4316 if (lpUrlComponents->lpszHostName)
4317 {
4318 len = URL_GET_COMP_LENGTHA(lpUrlComponents, HostName) + 1;
4319 urlCompW->lpszHostName = heap_alloc(len * sizeof(WCHAR));
4320 MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszHostName,
4321 -1, urlCompW->lpszHostName, len);
4322 }
4323
4324 if (lpUrlComponents->lpszUserName)
4325 {
4326 len = URL_GET_COMP_LENGTHA(lpUrlComponents, UserName) + 1;
4327 urlCompW->lpszUserName = heap_alloc(len * sizeof(WCHAR));
4328 MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszUserName,
4329 -1, urlCompW->lpszUserName, len);
4330 }
4331
4332 if (lpUrlComponents->lpszPassword)
4333 {
4334 len = URL_GET_COMP_LENGTHA(lpUrlComponents, Password) + 1;
4335 urlCompW->lpszPassword = heap_alloc(len * sizeof(WCHAR));
4336 MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszPassword,
4337 -1, urlCompW->lpszPassword, len);
4338 }
4339
4340 if (lpUrlComponents->lpszUrlPath)
4341 {
4342 len = URL_GET_COMP_LENGTHA(lpUrlComponents, UrlPath) + 1;
4343 urlCompW->lpszUrlPath = heap_alloc(len * sizeof(WCHAR));
4344 MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszUrlPath,
4345 -1, urlCompW->lpszUrlPath, len);
4346 }
4347
4348 if (lpUrlComponents->lpszExtraInfo)
4349 {
4350 len = URL_GET_COMP_LENGTHA(lpUrlComponents, ExtraInfo) + 1;
4351 urlCompW->lpszExtraInfo = heap_alloc(len * sizeof(WCHAR));
4352 MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszExtraInfo,
4353 -1, urlCompW->lpszExtraInfo, len);
4354 }
4355}
#define MultiByteToWideChar
Definition: compat.h:110
#define URL_GET_COMP_LENGTHA(url, component)
Definition: internet.c:4168
#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().

◆ create_req_file()

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

Definition at line 3989 of file internet.c.

3990{
3991 req_file_t *req_file;
3992
3993 req_file = heap_alloc_zero(sizeof(*req_file));
3994 if(!req_file)
3996
3997 req_file->ref = 1;
3998
3999 req_file->file_name = heap_strdupW(file_name);
4000 if(!req_file->file_name) {
4001 heap_free(req_file);
4003 }
4004
4007 if(req_file->file_handle == INVALID_HANDLE_VALUE) {
4008 req_file_release(req_file);
4009 return GetLastError();
4010 }
4011
4012 *ret = req_file;
4013 return ERROR_SUCCESS;
4014}
#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:4016
static LPCWSTR file_name
Definition: protocol.c:147
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
LONG ref
Definition: internet.h:248
WCHAR * file_name
Definition: internet.h:250
HANDLE file_handle
Definition: internet.h:249
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 4691 of file internet.c.

4693{
4694 FIXME("(%s, %s, %s, %p) stub\n", debugstr_w(pszChallengeInfo), debugstr_w(pwszRealm),
4695 debugstr_w(pwszTarget), pbHexHash);
4696 return FALSE;
4697}
#define debugstr_w
Definition: kernel32.h:32

◆ detect_proxy_autoconfig_url_dhcp()

static WCHAR * detect_proxy_autoconfig_url_dhcp ( void  )
static

Definition at line 2300 of file internet.c.

2301{
2302 IP_ADAPTER_ADDRESSES *adapters, *ptr;
2303 DHCPCAPI_PARAMS_ARRAY send_params, recv_params;
2306 DWORD err, size;
2307 BYTE *tmp, *buf = NULL;
2308
2309 if (!(adapters = get_adapters())) return NULL;
2310
2311 memset( &send_params, 0, sizeof(send_params) );
2312 memset( &param, 0, sizeof(param) );
2313 param.OptionId = OPTION_MSFT_IE_PROXY;
2314 recv_params.nParams = 1;
2315 recv_params.Params = &param;
2316
2317 for (ptr = adapters; ptr; ptr = ptr->Next)
2318 {
2319 MultiByteToWideChar( CP_ACP, 0, ptr->AdapterName, -1, name, ARRAY_SIZE(name) );
2320 TRACE( "adapter '%s' type %u dhcpv4 enabled %d\n", wine_dbgstr_w(name), ptr->IfType, ptr->Dhcpv4Enabled );
2321
2322 if (ptr->IfType == IF_TYPE_SOFTWARE_LOOPBACK) continue;
2323 /* FIXME: also skip adapters where DHCP is disabled */
2324
2325 size = 256;
2326 if (!(buf = heap_alloc( size ))) goto done;
2327 err = DhcpRequestParams( DHCPCAPI_REQUEST_SYNCHRONOUS, NULL, name, NULL, send_params, recv_params,
2328 buf, &size, NULL );
2329 while (err == ERROR_MORE_DATA)
2330 {
2331 if (!(tmp = heap_realloc( buf, size ))) goto done;
2332 buf = tmp;
2333 err = DhcpRequestParams( DHCPCAPI_REQUEST_SYNCHRONOUS, NULL, name, NULL, send_params, recv_params,
2334 buf, &size, NULL );
2335 }
2336 if (err == ERROR_SUCCESS && param.nBytesData)
2337 {
2338 int len = MultiByteToWideChar( CP_ACP, 0, (const char *)param.Data, param.nBytesData, NULL, 0 );
2339 if ((ret = heap_alloc( (len + 1) * sizeof(WCHAR) )))
2340 {
2341 MultiByteToWideChar( CP_ACP, 0, (const char *)param.Data, param.nBytesData, ret, len );
2342 ret[len] = 0;
2343 }
2344 TRACE("returning %s\n", debugstr_w(ret));
2345 break;
2346 }
2347 }
2348
2349done:
2350 heap_free( buf );
2351 heap_free( adapters );
2352 return ret;
2353}
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:71
#define ARRAY_SIZE(A)
Definition: main.h:20
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define DHCPCAPI_REQUEST_SYNCHRONOUS
Definition: dhcpcsdk.h:115
#define OPTION_MSFT_IE_PROXY
Definition: dhcpcsdk.h:87
DWORD APIENTRY DhcpRequestParams(DWORD Flags, PVOID Reserved, LPWSTR AdapterName, LPDHCPCAPI_CLASSID ClassId, DHCPCAPI_PARAMS_ARRAY SendParams, DHCPCAPI_PARAMS_ARRAY RecdParams, LPBYTE Buffer, LPDWORD pSize, LPWSTR RequestIdStr)
Definition: dhcpcsvc.c:500
static IP_ADAPTER_ADDRESSES * get_adapters(void)
Definition: internet.c:2281
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(...)
#define memset(x, y, z)
Definition: compat.h:39
LPDHCPCAPI_PARAMS Params
Definition: dhcpcsdk.h:104
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 2405 of file internet.c.

2406{
2407 char *fqdn, *domain, *p;
2408 WCHAR *ret = NULL;
2409
2410 if (!(fqdn = get_computer_name( ComputerNamePhysicalDnsFullyQualified ))) return NULL;
2411 if (!(domain = get_computer_name( ComputerNamePhysicalDnsDomain )))
2412 {
2413 heap_free( fqdn );
2414 return NULL;
2415 }
2416 p = fqdn;
2417 while ((p = strchr( p, '.' )) && is_domain_suffix( p + 1, domain ))
2418 {
2419 char *name;
2420 struct addrinfo *ai;
2421 int res;
2422
2423 if (!(name = heap_alloc( sizeof("wpad") + strlen(p) )))
2424 {
2425 heap_free( fqdn );
2426 heap_free( domain );
2427 return NULL;
2428 }
2429 strcpy( name, "wpad" );
2430 strcat( name, p );
2431 res = getaddrinfo( name, NULL, NULL, &ai );
2432 if (!res)
2433 {
2434 ret = build_wpad_url( name, ai );
2435 freeaddrinfo( ai );
2436 if (ret)
2437 {
2438 TRACE("returning %s\n", debugstr_w(ret));
2439 heap_free( name );
2440 break;
2441 }
2442 }
2443 heap_free( name );
2444 p++;
2445 }
2446 heap_free( domain );
2447 heap_free( fqdn );
2448 return ret;
2449}
_ACRTIMP char *__cdecl strchr(const char *, int)
Definition: string.c:3286
static WCHAR * build_wpad_url(const char *hostname, const struct addrinfo *ai)
Definition: internet.c:2385
static char * get_computer_name(COMPUTER_NAME_FORMAT format)
Definition: internet.c:2355
static BOOL is_domain_suffix(const char *domain, const char *suffix)
Definition: internet.c:2371
strcat
Definition: string.h:92
strcpy
Definition: string.h:131
Definition: cookie.c:42
#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 462 of file internet.c.

464{
465 FIXME("STUB\n");
467 return FALSE;
468}
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define SetLastError(x)
Definition: compat.h:752

◆ DllInstall()

HRESULT WINAPI DllInstall ( BOOL  bInstall,
LPCWSTR  cmdline 
)

Definition at line 317 of file internet.c.

318{
319 FIXME("(%x %s): stub\n", bInstall, debugstr_w(cmdline));
320 return S_OK;
321}
#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 266 of file internet.c.

267{
268 TRACE("%p,%x,%p\n", hinstDLL, fdwReason, lpvReserved);
269
270 switch (fdwReason) {
272
274
276 return FALSE;
277
278 if(!init_urlcache())
279 {
281 return FALSE;
282 }
283
284 WININET_hModule = hinstDLL;
285 break;
286
288 break;
289
292 {
294 }
295 break;
296
298 if (lpvReserved) break;
302 free_cookie();
303
305 {
308 }
309 break;
310 }
311 return TRUE;
312}
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:1240
BOOL WINAPI TlsFree(IN DWORD Index)
Definition: thread.c:1166
DWORD WINAPI DECLSPEC_HOTPATCH TlsAlloc(void)
Definition: thread.c:657
BOOL collect_connections(collect_type_t collect_type)
Definition: http.c:235
static DWORD g_dwTlsErrIndex
Definition: internet.c:72
HMODULE WININET_hModule
Definition: internet.c:73
void free_urlcache(void) DECLSPEC_HIDDEN
Definition: urlcache.c:4130
@ COLLECT_CLEANUP
Definition: internet.h:62
BOOL init_urlcache(void) DECLSPEC_HIDDEN
Definition: urlcache.c:4112
void NETCON_unload(void) DECLSPEC_HIDDEN
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 721 of file internet.c.

722{
723#define FE(x) { x, #x }
724 static const wininet_flag_info flag[] = {
753 };
754#undef FE
755 unsigned int i;
756
757 for (i = 0; i < ARRAY_SIZE(flag); i++) {
758 if (flag[i].val & dwFlags) {
759 TRACE(" %s", flag[i].name);
760 dwFlags &= ~flag[i].val;
761 }
762 }
763 if (dwFlags)
764 TRACE(" Unknown flags (%08x)\n", dwFlags);
765 else
766 TRACE("\n");
767}
#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
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
#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 480 of file internet.c.

481{
483 if (global_proxy)
484 {
487 }
489}
static void FreeProxyInfo(proxyinfo_t *lpwpi)
Definition: internet.c:470
static proxyinfo_t * global_proxy
Definition: internet.c:478

Referenced by InternetSetOptionW().

◆ FreeProxyInfo()

static void FreeProxyInfo ( proxyinfo_t lpwpi)
static

Definition at line 470 of file internet.c.

471{
472 heap_free(lpwpi->proxy);
473 heap_free(lpwpi->proxyBypass);
474 heap_free(lpwpi->proxyUsername);
475 heap_free(lpwpi->proxyPassword);
476}
LPWSTR proxyPassword
Definition: internet.c:94
LPWSTR proxyUsername
Definition: internet.c:93
LPWSTR proxy
Definition: internet.c:91
LPWSTR proxyBypass
Definition: internet.c:92

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

◆ get_adapters()

static IP_ADAPTER_ADDRESSES * get_adapters ( void  )
static

Definition at line 2281 of file internet.c.

2282{
2283 ULONG err, size = 1024, flags = GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST |
2284 GAA_FLAG_SKIP_DNS_SERVER | GAA_FLAG_SKIP_FRIENDLY_NAME;
2285 IP_ADAPTER_ADDRESSES *tmp, *ret;
2286
2287 if (!(ret = heap_alloc( size ))) return NULL;
2288 err = GetAdaptersAddresses( AF_UNSPEC, flags, NULL, ret, &size );
2289 while (err == ERROR_BUFFER_OVERFLOW)
2290 {
2291 if (!(tmp = heap_realloc( ret, size ))) break;
2292 ret = tmp;
2293 err = GetAdaptersAddresses( AF_UNSPEC, flags, NULL, ret, &size );
2294 }
2295 if (err == ERROR_SUCCESS) return ret;
2296 heap_free( ret );
2297 return NULL;
2298}
GLbitfield flags
Definition: glext.h:7161
#define GAA_FLAG_SKIP_FRIENDLY_NAME
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:307
#define AF_UNSPEC
Definition: winsock.h:338

Referenced by detect_proxy_autoconfig_url_dhcp().

◆ get_computer_name()

static char * get_computer_name ( COMPUTER_NAME_FORMAT  format)
static

Definition at line 2355 of file internet.c.

2356{
2357 char *ret;
2358 DWORD size = 0;
2359
2361 if (GetLastError() != ERROR_MORE_DATA) return NULL;
2362 if (!(ret = heap_alloc( size ))) return NULL;
2363 if (!GetComputerNameExA( format, ret, &size ))
2364 {
2365 heap_free( ret );
2366 return NULL;
2367 }
2368 return ret;
2369}
BOOL WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT, LPSTR, LPDWORD)
Definition: compname.c:376
Definition: format.c:58

Referenced by detect_proxy_autoconfig_url_dns().

◆ get_handle_object()

◆ get_proxy_autoconfig_url()

static WCHAR * get_proxy_autoconfig_url ( void  )
static

Definition at line 2451 of file internet.c.

2452{
2455 return ret;
2456}
static WCHAR * detect_proxy_autoconfig_url_dhcp(void)
Definition: internet.c:2300
static WCHAR * detect_proxy_autoconfig_url_dns(void)
Definition: internet.c:2405

Referenced by query_global_option().

◆ GetInternetSchemeW()

static INTERNET_SCHEME GetInternetSchemeW ( LPCWSTR  lpszScheme,
DWORD  nMaxCmp 
)
static

Definition at line 1600 of file internet.c.

1601{
1602 int i;
1603
1604 TRACE("%s %d\n",debugstr_wn(lpszScheme, nMaxCmp), nMaxCmp);
1605
1606 if(lpszScheme==NULL)
1608
1609 for (i = 0; i < ARRAY_SIZE(url_schemes); i++)
1610 if (!wcsnicmp(lpszScheme, url_schemes[i], nMaxCmp))
1611 return INTERNET_SCHEME_FIRST + i;
1612
1614}
#define wcsnicmp
Definition: compat.h:14
static const WCHAR * url_schemes[]
Definition: internet.c:1575
#define debugstr_wn
Definition: kernel32.h:33
@ INTERNET_SCHEME_FIRST
Definition: wininet.h:150
@ INTERNET_SCHEME_UNKNOWN
Definition: wininet.h:137

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 2654 of file internet.c.

2655{
2656 switch(option) {
2658 if (!size)
2660
2661 if (*size < sizeof(DWORD_PTR)) {
2662 *size = sizeof(DWORD_PTR);
2664 }
2665 if (!buffer)
2667
2668 *(DWORD_PTR *)buffer = hdr->dwContext;
2669 *size = sizeof(DWORD_PTR);
2670 return ERROR_SUCCESS;
2671
2673 WARN("INTERNET_OPTION_REQUEST_FLAGS\n");
2674 *size = sizeof(DWORD);
2676
2679 WARN("Called on global option %u\n", option);
2681 }
2682
2683 /* FIXME: we shouldn't call it here */
2684 return query_global_option(option, buffer, size, unicode);
2685}
#define WARN(fmt,...)
Definition: precomp.h:61
static DWORD query_global_option(DWORD option, void *buffer, DWORD *size, BOOL unicode)
Definition: internet.c:2458
#define DWORD_PTR
Definition: treelist.c:76
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define INTERNET_OPTION_MAX_CONNS_PER_SERVER
Definition: wininet.h:763
#define ERROR_INTERNET_INVALID_OPERATION
Definition: wininet.h:2005
#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 2753 of file internet.c.

2754{
2755 switch(option) {
2757 FIXME("INTERNETOPTION_SETTINGS_CHANGED semi-stub\n");
2759 return ERROR_SUCCESS;
2761 WARN("Not settable option %u\n", option);
2765 WARN("Called on global option %u\n", option);
2769 }
2770
2772}
@ COLLECT_CONNECTIONS
Definition: internet.h:61
#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().

◆ INTERNET_AllocThreadError()

static LPWITHREADERROR INTERNET_AllocThreadError ( void  )
static

Definition at line 3811 of file internet.c.

3812{
3813 LPWITHREADERROR lpwite = heap_alloc(sizeof(*lpwite));
3814
3815 if (lpwite)
3816 {
3817 lpwite->dwError = 0;
3818 lpwite->response[0] = '\0';
3819 }
3820
3821 if (!TlsSetValue(g_dwTlsErrIndex, lpwite))
3822 {
3823 heap_free(lpwite);
3824 return NULL;
3825 }
3826 return lpwite;
3827}
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
Definition: thread.c:1276
CHAR response[MAX_REPLY_LEN]
Definition: internet.c:69
DWORD dwError
Definition: internet.c:68

Referenced by INTERNET_GetResponseBuffer(), and INTERNET_SetLastError().

◆ INTERNET_AsyncCall()

DWORD INTERNET_AsyncCall ( task_header_t task)

Definition at line 3916 of file internet.c.

3917{
3918 BOOL bSuccess;
3919
3920 TRACE("\n");
3921
3923 if (!bSuccess)
3924 {
3925 heap_free(task);
3927 }
3928 return ERROR_SUCCESS;
3929}
BOOL WINAPI QueueUserWorkItem(IN LPTHREAD_START_ROUTINE Function, IN PVOID Context, IN ULONG Flags)
Definition: thread.c:1076
static DWORD CALLBACK INTERNET_WorkerThreadFunc(LPVOID lpvParam)
Definition: internet.c:3877
#define ERROR_INTERNET_ASYNC_THREAD_FAILED
Definition: wininet.h:2035
#define WT_EXECUTELONGFUNCTION
Definition: winnt_old.h:1101

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 688 of file internet.c.

689{
690 proxyinfo_t wpi;
691
692 if (INTERNET_LoadProxySettings( &wpi ))
693 return FALSE;
694
695 if (wpi.proxyEnabled)
696 {
697 TRACE("http proxy = %s bypass = %s\n", debugstr_w(wpi.proxy), debugstr_w(wpi.proxyBypass));
698
700 lpwai->proxy = wpi.proxy;
701 lpwai->proxyBypass = wpi.proxyBypass;
702 lpwai->proxyUsername = wpi.proxyUsername;
703 lpwai->proxyPassword = wpi.proxyPassword;
704 return TRUE;
705 }
706
708 FreeProxyInfo(&wpi);
709 return FALSE;
710}
static LONG INTERNET_LoadProxySettings(proxyinfo_t *lpwpi)
Definition: internet.c:538
DWORD proxyEnabled
Definition: internet.c:90
#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 384 of file internet.c.

385{
386 WCHAR *ret = NULL;
387 const WCHAR *ptr;
388
389 TRACE("(%s, %s)\n", debugstr_w(szProxy), debugstr_w(proto));
390
391 /* First, look for the specified protocol (proto=scheme://host:port) */
392 for (ptr = szProxy; ptr && *ptr; )
393 {
395
396 if (!(end = wcschr(ptr, ' ')))
397 end = ptr + lstrlenW(ptr);
398 if ((equal = wcschr(ptr, '=')) && equal < end &&
399 equal - ptr == lstrlenW(proto) &&
401 {
402 ret = heap_strndupW(equal + 1, end - equal - 1);
403 TRACE("found proxy for %s: %s\n", debugstr_w(proto), debugstr_w(ret));
404 return ret;
405 }
406 if (*end == ' ')
407 ptr = end + 1;
408 else
409 ptr = end;
410 }
411
412 /* It wasn't found: look for no protocol */
413 for (ptr = szProxy; ptr && *ptr; )
414 {
415 LPCWSTR end;
416
417 if (!(end = wcschr(ptr, ' ')))
418 end = ptr + lstrlenW(ptr);
419 if (!wcschr(ptr, '='))
420 {
422 TRACE("found proxy for %s: %s\n", debugstr_w(proto), debugstr_w(ret));
423 return ret;
424 }
425 if (*end == ' ')
426 ptr = end + 1;
427 else
428 ptr = end;
429 }
430
431 return NULL;
432}
static WCHAR * heap_strndupW(const WCHAR *src, size_t length)
Definition: button.c:262
#define wcschr
Definition: compat.h:17
GLuint GLuint end
Definition: gl.h:1545
#define equal(x, y)
Definition: reader.cc:56

Referenced by HTTP_DealWithProxy().

◆ INTERNET_GetLastError()

DWORD INTERNET_GetLastError ( void  )

Definition at line 3859 of file internet.c.

3860{
3862 if (!lpwite) return 0;
3863 /* TlsGetValue clears last error, so set it again here */
3864 SetLastError(lpwite->dwError);
3865 return lpwite->dwError;
3866}

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_GetResponseBuffer()

LPSTR INTERNET_GetResponseBuffer ( void  )

Definition at line 3938 of file internet.c.

3939{
3941 if (!lpwite)
3942 lpwite = INTERNET_AllocThreadError();
3943 TRACE("\n");
3944 return lpwite->response;
3945}
static LPWITHREADERROR INTERNET_AllocThreadError(void)
Definition: internet.c:3811

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

◆ INTERNET_GetSchemeString()

static LPCWSTR INTERNET_GetSchemeString ( INTERNET_SCHEME  scheme)
static

Definition at line 4203 of file internet.c.

4204{
4205 int index;
4207 return NULL;
4210 return NULL;
4211 return url_schemes[index];
4212}
#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 3604 of file internet.c.

3606{
3607 URL_COMPONENTSW urlComponents = { sizeof(urlComponents) };
3608 WCHAR *host, *user = NULL, *pass = NULL, *path;
3609 HINTERNET client = NULL, client1 = NULL;
3610 DWORD res;
3611
3612 TRACE("(%p, %s, %s, %08x, %08x, %08lx)\n", hIC, debugstr_w(lpszUrl), debugstr_w(lpszHeaders),
3613 dwHeadersLength, dwFlags, dwContext);
3614
3615 urlComponents.dwHostNameLength = 1;
3616 urlComponents.dwUserNameLength = 1;
3617 urlComponents.dwPasswordLength = 1;
3618 urlComponents.dwUrlPathLength = 1;
3619 urlComponents.dwExtraInfoLength = 1;
3620 if(!InternetCrackUrlW(lpszUrl, lstrlenW(lpszUrl), 0, &urlComponents))
3621 return NULL;
3622
3623 if ((urlComponents.nScheme == INTERNET_SCHEME_HTTP || urlComponents.nScheme == INTERNET_SCHEME_HTTPS) &&
3624 urlComponents.dwExtraInfoLength)
3625 {
3626 assert(urlComponents.lpszUrlPath + urlComponents.dwUrlPathLength == urlComponents.lpszExtraInfo);
3627 urlComponents.dwUrlPathLength += urlComponents.dwExtraInfoLength;
3628 }
3629
3630 host = heap_strndupW(urlComponents.lpszHostName, urlComponents.dwHostNameLength);
3631 path = heap_strndupW(urlComponents.lpszUrlPath, urlComponents.dwUrlPathLength);
3632 if(urlComponents.dwUserNameLength)
3633 user = heap_strndupW(urlComponents.lpszUserName, urlComponents.dwUserNameLength);
3634 if(urlComponents.dwPasswordLength)
3635 pass = heap_strndupW(urlComponents.lpszPassword, urlComponents.dwPasswordLength);
3636
3637 switch(urlComponents.nScheme) {
3639 client = FTP_Connect(hIC, host, urlComponents.nPort,
3640 user, pass, dwFlags, dwContext, INET_OPENURL);
3641 if(client == NULL)
3642 break;
3643 client1 = FtpOpenFileW(client, path, GENERIC_READ, dwFlags, dwContext);
3644 if(client1 == NULL) {
3646 break;
3647 }
3648 break;
3649
3651 case INTERNET_SCHEME_HTTPS: {
3652 LPCWSTR accept[2] = { L"*/*", NULL };
3653
3655
3656 /* FIXME: should use pointers, not handles, as handles are not thread-safe */
3657 res = HTTP_Connect(hIC, host, urlComponents.nPort,
3658 user, pass, dwFlags, dwContext, INET_OPENURL, &client);
3659 if(res != ERROR_SUCCESS) {
3661 break;
3662 }
3663
3664 client1 = HttpOpenRequestW(client, NULL, path, NULL, NULL, accept, dwFlags, dwContext);
3665 if(client1 == NULL) {
3667 break;
3668 }
3669 HttpAddRequestHeadersW(client1, lpszHeaders, dwHeadersLength, HTTP_ADDREQ_FLAG_ADD);
3670 if (!HttpSendRequestW(client1, NULL, 0, NULL, 0) &&
3672 InternetCloseHandle(client1);
3673 client1 = NULL;
3674 break;
3675 }
3676 }
3678 /* gopher doesn't seem to be implemented in wine, but it's supposed
3679 * to be supported by InternetOpenUrlA. */
3680 default:
3682 break;
3683 }
3684
3685 TRACE(" %p <--\n", client1);
3686
3687 heap_free(host);
3688 heap_free(path);
3689 heap_free(user);
3690 heap_free(pass);
3691 return client1;
3692}
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:1485
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:2428
BOOL WINAPI HttpAddRequestHeadersW(HINTERNET hHttpRequest, LPCWSTR lpszHeader, DWORD dwHeaderLength, DWORD dwModifier)
Definition: http.c:1297
BOOL WINAPI HttpSendRequestW(HINTERNET hHttpRequest, LPCWSTR lpszHeaders, DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength)
Definition: http.c:5595
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:5836
HINTERNET WINAPI HttpOpenRequestW(HINTERNET hHttpSession, LPCWSTR lpszVerb, LPCWSTR lpszObjectName, LPCWSTR lpszVersion, LPCWSTR lpszReferrer, LPCWSTR *lpszAcceptTypes, DWORD dwFlags, DWORD_PTR dwContext)
Definition: http.c:3469
BOOL WINAPI InternetCrackUrlW(const WCHAR *lpszUrl, DWORD dwUrlLength, DWORD dwFlags, URL_COMPONENTSW *lpUC)
Definition: internet.c:1625
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
Definition: internet.c:1414
#define INET_OPENURL
Definition: internet.h:243
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 538 of file internet.c.

539{
540 HKEY key;
541 DWORD type, len;
542 const WCHAR *envproxy;
543 LONG ret;
544
545 memset( lpwpi, 0, sizeof(*lpwpi) );
546
548 if (global_proxy)
549 {
553 }
555
557 {
558 FreeProxyInfo( lpwpi );
559 return ret;
560 }
561
562 len = sizeof(DWORD);
563 if (RegQueryValueExW( key, L"ProxyEnable", NULL, &type, (BYTE *)&lpwpi->proxyEnabled, &len ) || type != REG_DWORD)
564 {
565 lpwpi->proxyEnabled = 0;
566 if((ret = RegSetValueExW( key, L"ProxyEnable", 0, REG_DWORD, (BYTE *)&lpwpi->proxyEnabled, sizeof(DWORD) )))
567 {
568 FreeProxyInfo( lpwpi );
569 RegCloseKey( key );
570 return ret;
571 }
572 }
573
574 if (!(envproxy = _wgetenv( L"http_proxy" )) || lpwpi->proxyEnabled)
575 {
576 /* figure out how much memory the proxy setting takes */
577 if (!RegQueryValueExW( key, L"ProxyServer", NULL, &type, NULL, &len ) && len && (type == REG_SZ))
578 {
579 LPWSTR szProxy, p;
580
581 if (!(szProxy = heap_alloc(len)))
582 {
583 RegCloseKey( key );
584 FreeProxyInfo( lpwpi );
585 return ERROR_OUTOFMEMORY;
586 }
587 RegQueryValueExW( key, L"ProxyServer", NULL, &type, (BYTE*)szProxy, &len );
588
589 /* find the http proxy, and strip away everything else */
590 p = wcsstr( szProxy, L"http=" );
591 if (p)
592 {
593 p += lstrlenW( L"http=" );
594 lstrcpyW( szProxy, p );
595 }
596 p = wcschr( szProxy, ';' );
597 if (p) *p = 0;
598
599 FreeProxyInfo( lpwpi );
600 lpwpi->proxy = szProxy;
601 lpwpi->proxyBypass = NULL;
602
603 TRACE("http proxy (from registry) = %s\n", debugstr_w(lpwpi->proxy));
604 }
605 else
606 {
607 TRACE("No proxy server settings in registry.\n");
608 FreeProxyInfo( lpwpi );
609 lpwpi->proxy = NULL;
610 lpwpi->proxyBypass = NULL;
611 }
612 }
613 else if (envproxy)
614 {
615 FreeProxyInfo( lpwpi );
616 if (parse_proxy_url( lpwpi, envproxy ))
617 {
618 TRACE("http proxy (from environment) = %s\n", debugstr_w(lpwpi->proxy));
619 lpwpi->proxyEnabled = 1;
620 lpwpi->proxyBypass = NULL;
621 }
622 else
623 {
624 WARN("failed to parse http_proxy value %s\n", debugstr_w(envproxy));
625 lpwpi->proxyEnabled = 0;
626 lpwpi->proxy = NULL;
627 lpwpi->proxyBypass = NULL;
628 }
629 }
630
631 if (lpwpi->proxyEnabled)
632 {
633 TRACE("Proxy is enabled.\n");
634
635 if (!(envproxy = _wgetenv( L"no_proxy" )))
636 {
637 /* figure out how much memory the proxy setting takes */
638 if (!RegQueryValueExW( key, L"ProxyOverride", NULL, &type, NULL, &len ) && len && (type == REG_SZ))
639 {
640 LPWSTR szProxy;
641
642 if (!(szProxy = heap_alloc(len)))
643 {
644 RegCloseKey( key );
645 return ERROR_OUTOFMEMORY;
646 }
647 RegQueryValueExW( key, L"ProxyOverride", NULL, &type, (BYTE*)szProxy, &len );
648
649 heap_free( lpwpi->proxyBypass );
650 lpwpi->proxyBypass = szProxy;
651
652 TRACE("http proxy bypass (from registry) = %s\n", debugstr_w(lpwpi->proxyBypass));
653 }
654 else
655 {
656 heap_free( lpwpi->proxyBypass );
657 lpwpi->proxyBypass = NULL;
658
659 TRACE("No proxy bypass server settings in registry.\n");
660 }
661 }
662 else
663 {
664 WCHAR *envproxyW;
665
666 if (!(envproxyW = heap_alloc(lstrlenW(envproxy) * sizeof(WCHAR))))
667 {
668 RegCloseKey( key );
669 return ERROR_OUTOFMEMORY;
670 }
671 lstrcpyW( envproxyW, envproxy );
672
673 heap_free( lpwpi->proxyBypass );
674 lpwpi->proxyBypass = envproxyW;
675
676 TRACE("http proxy bypass (from environment) = %s\n", debugstr_w(lpwpi->proxyBypass));
677 }
678 }
679 else TRACE("Proxy is disabled.\n");
680
681 RegCloseKey( key );
682 return ERROR_SUCCESS;
683}
#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
wchar_t *CDECL _wgetenv(const wchar_t *name)
Definition: environ.c:254
_ACRTIMP wchar_t *__cdecl wcsstr(const wchar_t *, const wchar_t *)
Definition: wcs.c:2993
static const WCHAR szInternetSettings[]
Definition: internet.c:100
static BOOL parse_proxy_url(proxyinfo_t *info, const WCHAR *url)
Definition: internet.c:491
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define REG_SZ
Definition: layer.c:22
long LONG
Definition: pedump.c:60
#define REG_DWORD
Definition: sdbapi.c:615
Definition: copy.c:22
#define HKEY_CURRENT_USER
Definition: winreg.h:11

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

◆ INTERNET_SaveProxySettings()

static LONG INTERNET_SaveProxySettings ( proxyinfo_t lpwpi)
static

Definition at line 331 of file internet.c.

332{
333 HKEY key;
334 LONG ret;
335
337 return ret;
338
339 if ((ret = RegSetValueExW( key, L"ProxyEnable", 0, REG_DWORD, (BYTE*)&lpwpi->proxyEnabled, sizeof(DWORD))))
340 {
341 RegCloseKey( key );
342 return ret;
343 }
344
345 if (lpwpi->proxy)
346 {
347 if ((ret = RegSetValueExW( key, L"ProxyServer", 0, REG_SZ, (BYTE*)lpwpi->proxy, sizeof(WCHAR) * (lstrlenW(lpwpi->proxy) + 1))))
348 {
349 RegCloseKey( key );
350 return ret;
351 }
352 }
353 else
354 {
355 if ((ret = RegDeleteValueW( key, L"ProxyServer" )) && ret != ERROR_FILE_NOT_FOUND)
356 {
357 RegCloseKey( key );
358 return ret;
359 }
360 }
361
363 return ERROR_SUCCESS;
364}
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2330
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79

Referenced by InternetSetOptionW().

◆ INTERNET_SetLastError()

◆ INTERNET_WorkerThreadFunc()

static DWORD CALLBACK INTERNET_WorkerThreadFunc ( LPVOID  lpvParam)
static

Definition at line 3877 of file internet.c.

3878{
3879 task_header_t *task = lpvParam;
3880
3881 TRACE("\n");
3882
3883 task->proc(task);
3884 WININET_Release(task->hdr);
3885 heap_free(task);
3886
3888 {
3891 }
3892 return TRUE;
3893}
BOOL WININET_Release(object_header_t *info)
Definition: internet.c:211

Referenced by INTERNET_AsyncCall().

◆ InternetAttemptConnect()

DWORD WINAPI InternetAttemptConnect ( DWORD  dwReserved)

Definition at line 1935 of file internet.c.

1936{
1937 FIXME("Stub\n");
1938 return ERROR_SUCCESS;
1939}

◆ InternetAutodial()

BOOL WINAPI InternetAutodial ( DWORD  dwFlags,
HWND  hwndParent 
)

Definition at line 4083 of file internet.c.

4084{
4085 FIXME("STUB\n");
4086
4087 /* Tell that we are connected to the internet. */
4088 return TRUE;
4089}

◆ InternetAutodialHangup()

BOOL WINAPI InternetAutodialHangup ( DWORD  dwReserved)

Definition at line 4103 of file internet.c.

4104{
4105 FIXME("STUB\n");
4106
4107 /* we didn't dial, we don't disconnect */
4108 return TRUE;
4109}

◆ InternetCanonicalizeUrlA()

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

Definition at line 1978 of file internet.c.

1980{
1981 HRESULT hr;
1982
1983 TRACE("(%s, %p, %p, 0x%08x) buffer length: %d\n", debugstr_a(lpszUrl), lpszBuffer,
1985
1987 hr = UrlCanonicalizeA(lpszUrl, lpszBuffer, lpdwBufferLength, dwFlags);
1990
1991 return hr == S_OK;
1992}
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT hr
Definition: delayimp.cpp:573
HRESULT WINAPI UrlCanonicalizeA(const char *src_url, char *canonicalized, DWORD *canonicalized_len, DWORD flags)
Definition: path.c:3542
static DWORD convert_url_canonicalization_flags(DWORD dwFlags)
Definition: internet.c:1953
#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 2004 of file internet.c.

2006{
2007 HRESULT hr;
2008
2009 TRACE("(%s, %p, %p, 0x%08x) buffer length: %d\n", debugstr_w(lpszUrl), lpszBuffer,
2011
2013 hr = UrlCanonicalizeW(lpszUrl, lpszBuffer, lpdwBufferLength, dwFlags);
2016
2017 return hr == S_OK;
2018}
HRESULT WINAPI UrlCanonicalizeW(const WCHAR *src_url, WCHAR *canonicalized, DWORD *canonicalized_len, DWORD flags)
Definition: path.c:4152

Referenced by InternetCrackUrlW(), and SetFriendlyUrl().

◆ InternetCheckConnectionA()

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

Definition at line 3578 of file internet.c.

3579{
3580 WCHAR *url = NULL;
3581 BOOL rc;
3582
3583 if(lpszUrl) {
3584 url = heap_strdupAtoW(lpszUrl);
3585 if(!url)
3586 return FALSE;
3587 }
3588
3590
3591 heap_free(url);
3592 return rc;
3593}
static WCHAR * heap_strdupAtoW(const char *str)
Definition: appwiz.h:81
BOOL WINAPI InternetCheckConnectionW(LPCWSTR lpszUrl, DWORD dwFlags, DWORD dwReserved)
Definition: internet.c:3462
_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 3462 of file internet.c.

3463{
3464/*
3465 * this is a kludge which runs the resident ping program and reads the output.
3466 *
3467 * Anyone have a better idea?
3468 */
3469
3470 BOOL rc = FALSE;
3471 static const CHAR ping[] = "ping -c 1 ";
3472 static const CHAR redirect[] = " >/dev/null 2>/dev/null";
3473 WCHAR *host;
3474 DWORD len, host_len;
3476 int status = -1;
3477
3478 FIXME("(%s %x %x)\n", debugstr_w(lpszUrl), dwFlags, dwReserved);
3479
3480 /*
3481 * Crack or set the Address
3482 */
3483 if (lpszUrl == NULL)
3484 {
3485 /*
3486 * According to the doc we are supposed to use the ip for the next
3487 * server in the WnInet internal server database. I have
3488 * no idea what that is or how to get it.
3489 *
3490 * So someone needs to implement this.
3491 */
3492 FIXME("Unimplemented with URL of NULL\n");
3493 return TRUE;
3494 }
3495 else
3496 {
3498
3500
3501 if (!InternetCrackUrlW(lpszUrl,0,0,&components))
3502 goto End;
3503
3504 host = components.lpszHostName;
3505 host_len = components.dwHostNameLength;
3506 port = components.nPort;
3507 TRACE("host name: %s port: %d\n",debugstr_wn(host, host_len), port);
3508 }
3509
3511 {
3512 struct sockaddr_storage saddr;
3513 int sa_len = sizeof(saddr);
3514 WCHAR *host_z;
3515 int fd;
3516 BOOL b;
3517
3518 host_z = heap_strndupW(host, host_len);
3519 if (!host_z)
3520 return FALSE;
3521
3522 b = GetAddress(host_z, port, (struct sockaddr *)&saddr, &sa_len, NULL);
3523 heap_free(host_z);
3524 if(!b)
3525 goto End;
3526 init_winsock();
3527 fd = socket(saddr.ss_family, SOCK_STREAM, 0);
3528 if (fd != -1)
3529 {
3530 if (connect(fd, (struct sockaddr *)&saddr, sa_len) == 0)
3531 rc = TRUE;
3532 closesocket(fd);
3533 }
3534 }
3535 else
3536 {
3537 /*
3538 * Build our ping command
3539 */
3540 char *command;
3541
3542 len = WideCharToMultiByte(CP_UNIXCP, 0, host, host_len, NULL, 0, NULL, NULL);
3543 command = heap_alloc(strlen(ping)+len+strlen(redirect)+1);
3544 strcpy(command, ping);
3545 WideCharToMultiByte(CP_UNIXCP, 0, host, host_len, command+sizeof(ping)-1, len, NULL, NULL);
3546 strcpy(command+sizeof(ping)-1+len, redirect);
3547
3548 TRACE("Ping command is : %s\n",command);
3549
3551 heap_free( command );
3552
3553 TRACE("Ping returned a code of %i\n",status);
3554
3555 /* Ping return code of 0 indicates success */
3556 if (status == 0)
3557 rc = TRUE;
3558 }
3559
3560End:
3561 if (rc == FALSE)
3563
3564 return rc;
3565}
#define CP_UNIXCP
Definition: compat.h:79
_ACRTIMP int __cdecl system(const char *)
Definition: process.c:1297
#define SOCK_STREAM
Definition: tcpip.h:118
GLenum GLenum GLuint components
Definition: glext.h:9620
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
void init_winsock(void) DECLSPEC_HIDDEN
BOOL GetAddress(const WCHAR *, INTERNET_PORT, SOCKADDR *, int *, char *) DECLSPEC_HIDDEN
Definition: utility.c:133
#define b
Definition: ke_i.h:79
#define closesocket
Definition: ncftp.h:477
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
char CHAR
Definition: xmlstorage.h:175

Referenced by InternetCheckConnectionA().

◆ InternetCloseHandle()

BOOL WINAPI InternetCloseHandle ( HINTERNET  hInternet)

Definition at line 1414 of file internet.c.

1415{
1417
1418 TRACE("%p\n", hInternet);
1419
1420 obj = get_handle_object( hInternet );
1421 if (!obj) {
1423 return FALSE;
1424 }
1425
1428
1429 return TRUE;
1430}
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
static void invalidate_handle(object_header_t *info)
Definition: internet.c:193
object_header_t * get_handle_object(HINTERNET hinternet)
Definition: internet.c:176

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(), 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_no_cache(), test_null(), test_open_url_async(), test_openfile(), test_options(), test_proxy_direct(), test_secure_connection(), test_status_callbacks(), test_user_agent_header(), and CWebServiceWinInet::~CWebServiceWinInet().

◆ InternetCombineUrlA()

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

Definition at line 4122 of file internet.c.

4125{
4126 HRESULT hr=S_OK;
4127
4128 TRACE("(%s, %s, %p, %p, 0x%08x)\n", debugstr_a(lpszBaseUrl), debugstr_a(lpszRelativeUrl), lpszBuffer, lpdwBufferLength, dwFlags);
4129
4130 /* Flip this bit to correspond to URL_ESCAPE_UNSAFE */
4132 hr=UrlCombineA(lpszBaseUrl,lpszRelativeUrl,lpszBuffer,lpdwBufferLength,dwFlags);
4133
4134 return (hr==S_OK);
4135}
HRESULT WINAPI UrlCombineA(const char *base, const char *relative, char *combined, DWORD *combined_len, DWORD flags)
Definition: path.c:4932

◆ InternetCombineUrlW()

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

Definition at line 4148 of file internet.c.

4151{
4152 HRESULT hr=S_OK;
4153
4154 TRACE("(%s, %s, %p, %p, 0x%08x)\n", debugstr_w(lpszBaseUrl), debugstr_w(lpszRelativeUrl), lpszBuffer, lpdwBufferLength, dwFlags);
4155
4156 /* Flip this bit to correspond to URL_ESCAPE_UNSAFE */
4158 hr=UrlCombineW(lpszBaseUrl,lpszRelativeUrl,lpszBuffer,lpdwBufferLength,dwFlags);
4159
4160 return (hr==S_OK);
4161}
HRESULT WINAPI UrlCombineW(const WCHAR *baseW, const WCHAR *relativeW, WCHAR *combined, DWORD *combined_len, DWORD flags)
Definition: path.c:4972

Referenced by get_redirect_url().

◆ InternetConfirmZoneCrossingA()

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

Definition at line 4553 of file internet.c.

4554{
4555 FIXME("(%p, %s, %s, %x) stub\n", hWnd, debugstr_a(szUrlPrev), debugstr_a(szUrlNew), bPost);
4556 return ERROR_SUCCESS;
4557}
HWND hWnd
Definition: settings.c:17

◆ InternetConfirmZoneCrossingW()

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

Definition at line 4563 of file internet.c.

4564{
4565 FIXME("(%p, %s, %s, %x) stub\n", hWnd, debugstr_w(szUrlPrev), debugstr_w(szUrlNew), bPost);
4566 return ERROR_SUCCESS;
4567}

◆ 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 1321 of file internet.c.

1325{
1326 HINTERNET rc = NULL;
1327 LPWSTR szServerName;
1328 LPWSTR szUserName;
1329 LPWSTR szPassword;
1330
1331 szServerName = heap_strdupAtoW(lpszServerName);
1332 szUserName = heap_strdupAtoW(lpszUserName);
1333 szPassword = heap_strdupAtoW(lpszPassword);
1334
1335 rc = InternetConnectW(hInternet, szServerName, nServerPort,
1336 szUserName, szPassword, dwService, dwFlags, dwContext);
1337
1338 heap_free(szServerName);
1339 heap_free(szUserName);
1340 heap_free(szPassword);
1341 return rc;
1342}
HINTERNET WINAPI InternetConnectW(HINTERNET hInternet, LPCWSTR lpszServerName, INTERNET_PORT nServerPort, LPCWSTR lpszUserName, LPCWSTR lpszPassword, DWORD dwService, DWORD dwFlags, DWORD_PTR dwContext)
Definition: internet.c:1258
_In_opt_ LPSTR _In_opt_ LPSTR lpszPassword
Definition: winbase.h:2466

Referenced by _open_simple_request(), can_do_https(), CWebServiceWinInet::DoRequest(), HttpHeaders_test(), HttpSendRequestEx_test(), InternetOpenRequest_test(), InternetReadFile_chunked_test(), InternetReadFile_test(), InternetReadFileExA_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_no_cache(), test_no_content(), 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 1258 of file internet.c.

1262{
1263 appinfo_t *hIC;
1264 HINTERNET rc = NULL;
1266
1267 TRACE("(%p, %s, %u, %s, %p, %u, %x, %lx)\n", hInternet, debugstr_w(lpszServerName),
1268 nServerPort, debugstr_w(lpszUserName), lpszPassword, dwService, dwFlags, dwContext);
1269
1270 if (!lpszServerName)
1271 {
1273 return NULL;
1274 }
1275
1276 hIC = (appinfo_t*)get_handle_object( hInternet );
1277 if ( (hIC == NULL) || (hIC->hdr.htype != WH_HINIT) )
1278 {
1280 goto lend;
1281 }
1282
1283 switch (dwService)
1284 {
1286 rc = FTP_Connect(hIC, lpszServerName, nServerPort,
1287 lpszUserName, lpszPassword, dwFlags, dwContext, 0);
1288 if(!rc)
1290 break;
1291
1293 res = HTTP_Connect(hIC, lpszServerName, nServerPort,
1294 lpszUserName, lpszPassword, dwFlags, dwContext, 0, &rc);
1295 break;
1296
1298 default:
1299 break;
1300 }
1301lend:
1302 if( hIC )
1303 WININET_Release( &hIC->hdr );
1304
1305 TRACE("returning %p\n", rc);
1307 return rc;
1308}
DWORD INTERNET_GetLastError(void)
Definition: internet.c:3859
@ WH_HINIT
Definition: internet.h:234
WH_TYPE htype
Definition: internet.h:273
object_header_t hdr
Definition: internet.h:291
#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(), and test_secure_connection().

◆ InternetCrackUrlA()

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

Definition at line 1506 of file internet.c.

1507{
1508 WCHAR *host = NULL, *user = NULL, *pass = NULL, *path = NULL, *scheme = NULL, *extra = NULL;
1509 URL_COMPONENTSW comp;
1510 WCHAR *url_w = NULL;
1511 BOOL ret;
1512
1513 TRACE("(%s %u %x %p)\n", url_length ? debugstr_an(url, url_length) : debugstr_a(url), url_length, flags, ret_comp);
1514
1515 if (!url || !*url || !ret_comp || ret_comp->dwStructSize != sizeof(URL_COMPONENTSA)) {
1517 return FALSE;
1518 }
1519
1520 comp.dwStructSize = sizeof(comp);
1521
1523 &comp.lpszHostName, &comp.dwHostNameLength, &host)
1525 &comp.lpszUserName, &comp.dwUserNameLength, &user)
1527 &comp.lpszPassword, &comp.dwPasswordLength, &pass)
1528 && set_url_component_AtoW(ret_comp->lpszUrlPath, ret_comp->dwUrlPathLength,
1529 &comp.lpszUrlPath, &comp.dwUrlPathLength, &path)
1530 && set_url_component_AtoW(ret_comp->lpszScheme, ret_comp->dwSchemeLength,
1531 &comp.lpszScheme, &comp.dwSchemeLength, &scheme)
1533 &comp.lpszExtraInfo, &comp.dwExtraInfoLength, &extra);
1534
1535 if(ret && !(url_w = heap_strndupAtoW(url, url_length ? url_length : -1, &url_length))) {
1537 ret = FALSE;
1538 }
1539
1540 if (ret && (ret = InternetCrackUrlW(url_w, url_length, flags, &comp))) {
1541 ret_comp->nScheme = comp.nScheme;
1542 ret_comp->nPort = comp.nPort;
1543
1545 &ret_comp->lpszHostName, &ret_comp->dwHostNameLength, url)
1547 &ret_comp->lpszUserName, &ret_comp->dwUserNameLength, url)
1549 &ret_comp->lpszPassword, &ret_comp->dwPasswordLength, url)
1551 &ret_comp->lpszUrlPath, &ret_comp->dwUrlPathLength, url)
1553 &ret_comp->lpszScheme, &ret_comp->dwSchemeLength, url)
1555 &ret_comp->lpszExtraInfo, &ret_comp->dwExtraInfoLength, url);
1556
1557 if(ret)
1558 TRACE("%s: scheme(%s) host(%s) path(%s) extra(%s)\n", debugstr_a(url),
1559 debugstr_an(ret_comp->lpszScheme, ret_comp->dwSchemeLength),
1560 debugstr_an(ret_comp->lpszHostName, ret_comp->dwHostNameLength),
1561 debugstr_an(ret_comp->lpszUrlPath, ret_comp->dwUrlPathLength),
1562 debugstr_an(ret_comp->lpszExtraInfo, ret_comp->dwExtraInfoLength));
1563 }
1564
1565 heap_free(host);
1566 heap_free(user);
1567 heap_free(pass);
1568 heap_free(path);
1571 heap_free(url_w);
1572 return ret;
1573}
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:1457
static BOOL set_url_component_AtoW(const char *comp_a, DWORD len_a, WCHAR **comp_w, DWORD *len_w, WCHAR **buf)
Definition: internet.c:1484
@ extra
Definition: id3.c:95
static WCHAR * heap_strndupAtoW(const char *str, int len_a, DWORD *len_w)
Definition: internet.h:149
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 1625 of file internet.c.

1626{
1627 /*
1628 * RFC 1808
1629 * <protocol>:[//<net_loc>][/path][;<params>][?<query>][#<fragment>]
1630 *
1631 */
1632 LPCWSTR lpszParam = NULL;
1633 BOOL found_colon = FALSE;
1634 LPCWSTR lpszap;
1635 LPCWSTR lpszcp = NULL, lpszNetLoc;
1636
1637 TRACE("(%s %u %x %p)\n",
1638 lpszUrl ? debugstr_wn(lpszUrl, dwUrlLength ? dwUrlLength : lstrlenW(lpszUrl)) : "(null)",
1639 dwUrlLength, dwFlags, lpUC);
1640
1641 if (!lpszUrl || !*lpszUrl || !lpUC)
1642 {
1644 return FALSE;
1645 }
1646 if (!dwUrlLength) dwUrlLength = lstrlenW(lpszUrl);
1647
1648 if (dwFlags & ICU_DECODE)
1649 {
1650 WCHAR *url_tmp, *buffer;
1651 DWORD len = dwUrlLength + 1;
1652 BOOL ret;
1653
1654 if (!(url_tmp = heap_strndupW(lpszUrl, dwUrlLength)))
1655 {
1657 return FALSE;
1658 }
1659
1660 buffer = url_tmp;
1663 {
1664 buffer = heap_alloc(len * sizeof(WCHAR));
1665 if (!buffer)
1666 {
1668 heap_free(url_tmp);
1669 return FALSE;
1670 }
1672 }
1673 if (ret)
1675
1676 if (buffer != url_tmp) heap_free(buffer);
1677 heap_free(url_tmp);
1678 return ret;
1679 }
1680 lpszap = lpszUrl;
1681
1682 /* Determine if the URI is absolute. */
1683 while (lpszap - lpszUrl < dwUrlLength)
1684 {
1685 if (iswalnum(*lpszap) || *lpszap == '+' || *lpszap == '.' || *lpszap == '-')
1686 {
1687 lpszap++;
1688 continue;
1689 }
1690 if (*lpszap == ':')
1691 {
1692 found_colon = TRUE;
1693 lpszcp = lpszap;
1694 }
1695 else
1696 {
1697 lpszcp = lpszUrl; /* Relative url */
1698 }
1699
1700 break;
1701 }
1702
1703 if(!found_colon){
1705 return FALSE;
1706 }
1707
1710
1711 /* Parse <params> */
1712 lpszParam = wmemchr(lpszap, '?', dwUrlLength - (lpszap - lpszUrl));
1713 if(!lpszParam)
1714 lpszParam = wmemchr(lpszap, '#', dwUrlLength - (lpszap - lpszUrl));
1715
1717 lpszParam, lpszParam ? dwUrlLength-(lpszParam-lpszUrl) : 0))
1718 return FALSE;
1719
1720
1721 /* Get scheme first. */
1722 lpUC->nScheme = GetInternetSchemeW(lpszUrl, lpszcp - lpszUrl);
1723 if(!set_url_component(&lpUC->lpszScheme, &lpUC->dwSchemeLength, lpszUrl, lpszcp - lpszUrl))
1724 return FALSE;
1725
1726 /* Eat ':' in protocol. */
1727 lpszcp++;
1728
1729 /* double slash indicates the net_loc portion is present */
1730 if ((lpszcp[0] == '/') && (lpszcp[1] == '/'))
1731 {
1732 lpszcp += 2;
1733
1734 lpszNetLoc = wmemchr(lpszcp, '/', dwUrlLength - (lpszcp - lpszUrl));
1735 if (lpszParam)
1736 {
1737 if (lpszNetLoc)
1738 lpszNetLoc = min(lpszNetLoc, lpszParam);
1739 else
1740 lpszNetLoc = lpszParam;
1741 }
1742 else if (!lpszNetLoc)
1743 lpszNetLoc = lpszcp + dwUrlLength-(lpszcp-lpszUrl);
1744
1745 /* Parse net-loc */
1746 if (lpszNetLoc)
1747 {
1748 LPCWSTR lpszHost;
1749 LPCWSTR lpszPort;
1750
1751 /* [<user>[<:password>]@]<host>[:<port>] */
1752 /* First find the user and password if they exist */
1753
1754 lpszHost = wmemchr(lpszcp, '@', dwUrlLength - (lpszcp - lpszUrl));
1755 if (lpszHost == NULL || lpszHost > lpszNetLoc)
1756 {
1757 /* username and password not specified. */
1760 }
1761 else /* Parse out username and password */
1762 {
1763 LPCWSTR lpszUser = lpszcp;
1764 LPCWSTR lpszPasswd = lpszHost;
1765
1766 while (lpszcp < lpszHost)
1767 {
1768 if (*lpszcp == ':')
1769 lpszPasswd = lpszcp;
1770
1771 lpszcp++;
1772 }
1773
1774 if(!set_url_component(&lpUC->lpszUserName, &lpUC->dwUserNameLength, lpszUser, lpszPasswd - lpszUser))
1775 return FALSE;
1776
1777 if (lpszPasswd != lpszHost)
1778 lpszPasswd++;
1780 lpszPasswd == lpszHost ? NULL : lpszPasswd, lpszHost - lpszPasswd))
1781 return FALSE;
1782
1783 lpszcp++; /* Advance to beginning of host */
1784 }
1785
1786 /* Parse <host><:port> */
1787
1788 lpszHost = lpszcp;
1789 lpszPort = lpszNetLoc;
1790
1791 /* special case for res:// URLs: there is no port here, so the host is the
1792 entire string up to the first '/' */
1793 if(lpUC->nScheme==INTERNET_SCHEME_RES)
1794 {
1795 if(!set_url_component(&lpUC->lpszHostName, &lpUC->dwHostNameLength, lpszHost, lpszPort - lpszHost))
1796 return FALSE;
1797 lpszcp=lpszNetLoc;
1798 }
1799 else
1800 {
1801 while (lpszcp < lpszNetLoc)
1802 {
1803 if (*lpszcp == ':')
1804 lpszPort = lpszcp;
1805
1806 lpszcp++;
1807 }
1808
1809 /* If the scheme is "file" and the host is just one letter, it's not a host */
1810 if(lpUC->nScheme==INTERNET_SCHEME_FILE && lpszPort <= lpszHost+1)
1811 {
1812 lpszcp=lpszHost;
1814 }
1815 else
1816 {
1817 if(!set_url_component(&lpUC->lpszHostName, &lpUC->dwHostNameLength, lpszHost, lpszPort - lpszHost))
1818 return FALSE;
1819 if (lpszPort != lpszNetLoc)
1820 lpUC->nPort = wcstol(++lpszPort, NULL, 10);
1821 else switch (lpUC->nScheme)
1822 {
1825 break;
1828 break;
1831 break;
1832 default:
1833 break;
1834 }
1835 }
1836 }
1837 }
1838 }
1839 else
1840 {
1844 }
1845
1846 /* Here lpszcp points to:
1847 *
1848 * <protocol>:[//<net_loc>][/path][;<params>][?<query>][#<fragment>]
1849 * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1850 */
1851 if (lpszcp != 0 && lpszcp - lpszUrl < dwUrlLength && (!lpszParam || lpszcp <= lpszParam))
1852 {
1853 DWORD len;
1854
1855 /* Only truncate the parameter list if it's already been saved
1856 * in lpUC->lpszExtraInfo.
1857 */
1858 if (lpszParam && lpUC->dwExtraInfoLength && lpUC->lpszExtraInfo)
1859 len = lpszParam - lpszcp;
1860 else
1861 {
1862 /* Leave the parameter list in lpszUrlPath. Strip off any trailing
1863 * newlines if necessary.
1864 */
1865 LPWSTR lpsznewline = wmemchr(lpszcp, '\n', dwUrlLength - (lpszcp - lpszUrl));
1866 if (lpsznewline != NULL)
1867 len = lpsznewline - lpszcp;
1868 else
1869 len = dwUrlLength-(lpszcp-lpszUrl);
1870 }
1871 if (lpUC->dwUrlPathLength && lpUC->lpszUrlPath &&
1873 {
1874 WCHAR tmppath[MAX_PATH];
1875 if (*lpszcp == '/')
1876 {
1877 len = MAX_PATH;
1878 PathCreateFromUrlW(lpszUrl, tmppath, &len, 0);
1879 }
1880 else
1881 {
1882 WCHAR *iter;
1883 memcpy(tmppath, lpszcp, len * sizeof(WCHAR));
1884 tmppath[len] = '\0';
1885
1886 iter = tmppath;
1887 while (*iter) {
1888 if (*iter == '/')
1889 *iter = '\\';
1890 ++iter;
1891 }
1892 }
1893 /* if ends in \. or \.. append a backslash */
1894 if (tmppath[len - 1] == '.' &&
1895 (tmppath[len - 2] == '\\' ||
1896 (tmppath[len - 2] == '.' && tmppath[len - 3] == '\\')))
1897 {
1898 if (len < MAX_PATH - 1)
1899 {
1900 tmppath[len] = '\\';
1901 tmppath[len+1] = '\0';
1902 ++len;
1903 }
1904 }
1905 if(!set_url_component(&lpUC->lpszUrlPath, &lpUC->dwUrlPathLength, tmppath, len))
1906 return FALSE;
1907 }
1908 else if(!set_url_component(&lpUC->lpszUrlPath, &lpUC->dwUrlPathLength, lpszcp, len))
1909 return FALSE;
1910 }
1911 else
1912 {
1913 set_url_component(&lpUC->lpszUrlPath, &lpUC->dwUrlPathLength, lpszcp, 0);
1914 }
1915
1916 TRACE("%s: scheme(%s) host(%s) path(%s) extra(%s)\n", debugstr_wn(lpszUrl,dwUrlLength),
1921
1922 return TRUE;
1923}
#define MAX_PATH
Definition: compat.h:34
HRESULT WINAPI PathCreateFromUrlW(const WCHAR *url, WCHAR *path, DWORD *pcchPath, DWORD dwReserved)
Definition: path.c:3073
_ACRTIMP __msvcrt_long __cdecl wcstol(const wchar_t *, wchar_t **, int)
Definition: wcs.c:2747
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:1432
BOOL WINAPI InternetCanonicalizeUrlW(LPCWSTR lpszUrl, LPWSTR lpszBuffer, LPDWORD lpdwBufferLength, DWORD dwFlags)
Definition: internet.c:2004
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#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(), and urlcache_encode_url().

◆ InternetCreateUrlA()

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

Definition at line 4362 of file internet.c.

4364{
4365 BOOL ret;
4366 LPWSTR urlW = NULL;
4367 URL_COMPONENTSW urlCompW;
4368
4369 TRACE("(%p,%d,%p,%p)\n", lpUrlComponents, dwFlags, lpszUrl, lpdwUrlLength);
4370
4371 if (!lpUrlComponents || lpUrlComponents->dwStructSize != sizeof(URL_COMPONENTSW) || !lpdwUrlLength)
4372 {
4374 return FALSE;
4375 }
4376
4377 convert_urlcomp_atow(lpUrlComponents, &urlCompW);
4378
4379 if (lpszUrl)
4380 urlW = heap_alloc(*lpdwUrlLength * sizeof(WCHAR));
4381
4382 ret = InternetCreateUrlW(&urlCompW, dwFlags, urlW, lpdwUrlLength);
4383
4385 *lpdwUrlLength /= sizeof(WCHAR);
4386
4387 /* on success, lpdwUrlLength points to the size of urlW in WCHARS
4388 * minus one, so add one to leave room for NULL terminator
4389 */
4390 if (ret)
4391 WideCharToMultiByte(CP_ACP, 0, urlW, -1, lpszUrl, *lpdwUrlLength + 1, NULL, NULL);
4392
4393 heap_free(urlCompW.lpszScheme);
4394 heap_free(urlCompW.lpszHostName);
4395 heap_free(urlCompW.lpszUserName);
4396 heap_free(urlCompW.lpszPassword);
4397 heap_free(urlCompW.lpszUrlPath);
4398 heap_free(urlCompW.lpszExtraInfo);
4399 heap_free(urlW);
4400 return ret;
4401}
BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags, LPWSTR lpszUrl, LPDWORD lpdwUrlLength)
Definition: internet.c:4426
static void convert_urlcomp_atow(LPURL_COMPONENTSA lpUrlComponents, LPURL_COMPONENTSW urlCompW)
Definition: internet.c:4292

Referenced by InternetCreateUrlA_test().

◆ InternetCreateUrlW()

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

Definition at line 4426 of file internet.c.

4428{
4429 DWORD dwLen;
4430 INTERNET_SCHEME nScheme;
4431
4432 static const WCHAR slashSlashW[] = {'/','/'};
4433
4434 TRACE("(%p,%d,%p,%p)\n", lpUrlComponents, dwFlags, lpszUrl, lpdwUrlLength);
4435
4436 if (!lpUrlComponents || lpUrlComponents->dwStructSize != sizeof(URL_COMPONENTSW) || !lpdwUrlLength)
4437 {
4439 return FALSE;
4440 }
4441
4442 if (!calc_url_length(lpUrlComponents, &dwLen))
4443 return FALSE;
4444
4445 if (!lpszUrl || *lpdwUrlLength < dwLen)
4446 {
4447 *lpdwUrlLength = (dwLen + 1) * sizeof(WCHAR);
4449 return FALSE;
4450 }
4451
4452 *lpdwUrlLength = dwLen;
4453 lpszUrl[0] = 0x00;
4454
4455 dwLen = 0;
4456
4457 if (lpUrlComponents->lpszScheme)
4458 {
4459 dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, Scheme);
4460 memcpy(lpszUrl, lpUrlComponents->lpszScheme, dwLen * sizeof(WCHAR));
4461 lpszUrl += dwLen;
4462
4463 nScheme = GetInternetSchemeW(lpUrlComponents->lpszScheme, dwLen);
4464 }
4465 else
4466 {
4468 nScheme = lpUrlComponents->nScheme;
4469
4470 if (nScheme == INTERNET_SCHEME_DEFAULT)
4471 nScheme = INTERNET_SCHEME_HTTP;
4472
4474 dwLen = lstrlenW(scheme);
4475 memcpy(lpszUrl, scheme, dwLen * sizeof(WCHAR));
4476 lpszUrl += dwLen;
4477 }
4478
4479 /* all schemes are followed by at least a colon */
4480 *lpszUrl = ':';
4481 lpszUrl++;
4482
4483 if (!scheme_is_opaque(nScheme) || lpUrlComponents->lpszHostName)
4484 {
4485 memcpy(lpszUrl, slashSlashW, sizeof(slashSlashW));
4486 lpszUrl += ARRAY_SIZE(slashSlashW);
4487 }
4488
4489 if (lpUrlComponents->lpszUserName)
4490 {
4491 dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, UserName);
4492 memcpy(lpszUrl, lpUrlComponents->lpszUserName, dwLen * sizeof(WCHAR));
4493 lpszUrl += dwLen;
4494
4495 if (lpUrlComponents->lpszPassword)
4496 {
4497 *lpszUrl = ':';
4498 lpszUrl++;
4499
4500 dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, Password);
4501 memcpy(lpszUrl, lpUrlComponents->lpszPassword, dwLen * sizeof(WCHAR));
4502 lpszUrl += dwLen;
4503 }
4504
4505 *lpszUrl = '@';
4506 lpszUrl++;
4507 }
4508
4509 if (lpUrlComponents->lpszHostName)
4510 {
4511 dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, HostName);
4512 memcpy(lpszUrl, lpUrlComponents->lpszHostName, dwLen * sizeof(WCHAR));
4513 lpszUrl += dwLen;
4514
4515 if (!url_uses_default_port(nScheme, lpUrlComponents->nPort))
4516 {
4517 *lpszUrl++ = ':';
4518 _ltow(lpUrlComponents->nPort, lpszUrl, 10);
4519 lpszUrl += lstrlenW(lpszUrl);
4520 }
4521
4522 /* add slash between hostname and path if necessary */
4523 if (lpUrlComponents->lpszUrlPath && *lpUrlComponents->lpszUrlPath != '/')
4524 {
4525 *lpszUrl = '/';
4526 lpszUrl++;
4527 }
4528 }
4529
4530 if (lpUrlComponents->lpszUrlPath)
4531 {
4532 dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, UrlPath);
4533 memcpy(lpszUrl, lpUrlComponents->lpszUrlPath, dwLen * sizeof(WCHAR));
4534 lpszUrl += dwLen;
4535 }
4536
4537 if (lpUrlComponents->lpszExtraInfo)
4538 {
4539 dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, ExtraInfo);
4540 memcpy(lpszUrl, lpUrlComponents->lpszExtraInfo, dwLen * sizeof(WCHAR));
4541 lpszUrl += dwLen;
4542 }
4543
4544 *lpszUrl = '\0';
4545
4546 return TRUE;
4547}
static BOOL calc_url_length(LPURL_COMPONENTSW lpUrlComponents, LPDWORD lpdwUrlLength)
Definition: internet.c:4217

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 4657 of file internet.c.

4659{
4660 FIXME("(%p, %p, 0x%08x, %p, 0x%08x) stub\n", hwndParent, lpszConnectoid, dwFlags,
4661 lpdwConnection, dwReserved);
4662 return ERROR_SUCCESS;
4663}
static HWND hwndParent
Definition: cryptui.c:300

◆ InternetDialW()

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

Definition at line 4665 of file internet.c.

4667{
4668 FIXME("(%p, %p, 0x%08x, %p, 0x%08x) stub\n", hwndParent, lpszConnectoid, dwFlags,
4669 lpdwConnection, dwReserved);
4670 return ERROR_SUCCESS;
4671}

◆ InternetFindNextFileA()

BOOL WINAPI InternetFindNextFileA ( HINTERNET  hFind,
LPVOID  lpvFindData 
)

Definition at line 1355 of file internet.c.

1356{
1357 BOOL ret;
1359
1360 ret = InternetFindNextFileW(hFind, lpvFindData?&fd:NULL);
1361 if(lpvFindData)
1363 return ret;
1364}
BOOL WINAPI InternetFindNextFileW(HINTERNET hFind, LPVOID lpvFindData)
Definition: internet.c:1376
static void WININET_find_data_WtoA(LPWIN32_FIND_DATAW dataW, LPWIN32_FIND_DATAA dataA)
Definition: internet.h:214

◆ InternetFindNextFileW()

BOOL WINAPI InternetFindNextFileW ( HINTERNET  hFind,
LPVOID  lpvFindData 
)

Definition at line 1376 of file internet.c.

1377{
1379 DWORD res;
1380
1381 TRACE("\n");
1382
1383 hdr = get_handle_object(hFind);
1384 if(!hdr) {
1385 WARN("Invalid handle\n");
1387 return FALSE;
1388 }
1389
1390 if(hdr->vtbl->FindNextFileW) {
1391 res = hdr->vtbl->FindNextFileW(hdr, lpvFindData);
1392 }else {
1393 WARN("Handle doesn't support NextFile\n");
1395 }
1396
1398
1399 if(res != ERROR_SUCCESS)
1401 return res == ERROR_SUCCESS;
1402}

Referenced by InternetFindNextFileA().

◆ InternetGetConnectedState()

BOOL WINAPI InternetGetConnectedState ( LPDWORD  lpdwStatus,
DWORD  dwReserved 
)

Definition at line 1163 of file internet.c.

1164{
1165 TRACE("(%p, 0x%08x)\n", lpdwStatus, dwReserved);
1166
1167 return InternetGetConnectedStateExW(lpdwStatus, NULL, 0, dwReserved);
1168}
BOOL WINAPI InternetGetConnectedStateExW(LPDWORD lpdwStatus, LPWSTR lpszConnectionName, DWORD dwNameLen, DWORD dwReserved)
Definition: internet.c:1198

◆ InternetGetConnectedStateExA()

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

Definition at line 1226 of file internet.c.

1228{
1229 LPWSTR lpwszConnectionName = NULL;
1230 BOOL rc;
1231
1232 TRACE("(%p, %p, %d, 0x%08x)\n", lpdwStatus, lpszConnectionName, dwNameLen, dwReserved);
1233
1234 if (lpszConnectionName && dwNameLen > 0)
1235 lpwszConnectionName = heap_alloc(dwNameLen * sizeof(WCHAR));
1236
1237 rc = InternetGetConnectedStateExW(lpdwStatus,lpwszConnectionName, dwNameLen,
1238 dwReserved);
1239 if (rc && lpwszConnectionName)
1240 WideCharToMultiByte(CP_ACP,0,lpwszConnectionName,-1,lpszConnectionName,
1241 dwNameLen, NULL, NULL);
1242
1243 heap_free(lpwszConnectionName);
1244 return rc;
1245}

◆ InternetGetConnectedStateExW()

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

Definition at line 1198 of file internet.c.

1200{
1201 TRACE("(%p, %p, %d, 0x%08x)\n", lpdwStatus, lpszConnectionName, dwNameLen, dwReserved);
1202
1203 /* Must be zero */
1204 if(dwReserved)
1205 return FALSE;
1206
1207 if (lpdwStatus) {
1208 WARN("always returning LAN connection.\n");
1209 *lpdwStatus = INTERNET_CONNECTION_LAN;
1210 }
1211
1212 /* When the buffer size is zero LoadStringW fills the buffer with a pointer to
1213 * the resource, avoid it as we must not change the buffer in this case */
1214 if(lpszConnectionName && dwNameLen) {
1215 *lpszConnectionName = '\0';
1216 LoadStringW(WININET_hModule, IDS_LANCONNECTION, lpszConnectionName, dwNameLen);
1217 }
1218
1219 return TRUE;
1220}
#define IDS_LANCONNECTION
Definition: resource.h:38
#define LoadStringW
Definition: utils.h:64
#define INTERNET_CONNECTION_LAN
Definition: wininet.h:2539

Referenced by InternetGetConnectedState(), and InternetGetConnectedStateExA().

◆ InternetGetLastResponseInfoA()

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

Definition at line 1088 of file internet.c.

1090{
1092
1093 TRACE("\n");
1094
1095 if (lpwite)
1096 {
1097 *lpdwError = lpwite->dwError;
1098 if (lpwite->dwError)
1099 {
1100 memcpy(lpszBuffer, lpwite->response, *lpdwBufferLength);
1101 *lpdwBufferLength = strlen(lpszBuffer);
1102 }
1103 else
1104 *lpdwBufferLength = 0;
1105 }
1106 else
1107 {
1108 *lpdwError = 0;
1109 *lpdwBufferLength = 0;
1110 }
1111
1112 return TRUE;
1113}

Referenced by trace_extended_error().

◆ InternetGetLastResponseInfoW()

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

Definition at line 1125 of file internet.c.

1127{
1129
1130 TRACE("\n");
1131
1132 if (lpwite)
1133 {
1134 *lpdwError = lpwite->dwError;
1135 if (lpwite->dwError)
1136 {
1137 memcpy(lpszBuffer, lpwite->response, *lpdwBufferLength);
1138 *lpdwBufferLength = lstrlenW(lpszBuffer);
1139 }
1140 else
1141 *lpdwBufferLength = 0;
1142 }
1143 else
1144 {
1145 *lpdwError = 0;
1146 *lpdwBufferLength = 0;
1147 }
1148
1149 return TRUE;
1150}

◆ InternetGetSecurityInfoByURLA()

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

Definition at line 4597 of file internet.c.

4598{
4599 WCHAR *url;
4600 BOOL res;
4601
4602 TRACE("(%s %p %p)\n", debugstr_a(lpszURL), ppCertChain, pdwSecureFlags);
4603
4604 url = heap_strdupAtoW(lpszURL);
4605 if(!url)
4606 return FALSE;
4607
4608 res = InternetGetSecurityInfoByURLW(url, ppCertChain, pdwSecureFlags);
4609 heap_free(url);
4610 return res;
4611}
BOOL WINAPI InternetGetSecurityInfoByURLW(LPCWSTR lpszURL, PCCERT_CHAIN_CONTEXT *ppCertChain, DWORD *pdwSecureFlags)
Definition: internet.c:4616

◆ InternetGetSecurityInfoByURLW()

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

Definition at line 4616 of file internet.c.

4617{
4618 URL_COMPONENTSW url = {sizeof(url)};
4620 BOOL res;
4621
4622 TRACE("(%s %p %p)\n", debugstr_w(lpszURL), ppCertChain, pdwSecureFlags);
4623
4624 if (!ppCertChain && !pdwSecureFlags) {
4626 return FALSE;
4627 }
4628
4629 url.dwHostNameLength = 1;
4630 res = InternetCrackUrlW(lpszURL, 0, 0, &url);
4631 if(!res || url.nScheme != INTERNET_SCHEME_HTTPS) {
4633 return FALSE;
4634 }
4635
4636 server = get_server(substr(url.lpszHostName, url.dwHostNameLength), url.nPort, TRUE, FALSE);
4637 if(!server) {
4639 return FALSE;
4640 }
4641
4642 if(server->cert_chain) {
4643 if(pdwSecureFlags)
4644 *pdwSecureFlags = server->security_flags & _SECURITY_ERROR_FLAGS_MASK;
4645
4646 if(ppCertChain && !(*ppCertChain = CertDuplicateCertificateChain(server->cert_chain)))
4647 res = FALSE;
4648 }else {
4650 res = FALSE;
4651 }
4652
4654 return res;
4655}
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:2948
void server_release(server_t *server)
Definition: http.c:154
static substr_t substr(const WCHAR *str, size_t len)
Definition: internet.h:203
#define _SECURITY_ERROR_FLAGS_MASK
Definition: internet.h:477
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 4673 of file internet.c.

4674{
4675 FIXME("(%s, %p, 0x%08x) stub\n", debugstr_a(lpszURL), hwndParent, dwReserved);
4676 return TRUE;
4677}

◆ InternetGoOnlineW()

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

Definition at line 4679 of file internet.c.

4680{
4681 FIXME("(%s, %p, 0x%08x) stub\n", debugstr_w(lpszURL), hwndParent, dwReserved);
4682 return TRUE;
4683}

◆ InternetHangUp()

DWORD WINAPI InternetHangUp ( DWORD_PTR  dwConnection,
DWORD  dwReserved 
)

Definition at line 4685 of file internet.c.

4686{
4687 FIXME("(0x%08lx, 0x%08x) stub\n", dwConnection, dwReserved);
4688 return ERROR_SUCCESS;
4689}

◆ InternetInitializeAutoProxyDll()

BOOL WINAPI InternetInitializeAutoProxyDll ( DWORD  dwReserved)

Definition at line 446 of file internet.c.

447{
448 FIXME("STUB\n");
450 return FALSE;
451}

◆ InternetLockRequestFile()

BOOL WINAPI InternetLockRequestFile ( HINTERNET  hInternet,
HANDLE lphLockReqHandle 
)

Definition at line 4033 of file internet.c.

4034{
4035 req_file_t *req_file = NULL;
4037 DWORD res;
4038
4039 TRACE("(%p %p)\n", hInternet, lphLockReqHandle);
4040
4041 hdr = get_handle_object(hInternet);
4042 if (!hdr) {
4044 return FALSE;
4045 }
4046
4047 if(hdr->vtbl->LockRequestFile) {
4048 res = hdr->vtbl->LockRequestFile(hdr, &req_file);
4049 }else {
4050 WARN("wrong handle\n");
4052 }
4053
4055
4056 *lphLockReqHandle = req_file;
4057 if(res != ERROR_SUCCESS)
4059 return res == ERROR_SUCCESS;
4060}

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 1057 of file internet.c.

1059{
1060 WCHAR *szAgent, *szProxy, *szBypass;
1061 HINTERNET rc;
1062
1063 TRACE("(%s, 0x%08x, %s, %s, 0x%08x)\n", debugstr_a(lpszAgent),
1064 dwAccessType, debugstr_a(lpszProxy), debugstr_a(lpszProxyBypass), dwFlags);
1065
1066 szAgent = heap_strdupAtoW(lpszAgent);
1067 szProxy = heap_strdupAtoW(lpszProxy);
1068 szBypass = heap_strdupAtoW(lpszProxyBypass);
1069
1070 rc = InternetOpenW(szAgent, dwAccessType, szProxy, szBypass, dwFlags);
1071
1072 heap_free(szAgent);
1073 heap_free(szProxy);
1074 heap_free(szBypass);
1075 return rc;
1076}
HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
Definition: internet.c:979

Referenced by _open_simple_request(), can_do_https(), HttpHeaders_test(), HttpSendRequestEx_test(), InternetOpenRequest_test(), InternetOpenUrlA_test(), InternetReadFile_chunked_test(), InternetReadFile_test(), InternetReadFileExA_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_no_cache(), test_no_content(), test_open_url_async(), 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 3780 of file internet.c.

3782{
3783 HINTERNET rc = NULL;
3784 LPWSTR szUrl = NULL;
3785 WCHAR *headers = NULL;
3786
3787 TRACE("\n");
3788
3789 if(lpszUrl) {
3790 szUrl = heap_strdupAtoW(lpszUrl);
3791 if(!szUrl)
3792 return NULL;
3793 }
3794
3795 if(lpszHeaders) {
3796 headers = heap_strndupAtoW(lpszHeaders, dwHeadersLength, &dwHeadersLength);
3797 if(!headers) {
3798 heap_free(szUrl);
3799 return NULL;
3800 }
3801 }
3802
3803 rc = InternetOpenUrlW(hInternet, szUrl, headers, dwHeadersLength, dwFlags, dwContext);
3804
3805 heap_free(szUrl);
3807 return rc;
3808}
HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
Definition: internet.c:3723
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 3723 of file internet.c.

3725{
3726 HINTERNET ret = NULL;
3727 appinfo_t *hIC = NULL;
3728
3729 if (TRACE_ON(wininet)) {
3730 TRACE("(%p, %s, %s, %08x, %08x, %08lx)\n", hInternet, debugstr_w(lpszUrl), debugstr_w(lpszHeaders),
3731 dwHeadersLength, dwFlags, dwContext);
3732 TRACE(" flags :");
3734 }
3735
3736 if (!lpszUrl)
3737 {
3739 goto lend;
3740 }
3741
3742 hIC = (appinfo_t*)get_handle_object( hInternet );
3743 if (NULL == hIC || hIC->hdr.htype != WH_HINIT) {
3745 goto lend;
3746 }
3747
3748 if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) {
3750
3752 task->url = heap_strdupW(lpszUrl);
3753 task->headers = heap_strdupW(lpszHeaders);
3754 task->headers_len = dwHeadersLength;
3755 task->flags = dwFlags;
3756 task->context = dwContext;
3757
3758 INTERNET_AsyncCall(&task->hdr);
3760 } else {
3761 ret = INTERNET_InternetOpenUrlW(hIC, lpszUrl, lpszHeaders, dwHeadersLength, dwFlags, dwContext);
3762 }
3763
3764 lend:
3765 if( hIC )
3766 WININET_Release( &hIC->hdr );
3767 TRACE(" %p <--\n", ret);
3768
3769 return ret;
3770}
#define TRACE_ON(x)
Definition: compat.h:75
DWORD INTERNET_AsyncCall(task_header_t *task)
Definition: internet.c:3916
static void dump_INTERNET_FLAGS(DWORD dwFlags)
Definition: internet.c:721
void * alloc_async_task(object_header_t *hdr, async_task_proc_t proc, size_t size)
Definition: internet.c:3895
static void AsyncInternetOpenUrlProc(task_header_t *hdr)
Definition: internet.c:3711

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 979 of file internet.c.

981{
982 appinfo_t *lpwai = NULL;
983
984#ifdef __REACTOS__
985 init_winsock();
986#endif
987 if (TRACE_ON(wininet)) {
988#define FE(x) { x, #x }
989 static const wininet_flag_info access_type[] = {
994 };
995#undef FE
996 DWORD i;
997 const char *access_type_str = "Unknown";
998
999 TRACE("(%s, %i, %s, %s, %i)\n", debugstr_w(lpszAgent), dwAccessType,
1000 debugstr_w(lpszProxy), debugstr_w(lpszProxyBypass), dwFlags);
1001 for (i = 0; i < ARRAY_SIZE(access_type); i++) {
1002 if (access_type[i].val == dwAccessType) {
1003 access_type_str = access_type[i].name;
1004 break;
1005 }
1006 }
1007 TRACE(" access type : %s\n", access_type_str);
1008 TRACE(" flags :");
1010 }
1011
1012 /* Clear any error information */
1014
1015 if((dwAccessType == INTERNET_OPEN_TYPE_PROXY) && !lpszProxy) {
1017 return NULL;
1018 }
1019
1020 lpwai = alloc_object(NULL, &APPINFOVtbl, sizeof(appinfo_t));
1021 if (!lpwai) {
1023 return NULL;
1024 }
1025
1026 lpwai->hdr.htype = WH_HINIT;
1027 lpwai->hdr.dwFlags = dwFlags;
1028 lpwai->accessType = dwAccessType;
1029 lpwai->proxyUsername = NULL;
1030 lpwai->proxyPassword = NULL;
1032
1033 lpwai->agent = heap_strdupW(lpszAgent);
1034 if(dwAccessType == INTERNET_OPEN_TYPE_PRECONFIG)
1035 INTERNET_ConfigureProxy( lpwai );
1036 else if(dwAccessType == INTERNET_OPEN_TYPE_PROXY) {
1037 lpwai->proxy = heap_strdupW(lpszProxy);
1038 lpwai->proxyBypass = heap_strdupW(lpszProxyBypass);
1039 }
1040
1041 TRACE("returning %p\n", lpwai);
1042
1043 return lpwai->hdr.hInternet;
1044}
static BOOL INTERNET_ConfigureProxy(appinfo_t *lpwai)
Definition: internet.c:688
static const object_vtbl_t APPINFOVtbl
Definition: internet.c:958
void * alloc_object(object_header_t *parent, const object_vtbl_t *vtbl, size_t size)
Definition: internet.c:103
HINTERNET hInternet
Definition: internet.h:275
const char * name
Definition: internet.h:468
#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(), and test_secure_connection().

◆ InternetQueryDataAvailable()

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

Definition at line 3960 of file internet.c.

3963{
3965 DWORD res;
3966
3967 TRACE("(%p %p %x %lx)\n", hFile, lpdwNumberOfBytesAvailable, dwFlags, dwContext);
3968
3970 if (!hdr) {
3972 return FALSE;
3973 }
3974
3975 if(hdr->vtbl->QueryDataAvailable) {
3976 res = hdr->vtbl->QueryDataAvailable(hdr, lpdwNumberOfBytesAvailable, dwFlags, dwContext);
3977 }else {
3978 WARN("wrong handle\n");
3980 }
3981
3983
3984 if(res != ERROR_SUCCESS)
3986 return res == ERROR_SUCCESS;
3987}
_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(), and test_conn_close().

◆ InternetQueryFortezzaStatus()

BOOL WINAPI InternetQueryFortezzaStatus ( DWORD a,
DWORD_PTR  b 
)

Definition at line 4705 of file internet.c.

4706{
4707 FIXME("(%p, %08lx) stub\n", a, b);
4708 return FALSE;
4709}
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 2697 of file internet.c.

2699{
2702
2703 TRACE("%p %d %p %p\n", hInternet, dwOption, lpBuffer, lpdwBufferLength);
2704
2705 if(hInternet) {
2706 hdr = get_handle_object(hInternet);
2707 if (hdr) {
2708 res = hdr->vtbl->QueryOption(hdr, dwOption, lpBuffer, lpdwBufferLength, TRUE);
2710 }
2711 }else {
2713 }
2714
2715 if(res != ERROR_SUCCESS)
2717 return res == ERROR_SUCCESS;
2718}

Referenced by _test_http_version(), _test_request_flags(), _test_secflags_option(), HttpInfo_QueryOption(), start_downloading(), test_InternetSetOption(), test_Option_PerConnectionOption(), 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 2154 of file internet.c.

2156{
2159
2160 TRACE("%p %p %d %p\n", hFile, lpBuffer, dwNumOfBytesToRead, pdwNumOfBytesRead);
2161
2163 if (!hdr) {
2165 return FALSE;
2166 }
2167
2168 if(hdr->vtbl->ReadFile) {
2169 res = hdr->vtbl->ReadFile(hdr, lpBuffer, dwNumOfBytesToRead, pdwNumOfBytesRead, 0, 0);
2170 if(res == ERROR_IO_PENDING)
2171 *pdwNumOfBytesRead = 0;
2172 }
2173
2175
2176 TRACE("-- %s (%u) (bytes read: %d)\n", res == ERROR_SUCCESS ? "TRUE": "FALSE", res,
2177 pdwNumOfBytesRead ? *pdwNumOfBytesRead : -1);
2178
2180 return res == ERROR_SUCCESS;
2181}

Referenced by _read_expect_sync_data_len(), _receive_simple_request(), AsyncInetReadFileLoop(), CWebServiceWinInet::DoRequest(), HttpSendRequestEx_test(), InternetOpenUrlA_test(), InternetReadFile_chunked_test(), InternetReadFile_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(), and test_security_flags().

◆ InternetReadFileExA()

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

Definition at line 2210 of file internet.c.

2212{
2215
2216 TRACE("(%p %p 0x%x 0x%lx)\n", hFile, lpBuffersOut, dwFlags, dwContext);
2217
2218 if (lpBuffersOut->dwStructSize != sizeof(*lpBuffersOut)) {
2220 return FALSE;
2221 }
2222
2224 if (!hdr) {
2226 return FALSE;
2227 }
2228
2229 if(hdr->vtbl->ReadFile)
2230 res = hdr->vtbl->ReadFile(hdr, lpBuffersOut->lpvBuffer, lpBuffersOut->dwBufferLength,
2231 &lpBuffersOut->dwBufferLength, dwFlags, dwContext);
2232
2234
2235 TRACE("-- %s (%u, bytes read: %d)\n", res == ERROR_SUCCESS ? "TRUE": "FALSE",
2236 res, lpBuffersOut->dwBufferLength);
2237
2238 if(res != ERROR_SUCCESS)
2240 return res == ERROR_SUCCESS;
2241}
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 2248 of file internet.c.

2250{
2253
2254 TRACE("(%p %p 0x%x 0x%lx)\n", hFile, lpBuffer, dwFlags, dwContext);
2255
2256 if (!lpBuffer || lpBuffer->dwStructSize != sizeof(*lpBuffer)) {
2258 return FALSE;
2259 }
2260
2262 if (!hdr) {
2264 return FALSE;
2265 }
2266
2267 if(hdr->vtbl->ReadFile)
2268 res = hdr->vtbl->ReadFile(hdr, lpBuffer->lpvBuffer, lpBuffer->dwBufferLength, &lpBuffer->dwBufferLength,
2269 dwFlags, dwContext);
2270
2272
2273 TRACE("-- %s (%u, bytes read: %d)\n", res == ERROR_SUCCESS ? "TRUE": "FALSE",
2274 res, lpBuffer->dwBufferLength);
2275
2276 if(res != ERROR_SUCCESS)
2278 return res == ERROR_SUCCESS;
2279}

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 2095 of file internet.c.

2097{
2098 FIXME("(%p %d %p %d %lx): stub\n", hFile, lDistanceToMove, pReserved, dwMoveContext, dwContext);
2099
2102}
#define INVALID_SET_FILE_POINTER
Definition: compat.h:732
_Out_ PVOID pReserved
Definition: netsh.h:77

Referenced by InternetReadFile_test().

◆ InternetSetOptionA()

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

Definition at line 3132 of file internet.c.

3134{
3135 LPVOID wbuffer;
3136 DWORD wlen;
3137 BOOL r;
3138
3139 switch( dwOption )
3140 {
3142 {
3145 DWORD proxlen, prbylen;
3146 LPWSTR prox, prby;
3147
3148 proxlen = MultiByteToWideChar( CP_ACP, 0, pi->lpszProxy, -1, NULL, 0);
3149 prbylen= MultiByteToWideChar( CP_ACP, 0, pi->lpszProxyBypass, -1, NULL, 0);
3150 wlen = sizeof(*piw) + proxlen + prbylen;
3151 wbuffer = heap_alloc(wlen*sizeof(WCHAR) );
3152 piw = (LPINTERNET_PROXY_INFOW) wbuffer;
3153 piw->dwAccessType = pi->dwAccessType;
3154 prox = (LPWSTR) &piw[1];
3155 prby = &prox[proxlen+1];
3156 MultiByteToWideChar( CP_ACP, 0, pi->lpszProxy, -1, prox, proxlen);
3157 MultiByteToWideChar( CP_ACP, 0, pi->lpszProxyBypass, -1, prby, prbylen);
3158 piw->lpszProxy = prox;
3159 piw->lpszProxyBypass = prby;
3160 }
3161 break;
3167 wlen = MultiByteToWideChar( CP_ACP, 0, lpBuffer, -1, NULL, 0 );
3168 if (!(wbuffer = heap_alloc( wlen * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
3169 MultiByteToWideChar( CP_ACP, 0, lpBuffer, -1, wbuffer, wlen );
3170 break;
3172 unsigned int i;
3175 wlen = sizeof(INTERNET_PER_CONN_OPTION_LISTW);
3176 wbuffer = heap_alloc(wlen);
3177 listW = wbuffer;
3178
3179 listW->dwSize = sizeof(INTERNET_PER_CONN_OPTION_LISTW);
3180 if (listA->pszConnection)
3181 {
3182 wlen = MultiByteToWideChar( CP_ACP, 0, listA->pszConnection, -1, NULL, 0 );
3183 listW->pszConnection = heap_alloc(wlen*sizeof(WCHAR));
3184 MultiByteToWideChar( CP_ACP, 0, listA->pszConnection, -1, listW->pszConnection, wlen );
3185 }
3186 else
3187 listW->pszConnection = NULL;
3188 listW->dwOptionCount = listA->dwOptionCount;
3189 listW->dwOptionError = listA->dwOptionError;
3191
3192 for (i = 0; i < listA->dwOptionCount; ++i) {
3193 INTERNET_PER_CONN_OPTIONA *optA = listA->pOptions + i;
3194 INTERNET_PER_CONN_OPTIONW *optW = listW->pOptions + i;
3195
3196 optW->dwOption = optA->dwOption;
3197
3198 switch (optA->dwOption) {
3204 if (optA->Value.pszValue)
3205 {
3206 wlen = MultiByteToWideChar( CP_ACP, 0, optA->Value.pszValue, -1, NULL, 0 );
3207 optW->Value.pszValue = heap_alloc(wlen*sizeof(WCHAR));
3208 MultiByteToWideChar( CP_ACP, 0, optA->Value.pszValue, -1, optW->Value.pszValue, wlen );
3209 }
3210 else
3211 optW->Value.pszValue = NULL;
3212 break;
3216 optW->Value.dwValue = optA->Value.dwValue;
3217 break;
3219 optW->Value.ftValue = optA->Value.ftValue;
3220 break;
3221 default:
3222 WARN("Unknown PER_CONN dwOption: %d, guessing at conversion to Wide\n", optA->dwOption);
3223 optW->Value.dwValue = optA->Value.dwValue;
3224 break;
3225 }
3226 }
3227 }
3228 break;
3229 default:
3230 wbuffer = lpBuffer;
3231 wlen = dwBufferLength;
3232 }
3233
3234 r = InternetSetOptionW(hInternet,dwOption, wbuffer, wlen);
3235
3236 if( lpBuffer != wbuffer )
3237 {
3239 {
3241 unsigned int i;
3242 for (i = 0; i < list->dwOptionCount; ++i) {
3243 INTERNET_PER_CONN_OPTIONW *opt = list->pOptions + i;
3244 switch (opt->dwOption) {
3250 heap_free( opt->Value.pszValue );
3251 break;
3252 default:
3253 break;
3254 }
3255 }
3256 heap_free( list->pOptions );
3257 }
3258 heap_free( wbuffer );
3259 }
3260
3261 return r;
3262}
Definition: list.h:37
BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength)
Definition: internet.c:2837
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
LPCWSTR lpszProxyBypass
Definition: wininet.h:168
union _INTERNET_PER_CONN_OPTIONA::@3563 Value
union _INTERNET_PER_CONN_OPTIONW::@3564 Value
LPINTERNET_PER_CONN_OPTIONA pOptions
Definition: wininet.h:364
LPINTERNET_PER_CONN_OPTIONW pOptions
Definition: wininet.h:372
#define INTERNET_PER_CONN_AUTOCONFIG_RELOAD_DELAY_MINS
Definition: wininet.h:340
#define INTERNET_OPTION_PROXY_PASSWORD
Definition: wininet.h:738
#define INTERNET_PER_CONN_FLAGS
Definition: wininet.h:334
#define INTERNET_OPTION_PROXY_USERNAME
Definition: wininet.h:737
#define INTERNET_PER_CONN_AUTODISCOVERY_FLAGS
Definition: wininet.h:338
#define INTERNET_OPTION_PASSWORD
Definition: wininet.h:723
struct _INTERNET_PER_CONN_OPTION_LISTW INTERNET_PER_CONN_OPTION_LISTW
#define INTERNET_PER_CONN_AUTOCONFIG_URL
Definition: wininet.h:337
#define INTERNET_PER_CONN_PROXY_SERVER
Definition: wininet.h:335
#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_USERNAME
Definition: wininet.h:722
#define INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME
Definition: wininet.h:341
#define LPINTERNET_PROXY_INFOA
Definition: wininet_test.h:82
#define LPINTERNET_PROXY_INFOW
Definition: wininet_test.h:83

Referenced by InternetReadFile_test(), InternetSetOptionExA(), 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(), and test_security_flags().

◆ InternetSetOptionExA()

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

Definition at line 3268 of file internet.c.

3270{
3271 FIXME("Flags %08x ignored\n", dwFlags);
3272 return InternetSetOptionA( hInternet, dwOption, lpBuffer, dwBufferLength );
3273}
BOOL WINAPI InternetSetOptionA(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength)
Definition: internet.c:3132

◆ InternetSetOptionExW()

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

Definition at line 3278 of file internet.c.

3280{
3281 FIXME("Flags %08x ignored\n", dwFlags);
3282 if( dwFlags & ~ISO_VALID_FLAGS )
3283 {
3285 return FALSE;
3286 }
3287 return InternetSetOptionW( hInternet, dwOption, lpBuffer, dwBufferLength );
3288}
#define ISO_VALID_FLAGS
Definition: wininet.h:699

◆ InternetSetOptionW()

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

Definition at line 2837 of file internet.c.

2839{
2840 object_header_t *lpwhh;
2841 BOOL ret = TRUE;
2842 DWORD res;
2843
2844 TRACE("(%p %d %p %d)\n", hInternet, dwOption, lpBuffer, dwBufferLength);
2845
2846 lpwhh = (object_header_t*) get_handle_object( hInternet );
2847 if(lpwhh)
2848 res = lpwhh->vtbl->SetOption(lpwhh, dwOption, lpBuffer, dwBufferLength);
2849 else
2850 res = set_global_option(dwOption, lpBuffer, dwBufferLength);
2851
2853 if(lpwhh)
2854 WININET_Release(lpwhh);
2855
2856 if(res != ERROR_SUCCESS)
2858
2859 return res == ERROR_SUCCESS;
2860 }
2861
2862 switch (dwOption)
2863 {
2865 {
2867 FIXME("Option INTERNET_OPTION_HTTP_VERSION(%d,%d): STUB\n",pVersion->dwMajorVersion,pVersion->dwMinorVersion);
2868 }
2869 break;
2871 {
2872 if(!lpwhh) {
2874 return FALSE;
2879 ret = FALSE;
2880 } else if(dwBufferLength != sizeof(ULONG)) {
2882 ret = FALSE;
2883 } else {
2884 TRACE("INTERNET_OPTION_ERROR_MASK: %x\n", *(ULONG*)lpBuffer);
2885 lpwhh->ErrorMask = *(ULONG*)lpBuffer;
2886 }
2887 }
2888 break;
2890 {
2892
2893 if (!lpBuffer || dwBufferLength < sizeof(INTERNET_PROXY_INFOW))
2894 {
2896 return FALSE;
2897 }
2898 if (!hInternet)
2899 {
2902 global_proxy = heap_alloc( sizeof(proxyinfo_t) );
2903 if (global_proxy)
2904 {
2905 if (info->dwAccessType == INTERNET_OPEN_TYPE_PROXY)
2906 {
2908 global_proxy->proxy = heap_strdupW( info->lpszProxy );
2909 global_proxy->proxyBypass = heap_strdupW( info->lpszProxyBypass );
2910 }
2911 else
2912 {
2915 }
2916 }
2918 }
2919 else
2920 {
2921 /* In general, each type of object should handle
2922 * INTERNET_OPTION_PROXY directly. This FIXME ensures it doesn't
2923 * get silently dropped.
2924 */
2925 FIXME("INTERNET_OPTION_PROXY unimplemented\n");
2927 ret = FALSE;
2928 }
2929 break;
2930 }
2932 {
2934 FIXME("Option INTERNET_OPTION_CODEPAGE (%d): STUB\n", codepage);
2935 }
2936 break;
2938 {
2940 FIXME("Option INTERNET_OPTION_REQUEST_PRIORITY (%d): STUB\n", priority);
2941 }
2942 break;
2944 {
2945 ULONG connecttimeout = *(ULONG *)lpBuffer;
2946 FIXME("Option INTERNET_OPTION_CONNECT_TIMEOUT (%d): STUB\n", connecttimeout);
2947 }
2948 break;
2950 {
2951 ULONG receivetimeout = *(ULONG *)lpBuffer;
2952 FIXME("Option INTERNET_OPTION_DATA_RECEIVE_TIMEOUT (%d): STUB\n", receivetimeout);
2953 }
2954 break;
2956 FIXME("Option INTERNET_OPTION_RESET_URLCACHE_SESSION: STUB\n");
2957 break;
2959 FIXME("Option INTERNET_OPTION_END_BROWSER_SESSION: semi-stub\n");
2960 free_cookie();
2962 break;
2964 FIXME("Option INTERNET_OPTION_CONNECTED_STATE: STUB\n");
2965 break;
2967 TRACE("Option INTERNET_OPTION_DISABLE_PASSPORT_AUTH: harmless stub, since not enabled\n");
2968 break;
2970 FIXME("Option INTERNET_OPTION_IGNORE_OFFLINE: STUB\n");
2971 break;
2975 {
2977 FIXME("INTERNET_OPTION_SEND/RECEIVE_TIMEOUT/DATA_SEND_TIMEOUT %d\n", timeout);
2978 break;
2979 }
2981 {
2982 ULONG retries = *(ULONG *)lpBuffer;
2983 FIXME("INTERNET_OPTION_CONNECT_RETRIES %d\n", retries);
2984 break;
2985 }
2987 {
2988 if (!lpwhh)
2989 {
2991 return FALSE;
2992 }
2993 if (!lpBuffer || dwBufferLength != sizeof(DWORD_PTR))
2994 {
2996 ret = FALSE;
2997 }
2998 else
2999 lpwhh->dwContext = *(DWORD_PTR *)lpBuffer;
3000 break;
3001 }
3003 FIXME("Option INTERNET_OPTION_SECURITY_FLAGS; STUB\n");
3004 break;
3006 FIXME("Option INTERNET_OPTION_DISABLE_AUTODIAL; STUB\n");
3007 break;
3009 if (!lpwhh)
3010 {
3012 return FALSE;
3013 }
3014 if (!lpBuffer || dwBufferLength != sizeof(BOOL))
3015 {
3017 ret = FALSE;
3018 }
3019 else
3020 lpwhh->decoding = *(BOOL *)lpBuffer;
3021 break;
3023 FIXME("INTERNET_OPTION_COOKIES_3RD_PARTY; STUB\n");
3025 ret = FALSE;
3026 break;
3028 FIXME("INTERNET_OPTION_SEND_UTF8_SERVERNAME_TO_PROXY; STUB\n");
3030 ret = FALSE;
3031 break;
3033 FIXME("INTERNET_OPTION_CODEPAGE_PATH; STUB\n");
3035 ret = FALSE;
3036 break;
3038 FIXME("INTERNET_OPTION_CODEPAGE_EXTRA; STUB\n");
3040 ret = FALSE;
3041 break;
3043 FIXME("INTERNET_OPTION_IDN; STUB\n");
3045 ret = FALSE;
3046 break;
3049 ret = FALSE;
3050 break;
3053 LONG res;
3054 unsigned int i;
3056
3057 if (INTERNET_LoadProxySettings(&pi)) return FALSE;
3058
3059 for (i = 0; i < con->dwOptionCount; i++) {
3061
3062 switch (option->dwOption) {
3064 heap_free(pi.proxy);
3065 pi.proxy = heap_strdupW(option->Value.pszValue);
3066 break;
3067
3069 if(option->Value.dwValue & PROXY_TYPE_PROXY)
3070 pi.proxyEnabled = 1;
3071 else
3072 {
3073 if(option->Value.dwValue != PROXY_TYPE_DIRECT)
3074 FIXME("Unhandled flags: 0x%x\n", option->Value.dwValue);
3075 pi.proxyEnabled = 0;
3076 }
3077 break;
3078
3080 heap_free(pi.proxyBypass);
3081 pi.proxyBypass = heap_strdupW(option->Value.pszValue);
3082 break;
3083
3090 FIXME("Unhandled dwOption %d\n", option->dwOption);
3091 break;
3092
3093 default:
3094 FIXME("Unknown dwOption %d\n", option->dwOption);
3096 break;
3097 }
3098 }
3099
3102
3103 FreeProxyInfo(&pi);
3104
3105 ret = (res == ERROR_SUCCESS);
3106 break;
3107 }
3108 default:
3109 FIXME("Option %d STUB\n",dwOption);
3111 ret = FALSE;
3112 break;
3113 }
3114
3115 if(lpwhh)
3116 WININET_Release( lpwhh );
3117
3118 return ret;
3119}
void free_authorization_cache(void)
Definition: http.c:943
static void free_global_proxy(void)
Definition: internet.c:480
static DWORD set_global_option(DWORD option, void *buf, DWORD size)
Definition: internet.c:2774
static LONG INTERNET_SaveProxySettings(proxyinfo_t *lpwpi)
Definition: internet.c:331
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:274
DWORD_PTR dwContext
Definition: internet.h:278
DWORD(* SetOption)(object_header_t *, DWORD, void *, DWORD)
Definition: internet.h:261
Definition: dhcpd.h:248
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_DATA_SEND_TIMEOUT
Definition: wininet.h:708
#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 PROXY_TYPE_DIRECT
Definition: wininet.h:346
#define INTERNET_OPTION_IDN
Definition: wininet.h:792
#define INTERNET_ERROR_MASK_LOGIN_FAILURE_DISPLAY_ENTITY_BODY
Definition: wininet.h:127
#define INTERNET_OPTION_DATA_RECEIVE_TIMEOUT
Definition: wininet.h:709
#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_SEND_TIMEOUT
Definition: wininet.h:704
#define INTERNET_OPTION_DISABLE_AUTODIAL
Definition: wininet.h:762
#define INTERNET_OPTION_RECEIVE_TIMEOUT
Definition: wininet.h:706
#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 PROXY_TYPE_PROXY
Definition: wininet.h:347
#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_security_flags(), and update_user_agent().

◆ InternetSetStatusCallbackA()

INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackA ( HINTERNET  hInternet,
INTERNET_STATUS_CALLBACK  lpfnIntCB 
)

Definition at line 2047 of file internet.c.

2049{
2051 object_header_t *lpwh;
2052
2053 TRACE("%p\n", hInternet);
2054
2055 if (!(lpwh = get_handle_object(hInternet)))
2057
2058 retVal = set_status_callback(lpwh, lpfnIntCB, FALSE);
2059
2060 WININET_Release( lpwh );
2061 return retVal;
2062}
static INTERNET_STATUS_CALLBACK set_status_callback(object_header_t *lpwh, INTERNET_STATUS_CALLBACK callback, BOOL unicode)
Definition: internet.c:2022
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 2075 of file internet.c.

2077{
2079 object_header_t *lpwh;
2080
2081 TRACE("%p\n", hInternet);
2082
2083 if (!(lpwh = get_handle_object(hInternet)))
2085
2086 retVal = set_status_callback(lpwh, lpfnIntCB, TRUE);
2087
2088 WININET_Release( lpwh );
2089 return retVal;
2090}

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 3301 of file internet.c.

3302{
3303 BOOL ret;
3305
3306 TRACE( "%p 0x%08x %p 0x%08x\n", time, format, string, size );
3307
3308 if (!time || !string || format != INTERNET_RFC1123_FORMAT)
3309 {
3311 return FALSE;
3312 }
3313
3314 if (size < INTERNET_RFC1123_BUFSIZE * sizeof(*string))
3315 {
3317 return FALSE;
3318 }
3319
3321 if (ret) WideCharToMultiByte( CP_ACP, 0, stringW, -1, string, size, NULL, NULL );
3322
3323 return ret;
3324}
BOOL WINAPI InternetTimeFromSystemTimeW(const SYSTEMTIME *time, DWORD format, LPWSTR string, DWORD size)
Definition: internet.c:3329
static const WCHAR stringW[]
Definition: engine.c:38
__u16 time
Definition: mkdosfs.c:8
#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 3329 of file internet.c.

3330{
3331 TRACE( "%p 0x%08x %p 0x%08x\n", time, format, string, size );
3332
3333 if (!time || !string || format != INTERNET_RFC1123_FORMAT)
3334 {
3336 return FALSE;
3337 }
3338
3339 if (size < INTERNET_RFC1123_BUFSIZE * sizeof(*string))
3340 {
3342 return FALSE;
3343 }
3344
3345 swprintf( string, size, L"%s, %02d %s %4d %02d:%02d:%02d GMT",
3346 WININET_wkday[time->wDayOfWeek],
3347 time->wDay,
3348 WININET_month[time->wMonth - 1],
3349 time->wYear,
3350 time->wHour,
3351 time->wMinute,
3352 time->wSecond );
3353
3354 return TRUE;
3355}
static const WCHAR WININET_month[12][4]
Definition: internet.c:3293
static const WCHAR WININET_wkday[7][4]
Definition: internet.c:3290
#define swprintf
Definition: precomp.h:40

Referenced by InternetTimeFromSystemTimeA().

◆ InternetTimeToSystemTimeA()

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

Definition at line 3360 of file internet.c.

3361{
3362 BOOL ret = FALSE;
3363 WCHAR *stringW;
3364
3365 TRACE( "%s %p 0x%08x\n", debugstr_a(string), time, reserved );
3366
3367 stringW = heap_strdupAtoW(string);
3368 if (stringW)
3369 {
3371 heap_free( stringW );
3372 }
3373 return ret;
3374}
BOOL WINAPI InternetTimeToSystemTimeW(LPCWSTR string, SYSTEMTIME *time, DWORD reserved)
Definition: internet.c:3379
r reserved
Definition: btrfs.c:3006

◆ InternetTimeToSystemTimeW()

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

Definition at line 3379 of file internet.c.

3380{
3381 unsigned int i;
3382 const WCHAR *s = string;
3383 WCHAR *end;
3384
3385 TRACE( "%s %p 0x%08x\n", debugstr_w(string), time, reserved );
3386
3387 if (!string || !time) return FALSE;
3388
3389 /* Windows does this too */
3391
3392 /* Convert an RFC1123 time such as 'Fri, 07 Jan 2005 12:06:35 GMT' into
3393 * a SYSTEMTIME structure.
3394 */
3395
3396 while (*s && !iswalpha( *s )) s++;
3397 if (s[0] == '\0' || s[1] == '\0' || s[2] == '\0') return TRUE;
3398 time->wDayOfWeek = 7;
3399
3400 for (i = 0; i < 7; i++)
3401 {
3402 if (!wcsnicmp( WININET_wkday[i], s, 3 ))
3403 {
3404 time->wDayOfWeek = i;
3405 break;
3406 }
3407 }
3408
3409 if (time->wDayOfWeek > 6) return TRUE;
3410 while (*s && !iswdigit( *s )) s++;
3411 time->wDay = wcstol( s, &end, 10 );
3412 s = end;
3413
3414 while (*s && !iswalpha( *s )) s++;
3415 if (s[0] == '\0' || s[1] == '\0' || s[2] == '\0') return TRUE;
3416 time->wMonth = 0;
3417
3418 for (i = 0; i < 12; i++)
3419 {
3420 if (!wcsnicmp( WININET_month[i], s, 3 ))
3421 {
3422 time->wMonth = i + 1;
3423 break;
3424 }
3425 }
3426 if (time->wMonth == 0) return TRUE;
3427
3428 while (*s && !iswdigit( *s )) s++;
3429 if (*s == '\0') return TRUE;
3430 time->wYear = wcstol( s, &end, 10 );
3431 s = end;
3432
3433 while (*s && !iswdigit( *s )) s++;
3434 if (*s == '\0') return TRUE;
3435 time->wHour = wcstol( s, &end, 10 );
3436 s = end;
3437
3438 while (*s && !iswdigit( *s )) s++;
3439 if (*s == '\0') return TRUE;
3440 time->wMinute = wcstol( s, &end, 10 );
3441 s = end;
3442
3443 while (*s && !iswdigit( *s )) s++;
3444 if (*s == '\0') return TRUE;
3445 time->wSecond = wcstol( s, &end, 10 );
3446 s = end;
3447
3448 time->wMilliseconds = 0;
3449 return TRUE;
3450}
VOID WINAPI GetSystemTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:327
GLdouble s
Definition: gl.h:2039
char string[160]
Definition: util.h:11
#define iswdigit(_c)
Definition: ctype.h:667
#define iswalpha(_c)
Definition: ctype.h:664

Referenced by InternetTimeToSystemTimeA(), and set_cookie().

◆ InternetUnlockRequestFile()

BOOL WINAPI InternetUnlockRequestFile ( HANDLE  hLockHandle)

Definition at line 4062 of file internet.c.

4063{
4064 TRACE("(%p)\n", hLockHandle);
4065
4066 req_file_release(hLockHandle);
4067 return TRUE;
4068}

Referenced by InternetLockRequestFile_test(), and protocol_unlock_request().

◆ InternetWriteFile()

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

Definition at line 2114 of file internet.c.

2116{
2117 object_header_t *lpwh;
2118 BOOL res;
2119
2120 TRACE("(%p %p %d %p)\n", hFile, lpBuffer, dwNumOfBytesToWrite, lpdwNumOfBytesWritten);
2121
2122 lpwh = get_handle_object( hFile );
2123 if (!lpwh) {
2124 WARN("Invalid handle\n");
2126 return FALSE;
2127 }
2128
2129 if(lpwh->vtbl->WriteFile) {
2130 res = lpwh->vtbl->WriteFile(lpwh, lpBuffer, dwNumOfBytesToWrite, lpdwNumOfBytesWritten);
2131 }else {
2132 WARN("No Writefile method.\n");
2134 }
2135
2136 WININET_Release( lpwh );
2137
2138 if(res != ERROR_SUCCESS)
2140 return res == ERROR_SUCCESS;
2141}
DWORD(* WriteFile)(object_header_t *, const void *, DWORD, DWORD *)
Definition: internet.h:263

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 193 of file internet.c.

194{
196
197 if(!info->valid_handle)
198 return;
199 info->valid_handle = FALSE;
200
201 /* Free all children as native does */
203 {
204 TRACE("invalidating child handle %p for parent %p\n", child->hInternet, info);
206 }
207
209}
uint32_t entry
Definition: isohybrid.c:63
static HWND child
Definition: cursoricon.c:298
static unsigned __int64 next
Definition: rand_nt.c:6
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204

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 2371 of file internet.c.

2372{
2373 int len_domain = strlen( domain ), len_suffix = strlen( suffix );
2374
2375 if (len_suffix > len_domain) return FALSE;
2376 if (!stricmp( domain + len_domain - len_suffix, suffix )) return TRUE;
2377 return FALSE;
2378}
#define stricmp(_String1, _String2)
Definition: compat.h:24

Referenced by detect_proxy_autoconfig_url_dns().

◆ parse_proxy_url()

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

Definition at line 491 of file internet.c.

492{
493 URL_COMPONENTSW uc = {sizeof(uc)};
494
495 uc.dwHostNameLength = 1;
496 uc.dwUserNameLength = 1;
497 uc.dwPasswordLength = 1;
498
499 if (!InternetCrackUrlW( url, 0, 0, &uc )) return FALSE;
500 if (!uc.dwHostNameLength)
501 {
502 if (!(info->proxy = heap_strdupW( url ))) return FALSE;
503 info->proxyUsername = NULL;
504 info->proxyPassword = NULL;
505 return TRUE;
506 }
507 if (!(info->proxy = heap_alloc( (uc.dwHostNameLength + 12) * sizeof(WCHAR) ))) return FALSE;
508 swprintf( info->proxy, uc.dwHostNameLength + 12, L"%.*s:%u", uc.dwHostNameLength, uc.lpszHostName, uc.nPort );
509
510 if (!uc.dwUserNameLength) info->proxyUsername = NULL;
511 else if (!(info->proxyUsername = heap_strndupW( uc.lpszUserName, uc.dwUserNameLength )))
512 {
513 heap_free( info->proxy );
514 return FALSE;
515 }
516 if (!uc.dwPasswordLength) info->proxyPassword = NULL;
517 else if (!(info->proxyPassword = heap_strndupW( uc.lpszPassword, uc.dwPasswordLength )))
518 {
519 heap_free( info->proxyUsername );
520 heap_free( info->proxy );
521 return FALSE;
522 }
523 return TRUE;
524}

Referenced by INTERNET_LoadProxySettings().

◆ PrivacyGetZonePreferenceW()

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

Definition at line 4585 of file internet.c.

4587{
4588 FIXME( "%x %x %p %p %p: stub\n", zone, type, template, preference, length );
4589
4590 if (template) *template = zone_preference;
4591 return 0;
4592}
static DWORD zone_preference
Definition: internet.c:4569
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
DWORD zone
Definition: sec_mgr.c:1754

◆ PrivacySetZonePreferenceW()

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

Definition at line 4574 of file internet.c.

4575{
4576 FIXME( "%x %x %x %s: stub\n", zone, type, template, debugstr_w(preference) );
4577
4578 zone_preference = template;
4579 return 0;
4580}

◆ query_global_option()

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

Definition at line 2458 of file internet.c.

2459{
2460 /* FIXME: This function currently handles more options than it should. Options requiring
2461 * proper handles should be moved to proper functions */
2462 switch(option) {
2464 if (*size < sizeof(HTTP_VERSION_INFO))
2466
2467 /*
2468 * Presently hardcoded to 1.1
2469 */
2470 ((HTTP_VERSION_INFO*)buffer)->dwMajorVersion = 1;
2471 ((HTTP_VERSION_INFO*)buffer)->dwMinorVersion = 1;
2472 *size = sizeof(HTTP_VERSION_INFO);
2473
2474 return ERROR_SUCCESS;
2475
2477 FIXME("INTERNET_OPTION_CONNECTED_STATE: semi-stub\n");
2478
2479 if (*size < sizeof(ULONG))
2481
2483 *size = sizeof(ULONG);
2484
2485 return ERROR_SUCCESS;
2486
2487 case INTERNET_OPTION_PROXY: {
2488 appinfo_t ai;
2489 BOOL ret;
2490
2491 TRACE("Getting global proxy info\n");
2492 memset(&ai, 0, sizeof(appinfo_t));
2494
2495 ret = APPINFO_QueryOption(&ai.hdr, INTERNET_OPTION_PROXY, buffer, size, unicode); /* FIXME */
2496 APPINFO_Destroy(&ai.hdr);
2497 return ret;
2498 }
2499
2501 TRACE("INTERNET_OPTION_MAX_CONNS_PER_SERVER\n");
2502
2503 if (*size < sizeof(ULONG))
2505
2506 *(ULONG*)buffer = max_conns;
2507 *size = sizeof(ULONG);
2508
2509 return ERROR_SUCCESS;
2510
2512 TRACE("INTERNET_OPTION_MAX_CONNS_1_0_SERVER\n");
2513
2514 if (*size < sizeof(ULONG))
2516
2518 *size = sizeof(ULONG);
2519
2520 return ERROR_SUCCESS;
2521
2523 FIXME("INTERNET_OPTION_SECURITY_FLAGS: Stub\n");
2524 return ERROR_SUCCESS;
2525
2527 static const INTERNET_VERSION_INFO info = { 1, 2 };
2528
2529 TRACE("INTERNET_OPTION_VERSION\n");
2530
2531 if (*size < sizeof(INTERNET_VERSION_INFO))
2533
2534 memcpy(buffer, &info, sizeof(info));
2535 *size = sizeof(info);
2536
2537 return ERROR_SUCCESS;
2538 }
2539
2541 WCHAR *url;
2546 LONG ret;
2547
2548 TRACE("Getting global proxy info\n");
2550 return ret;
2551
2552#ifdef __REACTOS__
2553 WARN("INTERNET_OPTION_PER_CONNECTION_OPTION stub\n");
2554#else
2555 FIXME("INTERNET_OPTION_PER_CONNECTION_OPTION stub\n");
2556#endif
2557
2558 if (*size < sizeof(INTERNET_PER_CONN_OPTION_LISTW)) {
2559 FreeProxyInfo(&pi);
2561 }
2562
2564
2565 for (i = 0; i < con->dwOptionCount; i++) {
2567 INTERNET_PER_CONN_OPTIONA *optionA = conA->pOptions + i;
2568
2569 switch (optionW->dwOption) {
2571 if(pi.proxyEnabled)
2572 optionW->Value.dwValue = PROXY_TYPE_PROXY;
2573 else
2574 optionW->Value.dwValue = PROXY_TYPE_DIRECT;
2575 if (url)
2576 /* native includes PROXY_TYPE_DIRECT even if PROXY_TYPE_PROXY is set */
2578 break;
2579
2581 if (unicode)
2582 optionW->Value.pszValue = heap_strdupW(pi.proxy);
2583 else
2584 optionA->Value.pszValue = heap_strdupWtoA(pi.proxy);
2585 break;
2586
2588 if (unicode)
2589 optionW->Value.pszValue = heap_strdupW(pi.proxyBypass);
2590 else
2591 optionA->Value.pszValue = heap_strdupWtoA(pi.proxyBypass);
2592 break;
2593
2595 if (!url)
2596 optionW->Value.pszValue = NULL;
2597 else if (unicode)
2598 optionW->Value.pszValue = heap_strdupW(url);
2599 else
2600 optionA->Value.pszValue = heap_strdupWtoA(url);
2601 break;
2602
2604 optionW->Value.dwValue = AUTO_PROXY_FLAG_ALWAYS_DETECT;
2605 break;
2606
2611 FIXME("Unhandled dwOption %d\n", optionW->dwOption);
2612 memset(&optionW->Value, 0, sizeof(optionW->Value));
2613 break;
2614
2615#ifdef __REACTOS__
2617 WARN("Unhandled dwOption %d\n", optionW->dwOption);
2618 break;
2619
2620#endif
2621 default:
2622 FIXME("Unknown dwOption %d\n", optionW->dwOption);
2624 break;
2625 }
2626 }
2627 heap_free(url);
2628 FreeProxyInfo(&pi);
2629
2630 return res;
2631 }
2634 *size = 0;
2639 TRACE("INTERNET_OPTION_CONNECT_TIMEOUT\n");
2640
2641 if (*size < sizeof(ULONG))
2643
2645 *size = sizeof(ULONG);
2646
2647 return ERROR_SUCCESS;
2648 }
2649
2650 FIXME("Stub for %d\n", option);
2652}
static char * heap_strdupWtoA(const WCHAR *str)
static WCHAR * get_proxy_autoconfig_url(void)
Definition: internet.c:2451
static ULONG max_conns
Definition: internet.c:97
static DWORD APPINFO_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
Definition: internet.c:788
static ULONG max_1_0_conns
Definition: internet.c:97
static VOID APPINFO_Destroy(object_header_t *hdr)
Definition: internet.c:775
static const WCHAR optionW[]
Definition: htmlelem.c:36
#define AUTO_PROXY_FLAG_ALWAYS_DETECT
Definition: wininet.h:352
#define PROXY_TYPE_AUTO_PROXY_URL
Definition: wininet.h:348
#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 4016 of file internet.c.

4017{
4018 if(InterlockedDecrement(&req_file->ref))
4019 return;
4020
4021 if(!req_file->is_committed)
4022 DeleteFileW(req_file->file_name);
4023 if(req_file->file_handle && req_file->file_handle != INVALID_HANDLE_VALUE)
4024 CloseHandle(req_file->file_handle);
4025 heap_free(req_file->file_name);
4026 heap_free(req_file->url);
4027 heap_free(req_file);
4028}
#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:251
BOOL is_committed
Definition: internet.h:252

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

◆ ResumeSuspendedDownload()

BOOL WINAPI ResumeSuspendedDownload ( HINTERNET  hInternet,
DWORD  dwError 
)

Definition at line 4699 of file internet.c.

4700{
4701 FIXME("(%p, 0x%08x) stub\n", hInternet, dwError);
4702 return FALSE;
4703}

◆ reverse_lookup()

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

Definition at line 2380 of file internet.c.

2381{
2382 return getnameinfo( ai->ai_addr, ai->ai_addrlen, hostname, len, NULL, 0, 0 );
2383}
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().

◆ scheme_is_opaque()

static BOOL scheme_is_opaque ( INTERNET_SCHEME  nScheme)
inlinestatic

Definition at line 4194 of file internet.c.

4195{
4196 return (nScheme != INTERNET_SCHEME_FTP) &&
4197 (nScheme != INTERNET_SCHEME_GOPHER) &&
4198 (nScheme != INTERNET_SCHEME_HTTP) &&
4199 (nScheme != INTERNET_SCHEME_HTTPS) &&
4200 (nScheme != INTERNET_SCHEME_FILE);
4201}

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 2774 of file internet.c.

2775{
2776 switch(option) {
2778 WARN("Not global option %u\n", option);
2780
2782 TRACE("INTERNET_OPTION_MAX_CONNS_PER_SERVER\n");
2783
2784 if(size != sizeof(max_conns))
2786 if(!*(ULONG*)buf)
2787 return ERROR_BAD_ARGUMENTS;
2788
2789 max_conns = *(ULONG*)buf;
2790 return ERROR_SUCCESS;
2791
2793 TRACE("INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER\n");
2794
2795 if(size != sizeof(max_1_0_conns))
2797 if(!*(ULONG*)buf)
2798 return ERROR_BAD_ARGUMENTS;
2799
2800 max_1_0_conns = *(ULONG*)buf;
2801 return ERROR_SUCCESS;
2802
2804 TRACE("INTERNET_OPTION_CONNECT_TIMEOUT\n");
2805
2806 if(size != sizeof(connect_timeout))
2808 if(!*(ULONG*)buf)
2809 return ERROR_BAD_ARGUMENTS;
2810
2812 return ERROR_SUCCESS;
2813
2815 FIXME("INTERNET_OPTION_SUPPRESS_BEHAVIOR stub\n");
2816
2817 if(size != sizeof(ULONG))
2819
2820 FIXME("%08x\n", *(ULONG*)buf);
2821 return ERROR_SUCCESS;
2822 }
2823
2824 return INET_SetOption(NULL, option, buf, size);
2825}
#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 2022 of file internet.c.

2024{
2026
2027 if (unicode) lpwh->dwInternalFlags |= INET_CALLBACKW;
2028 else lpwh->dwInternalFlags &= ~INET_CALLBACKW;
2029
2030 ret = lpwh->lpfnStatusCB;
2031 lpwh->lpfnStatusCB = callback;
2032
2033 return ret;
2034}
static IPrintDialogCallback callback
Definition: printdlg.c:326
DWORD dwInternalFlags
Definition: internet.h:281
INTERNET_STATUS_CALLBACK lpfnStatusCB
Definition: internet.h:284

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 1432 of file internet.c.

1433{
1434 TRACE("%s (%d)\n", debugstr_wn(value, len), len);
1435
1436 if (!*component_length)
1437 return TRUE;
1438
1439 if (!*component) {
1440 *(const WCHAR**)component = value;
1441 *component_length = len;
1442 return TRUE;
1443 }
1444
1445 if (*component_length < len+1) {
1447 return FALSE;
1448 }
1449
1450 *component_length = len;
1451 if(len)
1452 memcpy(*component, value, len*sizeof(WCHAR));
1453 (*component)[len] = 0;
1454 return TRUE;
1455}
Definition: pdh_main.c:96

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 1484 of file internet.c.

1485{
1486 *len_w = len_a;
1487
1488 if(!comp_a) {
1489 *comp_w = NULL;
1490 return TRUE;
1491 }
1492
1493 if(!(*comp_w = *buf = heap_alloc(len_a*sizeof(WCHAR)))) {
1495 return FALSE;
1496 }
1497
1498 return TRUE;
1499}

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 1457 of file internet.c.

1459{
1460 size_t size, ret_size = *ret_length;
1461
1462 if (!*ret_length)
1463 return TRUE;
1464 size = WideCharToMultiByte(CP_ACP, 0, comp_w, length, NULL, 0, NULL, NULL);
1465
1466 if (!*comp) {
1467 *comp = comp_w ? (char*)url_a + WideCharToMultiByte(CP_ACP, 0, url_w, comp_w-url_w, NULL, 0, NULL, NULL) : NULL;
1468 *ret_length = size;
1469 return TRUE;
1470 }
1471
1472 if (size+1 > ret_size) {
1474 *ret_length = size+1;
1475 return FALSE;
1476 }
1477
1478 *ret_length = size;
1479 WideCharToMultiByte(CP_ACP, 0, comp_w, length, *comp, ret_size-1, NULL, NULL);
1480 (*comp)[size] = 0;
1481 return TRUE;
1482}

Referenced by InternetCrackUrlA().

◆ ShowClientAuthCerts()

DWORD WINAPI ShowClientAuthCerts ( HWND  parent)

Definition at line 4711 of file internet.c.

4712{
4713 FIXME("%p: stub\n", parent);
4714 return 0;
4715}

◆ url_uses_default_port()

static BOOL url_uses_default_port ( INTERNET_SCHEME  nScheme,
INTERNET_PORT  nPort 
)
static

Definition at line 4171 of file internet.c.

4172{
4173 if ((nScheme == INTERNET_SCHEME_HTTP) &&
4174 (nPort == INTERNET_DEFAULT_HTTP_PORT))
4175 return TRUE;
4176 if ((nScheme == INTERNET_SCHEME_HTTPS) &&
4177 (nPort == INTERNET_DEFAULT_HTTPS_PORT))
4178 return TRUE;
4179 if ((nScheme == INTERNET_SCHEME_FTP) &&
4180 (nPort == INTERNET_DEFAULT_FTP_PORT))
4181 return TRUE;
4182 if ((nScheme == INTERNET_SCHEME_GOPHER) &&
4184 return TRUE;
4185
4186 if (nPort == INTERNET_INVALID_PORT_NUMBER)
4187 return TRUE;
4188
4189 return FALSE;
4190}
#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 169 of file internet.c.

170{
171 ULONG refs = InterlockedIncrement(&info->refs);
172 TRACE("%p -> refcount = %d\n", info, refs );
173 return info;
174}
#define InterlockedIncrement
Definition: armddk.h:53

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 211 of file internet.c.

212{
213 ULONG refs = InterlockedDecrement(&info->refs);
214 TRACE( "object %p refcount = %d\n", info, refs );
215 if( !refs )
216 {
218 if ( info->vtbl->CloseConnection )
219 {
220 TRACE( "closing connection %p\n", info);
221 info->vtbl->CloseConnection( info );
222 }
223 /* Don't send a callback if this is a session handle created with InternetOpenUrl */
224 if ((info->htype != WH_HHTTPSESSION && info->htype != WH_HFTPSESSION)
225 || !(info->dwInternalFlags & INET_OPENURL))
226 {
227 INTERNET_SendCallback(info, info->dwContext,
229 sizeof(HINTERNET));
230 }
231 TRACE( "destroying object %p\n", info);
232 if ( info->htype != WH_HINIT )
233 list_remove( &info->entry );
234 info->vtbl->Destroy( info );
235
236 if(info->hInternet) {
237 UINT_PTR handle = (UINT_PTR)info->hInternet;
238
240
242 if(next_handle > handle)
244
246 }
247
249 }
250 return TRUE;
251}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
@ WH_HHTTPSESSION
Definition: internet.h:237
@ WH_HFTPSESSION
Definition: internet.h:235
VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext, DWORD dwInternetStatus, LPVOID lpvStatusInfo, DWORD dwStatusInfoLength) DECLSPEC_HIDDEN
#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(), 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:931

Definition at line 958 of file internet.c.

Referenced by InternetOpenW().

◆ connect_timeout

ULONG connect_timeout = 60000
static

◆ g_dwTlsErrIndex

◆ global_proxy

proxyinfo_t* global_proxy
static

Definition at line 478 of file internet.c.

Referenced by free_global_proxy(), INTERNET_LoadProxySettings(), and InternetSetOptionW().

◆ handle_table

Definition at line 84 of file internet.c.

◆ handle_table_size

UINT_PTR handle_table_size
static

Definition at line 86 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 97 of file internet.c.

Referenced by query_global_option(), and set_global_option().

◆ max_conns

ULONG max_conns = 2
static

Definition at line 97 of file internet.c.

Referenced by query_global_option(), and set_global_option().

◆ next_handle

UINT_PTR next_handle
static

Definition at line 85 of file internet.c.

Referenced by alloc_object(), and WININET_Release().

◆ szInternetSettings

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

Definition at line 100 of file internet.c.

Referenced by INTERNET_LoadProxySettings(), INTERNET_SaveProxySettings(), and r_verifyProxyEnable().

◆ 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 1575 of file internet.c.

Referenced by GetInternetSchemeW(), and INTERNET_GetSchemeString().

◆ WININET_cs

static CRITICAL_SECTION WININET_cs = { &WININET_cs_debug, -1, 0, 0, 0, 0 }
static

◆ 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:76

Definition at line 76 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 3293 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 3290 of file internet.c.

Referenced by InternetTimeFromSystemTimeW(), and InternetTimeToSystemTimeW().

◆ zone_preference

DWORD zone_preference = 3
static

Definition at line 4569 of file internet.c.

Referenced by PrivacyGetZonePreferenceW(), and PrivacySetZonePreferenceW().