Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
564b796e
Commit
564b796e
authored
Jan 04, 2024
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 17, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun/dictionary: Handle VT_EMPTY/VT_NULL keys.
parent
e89bedb7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
dictionary.c
dlls/scrrun/dictionary.c
+4
-0
dictionary.c
dlls/scrrun/tests/dictionary.c
+39
-0
No files found.
dlls/scrrun/dictionary.c
View file @
564b796e
...
@@ -188,6 +188,10 @@ static BOOL is_matching_key(const struct dictionary *dict, const struct keyitem_
...
@@ -188,6 +188,10 @@ static BOOL is_matching_key(const struct dictionary *dict, const struct keyitem_
{
{
return
hash
==
pair
->
hash
&&
numeric_key_eq
(
key
,
&
pair
->
key
);
return
hash
==
pair
->
hash
&&
numeric_key_eq
(
key
,
&
pair
->
key
);
}
}
else
if
(
V_VT
(
&
pair
->
key
)
==
VT_EMPTY
||
V_VT
(
&
pair
->
key
)
==
VT_NULL
)
{
return
V_VT
(
&
pair
->
key
)
==
V_VT
(
key
);
}
else
else
{
{
WARN
(
"Unexpected key type %#x.
\n
"
,
V_VT
(
key
));
WARN
(
"Unexpected key type %#x.
\n
"
,
V_VT
(
key
));
...
...
dlls/scrrun/tests/dictionary.c
View file @
564b796e
...
@@ -1009,6 +1009,45 @@ static void test_Add(void)
...
@@ -1009,6 +1009,45 @@ static void test_Add(void)
VariantClear
(
&
item
);
VariantClear
(
&
item
);
/* Empty and null keys. */
hr
=
IDictionary_RemoveAll
(
dict
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
V_VT
(
&
key1
)
=
VT_EMPTY
;
V_I4
(
&
key1
)
=
1
;
V_VT
(
&
item
)
=
VT_BSTR
;
V_BSTR
(
&
item
)
=
SysAllocString
(
L"empty"
);
hr
=
IDictionary_Add
(
dict
,
&
key1
,
&
item
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
V_VT
(
&
key2
)
=
VT_EMPTY
;
V_I4
(
&
key2
)
=
2
;
hr
=
IDictionary_Add
(
dict
,
&
key2
,
&
item
);
ok
(
hr
==
CTL_E_KEY_ALREADY_EXISTS
,
"Unexpected hr %#lx.
\n
"
,
hr
);
V_VT
(
&
key2
)
=
VT_NULL
;
V_I4
(
&
key2
)
=
2
;
hr
=
IDictionary_Add
(
dict
,
&
key2
,
&
item
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDictionary_RemoveAll
(
dict
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDictionary_Add
(
dict
,
&
key2
,
&
item
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDictionary_Add
(
dict
,
&
key2
,
&
item
);
ok
(
hr
==
CTL_E_KEY_ALREADY_EXISTS
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDictionary_Add
(
dict
,
&
key1
,
&
item
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
VariantClear
(
&
item
);
IDictionary_Release
(
dict
);
IDictionary_Release
(
dict
);
}
}
...
...
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