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
74a3d9ee
Commit
74a3d9ee
authored
Sep 21, 2011
by
Octavian Voicu
Committed by
Alexandre Julliard
Sep 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Add tmarshal test with variant array and fix variant marshalled size calculation.
parent
55a6db89
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
1 deletion
+52
-1
tmarshal.c
dlls/oleaut32/tests/tmarshal.c
+47
-0
tmarshal.idl
dlls/oleaut32/tests/tmarshal.idl
+3
-0
tmarshal_dispids.h
dlls/oleaut32/tests/tmarshal_dispids.h
+1
-0
tmarshal.c
dlls/oleaut32/tmarshal.c
+1
-1
No files found.
dlls/oleaut32/tests/tmarshal.c
View file @
74a3d9ee
...
...
@@ -475,6 +475,40 @@ static HRESULT WINAPI Widget_VariantArrayPtr(
return
S_OK
;
}
static
HRESULT
WINAPI
Widget_VariantCArray
(
IWidget
*
iface
,
ULONG
count
,
VARIANT
values
[])
{
ULONG
i
;
VARIANT
inc
,
res
;
HRESULT
hr
;
trace
(
"VariantCArray(%u,%p)
\n
"
,
count
,
values
);
ok
(
count
==
2
,
"count is %d
\n
"
,
count
);
for
(
i
=
0
;
i
<
count
;
i
++
)
ok
(
V_VT
(
&
values
[
i
])
==
VT_I4
,
"values[%d] is not VT_I4
\n
"
,
i
);
V_VT
(
&
inc
)
=
VT_I4
;
V_I4
(
&
inc
)
=
1
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
VariantInit
(
&
res
);
hr
=
VarAdd
(
&
values
[
i
],
&
inc
,
&
res
);
if
(
!
SUCCEEDED
(
hr
))
{
ok
(
0
,
"VarAdd failed at %u with error 0x%x
\n
"
,
i
,
hr
);
return
hr
;
}
hr
=
VariantCopy
(
&
values
[
i
],
&
res
);
if
(
!
SUCCEEDED
(
hr
))
{
ok
(
0
,
"VariantCopy failed at %u with error 0x%x
\n
"
,
i
,
hr
);
return
hr
;
}
}
return
S_OK
;
}
static
HRESULT
WINAPI
Widget_Variant
(
IWidget
__RPC_FAR
*
iface
,
VARIANT
var
)
...
...
@@ -640,6 +674,7 @@ static const struct IWidgetVtbl Widget_VTable =
Widget_Value
,
Widget_Array
,
Widget_VariantArrayPtr
,
Widget_VariantCArray
,
Widget_Variant
,
Widget_VarArg
,
Widget_StructArgs
,
...
...
@@ -1230,6 +1265,18 @@ static void test_typelibmarshal(void)
ok_ole_success
(
hr
,
IDispatch_Invoke
);
VariantClear
(
&
varresult
);
/* call VariantCArray - test marshaling of variant arrays */
V_VT
(
&
vararg
[
0
])
=
VT_I4
;
V_I4
(
&
vararg
[
0
])
=
1
;
V_VT
(
&
vararg
[
1
])
=
VT_I4
;
V_I4
(
&
vararg
[
1
])
=
2
;
hr
=
IWidget_VariantCArray
(
pWidget
,
2
,
vararg
);
ok_ole_success
(
hr
,
IWidget_VariantCArray
);
todo_wine
ok
(
V_VT
(
&
vararg
[
0
])
==
VT_I4
&&
V_I4
(
&
vararg
[
0
])
==
2
,
"vararg[0] = %d[%d]
\n
"
,
V_VT
(
&
vararg
[
0
]),
V_I4
(
&
vararg
[
0
]));
todo_wine
ok
(
V_VT
(
&
vararg
[
1
])
==
VT_I4
&&
V_I4
(
&
vararg
[
1
])
==
3
,
"vararg[1] = %d[%d]
\n
"
,
V_VT
(
&
vararg
[
1
]),
V_I4
(
&
vararg
[
1
]));
/* call VarArg */
VariantInit
(
&
vararg
[
3
]);
V_VT
(
&
vararg
[
3
])
=
VT_I4
;
...
...
dlls/oleaut32/tests/tmarshal.idl
View file @
74a3d9ee
...
...
@@ -111,6 +111,9 @@ library TestTypelib
[
id
(
DISPID_TM_VARARRAYPTR
)
]
HRESULT
VariantArrayPtr
(
[
in
]
SAFEARRAY
(
VARIANT
)
*
values
)
;
[
id
(
DISPID_TM_VARCARRAY
)
]
HRESULT
VariantCArray
(
[
in
]
ULONG
count
,
[
in
,
out
]
VARIANT
values
[
2
]
)
;
[
id
(
DISPID_TM_VARIANT
)
]
HRESULT
Variant
(
[
in
]
VARIANT
var
)
;
...
...
dlls/oleaut32/tests/tmarshal_dispids.h
View file @
74a3d9ee
...
...
@@ -40,6 +40,7 @@
#define DISPID_TM_BYREF_UINT 21
#define DISPID_TM_PROP_OPT_ARG 22
#define DISPID_TM_PROP_REQ_ARG 23
#define DISPID_TM_VARCARRAY 24
#define DISPID_NOA_BSTRRET 1
#define DISPID_NOA_ERROR 2
dlls/oleaut32/tmarshal.c
View file @
74a3d9ee
...
...
@@ -597,7 +597,7 @@ _xsize(const TYPEDESC *td, ITypeInfo *tinfo) {
case
VT_CY
:
return
sizeof
(
CY
);
case
VT_VARIANT
:
return
sizeof
(
VARIANT
)
+
3
;
/* FIXME: why the +3? */
return
sizeof
(
VARIANT
)
;
case
VT_CARRAY
:
{
int
i
,
arrsize
=
1
;
const
ARRAYDESC
*
adesc
=
td
->
u
.
lpadesc
;
...
...
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