Misha Koshelev : urlmon: Fix HttpProtocol_Start and strndupW to work properly with native wininet.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jul 12 08:32:26 CDT 2007


Module: wine
Branch: master
Commit: 213bfd27776ac453689e3bd4864f6077c3169faa
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=213bfd27776ac453689e3bd4864f6077c3169faa

Author: Misha Koshelev <mk144210 at bcm.edu>
Date:   Thu Jul 12 00:38:20 2007 -0500

urlmon: Fix HttpProtocol_Start and strndupW to work properly with native wininet.

---

 dlls/urlmon/http.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c
index c501f05..ff79334 100644
--- a/dlls/urlmon/http.c
+++ b/dlls/urlmon/http.c
@@ -190,8 +190,9 @@ static void CALLBACK HTTPPROTOCOL_InternetStatusCallback(
 
 static inline LPWSTR strndupW(LPWSTR string, int len)
 {
-    LPWSTR ret = HeapAlloc(GetProcessHeap(), 0, (len+1)*sizeof(WCHAR));
-    if (ret)
+    LPWSTR ret = NULL;
+    if (string &&
+        (ret = HeapAlloc(GetProcessHeap(), 0, (len+1)*sizeof(WCHAR))) != NULL)
     {
         memcpy(ret, string, len*sizeof(WCHAR));
         ret[len] = 0;
@@ -304,7 +305,7 @@ static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
     url.dwStructSize = sizeof(url);
     url.dwSchemeLength = url.dwHostNameLength = url.dwUrlPathLength = url.dwUserNameLength =
         url.dwPasswordLength = 1;
-    if (!InternetCrackUrlW(szUrl, 0, ICU_ESCAPE, &url))
+    if (!InternetCrackUrlW(szUrl, 0, 0, &url))
     {
         hres = MK_E_SYNTAX;
         goto done;




More information about the wine-cvs mailing list