Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
5bc5d360
Commit
5bc5d360
authored
Jan 31, 2023
by
Vladislav Timonin
Committed by
Alexandre Julliard
Jul 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Return E_UNEXPECTED if IFileDialog is already shown.
parent
3149d845
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
1 deletion
+48
-1
itemdlg.c
dlls/comdlg32/itemdlg.c
+3
-0
itemdlg.c
dlls/comdlg32/tests/itemdlg.c
+45
-1
No files found.
dlls/comdlg32/itemdlg.c
View file @
5bc5d360
...
...
@@ -2246,6 +2246,9 @@ static HRESULT create_dialog(FileDialogImpl *This, HWND parent)
{
INT_PTR
res
;
if
(
This
->
dlg_hwnd
)
return
E_UNEXPECTED
;
SetLastError
(
0
);
res
=
DialogBoxParamW
(
COMDLG32_hInstance
,
MAKEINTRESOURCEW
(
NEWFILEOPENV3ORD
),
...
...
dlls/comdlg32/tests/itemdlg.c
View file @
5bc5d360
...
...
@@ -27,12 +27,14 @@
#define IDT_CHANGEFILETYPE 500
#define IDT_CLOSEDIALOG 501
#define IDT_SHOWDIALOG 502
typedef
enum
{
IFDEVENT_TEST_NONE
=
0
,
IFDEVENT_TEST1
=
0x1
,
IFDEVENT_TEST2
=
0x2
,
IFDEVENT_TEST3
=
0x3
IFDEVENT_TEST3
=
0x3
,
IFDEVENT_TEST4
=
0x4
,
}
FileDialogEventsTest
;
static
HRESULT
(
WINAPI
*
pSHCreateShellItem
)(
LPCITEMIDLIST
,
IShellFolder
*
,
LPCITEMIDLIST
,
IShellItem
**
);
...
...
@@ -193,6 +195,15 @@ static LRESULT CALLBACK test_customize_dlgproc(HWND hwnd, UINT message, WPARAM w
br
=
PostMessageW
(
hwnd
,
WM_COMMAND
,
IDCANCEL
,
0
);
ok
(
br
,
"Failed
\n
"
);
return
TRUE
;
case
IDT_SHOWDIALOG
:
{
HRESULT
hr
;
KillTimer
(
hwnd
,
IDT_SHOWDIALOG
);
hr
=
IFileDialog_Show
(
pfd
,
NULL
);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08lx.
\n
"
,
hr
);
SetTimer
(
hwnd
,
IDT_CLOSEDIALOG
,
100
,
0
);
return
TRUE
;
}
}
}
...
...
@@ -249,6 +260,9 @@ static HRESULT WINAPI IFileDialogEvents_fnOnFolderChange(IFileDialogEvents *ifac
case
IFDEVENT_TEST3
:
SetTimer
(
dlg_hwnd
,
IDT_CHANGEFILETYPE
,
100
,
0
);
break
;
case
IFDEVENT_TEST4
:
SetTimer
(
dlg_hwnd
,
IDT_SHOWDIALOG
,
100
,
0
);
break
;
default:
ok
(
FALSE
,
"Should not happen (%d)
\n
"
,
This
->
events_test
);
}
...
...
@@ -2496,6 +2510,35 @@ static void test_customize_remove_from_empty_combobox(void)
IFileDialog_Release
(
pfod
);
}
static
void
test_double_show
(
void
)
{
IFileDialogEventsImpl
*
pfdeimpl
;
IFileDialogEvents
*
pfde
;
IFileDialog
*
pfd
;
DWORD
cookie
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_FileOpenDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileDialog
,
(
void
**
)
&
pfd
);
ok
(
hr
==
S_OK
,
"got 0x%08lx.
\n
"
,
hr
);
pfde
=
IFileDialogEvents_Constructor
();
pfdeimpl
=
impl_from_IFileDialogEvents
(
pfde
);
pfdeimpl
->
events_test
=
IFDEVENT_TEST4
;
hr
=
IFileDialog_Advise
(
pfd
,
pfde
,
&
cookie
);
ok
(
hr
==
S_OK
,
"got 0x%08lx.
\n
"
,
hr
);
hr
=
IFileDialog_Show
(
pfd
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_CANCELLED
),
"got 0x%08lx.
\n
"
,
hr
);
hr
=
IFileDialog_Unadvise
(
pfd
,
cookie
);
ok
(
hr
==
S_OK
,
"got 0x%08lx.
\n
"
,
hr
);
IFileDialogEvents_Release
(
pfde
);
IFileDialog_Release
(
pfd
);
}
START_TEST
(
itemdlg
)
{
OleInitialize
(
NULL
);
...
...
@@ -2521,6 +2564,7 @@ START_TEST(itemdlg)
test_persistent_state
();
test_overwrite
();
test_customize_remove_from_empty_combobox
();
test_double_show
();
}
else
skip
(
"Skipping all Item Dialog tests.
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment