Commit 1a047044 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

comdlg32: Fix error precedence in IFileDialog2_SetFileTypes.

parent c409ab62
......@@ -2402,12 +2402,12 @@ static HRESULT WINAPI IFileDialog2_fnSetFileTypes(IFileDialog2 *iface, UINT cFil
UINT i;
TRACE("%p (%d, %p)\n", This, cFileTypes, rgFilterSpec);
if(This->filterspecs)
return E_UNEXPECTED;
if(!rgFilterSpec)
return E_INVALIDARG;
if(This->filterspecs)
return E_UNEXPECTED;
if(!cFileTypes)
return S_OK;
......
......@@ -675,6 +675,8 @@ static void test_basics(void)
ok(hr == S_OK, "got 0x%08x.\n", hr);
hr = IFileOpenDialog_SetFileTypes(pfod, 0, filterspec);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr);
hr = IFileOpenDialog_SetFileTypes(pfod, 0, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr);
hr = IFileOpenDialog_SetFileTypeIndex(pfod, 0);
ok(hr == S_OK, "got 0x%08x.\n", hr);
hr = IFileOpenDialog_GetFileTypeIndex(pfod, &filetype);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment