wininet: The host name is optional in InternetCreateUrlW.

This commit is contained in:
Robert Shearman 2006-03-09 15:15:00 +00:00 committed by Alexandre Julliard
parent ed90c868a9
commit 01219c65aa
1 changed files with 8 additions and 4 deletions

View File

@ -3743,7 +3743,8 @@ static BOOL calc_url_length(LPURL_COMPONENTSW lpUrlComponents,
*lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, Password); *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, Password);
} }
*lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, HostName); if (lpUrlComponents->lpszHostName)
*lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, HostName);
if (!url_uses_default_port(lpUrlComponents)) if (!url_uses_default_port(lpUrlComponents))
{ {
@ -3945,9 +3946,12 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags,
lpszUrl++; lpszUrl++;
} }
dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, HostName); if (lpUrlComponents->lpszHostName)
memcpy(lpszUrl, lpUrlComponents->lpszHostName, dwLen * sizeof(WCHAR)); {
lpszUrl += dwLen; dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, HostName);
memcpy(lpszUrl, lpUrlComponents->lpszHostName, dwLen * sizeof(WCHAR));
lpszUrl += dwLen;
}
if (!url_uses_default_port(lpUrlComponents)) if (!url_uses_default_port(lpUrlComponents))
{ {