Jacek Caban : urlmon: Use CoInternetCombineUrl in
URLMonikerImpl_Construct.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Jan 11 14:34:28 CST 2006
Module: wine
Branch: refs/heads/master
Commit: 0d57265a164038e2d293d8ac26a6af069a5bed2f
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=0d57265a164038e2d293d8ac26a6af069a5bed2f
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Jan 11 20:55:51 2006 +0100
urlmon: Use CoInternetCombineUrl in URLMonikerImpl_Construct.
---
dlls/urlmon/umon.c | 22 ++++++----------------
1 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/dlls/urlmon/umon.c b/dlls/urlmon/umon.c
index affcdfa..03ddefc 100644
--- a/dlls/urlmon/umon.c
+++ b/dlls/urlmon/umon.c
@@ -1065,29 +1065,19 @@ static HRESULT URLMonikerImpl_Construct(
DWORD sizeStr = INTERNET_MAX_URL_LENGTH;
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->ref = 0;
- if(lpszLeftURLName) {
- hres = UrlCombineW(lpszLeftURLName, lpszURLName, NULL, &sizeStr, 0);
- if(FAILED(hres)) {
- return hres;
- }
- sizeStr++;
- }
- else
- sizeStr = lstrlenW(lpszURLName)+1;
-
- This->URLName=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(sizeStr));
+ sizeStr = lstrlenW(lpszURLName)+1;
+ if(lpszLeftURLName)
+ sizeStr += strlenW(lpszLeftURLName)+32;
- if (This->URLName==NULL)
- return E_OUTOFMEMORY;
+ This->URLName = HeapAlloc(GetProcessHeap(), 0, sizeStr*sizeof(WCHAR));
if(lpszLeftURLName) {
- hres = UrlCombineW(lpszLeftURLName, lpszURLName, This->URLName, &sizeStr, 0);
+ hres = CoInternetCombineUrl(lpszLeftURLName, lpszURLName, 0, This->URLName, sizeStr,
+ &sizeStr, 0);
if(FAILED(hres)) {
HeapFree(GetProcessHeap(), 0, This->URLName);
return hres;
More information about the wine-cvs
mailing list