Author: akhaldi
Date: Thu Apr 9 12:42:05 2015
New Revision: 67113
URL:
http://svn.reactos.org/svn/reactos?rev=67113&view=rev
Log:
[URLMON] Sync with Wine Staging 1.7.37. CORE-9246
Removed:
trunk/reactos/dll/win32/urlmon/urlmon_ros.diff
Modified:
trunk/reactos/dll/win32/urlmon/CMakeLists.txt
trunk/reactos/dll/win32/urlmon/bindprot.c
trunk/reactos/dll/win32/urlmon/file.c
trunk/reactos/dll/win32/urlmon/internet.c
trunk/reactos/dll/win32/urlmon/mimefilter.c
trunk/reactos/dll/win32/urlmon/protocol.c
trunk/reactos/dll/win32/urlmon/sec_mgr.c
trunk/reactos/dll/win32/urlmon/session.c
trunk/reactos/dll/win32/urlmon/urlmon_main.c
trunk/reactos/dll/win32/urlmon/urlmon_main.h
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/urlmon/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/CMakeList…
==============================================================================
--- trunk/reactos/dll/win32/urlmon/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/urlmon/CMakeLists.txt [iso-8859-1] Thu Apr 9 12:42:05 2015
@@ -45,6 +45,6 @@
set_module_type(urlmon win32dll)
target_link_libraries(urlmon uuid wine ${PSEH_LIB})
-add_importlibs(urlmon rpcrt4 propsys ole32 oleaut32 shlwapi shell32 wininet user32
advapi32 advpack msvcrt kernel32 ntdll)
+add_importlibs(urlmon rpcrt4 propsys ole32 oleaut32 shlwapi shell32 wininet user32
advapi32 advpack kernel32_vista msvcrt kernel32 ntdll)
add_pch(urlmon urlmon_main.h SOURCE)
add_cd_file(TARGET urlmon DESTINATION reactos/system32 FOR all)
Modified: trunk/reactos/dll/win32/urlmon/bindprot.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/bindprot.…
==============================================================================
--- trunk/reactos/dll/win32/urlmon/bindprot.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/urlmon/bindprot.c [iso-8859-1] Thu Apr 9 12:42:05 2015
@@ -80,8 +80,6 @@
return DefWindowProcW(hwnd, msg, wParam, lParam);
}
-#ifndef __REACTOS__
-
static const WCHAR wszURLMonikerNotificationWindow[] =
{'U','R','L','
','M','o','n','i','k','e','r','
',
'N','o','t','i','f','i','c','a','t','i','o','n','
','W','i','n','d','o','w',0};
@@ -107,22 +105,11 @@
UnregisterClassW(MAKEINTRESOURCEW(notif_wnd_class), hProxyDll);
}
-#endif /* !__REACTOS__ */
-
HWND get_notif_hwnd(void)
{
-#ifdef __REACTOS__
- static ATOM wnd_class = 0;
-#endif
tls_data_t *tls_data;
-#ifdef __REACTOS__
- static const WCHAR wszURLMonikerNotificationWindow[] =
- {'U','R','L','
','M','o','n','i','k','e','r','
',
-
'N','o','t','i','f','i','c','a','t','i','o','n','
','W','i','n','d','o','w',0};
-#else
static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT;
-#endif
tls_data = get_tls_data();
if(!tls_data)
@@ -133,33 +120,11 @@
return tls_data->notif_hwnd;
}
-#ifndef __REACTOS__
InitOnceExecuteOnce(&init_once, register_notif_wnd_class, NULL, NULL);
if(!notif_wnd_class)
return NULL;
-#else
- if(!wnd_class) {
- static WNDCLASSEXW wndclass = {
- sizeof(wndclass), 0,
- notif_wnd_proc, 0, 0,
- NULL, NULL, NULL, NULL, NULL,
- wszURLMonikerNotificationWindow,
- NULL
- };
-
- wndclass.hInstance = hProxyDll;
-
- wnd_class = RegisterClassExW(&wndclass);
- if (!wnd_class && GetLastError() == ERROR_CLASS_ALREADY_EXISTS)
- wnd_class = 1;
- }
-#endif
-
-#ifndef __REACTOS__
+
tls_data->notif_hwnd = CreateWindowExW(0, MAKEINTRESOURCEW(notif_wnd_class),
-#else
- tls_data->notif_hwnd = CreateWindowExW(0, wszURLMonikerNotificationWindow,
-#endif
wszURLMonikerNotificationWindow, 0, 0, 0, 0, 0, HWND_MESSAGE,
NULL, hProxyDll, NULL);
if(tls_data->notif_hwnd)
Modified: trunk/reactos/dll/win32/urlmon/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/file.c?re…
==============================================================================
--- trunk/reactos/dll/win32/urlmon/file.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/urlmon/file.c [iso-8859-1] Thu Apr 9 12:42:05 2015
@@ -245,7 +245,7 @@
DWORD scheme, size;
LPWSTR mime = NULL;
WCHAR null_char = 0;
- BSTR url;
+ BSTR ext;
HRESULT hres;
TRACE("(%p)->(%p %p %p %08x %p)\n", This, pUri, pOIProtSink,
@@ -294,17 +294,19 @@
if(FAILED(hres))
return hres;
- hres = IUri_GetDisplayUri(pUri, &url);
- if(hres == S_OK) {
- hres = FindMimeFromData(NULL, url, NULL, 0, NULL, 0, &mime, 0);
- SysFreeString(url);
- if(SUCCEEDED(hres)) {
- IInternetProtocolSink_ReportProgress(pOIProtSink,
- (grfBINDF & BINDF_FROMURLMON) ?
- BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE :
BINDSTATUS_MIMETYPEAVAILABLE,
- mime);
- CoTaskMemFree(mime);
+ hres = IUri_GetExtension(pUri, &ext);
+ if(SUCCEEDED(hres)) {
+ if(hres == S_OK && *ext) {
+ hres = find_mime_from_ext(ext, &mime);
+ if(SUCCEEDED(hres)) {
+ IInternetProtocolSink_ReportProgress(pOIProtSink,
+ (grfBINDF & BINDF_FROMURLMON) ?
+ BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE :
BINDSTATUS_MIMETYPEAVAILABLE,
+ mime);
+ CoTaskMemFree(mime);
+ }
}
+ SysFreeString(ext);
}
IInternetProtocolSink_ReportData(pOIProtSink,
Modified: trunk/reactos/dll/win32/urlmon/internet.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/internet.…
==============================================================================
--- trunk/reactos/dll/win32/urlmon/internet.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/urlmon/internet.c [iso-8859-1] Thu Apr 9 12:42:05 2015
@@ -530,10 +530,8 @@
if(feature >= FEATURE_ENTRY_COUNT)
return E_FAIL;
- if(flags & ~supported_flags) {
+ if(flags & ~supported_flags)
FIXME("Unsupported flags: %08x\n", flags & ~supported_flags);
- return E_NOTIMPL;
- }
if(flags & SET_FEATURE_ON_PROCESS)
set_feature_on_process(feature, enable);
Modified: trunk/reactos/dll/win32/urlmon/mimefilter.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/mimefilte…
==============================================================================
--- trunk/reactos/dll/win32/urlmon/mimefilter.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/urlmon/mimefilter.c [iso-8859-1] Thu Apr 9 12:42:05 2015
@@ -419,20 +419,15 @@
return TRUE;
}
-static HRESULT find_mime_from_url(const WCHAR *url, WCHAR **ret)
-{
- const WCHAR *ptr;
+HRESULT find_mime_from_ext(const WCHAR *ext, WCHAR **ret)
+{
DWORD res, size;
WCHAR mime[64];
HKEY hkey;
static const WCHAR content_typeW[] =
{'C','o','n','t','e','n','t','
','T','y','p','e','\0'};
- ptr = strrchrW(url, '.');
- if(!ptr)
- return E_FAIL;
-
- res = RegOpenKeyW(HKEY_CLASSES_ROOT, ptr, &hkey);
+ res = RegOpenKeyW(HKEY_CLASSES_ROOT, ext, &hkey);
if(res != ERROR_SUCCESS)
return HRESULT_FROM_WIN32(res);
@@ -447,6 +442,41 @@
*ret = CoTaskMemAlloc(size);
memcpy(*ret, mime, size);
return S_OK;
+}
+
+static HRESULT find_mime_from_url(const WCHAR *url, WCHAR **ret)
+{
+ const WCHAR *ptr, *end_ptr;
+ WCHAR *ext = NULL;
+ HRESULT hres;
+
+ for(end_ptr = url; *end_ptr; end_ptr++) {
+ if(*end_ptr == '?' || *end_ptr == '#')
+ break;
+ }
+
+ for(ptr = end_ptr; ptr >= url; ptr--) {
+ if(*ptr == '.')
+ break;
+ }
+
+ if(ptr < url)
+ return E_FAIL;
+
+ if(*end_ptr) {
+ unsigned len = end_ptr-ptr;
+
+ ext = heap_alloc((len+1)*sizeof(WCHAR));
+ if(!ext)
+ return E_OUTOFMEMORY;
+
+ memcpy(ext, ptr, len*sizeof(WCHAR));
+ ext[len] = 0;
+ }
+
+ hres = find_mime_from_ext(ext ? ext : ptr, ret);
+ heap_free(ext);
+ return hres;
}
static const WCHAR text_htmlW[] =
{'t','e','x','t','/','h','t','m','l',0};
Modified: trunk/reactos/dll/win32/urlmon/protocol.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/protocol.…
==============================================================================
--- trunk/reactos/dll/win32/urlmon/protocol.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/urlmon/protocol.c [iso-8859-1] Thu Apr 9 12:42:05 2015
@@ -296,6 +296,12 @@
InternetCloseHandle(new_session);
return internet_session;
+}
+
+void update_user_agent(WCHAR *user_agent)
+{
+ if(internet_session)
+ InternetSetOptionW(internet_session, INTERNET_OPTION_USER_AGENT, user_agent,
strlenW(user_agent));
}
HRESULT protocol_start(Protocol *protocol, IInternetProtocol *prot, IUri *uri,
Modified: trunk/reactos/dll/win32/urlmon/sec_mgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/sec_mgr.c…
==============================================================================
--- trunk/reactos/dll/win32/urlmon/sec_mgr.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/urlmon/sec_mgr.c [iso-8859-1] Thu Apr 9 12:42:05 2015
@@ -729,7 +729,7 @@
if(len+sizeof(DWORD) > *secid_len) {
SysFreeString(display_uri);
- return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
+ return E_NOT_SUFFICIENT_BUFFER;
}
WideCharToMultiByte(CP_ACP, 0, display_uri, -1, (LPSTR)secid, len, NULL, NULL);
@@ -765,7 +765,7 @@
if(len+sizeof(DWORD) > *secid_len) {
SysFreeString(host);
SysFreeString(scheme);
- return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
+ return E_NOT_SUFFICIENT_BUFFER;
}
WideCharToMultiByte(CP_ACP, 0, scheme, -1, (LPSTR)secid, len, NULL, NULL);
Modified: trunk/reactos/dll/win32/urlmon/session.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/session.c…
==============================================================================
--- trunk/reactos/dll/win32/urlmon/session.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/urlmon/session.c [iso-8859-1] Thu Apr 9 12:42:05 2015
@@ -713,6 +713,7 @@
heap_free(user_agent);
user_agent = new_user_agent;
+ update_user_agent(user_agent);
LeaveCriticalSection(&session_cs);
break;
Modified: trunk/reactos/dll/win32/urlmon/urlmon_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon_ma…
==============================================================================
--- trunk/reactos/dll/win32/urlmon/urlmon_main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/urlmon/urlmon_main.c [iso-8859-1] Thu Apr 9 12:42:05 2015
@@ -127,9 +127,7 @@
free_session();
free_tls_list();
-#ifndef __REACTOS__
unregister_notif_wnd_class();
-#endif
}
/***********************************************************************
Modified: trunk/reactos/dll/win32/urlmon/urlmon_main.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon_ma…
==============================================================================
--- trunk/reactos/dll/win32/urlmon/urlmon_main.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/urlmon/urlmon_main.h [iso-8859-1] Thu Apr 9 12:42:05 2015
@@ -83,8 +83,11 @@
BOOL is_registered_protocol(LPCWSTR) DECLSPEC_HIDDEN;
HRESULT register_namespace(IClassFactory*,REFIID,LPCWSTR,BOOL) DECLSPEC_HIDDEN;
HINTERNET get_internet_session(IInternetBindInfo*) DECLSPEC_HIDDEN;
-LPWSTR get_useragent(void) DECLSPEC_HIDDEN;
+WCHAR *get_useragent(void) DECLSPEC_HIDDEN;
+void update_user_agent(WCHAR*) DECLSPEC_HIDDEN;
void free_session(void) DECLSPEC_HIDDEN;
+
+HRESULT find_mime_from_ext(const WCHAR*,WCHAR**) DECLSPEC_HIDDEN;
HRESULT bind_to_storage(IUri*,IBindCtx*,REFIID,void**) DECLSPEC_HIDDEN;
HRESULT bind_to_object(IMoniker*,IUri*,IBindCtx*,REFIID,void**ppv) DECLSPEC_HIDDEN;
@@ -236,9 +239,7 @@
tls_data_t *get_tls_data(void) DECLSPEC_HIDDEN;
-#ifndef __REACTOS__
void unregister_notif_wnd_class(void) DECLSPEC_HIDDEN;
-#endif
HWND get_notif_hwnd(void) DECLSPEC_HIDDEN;
void release_notif_hwnd(HWND) DECLSPEC_HIDDEN;
Removed: trunk/reactos/dll/win32/urlmon/urlmon_ros.diff
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/urlmon/urlmon_ro…
==============================================================================
--- trunk/reactos/dll/win32/urlmon/urlmon_ros.diff [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/urlmon/urlmon_ros.diff (removed)
@@ -1,96 +0,0 @@
-diff -prudN e:\Wine\dlls\urlmon/bindprot.c e:\reactos\dll\win32\urlmon/bindprot.c
---- e:\Wine\dlls\urlmon/bindprot.c 2014-04-04 14:12:42.439519600 +0100
-+++ e:\reactos\dll\win32\urlmon/bindprot.c 2014-04-11 16:18:48.958227500 +0100
-@@ -83,36 +80,14 @@ static LRESULT WINAPI notif_wnd_proc(HWN
- return DefWindowProcW(hwnd, msg, wParam, lParam);
- }
-
--static const WCHAR wszURLMonikerNotificationWindow[] =
-- {'U','R','L','
','M','o','n','i','k','e','r','
',
--
'N','o','t','i','f','i','c','a','t','i','o','n','
','W','i','n','d','o','w',0};
--
--static ATOM notif_wnd_class;
--
--static BOOL WINAPI register_notif_wnd_class(INIT_ONCE *once, void *param, void
**context)
--{
-- static WNDCLASSEXW wndclass = {
-- sizeof(wndclass), 0, notif_wnd_proc, 0, 0,
-- NULL, NULL, NULL, NULL, NULL,
-- wszURLMonikerNotificationWindow, NULL
-- };
--
-- wndclass.hInstance = hProxyDll;
-- notif_wnd_class = RegisterClassExW(&wndclass);
-- return TRUE;
--}
--
--void unregister_notif_wnd_class(void)
--{
-- if(notif_wnd_class)
-- UnregisterClassW(MAKEINTRESOURCEW(notif_wnd_class), hProxyDll);
--}
--
- HWND get_notif_hwnd(void)
- {
-+ static ATOM wnd_class = 0;
- tls_data_t *tls_data;
-
-- static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT;
-+ static const WCHAR wszURLMonikerNotificationWindow[] =
-+ {'U','R','L','
','M','o','n','i','k','e','r','
',
-+
'N','o','t','i','f','i','c','a','t','i','o','n','
','W','i','n','d','o','w',0};
-
- tls_data = get_tls_data();
- if(!tls_data)
-@@ -123,11 +98,23 @@ HWND get_notif_hwnd(void)
- return tls_data->notif_hwnd;
- }
-
-- InitOnceExecuteOnce(&init_once, register_notif_wnd_class, NULL, NULL);
-- if(!notif_wnd_class)
-- return NULL;
-+ if(!wnd_class) {
-+ static WNDCLASSEXW wndclass = {
-+ sizeof(wndclass), 0,
-+ notif_wnd_proc, 0, 0,
-+ NULL, NULL, NULL, NULL, NULL,
-+ wszURLMonikerNotificationWindow,
-+ NULL
-+ };
-
-- tls_data->notif_hwnd = CreateWindowExW(0, MAKEINTRESOURCEW(notif_wnd_class),
-+ wndclass.hInstance = hProxyDll;
-+
-+ wnd_class = RegisterClassExW(&wndclass);
-+ if (!wnd_class && GetLastError() == ERROR_CLASS_ALREADY_EXISTS)
-+ wnd_class = 1;
-+ }
-+
-+ tls_data->notif_hwnd = CreateWindowExW(0, wszURLMonikerNotificationWindow,
- wszURLMonikerNotificationWindow, 0, 0, 0, 0, 0, HWND_MESSAGE,
- NULL, hProxyDll, NULL);
- if(tls_data->notif_hwnd)
-
-diff -prudN e:\Wine\dlls\urlmon/urlmon_main.c e:\reactos\dll\win32\urlmon/urlmon_main.c
---- e:\Wine\dlls\urlmon/urlmon_main.c 2014-04-04 14:12:42.460533100 +0100
-+++ e:\reactos\dll\win32\urlmon/urlmon_main.c 2014-04-11 16:19:12.473179000 +0100
-@@ -139,7 +127,6 @@ static void process_detach(void)
-
- free_session();
- free_tls_list();
-- unregister_notif_wnd_class();
- }
-
- /***********************************************************************
-
-diff -prudN e:\Wine\dlls\urlmon/urlmon_main.h e:\reactos\dll\win32\urlmon/urlmon_main.h
---- e:\Wine\dlls\urlmon/urlmon_main.h 2014-04-04 14:12:42.461533700 +0100
-+++ e:\reactos\dll\win32\urlmon/urlmon_main.h 2014-04-11 16:19:21.822446700 +0100
-@@ -225,7 +236,6 @@ typedef struct {
-
- tls_data_t *get_tls_data(void) DECLSPEC_HIDDEN;
-
--void unregister_notif_wnd_class(void) DECLSPEC_HIDDEN;
- HWND get_notif_hwnd(void) DECLSPEC_HIDDEN;
- void release_notif_hwnd(HWND) DECLSPEC_HIDDEN;
-
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Thu Apr 9 12:42:05 2015
@@ -201,7 +201,7 @@
reactos/dll/win32/unicows # Synced to Wine-1.3.32 (Win9x only, why do we need
this?!)
reactos/dll/win32/updspapi # Synced to Wine-1.7.27
reactos/dll/win32/url # Synced to Wine-1.7.27
-reactos/dll/win32/urlmon # Synced to Wine-1.7.27
+reactos/dll/win32/urlmon # Synced to WineStaging-1.7.37
reactos/dll/win32/usp10 # Synced to Wine-1.7.27
reactos/dll/win32/uxtheme # Forked
reactos/dll/win32/vbscript # Synced to Wine-1.7.27