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
1c813d5b
Commit
1c813d5b
authored
Feb 27, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun: Implement Keys() and Items() of dictionary.
parent
db35807e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
14 deletions
+68
-14
dictionary.c
dlls/scrrun/dictionary.c
+66
-6
dictionary.c
dlls/scrrun/tests/dictionary.c
+2
-8
No files found.
dlls/scrrun/dictionary.c
View file @
1c813d5b
...
...
@@ -381,13 +381,43 @@ static HRESULT WINAPI dictionary_Exists(IDictionary *iface, VARIANT *key, VARIAN
return
S_OK
;
}
static
HRESULT
WINAPI
dictionary_Items
(
IDictionary
*
iface
,
VARIANT
*
pItemsArray
)
static
HRESULT
WINAPI
dictionary_Items
(
IDictionary
*
iface
,
VARIANT
*
items
)
{
dictionary
*
This
=
impl_from_IDictionary
(
iface
);
struct
keyitem_pair
*
pair
;
SAFEARRAYBOUND
bound
;
SAFEARRAY
*
sa
;
VARIANT
*
v
;
HRESULT
hr
;
LONG
i
;
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pItemsArray
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
items
);
return
E_NOTIMPL
;
if
(
!
items
)
return
S_OK
;
bound
.
lLbound
=
0
;
bound
.
cElements
=
This
->
count
;
sa
=
SafeArrayCreate
(
VT_VARIANT
,
1
,
&
bound
);
if
(
!
sa
)
return
E_OUTOFMEMORY
;
hr
=
SafeArrayAccessData
(
sa
,
(
void
**
)
&
v
);
if
(
FAILED
(
hr
))
{
SafeArrayDestroy
(
sa
);
return
hr
;
}
i
=
0
;
LIST_FOR_EACH_ENTRY
(
pair
,
&
This
->
pairs
,
struct
keyitem_pair
,
entry
)
{
VariantCopy
(
&
v
[
i
],
&
pair
->
item
);
i
++
;
}
SafeArrayUnaccessData
(
sa
);
V_VT
(
items
)
=
VT_ARRAY
|
VT_VARIANT
;
V_ARRAY
(
items
)
=
sa
;
return
S_OK
;
}
static
HRESULT
WINAPI
dictionary_put_Key
(
IDictionary
*
iface
,
VARIANT
*
Key
,
VARIANT
*
rhs
)
...
...
@@ -399,13 +429,43 @@ static HRESULT WINAPI dictionary_put_Key(IDictionary *iface, VARIANT *Key, VARIA
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
dictionary_Keys
(
IDictionary
*
iface
,
VARIANT
*
pKeysArray
)
static
HRESULT
WINAPI
dictionary_Keys
(
IDictionary
*
iface
,
VARIANT
*
keys
)
{
dictionary
*
This
=
impl_from_IDictionary
(
iface
);
struct
keyitem_pair
*
pair
;
SAFEARRAYBOUND
bound
;
SAFEARRAY
*
sa
;
VARIANT
*
v
;
HRESULT
hr
;
LONG
i
;
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pKeysArray
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
keys
);
return
E_NOTIMPL
;
if
(
!
keys
)
return
S_OK
;
bound
.
lLbound
=
0
;
bound
.
cElements
=
This
->
count
;
sa
=
SafeArrayCreate
(
VT_VARIANT
,
1
,
&
bound
);
if
(
!
sa
)
return
E_OUTOFMEMORY
;
hr
=
SafeArrayAccessData
(
sa
,
(
void
**
)
&
v
);
if
(
FAILED
(
hr
))
{
SafeArrayDestroy
(
sa
);
return
hr
;
}
i
=
0
;
LIST_FOR_EACH_ENTRY
(
pair
,
&
This
->
pairs
,
struct
keyitem_pair
,
entry
)
{
VariantCopy
(
&
v
[
i
],
&
pair
->
key
);
i
++
;
}
SafeArrayUnaccessData
(
sa
);
V_VT
(
keys
)
=
VT_ARRAY
|
VT_VARIANT
;
V_ARRAY
(
keys
)
=
sa
;
return
S_OK
;
}
static
HRESULT
WINAPI
dictionary_Remove
(
IDictionary
*
iface
,
VARIANT
*
key
)
...
...
dlls/scrrun/tests/dictionary.c
View file @
1c813d5b
...
...
@@ -495,15 +495,12 @@ static void test_Keys(void)
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDictionary_Keys
(
dict
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
VariantInit
(
&
keys
);
hr
=
IDictionary_Keys
(
dict
,
&
keys
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
V_VT
(
&
keys
)
==
(
VT_ARRAY
|
VT_VARIANT
),
"got %d
\n
"
,
V_VT
(
&
keys
));
}
VariantClear
(
&
keys
);
V_VT
(
&
key
)
=
VT_R4
;
...
...
@@ -514,12 +511,9 @@ todo_wine {
VariantInit
(
&
keys
);
hr
=
IDictionary_Keys
(
dict
,
&
keys
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
V_VT
(
&
keys
)
==
(
VT_ARRAY
|
VT_VARIANT
),
"got %d
\n
"
,
V_VT
(
&
keys
));
}
if
(
hr
==
S_OK
)
{
VariantInit
(
&
key
);
index
=
0
;
hr
=
SafeArrayGetElement
(
V_ARRAY
(
&
keys
),
&
index
,
&
key
);
...
...
@@ -532,7 +526,7 @@ if (hr == S_OK)
hr
=
SafeArrayGetUBound
(
V_ARRAY
(
&
keys
),
1
,
&
index
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
index
==
0
,
"got %d
\n
"
,
index
);
}
VariantClear
(
&
keys
);
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