Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 3856 of file internet.c.
Referenced by InternetCreateUrlW().
{ INTERNET_SCHEME nScheme; *lpdwUrlLength = 0; if (lpUrlComponents->lpszScheme) { DWORD dwLen = URL_GET_COMP_LENGTH(lpUrlComponents, Scheme); *lpdwUrlLength += dwLen; nScheme = GetInternetSchemeW(lpUrlComponents->lpszScheme, dwLen); } else { LPCWSTR scheme; nScheme = lpUrlComponents->nScheme; if (nScheme == INTERNET_SCHEME_DEFAULT) nScheme = INTERNET_SCHEME_HTTP; scheme = INTERNET_GetSchemeString(nScheme); *lpdwUrlLength += strlenW(scheme); } (*lpdwUrlLength)++; /* ':' */ if (!scheme_is_opaque(nScheme) || lpUrlComponents->lpszHostName) *lpdwUrlLength += strlen("//"); if (lpUrlComponents->lpszUserName) { *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, UserName); *lpdwUrlLength += strlen("@"); } else { if (lpUrlComponents->lpszPassword) { INTERNET_SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } } if (lpUrlComponents->lpszPassword) { *lpdwUrlLength += strlen(":"); *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, Password); } if (lpUrlComponents->lpszHostName) { *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, HostName); if (!url_uses_default_port(nScheme, lpUrlComponents->nPort)) { char szPort[MAX_WORD_DIGITS+1]; sprintf(szPort, "%d", lpUrlComponents->nPort); *lpdwUrlLength += strlen(szPort); *lpdwUrlLength += strlen(":"); } if (lpUrlComponents->lpszUrlPath && *lpUrlComponents->lpszUrlPath != '/') (*lpdwUrlLength)++; /* '/' */ } if (lpUrlComponents->lpszUrlPath) *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, UrlPath); if (lpUrlComponents->lpszExtraInfo) *lpdwUrlLength += URL_GET_COMP_LENGTH(lpUrlComponents, ExtraInfo); return TRUE; }