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
9419e97c
Commit
9419e97c
authored
Feb 27, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 02, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun: Implement Exists() method for dictionary.
parent
acfde52f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
dictionary.c
dlls/scrrun/dictionary.c
+7
-3
dictionary.c
dlls/scrrun/tests/dictionary.c
+7
-12
No files found.
dlls/scrrun/dictionary.c
View file @
9419e97c
...
...
@@ -368,13 +368,17 @@ static HRESULT WINAPI dictionary_get_Count(IDictionary *iface, LONG *count)
return
S_OK
;
}
static
HRESULT
WINAPI
dictionary_Exists
(
IDictionary
*
iface
,
VARIANT
*
Key
,
VARIANT_BOOL
*
pE
xists
)
static
HRESULT
WINAPI
dictionary_Exists
(
IDictionary
*
iface
,
VARIANT
*
key
,
VARIANT_BOOL
*
e
xists
)
{
dictionary
*
This
=
impl_from_IDictionary
(
iface
);
FIXME
(
"(%p)->(%p %p)
\n
"
,
This
,
Key
,
pE
xists
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_variant
(
key
),
e
xists
);
return
E_NOTIMPL
;
if
(
!
exists
)
return
CTL_E_ILLEGALFUNCTIONCALL
;
*
exists
=
get_keyitem_pair
(
This
,
key
)
!=
NULL
?
VARIANT_TRUE
:
VARIANT_FALSE
;
return
S_OK
;
}
static
HRESULT
WINAPI
dictionary_Items
(
IDictionary
*
iface
,
VARIANT
*
pItemsArray
)
...
...
dlls/scrrun/tests/dictionary.c
View file @
9419e97c
...
...
@@ -69,16 +69,16 @@ static void test_interfaces(void)
exists
=
VARIANT_FALSE
;
hr
=
IDictionary_Exists
(
dict
,
&
key
,
&
exists
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x, expected 0x%08x
\n
"
,
hr
,
S_OK
);
todo_wine
ok
(
exists
==
VARIANT_TRUE
,
"Expected TRUE but got FALSE.
\n
"
);
ok
(
hr
==
S_OK
,
"got 0x%08x, expected 0x%08x
\n
"
,
hr
,
S_OK
);
ok
(
exists
==
VARIANT_TRUE
,
"Expected TRUE but got FALSE.
\n
"
);
VariantClear
(
&
key
);
exists
=
VARIANT_TRUE
;
V_VT
(
&
key
)
=
VT_BSTR
;
V_BSTR
(
&
key
)
=
SysAllocString
(
key_non_exist
);
hr
=
IDictionary_Exists
(
dict
,
&
key
,
&
exists
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x, expected 0x%08x
\n
"
,
hr
,
S_OK
);
todo_wine
ok
(
exists
==
VARIANT_FALSE
,
"Expected FALSE but got TRUE.
\n
"
);
ok
(
hr
==
S_OK
,
"got 0x%08x, expected 0x%08x
\n
"
,
hr
,
S_OK
);
ok
(
exists
==
VARIANT_FALSE
,
"Expected FALSE but got TRUE.
\n
"
);
VariantClear
(
&
key
);
hr
=
IDictionary_get_Count
(
dict
,
&
count
);
...
...
@@ -442,17 +442,15 @@ if (0) /* crashes on native */
V_VT
(
&
key
)
=
VT_I2
;
V_I2
(
&
key
)
=
0
;
hr
=
IDictionary_Exists
(
dict
,
&
key
,
NULL
);
todo_wine
ok
(
hr
==
CTL_E_ILLEGALFUNCTIONCALL
,
"got 0x%08x
\n
"
,
hr
);
V_VT
(
&
key
)
=
VT_I2
;
V_I2
(
&
key
)
=
0
;
exists
=
VARIANT_TRUE
;
hr
=
IDictionary_Exists
(
dict
,
&
key
,
&
exists
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
exists
==
VARIANT_FALSE
,
"got %x
\n
"
,
exists
);
}
VariantInit
(
&
item
);
hr
=
IDictionary_Add
(
dict
,
&
key
,
&
item
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
...
...
@@ -465,26 +463,23 @@ todo_wine {
V_VT
(
&
key
)
=
VT_I2
;
V_I2
(
&
key
)
=
0
;
hr
=
IDictionary_Exists
(
dict
,
&
key
,
NULL
);
todo_wine
ok
(
hr
==
CTL_E_ILLEGALFUNCTIONCALL
,
"got 0x%08x
\n
"
,
hr
);
V_VT
(
&
key
)
=
VT_I2
;
V_I2
(
&
key
)
=
0
;
exists
=
VARIANT_FALSE
;
hr
=
IDictionary_Exists
(
dict
,
&
key
,
&
exists
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
exists
==
VARIANT_TRUE
,
"got %x
\n
"
,
exists
);
}
/* key of different type, but resolves to same hash value */
V_VT
(
&
key
)
=
VT_R4
;
V_R4
(
&
key
)
=
0
.
0
;
exists
=
VARIANT_FALSE
;
hr
=
IDictionary_Exists
(
dict
,
&
key
,
&
exists
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
exists
==
VARIANT_TRUE
,
"got %x
\n
"
,
exists
);
}
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