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
232f54ae
Commit
232f54ae
authored
Sep 10, 2015
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32/tests: Add another test for calling a varargs method.
This time with passing SAFEARRAY as a reference.
parent
7d1e3691
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
1 deletion
+58
-1
tmarshal.c
dlls/oleaut32/tests/tmarshal.c
+54
-1
tmarshal.idl
dlls/oleaut32/tests/tmarshal.idl
+3
-0
tmarshal_dispids.h
dlls/oleaut32/tests/tmarshal_dispids.h
+1
-0
No files found.
dlls/oleaut32/tests/tmarshal.c
View file @
232f54ae
...
...
@@ -874,6 +874,41 @@ static HRESULT WINAPI Widget_VarArg_Run(
return
S_OK
;
}
static
HRESULT
WINAPI
Widget_VarArg_Ref_Run
(
IWidget
*
iface
,
BSTR
name
,
SAFEARRAY
**
params
,
VARIANT
*
result
)
{
static
const
WCHAR
catW
[]
=
{
'C'
,
'a'
,
't'
,
0
};
static
const
WCHAR
supermanW
[]
=
{
'S'
,
'u'
,
'p'
,
'e'
,
'r'
,
'm'
,
'a'
,
'n'
,
0
};
LONG
bound
;
VARIANT
*
var
;
BSTR
bstr
;
HRESULT
hr
;
trace
(
"VarArg_Ref_Run(%p,%p,%p)
\n
"
,
name
,
params
,
result
);
ok
(
!
lstrcmpW
(
name
,
catW
),
"got %s
\n
"
,
wine_dbgstr_w
(
name
));
hr
=
SafeArrayGetLBound
(
*
params
,
1
,
&
bound
);
ok
(
hr
==
S_OK
,
"SafeArrayGetLBound error %#x
\n
"
,
hr
);
ok
(
bound
==
0
,
"expected 0, got %d
\n
"
,
bound
);
hr
=
SafeArrayGetUBound
(
*
params
,
1
,
&
bound
);
ok
(
hr
==
S_OK
,
"SafeArrayGetUBound error %#x
\n
"
,
hr
);
ok
(
bound
==
0
,
"expected 0, got %d
\n
"
,
bound
);
hr
=
SafeArrayAccessData
(
*
params
,
(
void
**
)
&
var
);
ok
(
hr
==
S_OK
,
"SafeArrayAccessData error %#x
\n
"
,
hr
);
ok
(
V_VT
(
&
var
[
0
])
==
VT_BSTR
,
"expected VT_BSTR, got %d
\n
"
,
V_VT
(
&
var
[
0
]));
bstr
=
V_BSTR
(
&
var
[
0
]);
ok
(
!
lstrcmpW
(
bstr
,
supermanW
),
"got %s
\n
"
,
wine_dbgstr_w
(
bstr
));
hr
=
SafeArrayUnaccessData
(
*
params
);
ok
(
hr
==
S_OK
,
"SafeArrayUnaccessData error %#x
\n
"
,
hr
);
return
S_OK
;
}
static
const
struct
IWidgetVtbl
Widget_VTable
=
{
Widget_QueryInterface
,
...
...
@@ -912,7 +947,8 @@ static const struct IWidgetVtbl Widget_VTable =
Widget_put_prop_req_arg
,
Widget_pos_restrict
,
Widget_neg_restrict
,
Widget_VarArg_Run
Widget_VarArg_Run
,
Widget_VarArg_Ref_Run
};
static
HRESULT
WINAPI
StaticWidget_QueryInterface
(
IStaticWidget
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
...
...
@@ -1554,6 +1590,23 @@ static void test_typelibmarshal(void)
SysFreeString
(
V_BSTR
(
&
vararg
[
1
]));
SysFreeString
(
V_BSTR
(
&
vararg
[
0
]));
/* call VarArg_Ref_Run */
VariantInit
(
&
vararg
[
1
]);
V_VT
(
&
vararg
[
1
])
=
VT_BSTR
;
V_BSTR
(
&
vararg
[
1
])
=
SysAllocString
(
szCat
);
VariantInit
(
&
vararg
[
0
]);
V_VT
(
&
vararg
[
0
])
=
VT_BSTR
;
V_BSTR
(
&
vararg
[
0
])
=
SysAllocString
(
szSuperman
);
dispparams
.
cNamedArgs
=
0
;
dispparams
.
cArgs
=
2
;
dispparams
.
rgdispidNamedArgs
=
NULL
;
dispparams
.
rgvarg
=
vararg
;
hr
=
IDispatch_Invoke
(
pDispatch
,
DISPID_TM_VARARG_REF_RUN
,
&
IID_NULL
,
LOCALE_NEUTRAL
,
DISPATCH_METHOD
,
&
dispparams
,
NULL
,
NULL
,
NULL
);
todo_wine
ok_ole_success
(
hr
,
IDispatch_Invoke
);
SysFreeString
(
V_BSTR
(
&
vararg
[
1
]));
SysFreeString
(
V_BSTR
(
&
vararg
[
0
]));
/* call Error */
dispparams
.
cNamedArgs
=
0
;
dispparams
.
cArgs
=
0
;
...
...
dlls/oleaut32/tests/tmarshal.idl
View file @
232f54ae
...
...
@@ -182,6 +182,9 @@ library TestTypelib
[
id
(
DISPID_TM_VARARG_RUN
),
vararg
]
HRESULT
VarArg_Run
(
[
in
]
BSTR
name
,
[
in
]
SAFEARRAY
(
VARIANT
)
params
,
[
out
,
retval
]
VARIANT
*
result
)
;
[
id
(
DISPID_TM_VARARG_REF_RUN
),
vararg
]
HRESULT
VarArg_Ref_Run
(
[
in
]
BSTR
name
,
[
in
]
SAFEARRAY
(
VARIANT
)
*
params
,
[
out
,
retval
]
VARIANT
*
result
)
;
}
[
...
...
dlls/oleaut32/tests/tmarshal_dispids.h
View file @
232f54ae
...
...
@@ -45,6 +45,7 @@
#define DISPID_TM_NEG_RESTRICTED -26
#define DISPID_TM_TESTSECONDIFACE 27
#define DISPID_TM_VARARG_RUN 28
#define DISPID_TM_VARARG_REF_RUN 29
#define DISPID_NOA_BSTRRET 1
#define DISPID_NOA_ERROR 2
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