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
d2bdbd4e
Commit
d2bdbd4e
authored
Jan 06, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jan 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole: Remove the no longer used _copy_arg function.
parent
8cf5373f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
159 deletions
+0
-159
typelib.c
dlls/oleaut32/typelib.c
+0
-159
No files found.
dlls/oleaut32/typelib.c
View file @
d2bdbd4e
...
...
@@ -4939,165 +4939,6 @@ _invoke(FARPROC func,CALLCONV callconv, int nrargs, DWORD *args) {
extern
int
_argsize
(
DWORD
vt
);
/****************************************************************************
* Helper functions for Dispcall / Invoke, which copies one variant
* with target type onto the argument stack.
*/
static
HRESULT
_copy_arg
(
ITypeInfo2
*
tinfo
,
TYPEDESC
*
tdesc
,
DWORD
*
argpos
,
VARIANT
*
arg
,
VARTYPE
vt
)
{
UINT
arglen
=
_argsize
(
vt
)
*
sizeof
(
DWORD
);
VARIANT
va
;
if
((
vt
==
VT_PTR
)
&&
tdesc
&&
(
tdesc
->
u
.
lptdesc
->
vt
==
VT_VARIANT
))
{
memcpy
(
argpos
,
&
arg
,
sizeof
(
void
*
));
return
S_OK
;
}
if
(
V_VT
(
arg
)
==
vt
)
{
memcpy
(
argpos
,
&
V_I4
(
arg
),
arglen
);
return
S_OK
;
}
if
(
V_ISARRAY
(
arg
)
&&
(
vt
==
VT_SAFEARRAY
))
{
memcpy
(
argpos
,
&
V_ARRAY
(
arg
),
sizeof
(
SAFEARRAY
*
));
return
S_OK
;
}
if
(
vt
==
VT_VARIANT
)
{
memcpy
(
argpos
,
arg
,
arglen
);
return
S_OK
;
}
/* Deref BYREF vars if there is need */
if
(
V_ISBYREF
(
arg
)
&&
((
V_VT
(
arg
)
&
~
VT_BYREF
)
==
vt
))
{
memcpy
(
argpos
,(
void
*
)
V_I4
(
arg
),
arglen
);
return
S_OK
;
}
if
(
vt
==
VT_UNKNOWN
&&
V_VT
(
arg
)
==
VT_DISPATCH
)
{
/* in this context, if the type lib specifies IUnknown*, giving an
IDispatch* is correct; so, don't invoke VariantChangeType */
memcpy
(
argpos
,
&
V_I4
(
arg
),
arglen
);
return
S_OK
;
}
if
((
vt
==
VT_PTR
)
&&
tdesc
)
return
_copy_arg
(
tinfo
,
tdesc
->
u
.
lptdesc
,
argpos
,
arg
,
tdesc
->
u
.
lptdesc
->
vt
);
if
((
vt
==
VT_USERDEFINED
)
&&
tdesc
&&
tinfo
)
{
ITypeInfo
*
tinfo2
=
NULL
;
TYPEATTR
*
tattr
=
NULL
;
HRESULT
hres
;
hres
=
ITypeInfo_GetRefTypeInfo
(
tinfo
,
tdesc
->
u
.
hreftype
,
&
tinfo2
);
if
(
hres
)
{
FIXME
(
"Could not get typeinfo of hreftype %lx for VT_USERDEFINED, "
"while coercing from vt 0x%x. Copying 4 byte.
\n
"
,
tdesc
->
u
.
hreftype
,
V_VT
(
arg
));
memcpy
(
argpos
,
&
V_I4
(
arg
),
4
);
return
S_OK
;
}
hres
=
ITypeInfo_GetTypeAttr
(
tinfo2
,
&
tattr
);
if
(
hres
)
{
ERR
(
"GetTypeAttr failed
\n
"
);
ITypeInfo_Release
(
tinfo2
);
return
hres
;
}
switch
(
tattr
->
typekind
)
{
case
TKIND_ENUM
:
switch
(
V_VT
(
arg
)
)
{
case
VT_I2
:
*
argpos
=
V_I2
(
arg
);
hres
=
S_OK
;
break
;
case
VT_I4
:
memcpy
(
argpos
,
&
V_I4
(
arg
),
4
);
hres
=
S_OK
;
break
;
case
VT_BYREF
|
VT_I4
:
memcpy
(
argpos
,
V_I4REF
(
arg
),
4
);
hres
=
S_OK
;
break
;
default:
FIXME
(
"vt 0x%x -> TKIND_ENUM unhandled.
\n
"
,
V_VT
(
arg
));
hres
=
E_FAIL
;
break
;
}
break
;
case
TKIND_ALIAS
:
tdesc
=
&
(
tattr
->
tdescAlias
);
hres
=
_copy_arg
((
ITypeInfo2
*
)
tinfo2
,
tdesc
,
argpos
,
arg
,
tdesc
->
vt
);
break
;
case
TKIND_INTERFACE
:
if
(
V_VT
(
arg
)
==
VT_DISPATCH
)
{
IDispatch
*
disp
;
if
(
IsEqualIID
(
&
IID_IDispatch
,
&
(
tattr
->
guid
)))
{
memcpy
(
argpos
,
&
V_DISPATCH
(
arg
),
4
);
hres
=
S_OK
;
break
;
}
hres
=
IUnknown_QueryInterface
(
V_DISPATCH
(
arg
),
&
IID_IDispatch
,(
LPVOID
*
)
&
disp
);
if
(
SUCCEEDED
(
hres
))
{
memcpy
(
argpos
,
&
disp
,
4
);
IUnknown_Release
(
V_DISPATCH
(
arg
));
hres
=
S_OK
;
break
;
}
FIXME
(
"Failed to query IDispatch interface from %s while "
"converting to VT_DISPATCH!
\n
"
,
debugstr_guid
(
&
(
tattr
->
guid
)));
hres
=
E_FAIL
;
break
;
}
if
(
V_VT
(
arg
)
==
VT_UNKNOWN
)
{
memcpy
(
argpos
,
&
V_UNKNOWN
(
arg
),
4
);
hres
=
S_OK
;
break
;
}
FIXME
(
"vt 0x%x -> TKIND_INTERFACE(%s) unhandled
\n
"
,
V_VT
(
arg
),
debugstr_guid
(
&
(
tattr
->
guid
)));
hres
=
E_FAIL
;
break
;
case
TKIND_DISPATCH
:
if
(
V_VT
(
arg
)
==
VT_DISPATCH
)
{
memcpy
(
argpos
,
&
V_DISPATCH
(
arg
),
4
);
hres
=
S_OK
;
}
else
{
hres
=
E_FAIL
;
FIXME
(
"TKIND_DISPATCH unhandled for target vt 0x%x.
\n
"
,
V_VT
(
arg
));
}
break
;
case
TKIND_RECORD
:
FIXME
(
"TKIND_RECORD unhandled.
\n
"
);
hres
=
E_FAIL
;
break
;
default:
FIXME
(
"TKIND %d unhandled.
\n
"
,
tattr
->
typekind
);
hres
=
E_FAIL
;
break
;
}
ITypeInfo_ReleaseTypeAttr
(
tinfo2
,
tattr
);
ITypeInfo_Release
(
tinfo2
);
return
hres
;
}
VariantInit
(
&
va
);
if
(
VariantChangeType
(
&
va
,
arg
,
0
,
vt
)
==
S_OK
)
{
memcpy
(
argpos
,
&
V_I4
(
&
va
),
arglen
);
FIXME
(
"Should not use VariantChangeType here."
" (conversion from 0x%x -> 0x%x) %08lx
\n
"
,
V_VT
(
arg
),
vt
,
*
argpos
);
return
S_OK
;
}
ERR
(
"Set arg to disparg type 0x%x vs 0x%x
\n
"
,
V_VT
(
arg
),
vt
);
return
E_FAIL
;
}
static
HRESULT
userdefined_to_variantvt
(
ITypeInfo
*
tinfo
,
const
TYPEDESC
*
tdesc
,
VARTYPE
*
vt
)
{
HRESULT
hr
=
S_OK
;
...
...
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