comdlg32: Fix error precedence in IFileDialog2_SetFileTypes.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2020-09-09 23:40:26 -06:00 committed by Alexandre Julliard
parent c409ab6290
commit 1a0470443d
2 changed files with 5 additions and 3 deletions

View File

@ -2402,12 +2402,12 @@ static HRESULT WINAPI IFileDialog2_fnSetFileTypes(IFileDialog2 *iface, UINT cFil
UINT i; UINT i;
TRACE("%p (%d, %p)\n", This, cFileTypes, rgFilterSpec); TRACE("%p (%d, %p)\n", This, cFileTypes, rgFilterSpec);
if(This->filterspecs)
return E_UNEXPECTED;
if(!rgFilterSpec) if(!rgFilterSpec)
return E_INVALIDARG; return E_INVALIDARG;
if(This->filterspecs)
return E_UNEXPECTED;
if(!cFileTypes) if(!cFileTypes)
return S_OK; return S_OK;

View File

@ -675,6 +675,8 @@ static void test_basics(void)
ok(hr == S_OK, "got 0x%08x.\n", hr); ok(hr == S_OK, "got 0x%08x.\n", hr);
hr = IFileOpenDialog_SetFileTypes(pfod, 0, filterspec); hr = IFileOpenDialog_SetFileTypes(pfod, 0, filterspec);
ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr); 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); hr = IFileOpenDialog_SetFileTypeIndex(pfod, 0);
ok(hr == S_OK, "got 0x%08x.\n", hr); ok(hr == S_OK, "got 0x%08x.\n", hr);
hr = IFileOpenDialog_GetFileTypeIndex(pfod, &filetype); hr = IFileOpenDialog_GetFileTypeIndex(pfod, &filetype);