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

This commit is contained in:
Misha Koshelev 2007-07-12 00:38:20 -05:00 committed by Alexandre Julliard
parent efdee19d90
commit 213bfd2777
1 changed files with 4 additions and 3 deletions

View File

@ -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;