51 0, 0, { (
DWORD_PTR)(__FILE__
": session") }
56 {
'S',
'O',
'F',
'T',
'W',
'A',
'R',
'E',
57 '\\',
'M',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
58 '\\',
'W',
'i',
'n',
'd',
'o',
'w',
's',
59 '\\',
'C',
'u',
'r',
'r',
'e',
'n',
't',
'V',
'e',
'r',
's',
'i',
'o',
'n',
60 '\\',
'I',
'n',
't',
'e',
'r',
'n',
'e',
't',
' ',
'S',
'e',
't',
't',
'i',
'n',
'g',
's',0};
83 static const WCHAR wszProtocolsKey[] =
84 {
'P',
'R',
'O',
'T',
'O',
'C',
'O',
'L',
'S',
'\\',
'H',
'a',
'n',
'd',
'l',
'e',
'r',
'\\'};
85 static const WCHAR wszCLSID[] = {
'C',
'L',
'S',
'I',
'D',0};
87 wszKey =
heap_alloc(
sizeof(wszProtocolsKey)+(schema_len+1)*
sizeof(
WCHAR));
88 memcpy(wszKey, wszProtocolsKey,
sizeof(wszProtocolsKey));
94 TRACE(
"Could not open protocol handler key\n");
98 size =
sizeof(str_clsid);
102 WARN(
"Could not get protocol CLSID res=%d\n",
res);
108 WARN(
"CLSIDFromString failed: %08x\n",
hres);
129 IClassFactory_AddRef(
cf);
130 new_name_space->
cf =
cf;
132 new_name_space->
urlmon = urlmon_protocol;
157 IClassFactory_Release(iter->
cf);
197 if(
ns && !
ns->urlmon) {
198 hres = IClassFactory_QueryInterface(
ns->cf, &IID_IInternetProtocolInfo, (
void**)&
ret);
200 hres = IClassFactory_CreateInstance(
ns->cf,
NULL, &IID_IInternetProtocolInfo, (
void**)&
ret);
212 hres = IClassFactory_QueryInterface(
cf, &IID_IInternetProtocolInfo, (
void**)&
ret);
214 IClassFactory_CreateInstance(
cf,
NULL, &IID_IInternetProtocolInfo, (
void**)&
ret);
215 IClassFactory_Release(
cf);
238 IClassFactory_AddRef(*
ret);
252 static const WCHAR filtersW[] = {
'P',
'r',
'o',
't',
'o',
'c',
'o',
'l',
's',
253 '\\',
'F',
'i',
'l',
't',
'e',
'r',0 };
254 static const WCHAR CLSIDW[] = {
'C',
'L',
'S',
'I',
'D',0};
277 hres = IClassFactory_CreateInstance(
cf,
NULL, &IID_IInternetProtocol, (
void**)&
ret);
279 WARN(
"CreateInstance failed: %08x\n",
hres);
288 TRACE(
"Could not open MIME filters key\n");
297 size =
sizeof(clsidw);
313 WARN(
"CoCreateInstance failed: %08x\n",
hres);
327 IInternetSession_AddRef(iface);
356 if(cPatterns || ppwzPatterns)
357 FIXME(
"patterns not supported\n");
361 if(!pCF || !pwzProtocol)
372 if(!pCF || !pszProtocol)
387 IClassFactory_AddRef(pCF);
416 IClassFactory_Release(iter->
cf);
434 TRACE(
"(%p %s %p %p %p %08x)\n", pBC,
debugstr_w(szUrl), pUnkOuter, ppUnk,
435 ppOInetProt, dwOption);
437 if(pBC || pUnkOuter || ppUnk || dwOption)
438 FIXME(
"Unsupported arguments\n");
491 ERR(
"dwSessionMode=%d\n", dwSessionMode);
508 static const WCHAR wszUrlEncoding[] = {
'U',
'r',
'l',
'E',
'n',
'c',
'o',
'd',
'i',
'n',
'g',0};
525 const WCHAR *os_type, *is_nt;
532 static const WCHAR formatW[] =
533 {
'M',
'o',
'z',
'i',
'l',
'l',
'a',
'/',
'4',
'.',
'0',
534 ' ',
'(',
'c',
'o',
'm',
'p',
'a',
't',
'i',
'b',
'l',
'e',
';',
535 ' ',
'M',
'S',
'I',
'E',
' ',
'8',
'.',
'0',
';',
536 ' ',
'W',
'i',
'n',
'd',
'o',
'w',
's',
' ',
'%',
's',
'%',
'd',
'.',
'%',
'd',
';',
537 ' ',
'%',
's',
'T',
'r',
'i',
'd',
'e',
'n',
't',
'/',
'5',
'.',
'0',0};
538 static const WCHAR post_platform_keyW[] =
539 {
'S',
'O',
'F',
'T',
'W',
'A',
'R',
'E',
540 '\\',
'M',
'i',
'c',
'r',
'o',
's',
'o',
'f',
't',
541 '\\',
'W',
'i',
'n',
'd',
'o',
'w',
's',
542 '\\',
'C',
'u',
'r',
'r',
'e',
'n',
't',
'V',
'e',
'r',
's',
'i',
'o',
'n',
543 '\\',
'I',
'n',
't',
'e',
'r',
'n',
'e',
't',
' ',
'S',
'e',
't',
't',
'i',
'n',
'g',
's',
544 '\\',
'5',
'.',
'0',
'\\',
'U',
's',
'e',
'r',
' ',
'A',
'g',
'e',
'n',
't',
545 '\\',
'P',
'o',
's',
't',
' ',
'P',
'l',
'a',
't',
'f',
'o',
'r',
'm',0};
546 static const WCHAR ntW[] = {
'N',
'T',
' ',0};
547 static const WCHAR win64W[] = {
'W',
'i',
'n',
'6',
'4',
';',
' ',
'x',
'6',
'4',
';',
' ',0};
548 static const WCHAR wow64W[] = {
'W',
'O',
'W',
'6',
'4',
';',
' ',0};
557 if(
sizeof(
void*) == 8)
585 if(
len + value_len + 2 + 1 >=
size) {
625 TRACE(
"(%x, %p, %d, %p)\n", dwOption,
pBuffer, dwBufferLength, pdwBufferLength);
631 case URLMON_OPTION_USERAGENT: {
643 *pdwBufferLength =
size;
644 if(
size <= dwBufferLength) {
657 case URLMON_OPTION_URL_ENCODING: {
660 if(!
pBuffer || dwBufferLength <
sizeof(
DWORD) || !pdwBufferLength)
666 *pdwBufferLength =
sizeof(
DWORD);
671 FIXME(
"unsupported option %x\n", dwOption);
683 TRACE(
"(%x %p %x)\n", dwOption,
pBuffer, dwBufferLength);
686 case URLMON_OPTION_USERAGENT: {
691 if(!
pBuffer || !dwBufferLength)
703 new_user_agent[
size] = 0;
715 FIXME(
"Unknown option %x\n", dwOption);
730 TRACE(
"(%d %p %p)\n", dwOption, pcszUAOut, cbSize);
732 if(!pcszUAOut || !cbSize)
741 if(
size <= *cbSize) {
762 IClassFactory_Release(ns_iter->
cf);
768 IClassFactory_Release(mf_iter->
cf);
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
static void * heap_realloc(void *mem, size_t len)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_remove(struct list_entry *entry)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
const GUID IID_IClassFactory
HRESULT create_binding_protocol(BindProtocol **protocol)
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
static WCHAR * heap_strdupW(const WCHAR *str)
static __inline const char * debugstr_an(const char *s, int n)
#define GetCurrentProcess()
#define WideCharToMultiByte
#define MultiByteToWideChar
BOOL WINAPI GetVersionExW(IN LPOSVERSIONINFOW lpVersionInformation)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI DECLSPEC_HOTPATCH CoGetClassObject(REFCLSID rclsid, DWORD dwClsContext, COSERVERINFO *pServerInfo, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
HRESULT WINAPI CoInternetParseUrl(LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD dwFlags, LPWSTR pszResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
void update_user_agent(WCHAR *user_agent)
static HRESULT WINAPI InternetSession_CreateBinding(IInternetSession *iface, LPBC pBC, LPCWSTR szUrl, IUnknown *pUnkOuter, IUnknown **ppUnk, IInternetProtocol **ppOInetProt, DWORD dwOption)
static name_space * find_name_space(LPCWSTR protocol)
static HRESULT get_protocol_cf(LPCWSTR schema, DWORD schema_len, CLSID *pclsid, IClassFactory **ret)
HRESULT WINAPI UrlMkGetSessionOption(DWORD dwOption, LPVOID pBuffer, DWORD dwBufferLength, DWORD *pdwBufferLength, DWORD dwReserved)
HRESULT WINAPI ObtainUserAgentString(DWORD dwOption, LPSTR pcszUAOut, DWORD *cbSize)
static HRESULT WINAPI InternetSession_QueryInterface(IInternetSession *iface, REFIID riid, void **ppv)
static CRITICAL_SECTION session_cs
IInternetProtocol * get_mime_filter(LPCWSTR mime)
static void ensure_useragent(void)
HRESULT get_protocol_handler(IUri *uri, CLSID *clsid, IClassFactory **ret)
static ULONG WINAPI InternetSession_AddRef(IInternetSession *iface)
static CRITICAL_SECTION_DEBUG session_cs_dbg
static BOOL get_url_encoding(HKEY root, DWORD *encoding)
static const WCHAR internet_settings_keyW[]
static HRESULT WINAPI InternetSession_UnregisterMimeFilter(IInternetSession *iface, IClassFactory *pCF, LPCWSTR pwzType)
static HRESULT WINAPI InternetSession_RegisterMimeFilter(IInternetSession *iface, IClassFactory *pCF, REFCLSID rclsid, LPCWSTR pwzType)
LPWSTR get_useragent(void)
BOOL is_registered_protocol(LPCWSTR url)
static struct list name_space_list
static struct list mime_filter_list
IInternetProtocolInfo * get_protocol_info(LPCWSTR url)
HRESULT WINAPI CoInternetGetSession(DWORD dwSessionMode, IInternetSession **ppIInternetSession, DWORD dwReserved)
static HRESULT unregister_namespace(IClassFactory *cf, LPCWSTR protocol)
static HRESULT WINAPI InternetSession_SetSessionOption(IInternetSession *iface, DWORD dwOption, LPVOID pBuffer, DWORD dwBufferLength, DWORD dwReserved)
static ULONG WINAPI InternetSession_Release(IInternetSession *iface)
static IInternetSession InternetSession
static HRESULT WINAPI InternetSession_UnregisterNameSpace(IInternetSession *iface, IClassFactory *pCF, LPCWSTR pszProtocol)
static HRESULT WINAPI InternetSession_RegisterNameSpace(IInternetSession *iface, IClassFactory *pCF, REFCLSID rclsid, LPCWSTR pwzProtocol, ULONG cPatterns, const LPCWSTR *ppwzPatterns, DWORD dwReserved)
HRESULT WINAPI UrlMkSetSessionOption(DWORD dwOption, LPVOID pBuffer, DWORD dwBufferLength, DWORD Reserved)
HRESULT register_namespace(IClassFactory *cf, REFIID clsid, LPCWSTR protocol, BOOL urlmon_protocol)
static const IInternetSessionVtbl InternetSessionVtbl
GLuint GLuint GLsizei GLenum type
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
static const WCHAR emptyW[]
#define memcpy(s1, s2, n)
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
#define VER_PLATFORM_WIN32_NT
interface IBindCtx * LPBC
UINT WINAPI SysStringLen(BSTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
#define IsEqualGUID(rguid1, rguid2)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
LIST_ENTRY ProcessLocksList
static void URLMON_LockModule(void)
static void URLMON_UnlockModule(void)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
_Reserved_ PVOID Reserved
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER
#define HKEY_CLASSES_ROOT