comdlg32: Use proper helpers for iface calls.
This commit is contained in:
parent
7839d134e9
commit
e5e2673984
|
@ -226,26 +226,22 @@ static HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface,
|
|||
|
||||
*ppvObj = NULL;
|
||||
|
||||
if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/
|
||||
{ *ppvObj = This;
|
||||
}
|
||||
else if(IsEqualIID(riid, &IID_IOleWindow)) /*IOleWindow*/
|
||||
{ *ppvObj = This;
|
||||
}
|
||||
|
||||
else if(IsEqualIID(riid, &IID_IShellBrowser)) /*IShellBrowser*/
|
||||
{ *ppvObj = This;
|
||||
}
|
||||
|
||||
else if(IsEqualIID(riid, &IID_ICommDlgBrowser)) /*ICommDlgBrowser*/
|
||||
if(IsEqualIID(riid, &IID_IUnknown))
|
||||
*ppvObj = &This->IShellBrowser_iface;
|
||||
else if(IsEqualIID(riid, &IID_IOleWindow))
|
||||
*ppvObj = &This->IShellBrowser_iface;
|
||||
else if(IsEqualIID(riid, &IID_IShellBrowser))
|
||||
*ppvObj = &This->IShellBrowser_iface;
|
||||
else if(IsEqualIID(riid, &IID_ICommDlgBrowser))
|
||||
*ppvObj = &This->ICommDlgBrowser_iface;
|
||||
else if(IsEqualIID(riid, &IID_IServiceProvider)) /* IServiceProvider */
|
||||
else if(IsEqualIID(riid, &IID_IServiceProvider))
|
||||
*ppvObj = &This->IServiceProvider_iface;
|
||||
|
||||
if(*ppvObj)
|
||||
{ IUnknown_AddRef( (IShellBrowser*) *ppvObj);
|
||||
return S_OK;
|
||||
if(*ppvObj) {
|
||||
IUnknown_AddRef((IUnknown*)*ppvObj);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
FIXME("Unknown interface requested\n");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
|
|
@ -506,7 +506,7 @@ static HRESULT on_default_action(FileDialogImpl *This)
|
|||
pidla[i] = COMDLG32_SHSimpleIDListFromPathAW(canon_filename);
|
||||
|
||||
if(psf_parent && !(open_action == ONOPEN_BROWSE))
|
||||
IShellItem_Release(psf_parent);
|
||||
IShellFolder_Release(psf_parent);
|
||||
|
||||
fn_iter += (WCHAR)lstrlenW(fn_iter) + 1;
|
||||
}
|
||||
|
@ -528,7 +528,7 @@ static HRESULT on_default_action(FileDialogImpl *This)
|
|||
if(FAILED(hr))
|
||||
ERR("Failed to browse to directory: %08x\n", hr);
|
||||
|
||||
IShellItem_Release(psf_parent);
|
||||
IShellFolder_Release(psf_parent);
|
||||
break;
|
||||
|
||||
case ONOPEN_OPEN:
|
||||
|
|
|
@ -369,7 +369,7 @@ static BOOL test_instantiation(void)
|
|||
|
||||
hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileDialogEvents, (void**)&punk);
|
||||
ok(hr == E_NOINTERFACE, "got 0x%08x.\n", hr);
|
||||
if(SUCCEEDED(hr)) IUnknown_Release(pfd);
|
||||
if(SUCCEEDED(hr)) IFileDialog_Release(pfd);
|
||||
|
||||
hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IExplorerBrowser, (void**)&punk);
|
||||
ok(hr == E_NOINTERFACE, "got 0x%08x.\n", hr);
|
||||
|
@ -379,7 +379,7 @@ static BOOL test_instantiation(void)
|
|||
ok(hr == S_OK, "got 0x%08x.\n", hr);
|
||||
if(SUCCEEDED(hr)) IUnknown_Release(punk);
|
||||
|
||||
hr = IFileOpenDialog_QueryInterface(pfsd, &IID_ICommDlgBrowser3, (void**)&punk);
|
||||
hr = IFileSaveDialog_QueryInterface(pfsd, &IID_ICommDlgBrowser3, (void**)&punk);
|
||||
ok(hr == S_OK, "got 0x%08x.\n", hr);
|
||||
if(SUCCEEDED(hr)) IUnknown_Release(punk);
|
||||
|
||||
|
@ -1378,7 +1378,7 @@ static void test_customize(void)
|
|||
&IID_IFileDialog, (void**)&pfod);
|
||||
ok(hr == S_OK, "got 0x%08x.\n", hr);
|
||||
|
||||
hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileDialogCustomize, (void**)&pfdc);
|
||||
hr = IFileDialog_QueryInterface(pfod, &IID_IFileDialogCustomize, (void**)&pfdc);
|
||||
ok(hr == S_OK, "got 0x%08x.\n", hr);
|
||||
if(FAILED(hr))
|
||||
{
|
||||
|
@ -1666,7 +1666,7 @@ static void test_customize(void)
|
|||
|
||||
IFileDialogEvents_Release(pfde);
|
||||
IFileDialogCustomize_Release(pfdc);
|
||||
ref = IFileOpenDialog_Release(pfod);
|
||||
ref = IFileDialog_Release(pfod);
|
||||
ok(!ref, "Refcount not zero (%d).\n", ref);
|
||||
|
||||
|
||||
|
@ -1674,7 +1674,7 @@ static void test_customize(void)
|
|||
&IID_IFileDialog, (void**)&pfod);
|
||||
ok(hr == S_OK, "got 0x%08x.\n", hr);
|
||||
|
||||
hr = IFileDialogCustomize_QueryInterface(pfod, &IID_IFileDialogCustomize, (void**)&pfdc);
|
||||
hr = IFileDialog_QueryInterface(pfod, &IID_IFileDialogCustomize, (void**)&pfdc);
|
||||
ok(hr == S_OK, "got 0x%08x.\n", hr);
|
||||
|
||||
i = 0;
|
||||
|
@ -1884,7 +1884,7 @@ static void test_customize(void)
|
|||
}
|
||||
|
||||
IFileDialogCustomize_Release(pfdc);
|
||||
ref = IFileOpenDialog_Release(pfod);
|
||||
ref = IFileDialog_Release(pfod);
|
||||
ok(!ref, "Refcount not zero (%d).\n", ref);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue