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
743fb99a
Commit
743fb99a
authored
Feb 22, 2005
by
Jon Griffiths
Committed by
Alexandre Julliard
Feb 22, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use variant macros instead of accessing the union directly.
parent
5f8797f1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
22 deletions
+22
-22
olepicture.c
dlls/oleaut32/olepicture.c
+1
-1
typelib.c
dlls/oleaut32/typelib.c
+18
-18
usrmarshal.c
dlls/oleaut32/usrmarshal.c
+3
-3
variant.c
dlls/oleaut32/variant.c
+0
-0
No files found.
dlls/oleaut32/olepicture.c
View file @
743fb99a
...
...
@@ -1827,7 +1827,7 @@ static HRESULT WINAPI OLEPictureImpl_Invoke(
VariantInit
(
pVarResult
);
V_VT
(
pVarResult
)
=
VT_BOOL
;
V_
UNION
(
pVarResult
,
boolVal
)
=
FALSE
;
V_
BOOL
(
pVarResult
)
=
FALSE
;
return
S_OK
;
}
...
...
dlls/oleaut32/typelib.c
View file @
743fb99a
...
...
@@ -1497,7 +1497,7 @@ static void MSFT_ReadValue( VARIANT * pVar, int offset, TLBContext *pcx )
if
(
offset
<
0
)
{
/* data are packed in here */
V_VT
(
pVar
)
=
(
offset
&
0x7c000000
)
>>
26
;
V_
UNION
(
pVar
,
iVal
)
=
offset
&
0x3ffffff
;
V_
I2
(
pVar
)
=
offset
&
0x3ffffff
;
return
;
}
MSFT_ReadLEWords
(
&
(
V_VT
(
pVar
)),
sizeof
(
VARTYPE
),
pcx
,
...
...
@@ -1537,7 +1537,7 @@ static void MSFT_ReadValue( VARIANT * pVar, int offset, TLBContext *pcx )
}
else
{
ptr
=
TLB_Alloc
(
size
);
/* allocate temp buffer */
MSFT_Read
(
ptr
,
size
,
pcx
,
DO_NOT_SEEK
);
/* read string (ANSI) */
V_
UNION
(
pVar
,
bstrVal
)
=
SysAllocStringLen
(
NULL
,
size
);
V_
BSTR
(
pVar
)
=
SysAllocStringLen
(
NULL
,
size
);
/* FIXME: do we need a AtoW conversion here? */
V_UNION
(
pVar
,
bstrVal
[
size
])
=
L'\0'
;
while
(
size
--
)
V_UNION
(
pVar
,
bstrVal
[
size
])
=
ptr
[
size
];
...
...
@@ -1570,7 +1570,7 @@ static void MSFT_ReadValue( VARIANT * pVar, int offset, TLBContext *pcx )
}
if
(
size
>
0
)
/* (big|small) endian correct? */
MSFT_Read
(
&
(
V_
UNION
(
pVar
,
iVal
)),
size
,
pcx
,
DO_NOT_SEEK
);
MSFT_Read
(
&
(
V_
I2
(
pVar
)),
size
,
pcx
,
DO_NOT_SEEK
);
return
;
}
/*
...
...
@@ -4523,12 +4523,12 @@ _copy_arg( ITypeInfo2 *tinfo, TYPEDESC *tdesc,
}
if
(
V_VT
(
arg
)
==
vt
)
{
memcpy
(
argpos
,
&
V_
UNION
(
arg
,
lVal
),
arglen
);
memcpy
(
argpos
,
&
V_
I4
(
arg
),
arglen
);
return
S_OK
;
}
if
(
V_ISARRAY
(
arg
)
&&
(
vt
==
VT_SAFEARRAY
))
{
memcpy
(
argpos
,
&
V_
UNION
(
arg
,
parray
),
sizeof
(
SAFEARRAY
*
));
memcpy
(
argpos
,
&
V_
ARRAY
(
arg
),
sizeof
(
SAFEARRAY
*
));
return
S_OK
;
}
...
...
@@ -4538,13 +4538,13 @@ _copy_arg( ITypeInfo2 *tinfo, TYPEDESC *tdesc,
}
/* Deref BYREF vars if there is need */
if
(
V_ISBYREF
(
arg
)
&&
((
V_VT
(
arg
)
&
~
VT_BYREF
)
==
vt
))
{
memcpy
(
argpos
,(
void
*
)
V_
UNION
(
arg
,
lVal
),
arglen
);
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_
UNION
(
arg
,
lVal
),
arglen
);
memcpy
(
argpos
,
&
V_
I4
(
arg
),
arglen
);
return
S_OK
;
}
if
((
vt
==
VT_PTR
)
&&
tdesc
)
...
...
@@ -4560,7 +4560,7 @@ _copy_arg( ITypeInfo2 *tinfo, TYPEDESC *tdesc,
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_
UNION
(
arg
,
lVal
),
4
);
memcpy
(
argpos
,
&
V_
I4
(
arg
),
4
);
return
S_OK
;
}
hres
=
ITypeInfo_GetTypeAttr
(
tinfo2
,
&
tattr
);
...
...
@@ -4574,11 +4574,11 @@ _copy_arg( ITypeInfo2 *tinfo, TYPEDESC *tdesc,
case
TKIND_ENUM
:
switch
(
V_VT
(
arg
)
)
{
case
VT_I2
:
*
argpos
=
V_
UNION
(
arg
,
iVal
);
*
argpos
=
V_
I2
(
arg
);
hres
=
S_OK
;
break
;
case
VT_I4
:
memcpy
(
argpos
,
&
V_
UNION
(
arg
,
lVal
),
4
);
memcpy
(
argpos
,
&
V_
I4
(
arg
),
4
);
hres
=
S_OK
;
break
;
default:
...
...
@@ -4597,15 +4597,15 @@ _copy_arg( ITypeInfo2 *tinfo, TYPEDESC *tdesc,
if
(
V_VT
(
arg
)
==
VT_DISPATCH
)
{
IDispatch
*
disp
;
if
(
IsEqualIID
(
&
IID_IDispatch
,
&
(
tattr
->
guid
)))
{
memcpy
(
argpos
,
&
V_
UNION
(
arg
,
pdispVal
),
4
);
memcpy
(
argpos
,
&
V_
DISPATCH
(
arg
),
4
);
hres
=
S_OK
;
break
;
}
hres
=
IUnknown_QueryInterface
(
V_
UNION
(
arg
,
pdispVal
),
hres
=
IUnknown_QueryInterface
(
V_
DISPATCH
(
arg
),
&
IID_IDispatch
,(
LPVOID
*
)
&
disp
);
if
(
SUCCEEDED
(
hres
))
{
memcpy
(
argpos
,
&
disp
,
4
);
IUnknown_Release
(
V_
UNION
(
arg
,
pdispVal
));
IUnknown_Release
(
V_
DISPATCH
(
arg
));
hres
=
S_OK
;
break
;
}
...
...
@@ -4615,7 +4615,7 @@ _copy_arg( ITypeInfo2 *tinfo, TYPEDESC *tdesc,
break
;
}
if
(
V_VT
(
arg
)
==
VT_UNKNOWN
)
{
memcpy
(
argpos
,
&
V_UN
ION
(
arg
,
punkVal
),
4
);
memcpy
(
argpos
,
&
V_UN
KNOWN
(
arg
),
4
);
hres
=
S_OK
;
break
;
}
...
...
@@ -4626,7 +4626,7 @@ _copy_arg( ITypeInfo2 *tinfo, TYPEDESC *tdesc,
case
TKIND_DISPATCH
:
if
(
V_VT
(
arg
)
==
VT_DISPATCH
)
{
memcpy
(
argpos
,
&
V_
UNION
(
arg
,
pdispVal
),
4
);
memcpy
(
argpos
,
&
V_
DISPATCH
(
arg
),
4
);
hres
=
S_OK
;
}
else
{
...
...
@@ -4651,7 +4651,7 @@ _copy_arg( ITypeInfo2 *tinfo, TYPEDESC *tdesc,
oldvt
=
V_VT
(
arg
);
VariantInit
(
&
va
);
if
(
VariantChangeType
(
&
va
,
arg
,
0
,
vt
)
==
S_OK
)
{
memcpy
(
argpos
,
&
V_
UNION
(
&
va
,
lVal
),
arglen
);
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
...
...
@@ -4773,7 +4773,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
if
(
i
<
func_desc
->
cParams
-
func_desc
->
cParamsOpt
)
ERR
(
"Parameter has PARAMFLAG_FOPT flag but is not one of last cParamOpt parameters
\n
"
);
if
(
V_VT
(
arg
)
==
VT_EMPTY
||
((
V_
VT
(
arg
)
&
VT_BYREF
)
&&
!
V_BYREF
(
arg
)))
{
||
((
V_
ISBYREF
(
arg
)
)
&&
!
V_BYREF
(
arg
)))
{
/* FIXME: Documentation says that we do this when parameter is left unspecified.
How to determine it? */
...
...
@@ -4839,7 +4839,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
continue
;
VariantInit
(
pVarResult
);
memcpy
(
&
V_
UNION
(
pVarResult
,
intVal
),
&
args2
[
args2pos
],
arglen
*
sizeof
(
DWORD
));
memcpy
(
&
V_
INT
(
pVarResult
),
&
args2
[
args2pos
],
arglen
*
sizeof
(
DWORD
));
if
(
tdesc
->
vt
==
VT_PTR
)
tdesc
=
tdesc
->
u
.
lptdesc
;
...
...
dlls/oleaut32/usrmarshal.c
View file @
743fb99a
...
...
@@ -190,7 +190,7 @@ static unsigned wire_extra(unsigned long *pFlags, VARIANT *pvar)
ULONG
size
;
HRESULT
hr
;
if
(
V_
VT
(
pvar
)
&
VT_ARRAY
)
{
if
(
V_
ISARRAY
(
pvar
)
)
{
FIXME
(
"wire-size safearray
\n
"
);
return
0
;
}
...
...
@@ -527,7 +527,7 @@ HRESULT CALLBACK IDispatch_Invoke_Proxy(
/* count by-ref args */
for
(
cVarRef
=
0
,
u
=
0
;
u
<
pDispParams
->
cArgs
;
u
++
)
{
VARIANTARG
*
arg
=
&
pDispParams
->
rgvarg
[
u
];
if
(
V_
VT
(
arg
)
&
VT_BYREF
)
{
if
(
V_
ISBYREF
(
arg
)
)
{
cVarRef
++
;
}
}
...
...
@@ -537,7 +537,7 @@ HRESULT CALLBACK IDispatch_Invoke_Proxy(
/* make list of by-ref args */
for
(
cVarRef
=
0
,
u
=
0
;
u
<
pDispParams
->
cArgs
;
u
++
)
{
VARIANTARG
*
arg
=
&
pDispParams
->
rgvarg
[
u
];
if
(
V_
VT
(
arg
)
&
VT_BYREF
)
{
if
(
V_
ISBYREF
(
arg
)
)
{
rgVarRefIdx
[
cVarRef
]
=
u
;
VariantInit
(
&
rgVarRef
[
cVarRef
]);
cVarRef
++
;
...
...
dlls/oleaut32/variant.c
View file @
743fb99a
This diff is collapsed.
Click to expand it.
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