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
345ca7e0
Commit
345ca7e0
authored
Dec 10, 2021
by
Bernhard Übelacker
Committed by
Alexandre Julliard
Jun 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Avoid crash in RemoveControlItem.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51640
parent
7770f317
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
itemdlg.c
dlls/comdlg32/itemdlg.c
+3
-0
itemdlg.c
dlls/comdlg32/tests/itemdlg.c
+37
-0
No files found.
dlls/comdlg32/itemdlg.c
View file @
345ca7e0
...
...
@@ -4159,6 +4159,9 @@ static HRESULT WINAPI IFileDialogCustomize_fnRemoveControlItem(IFileDialogCustom
item
=
get_item
(
ctrl
,
dwIDItem
,
CDCS_VISIBLE
|
CDCS_ENABLED
,
&
position
);
if
(
!
item
)
return
E_INVALIDARG
;
if
((
item
->
cdcstate
&
(
CDCS_VISIBLE
|
CDCS_ENABLED
))
==
(
CDCS_VISIBLE
|
CDCS_ENABLED
))
{
if
(
SendMessageW
(
ctrl
->
hwnd
,
CB_DELETESTRING
,
position
,
0
)
==
CB_ERR
)
...
...
dlls/comdlg32/tests/itemdlg.c
View file @
345ca7e0
...
...
@@ -2460,6 +2460,42 @@ static void test_overwrite(void)
IShellItem_Release
(
psi_current
);
}
static
void
test_customize_remove_from_empty_combobox
(
void
)
{
IFileDialog
*
pfod
;
IFileDialogCustomize
*
pfdc
;
UINT
i
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_FileOpenDialog
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IFileDialog
,
(
void
**
)
&
pfod
);
ok
(
hr
==
S_OK
,
"got 0x%08lx.
\n
"
,
hr
);
hr
=
IFileDialog_QueryInterface
(
pfod
,
&
IID_IFileDialogCustomize
,
(
void
**
)
&
pfdc
);
ok
(
hr
==
S_OK
,
"got 0x%08lx.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
skip
(
"Skipping IFileDialogCustomize tests.
\n
"
);
IFileDialog_Release
(
pfod
);
return
;
}
i
=
107
;
hr
=
IFileDialogCustomize_AddComboBox
(
pfdc
,
i
);
ok
(
hr
==
S_OK
,
"got 0x%08lx.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_RemoveAllControlItems
(
pfdc
,
i
);
ok
(
hr
==
E_NOTIMPL
,
"got 0x%08lx.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_SetSelectedControlItem
(
pfdc
,
i
,
1000
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08lx.
\n
"
,
hr
);
hr
=
IFileDialogCustomize_RemoveControlItem
(
pfdc
,
i
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08lx.
\n
"
,
hr
);
IFileDialogCustomize_Release
(
pfdc
);
IFileDialog_Release
(
pfod
);
}
START_TEST
(
itemdlg
)
{
OleInitialize
(
NULL
);
...
...
@@ -2484,6 +2520,7 @@ START_TEST(itemdlg)
test_customize
();
test_persistent_state
();
test_overwrite
();
test_customize_remove_from_empty_combobox
();
}
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