urlmon: Use CoInternetCombineUrl in URLMonikerImpl_Construct.
This commit is contained in:
parent
4bc3b16b44
commit
0d57265a16
|
@ -1065,29 +1065,19 @@ static HRESULT URLMonikerImpl_Construct(URLMonikerImpl* This, LPCOLESTR lpszLeft
|
||||||
DWORD sizeStr = INTERNET_MAX_URL_LENGTH;
|
DWORD sizeStr = INTERNET_MAX_URL_LENGTH;
|
||||||
|
|
||||||
TRACE("(%p,%s,%s)\n",This,debugstr_w(lpszLeftURLName),debugstr_w(lpszURLName));
|
TRACE("(%p,%s,%s)\n",This,debugstr_w(lpszLeftURLName),debugstr_w(lpszURLName));
|
||||||
memset(This, 0, sizeof(*This));
|
|
||||||
|
|
||||||
/* Initialize the virtual function table. */
|
|
||||||
This->lpvtbl = &VT_URLMonikerImpl;
|
This->lpvtbl = &VT_URLMonikerImpl;
|
||||||
This->ref = 0;
|
This->ref = 0;
|
||||||
|
|
||||||
if(lpszLeftURLName) {
|
sizeStr = lstrlenW(lpszURLName)+1;
|
||||||
hres = UrlCombineW(lpszLeftURLName, lpszURLName, NULL, &sizeStr, 0);
|
if(lpszLeftURLName)
|
||||||
if(FAILED(hres)) {
|
sizeStr += strlenW(lpszLeftURLName)+32;
|
||||||
return hres;
|
|
||||||
}
|
|
||||||
sizeStr++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
sizeStr = lstrlenW(lpszURLName)+1;
|
|
||||||
|
|
||||||
This->URLName=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(sizeStr));
|
This->URLName = HeapAlloc(GetProcessHeap(), 0, sizeStr*sizeof(WCHAR));
|
||||||
|
|
||||||
if (This->URLName==NULL)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
|
|
||||||
if(lpszLeftURLName) {
|
if(lpszLeftURLName) {
|
||||||
hres = UrlCombineW(lpszLeftURLName, lpszURLName, This->URLName, &sizeStr, 0);
|
hres = CoInternetCombineUrl(lpszLeftURLName, lpszURLName, 0, This->URLName, sizeStr,
|
||||||
|
&sizeStr, 0);
|
||||||
if(FAILED(hres)) {
|
if(FAILED(hres)) {
|
||||||
HeapFree(GetProcessHeap(), 0, This->URLName);
|
HeapFree(GetProcessHeap(), 0, This->URLName);
|
||||||
return hres;
|
return hres;
|
||||||
|
|
Loading…
Reference in New Issue