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
806ea127
Commit
806ea127
authored
Aug 02, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 02, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Fix return value when converting from NULL interface pointers.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d283051b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
vartype.c
dlls/oleaut32/tests/vartype.c
+20
-0
variant.c
dlls/oleaut32/variant.c
+6
-0
No files found.
dlls/oleaut32/tests/vartype.c
View file @
806ea127
...
...
@@ -5889,6 +5889,16 @@ static void test_IUnknownChangeTypeEx(void)
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
),
SORT_DEFAULT
);
/* NULL IUnknown -> IDispatch */
V_VT
(
&
vSrc
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
&
vSrc
)
=
NULL
;
VariantInit
(
&
vDst
);
V_DISPATCH
(
&
vDst
)
=
(
void
*
)
0xdeadbeef
;
hres
=
VariantChangeTypeEx
(
&
vDst
,
&
vSrc
,
lcid
,
0
,
VT_DISPATCH
);
ok
(
hres
==
S_OK
&&
V_VT
(
&
vDst
)
==
VT_DISPATCH
&&
V_DISPATCH
(
&
vDst
)
==
NULL
,
"change unk(src,dst): expected 0x%08x,%d,%p, got 0x%08x,%d,%p
\n
"
,
S_OK
,
VT_DISPATCH
,
NULL
,
hres
,
V_VT
(
&
vDst
),
V_DISPATCH
(
&
vDst
));
V_VT
(
&
vSrc
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
&
vSrc
)
=
pu
;
...
...
@@ -6033,6 +6043,16 @@ static void test_IDispatchChangeTypeEx(void)
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
),
SORT_DEFAULT
);
/* NULL IDispatch -> IUnknown */
V_VT
(
&
vSrc
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
vSrc
)
=
NULL
;
VariantInit
(
&
vDst
);
V_UNKNOWN
(
&
vDst
)
=
(
void
*
)
0xdeadbeef
;
hres
=
VariantChangeTypeEx
(
&
vDst
,
&
vSrc
,
lcid
,
0
,
VT_UNKNOWN
);
ok
(
hres
==
S_OK
&&
V_VT
(
&
vDst
)
==
VT_UNKNOWN
&&
V_UNKNOWN
(
&
vDst
)
==
NULL
,
"change unk(src,dst): expected 0x%08x,%d,%p, got 0x%08x,%d,%p
\n
"
,
S_OK
,
VT_UNKNOWN
,
NULL
,
hres
,
V_VT
(
&
vDst
),
V_UNKNOWN
(
&
vDst
));
V_VT
(
&
vSrc
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
vSrc
)
=
pd
;
...
...
dlls/oleaut32/variant.c
View file @
806ea127
...
...
@@ -469,7 +469,10 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
{
case
VT_DISPATCH
:
if
(
V_DISPATCH
(
ps
)
==
NULL
)
{
V_UNKNOWN
(
pd
)
=
NULL
;
res
=
S_OK
;
}
else
res
=
IDispatch_QueryInterface
(
V_DISPATCH
(
ps
),
&
IID_IUnknown
,
(
LPVOID
*
)
&
V_UNKNOWN
(
pd
));
break
;
...
...
@@ -481,7 +484,10 @@ static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
{
case
VT_UNKNOWN
:
if
(
V_UNKNOWN
(
ps
)
==
NULL
)
{
V_DISPATCH
(
pd
)
=
NULL
;
res
=
S_OK
;
}
else
res
=
IUnknown_QueryInterface
(
V_UNKNOWN
(
ps
),
&
IID_IDispatch
,
(
LPVOID
*
)
&
V_DISPATCH
(
pd
));
break
;
...
...
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