Fix handling of pmkContext in CreateURLMoniker.

This commit is contained in:
Jacek Caban 2005-07-03 11:20:28 +00:00 committed by Alexandre Julliard
parent 9111d07db7
commit 608bdc6025
1 changed files with 5 additions and 4 deletions

View File

@ -1255,11 +1255,12 @@ HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
if(pmkContext) { if(pmkContext) {
CLSID clsid;
IBindCtx* bind; IBindCtx* bind;
IMoniker_GetClassID(pmkContext, &clsid); DWORD dwMksys = 0;
if(IsEqualCLSID(&clsid, &CLSID_StdURLMoniker) && SUCCEEDED(CreateBindCtx(0, &bind))) { IMoniker_IsSystemMoniker(pmkContext, &dwMksys);
URLMonikerImpl_GetDisplayName(pmkContext, bind, NULL, &lefturl); if(dwMksys == MKSYS_URLMONIKER && SUCCEEDED(CreateBindCtx(0, &bind))) {
IMoniker_GetDisplayName(pmkContext, bind, NULL, &lefturl);
TRACE("lefturl = %s\n", debugstr_w(lefturl));
IBindCtx_Release(bind); IBindCtx_Release(bind);
} }
} }