wine/dlls/urlmon umon.c

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 14 05:22:01 CST 2005


ChangeSet ID:	21243
CVSROOT:	/opt/cvs-commit
Module name:	wine
Changes by:	julliard at winehq.org	2005/11/14 05:22:01

Modified files:
	dlls/urlmon    : umon.c 

Log message:
	Jacek Caban <jack at itma.pwr.wroc.pl>
	Move BindToStorage hack to the separated function.

Patch: http://cvs.winehq.org/patch.py?id=21243

Old revision  New revision  Changes     Path
 1.66          1.67          +37 -4      wine/dlls/urlmon/umon.c

Index: wine/dlls/urlmon/umon.c
diff -u -p wine/dlls/urlmon/umon.c:1.66 wine/dlls/urlmon/umon.c:1.67
--- wine/dlls/urlmon/umon.c:1.66	14 Nov 2005 11:22: 1 -0000
+++ wine/dlls/urlmon/umon.c	14 Nov 2005 11:22: 1 -0000
@@ -547,13 +547,12 @@ static void CALLBACK URLMON_InternetCall
 /******************************************************************************
  *        URLMoniker_BindToStorage
  ******************************************************************************/
-static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
+static HRESULT URLMonikerImpl_BindToStorage_hack(LPCWSTR URLName,
 						   IBindCtx* pbc,
 						   IMoniker* pmkToLeft,
 						   REFIID riid,
 						   VOID** ppvObject)
 {
-    URLMonikerImpl *This = (URLMonikerImpl *)iface;
     HRESULT hres;
     BINDINFO bi;
     DWORD bindf;
@@ -561,6 +560,9 @@ static HRESULT WINAPI URLMonikerImpl_Bin
     Binding *bind;
     int len;
 
+    WARN("(%s %p %p %s %p)\n", debugstr_w(URLName), pbc, pmkToLeft, debugstr_guid(riid),
+            ppvObject);
+
     if(pmkToLeft) {
 	FIXME("pmkToLeft != NULL\n");
 	return E_NOTIMPL;
@@ -575,9 +577,9 @@ static HRESULT WINAPI URLMonikerImpl_Bin
     bind->ref = 1;
     URLMON_LockModule();
 
-    len = lstrlenW(This->URLName)+1;
+    len = lstrlenW(URLName)+1;
     bind->URLName = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
-    memcpy(bind->URLName, This->URLName, len*sizeof(WCHAR));
+    memcpy(bind->URLName, URLName, len*sizeof(WCHAR));
 
     hres = UMCreateStreamOnCacheFile(bind->URLName, 0, szFileName, &bind->hCacheFile, &bind->pstrCache);
 
@@ -855,6 +857,37 @@ static HRESULT WINAPI URLMonikerImpl_Bin
     return hres;
 }
 
+static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
+                                                   IBindCtx* pbc,
+						   IMoniker* pmkToLeft,
+						   REFIID riid,
+						   VOID** ppvObject)
+{
+    URLMonikerImpl *This = (URLMonikerImpl*)iface;
+    WCHAR schema[64];
+    BOOL bret;
+
+    URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW), schema,
+        sizeof(schema)/sizeof(WCHAR), 0, NULL, 0, 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0};
+
+    bret = InternetCrackUrlW(This->URLName, 0, ICU_ESCAPE, &url);
+    if(!bret) {
+        ERR("InternetCrackUrl failed: %ld\n", GetLastError());
+        return E_FAIL;
+    }
+
+    if(url.nScheme == INTERNET_SCHEME_HTTP
+       || url.nScheme== INTERNET_SCHEME_HTTPS
+       || url.nScheme== INTERNET_SCHEME_FTP
+       || url.nScheme == INTERNET_SCHEME_GOPHER
+       || url.nScheme == INTERNET_SCHEME_FILE)
+        return URLMonikerImpl_BindToStorage_hack(This->URLName, pbc, pmkToLeft, riid, ppvObject);
+
+    FIXME("(%p)->(%p %p %s %p)\n", This, pbc, pmkToLeft, debugstr_guid(riid), ppvObject);
+
+    return E_NOTIMPL;
+}
+
 /******************************************************************************
  *        URLMoniker_Reduce
  ******************************************************************************/



More information about the wine-cvs mailing list