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
a056a9a8
Commit
a056a9a8
authored
Dec 06, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Dec 06, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OLE: Implement undocumented behaviour in DispCallFunc.
Fix DispCallFunc to work with MSDN-undocumented behaviour used by Office 2003 and document the function.
parent
1f68feee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
7 deletions
+61
-7
typelib.c
dlls/oleaut32/typelib.c
+61
-7
No files found.
dlls/oleaut32/typelib.c
View file @
a056a9a8
...
...
@@ -5173,6 +5173,45 @@ static HRESULT typedescvt_to_variantvt(ITypeInfo *tinfo, TYPEDESC *tdesc, VARTYP
/***********************************************************************
* DispCallFunc (OLEAUT32.@)
*
* Invokes a function of the specifed calling convention, passing the
* specified arguments and returns the result.
*
* PARAMS
* pvInstance [I] Optional pointer to the instance whose function to invoke.
* oVft [I] The offset in the vtable. See notes.
* cc [I] Calling convention of the function to call.
* vtReturn [I] The return type of the function.
* cActuals [I] Number of parameters.
* prgvt [I] The types of the parameters to pass. This is used for sizing only.
* prgpvarg [I] The arguments to pass.
* pvargResult [O] The return value of the function. Can be NULL.
*
* RETURNS
* Success: S_OK.
* Failure: HRESULT code.
*
* NOTES
* The HRESULT return value of this function is not affected by the return
* value of the user supplied function, which is returned in pvargResult.
*
* If pvInstance is NULL then a non-object function is to be called and oVft
* is the address of the function to call.
*
* The cc parameter can be one of the following values:
*|CC_FASTCALL
*|CC_CDECL
*|CC_PASCAL
*|CC_STDCALL
*|CC_FPFASTCALL
*|CC_SYSCALL
*|CC_MPWCDECL
*|CC_MPWPASCAL
*
* BUGS
* Native accepts arguments in the reverse order. I.e. the first item in the
* prgpvarg array is the last argument in the C/C++ declaration of the
* function to be called.
*/
HRESULT
WINAPI
DispCallFunc
(
...
...
@@ -5187,10 +5226,10 @@ DispCallFunc(
pvInstance
,
oVft
,
cc
,
vtReturn
,
cActuals
,
prgvt
,
prgpvarg
,
pvargResult
,
V_VT
(
pvargResult
));
/* DispCallFunc is only used to invoke methods belonging to an
* IDispatch-derived COM interface. So we need to add a first parameter
* to the list of arguments, to supply the interface
pointer */
argsize
=
1
;
argsize
=
0
;
if
(
pvInstance
)
argsize
++
;
/* for This
pointer */
for
(
i
=
0
;
i
<
cActuals
;
i
++
)
{
TRACE
(
"arg %d: type %d, size %d
\n
"
,
i
,
prgvt
[
i
],
_argsize
(
prgvt
[
i
]));
...
...
@@ -5198,8 +5237,14 @@ DispCallFunc(
argsize
+=
_argsize
(
prgvt
[
i
]);
}
args
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DWORD
)
*
argsize
);
args
[
0
]
=
(
DWORD
)
pvInstance
;
/* this is the fake IDispatch interface pointer */
argspos
=
1
;
argspos
=
0
;
if
(
pvInstance
)
{
args
[
0
]
=
(
DWORD
)
pvInstance
;
/* the This pointer is always the first parameter */
argspos
++
;
}
for
(
i
=
0
;
i
<
cActuals
;
i
++
)
{
VARIANT
*
arg
=
prgpvarg
[
i
];
...
...
@@ -5208,7 +5253,16 @@ DispCallFunc(
argspos
+=
_argsize
(
prgvt
[
i
]);
}
hres
=
_invoke
((
*
(
FARPROC
**
)
pvInstance
)[
oVft
/
sizeof
(
void
*
)],
cc
,
argsize
,
args
);
if
(
pvInstance
)
{
FARPROC
*
vtable
=
*
(
FARPROC
**
)
pvInstance
;
hres
=
_invoke
(
vtable
[
oVft
/
sizeof
(
void
*
)],
cc
,
argsize
,
args
);
}
else
/* if we aren't invoking an object then the function pointer is stored
* in oVft */
hres
=
_invoke
((
FARPROC
)
oVft
,
cc
,
argsize
,
args
);
if
(
pvargResult
&&
(
vtReturn
!=
VT_EMPTY
))
{
TRACE
(
"Method returned 0x%08lx
\n
"
,
hres
);
...
...
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