- Sync urlmon with Wine head
authorDmitry Chapyshev <dmitry@reactos.org>
Sun, 11 Jan 2009 19:04:02 +0000 (19:04 +0000)
committerDmitry Chapyshev <dmitry@reactos.org>
Sun, 11 Jan 2009 19:04:02 +0000 (19:04 +0000)
svn path=/trunk/; revision=38707

reactos/dll/win32/urlmon/bindctx.c
reactos/dll/win32/urlmon/binding.c
reactos/dll/win32/urlmon/file.c
reactos/dll/win32/urlmon/http.c
reactos/dll/win32/urlmon/regsvr.c
reactos/dll/win32/urlmon/umon.c
reactos/dll/win32/urlmon/umstream.c
reactos/dll/win32/urlmon/urlmon.spec
reactos/dll/win32/urlmon/urlmon_main.c

index 328254c..044b817 100644 (file)
@@ -511,7 +511,8 @@ HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pb
     hres = IBindCtx_RegisterObjectParam(pbc, BSCBHolder, (IUnknown*)bsc);
     IBindStatusCallback_Release(bsc);
     if(FAILED(hres)) {
-        IBindStatusCallback_Release(prev);
+        if(prev)
+            IBindStatusCallback_Release(prev);
         return hres;
     }
 
index 47b521c..e0f0085 100644 (file)
@@ -1532,7 +1532,8 @@ static BOOL is_urlmon_protocol(LPCWSTR url)
         {wszMk,     sizeof(wszMk)    /sizeof(WCHAR)}
     };
 
-    int i, len = strlenW(url);
+    unsigned int i;
+    int len = lstrlenW(url);
 
     for(i=0; i < sizeof(protocol_list)/sizeof(protocol_list[0]); i++) {
         if(len >= protocol_list[i].len
index dda1dd0..8b5a229 100644 (file)
@@ -109,7 +109,7 @@ static HRESULT WINAPI FileProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
     TRACE("(%p)->(%s %p %p %08x %d)\n", This, debugstr_w(szUrl), pOIProtSink,
             pOIBindInfo, grfPI, dwReserved);
 
-    if(!szUrl || lstrlenW(szUrl) < sizeof(wszFile)/sizeof(WCHAR)
+    if(!szUrl || strlenW(szUrl) < sizeof(wszFile)/sizeof(WCHAR)
             || memcmp(szUrl, wszFile, sizeof(wszFile)))
         return E_INVALIDARG;
 
index ede6f14..20e90ed 100644 (file)
@@ -330,7 +330,7 @@ static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
         goto done;
     }
 
-    if (lstrlenW(szUrl) < sizeof(wszHttp)/sizeof(WCHAR)
+    if (strlenW(szUrl) < sizeof(wszHttp)/sizeof(WCHAR)
         || memcmp(szUrl, wszHttp, sizeof(wszHttp)))
     {
         hres = MK_E_SYNTAX;
@@ -397,7 +397,7 @@ static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
     InternetSetStatusCallbackW(This->internet, HTTPPROTOCOL_InternetStatusCallback);
 
     This->connect = InternetConnectW(This->internet, host, url.nPort, user,
-                                     pass, INTERNET_SERVICE_HTTP, 0, (DWORD)This);
+                                     pass, INTERNET_SERVICE_HTTP, 0, (DWORD_PTR)This);
     if (!This->connect)
     {
         WARN("InternetConnect failed: %d\n", GetLastError());
@@ -425,7 +425,7 @@ static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
                                      wszBindVerb[This->bind_info.dwBindVerb] :
                                      This->bind_info.szCustomVerb,
                                      path, NULL, NULL, (LPCWSTR *)accept_mimes,
-                                     request_flags, (DWORD)This);
+                                     request_flags, (DWORD_PTR)This);
     if (!This->request)
     {
         WARN("HttpOpenRequest failed: %d\n", GetLastError());
index ece1915..2728ced 100644 (file)
@@ -26,6 +26,7 @@
 #include "advpub.h"
 
 #include "wine/debug.h"
+#include "wine/unicode.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
 
@@ -152,7 +153,7 @@ static HRESULT register_interfaces(struct regsvr_interface const *list)
                                  KEY_READ | KEY_WRITE, NULL, &key, NULL);
            if (res != ERROR_SUCCESS) goto error_close_iid_key;
 
-           wsprintfW(buf, fmt, list->num_methods);
+           sprintfW(buf, fmt, list->num_methods);
            res = RegSetValueExW(key, NULL, 0, REG_SZ,
                                 (CONST BYTE*)buf,
                                 (lstrlenW(buf) + 1) * sizeof(WCHAR));
@@ -526,7 +527,7 @@ static HRESULT register_inf(BOOL doregister)
     STRTABLEA strtable;
     STRENTRYA pse[7];
     static CLSID const *clsids[34];
-    int i = 0;
+    unsigned int i = 0;
 
     static const WCHAR wszAdvpack[] = {'a','d','v','p','a','c','k','.','d','l','l',0};
 
index d6a4242..01266dd 100644 (file)
@@ -237,7 +237,7 @@ static void Binding_FinishedDownload(Binding *This, HRESULT hr)
     IBindStatusCallback_OnProgress(This->pbscb, This->total_read, This->expected_size,
                                    BINDSTATUS_ENDDOWNLOADDATA, This->URLName);
     IBindStatusCallback_OnDataAvailable(This->pbscb, BSCF_LASTDATANOTIFICATION, This->total_read, &fmt, &stg);
-    if (hr)
+    if (hr != S_OK)
     {
        WCHAR *pwchError = 0;
 
@@ -606,7 +606,7 @@ static HRESULT URLMonikerImpl_BindToStorage_hack(LPCWSTR URLName, IBindCtx* pbc,
                     }
 
                     bind->hconnect = InternetConnectW(bind->hinternet, host, url.nPort, user, pass,
-                                                      dwService, 0, (DWORD)bind);
+                                                      dwService, 0, (DWORD_PTR)bind);
                     if (!bind->hconnect)
                     {
                             hres = HRESULT_FROM_WIN32(GetLastError());
@@ -650,7 +650,7 @@ static HRESULT URLMonikerImpl_BindToStorage_hack(LPCWSTR URLName, IBindCtx* pbc,
                         break;
 
                     case INTERNET_SERVICE_HTTP:
-                        bind->hrequest = HttpOpenRequestW(bind->hconnect, NULL, path, NULL, NULL, NULL, 0, (DWORD)bind);
+                        bind->hrequest = HttpOpenRequestW(bind->hconnect, NULL, path, NULL, NULL, NULL, 0, (DWORD_PTR)bind);
                         if (!bind->hrequest)
                         {
                                 hres = HRESULT_FROM_WIN32(GetLastError());
@@ -1273,7 +1273,7 @@ HRESULT WINAPI URLDownloadToCacheFileW(LPUNKNOWN lpUnkCaller, LPCWSTR szURL, LPW
                               header, sizeof(header), NULL, NULL))
         return E_FAIL;
 
-    if (lstrlenW(cache_path) > dwBufLength)
+    if (strlenW(cache_path) > dwBufLength)
         return E_OUTOFMEMORY;
 
     lstrcpyW(szFileName, cache_path);
index 7523781..48cc769 100644 (file)
@@ -61,11 +61,11 @@ HRESULT UMCreateStreamOnCacheFile(LPCWSTR pszURL,
     if(!CreateUrlCacheEntryW(url, dwSize, ext, pszFileName, 0))
        hr = HRESULT_FROM_WIN32(GetLastError());
     else
-       hr = 0;
+       hr = S_OK;
 
     heap_free(url);
 
-    if (hr)
+    if (hr != S_OK)
        return hr;
 
     TRACE("Opening %s\n", debugstr_w(pszFileName) );
index 0f3c9c2..2001f0b 100644 (file)
@@ -51,8 +51,8 @@
 @ stub HlinkSimpleNavigateToMoniker
 @ stdcall HlinkSimpleNavigateToString(wstr wstr wstr ptr ptr ptr long long)
 @ stdcall IsAsyncMoniker(ptr)
-@ stub IsLoggingEnabledA
-@ stub IsLoggingEnabledW
+@ stdcall IsLoggingEnabledA(str)
+@ stdcall IsLoggingEnabledW(wstr)
 @ stdcall IsValidURL(ptr wstr long)
 @ stdcall MkParseDisplayNameEx(ptr wstr ptr ptr)
 @ stdcall ObtainUserAgentString(long str ptr)
index bc3de93..bbf58c7 100644 (file)
@@ -210,7 +210,7 @@ static const struct object_creation_info object_creation[] =
 
 static void init_session(BOOL init)
 {
-    int i;
+    unsigned int i;
 
     for(i=0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++) {
 
@@ -240,7 +240,7 @@ static void init_session(BOOL init)
 
 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 {
-    int i;
+    unsigned int i;
     
     TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
     
@@ -435,7 +435,7 @@ static BOOL text_richtext_filter(const BYTE *b, DWORD size)
 
 static BOOL text_html_filter(const BYTE *b, DWORD size)
 {
-    int i;
+    DWORD i;
 
     if(size < 5)
         return FALSE;
@@ -598,7 +598,7 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
         const BYTE *buf = pBuffer;
         DWORD len;
         LPCWSTR ret = NULL;
-        int i;
+        unsigned int i;
 
         static const WCHAR wszTextHtml[] = {'t','e','x','t','/','h','t','m','l',0};
         static const WCHAR wszTextRichtext[] = {'t','e','x','t','/','r','i','c','h','t','e','x','t',0};
@@ -767,3 +767,21 @@ HRESULT WINAPI Extract(void *dest, LPCSTR szCabName)
 
     return pExtract(dest, szCabName);
 }
+
+/***********************************************************************
+ *           IsLoggingEnabledA (URLMON.@)
+ */
+BOOL WINAPI IsLoggingEnabledA(LPCSTR url)
+{
+    FIXME("(%s)\n", debugstr_a(url));
+    return FALSE;
+}
+
+/***********************************************************************
+ *           IsLoggingEnabledW (URLMON.@)
+ */
+BOOL WINAPI IsLoggingEnabledW(LPCWSTR url)
+{
+    FIXME("(%s)\n", debugstr_w(url));
+    return FALSE;
+}