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
88367a3c
Commit
88367a3c
authored
Feb 12, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Return error if VT_HRESULT is used as return type in DispCallFunc.
parent
6b0e2c8f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
typelib.c
dlls/oleaut32/tests/typelib.c
+16
-0
typelib.c
dlls/oleaut32/typelib.c
+8
-0
No files found.
dlls/oleaut32/tests/typelib.c
View file @
88367a3c
...
...
@@ -923,6 +923,11 @@ static int WINAPI inst_func( void *inst, int a )
return
a
*
2
;
}
static
HRESULT
WINAPI
ret_false_func
(
void
)
{
return
S_FALSE
;
}
static
const
void
*
vtable
[]
=
{
NULL
,
NULL
,
NULL
,
inst_func
};
static
void
test_DispCallFunc
(
void
)
...
...
@@ -1038,6 +1043,17 @@ static void test_DispCallFunc(void)
ok
(
res
==
S_OK
,
"DispCallFunc failed %x
\n
"
,
res
);
ok
(
V_VT
(
&
result
)
==
VT_I4
,
"wrong result type %d
\n
"
,
V_VT
(
&
result
)
);
ok
(
V_I4
(
&
result
)
==
6
,
"wrong result %08x
\n
"
,
V_I4
(
&
result
)
);
memset
(
&
result
,
0xcc
,
sizeof
(
result
)
);
res
=
DispCallFunc
(
NULL
,
(
ULONG_PTR
)
ret_false_func
,
CC_STDCALL
,
VT_ERROR
,
0
,
NULL
,
NULL
,
&
result
);
ok
(
res
==
S_OK
,
"DispCallFunc failed: %08x
\n
"
,
res
);
ok
(
V_VT
(
&
result
)
==
VT_ERROR
,
"V_VT(result) = %u
\n
"
,
V_VT
(
&
result
));
ok
(
V_ERROR
(
&
result
)
==
S_FALSE
,
"V_ERROR(result) = %08x
\n
"
,
V_ERROR
(
&
result
));
memset
(
&
result
,
0xcc
,
sizeof
(
result
)
);
res
=
DispCallFunc
(
NULL
,
(
ULONG_PTR
)
ret_false_func
,
CC_STDCALL
,
VT_HRESULT
,
0
,
NULL
,
NULL
,
&
result
);
ok
(
res
==
E_INVALIDARG
,
"DispCallFunc failed: %08x
\n
"
,
res
);
ok
(
V_VT
(
&
result
)
==
0xcccc
,
"V_VT(result) = %u
\n
"
,
V_VT
(
&
result
));
}
/* RegDeleteTreeW from dlls/advapi32/registry.c */
...
...
dlls/oleaut32/typelib.c
View file @
88367a3c
...
...
@@ -6185,6 +6185,10 @@ DispCallFunc(
case
VT_CY
:
V_UI8
(
pvargResult
)
=
call_method
(
func
,
argspos
-
1
,
args
+
1
,
&
stack_offset
);
break
;
case
VT_HRESULT
:
WARN
(
"invalid return type %u
\n
"
,
vtReturn
);
heap_free
(
args
);
return
E_INVALIDARG
;
default:
V_UI4
(
pvargResult
)
=
call_method
(
func
,
argspos
-
1
,
args
+
1
,
&
stack_offset
);
break
;
...
...
@@ -6263,6 +6267,10 @@ DispCallFunc(
args
[
0
]
=
(
DWORD_PTR
)
pvargResult
;
/* arg 0 is a pointer to the result */
call_method
(
func
,
argspos
,
args
);
break
;
case
VT_HRESULT
:
WARN
(
"invalid return type %u
\n
"
,
vtReturn
);
heap_free
(
args
);
return
E_INVALIDARG
;
default:
V_UI8
(
pvargResult
)
=
call_method
(
func
,
argspos
-
1
,
args
+
1
);
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