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
89b2cde8
Commit
89b2cde8
authored
Dec 04, 2009
by
James Hawkins
Committed by
Alexandre Julliard
Dec 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Report the parameter index for any failure in DispGetParam.
parent
02dcc198
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
24 deletions
+23
-24
dispatch.c
dlls/oleaut32/dispatch.c
+23
-9
dispatch.c
dlls/oleaut32/tests/dispatch.c
+0
-15
No files found.
dlls/oleaut32/dispatch.c
View file @
89b2cde8
...
...
@@ -131,16 +131,13 @@ HRESULT WINAPI DispGetParam(
TRACE
(
"position=%d, cArgs=%d, cNamedArgs=%d
\n
"
,
position
,
pdispparams
->
cArgs
,
pdispparams
->
cNamedArgs
);
if
(
pdispparams
->
cArgs
>
0
&&
!
pdispparams
->
rgvarg
)
return
E_INVALIDARG
;
if
(
!
pvarResult
)
return
E_INVALIDARG
;
if
(
position
<
pdispparams
->
cArgs
)
{
if
(
position
<
pdispparams
->
cArgs
)
{
/* positional arg? */
pos
=
pdispparams
->
cArgs
-
position
-
1
;
}
else
{
}
else
{
/* FIXME: is this how to handle named args? */
for
(
pos
=
0
;
pos
<
pdispparams
->
cNamedArgs
;
pos
++
)
if
(
pdispparams
->
rgdispidNamedArgs
[
pos
]
==
position
)
break
;
...
...
@@ -148,10 +145,27 @@ HRESULT WINAPI DispGetParam(
if
(
pos
==
pdispparams
->
cNamedArgs
)
return
DISP_E_PARAMNOTFOUND
;
}
if
(
pdispparams
->
cArgs
>
0
&&
!
pdispparams
->
rgvarg
)
{
hr
=
E_INVALIDARG
;
goto
done
;
}
if
(
!
pvarResult
)
{
hr
=
E_INVALIDARG
;
goto
done
;
}
hr
=
VariantChangeType
(
pvarResult
,
&
pdispparams
->
rgvarg
[
pos
],
0
,
vtTarg
);
if
(
hr
==
DISP_E_TYPEMISMATCH
)
*
puArgErr
=
pos
;
done:
if
(
FAILED
(
hr
))
*
puArgErr
=
pos
;
return
hr
;
}
...
...
dlls/oleaut32/tests/dispatch.c
View file @
89b2cde8
...
...
@@ -103,11 +103,8 @@ void test_DispGetParam(void)
INIT_DISPPARAMS
(
dispparams
,
NULL
,
NULL
,
0
,
0
);
err_index
=
0xdeadbeef
;
hr
=
DispGetParam
(
&
dispparams
,
0
,
VT_I2
,
NULL
,
&
err_index
);
todo_wine
{
ok
(
hr
==
DISP_E_PARAMNOTFOUND
,
"Expected DISP_E_PARAMNOTFOUND, got %08x
\n
"
,
hr
);
}
ok
(
err_index
==
0xdeadbeef
,
"Expected err_index to be unchanged, got %d
\n
"
,
err_index
);
...
...
@@ -128,10 +125,7 @@ void test_DispGetParam(void)
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08x
\n
"
,
hr
);
ok
(
V_VT
(
&
result
)
==
VT_EMPTY
,
"Expected VT_EMPTY, got %08x
\n
"
,
V_VT
(
&
result
));
todo_wine
{
ok
(
err_index
==
0
,
"Expected 0, got %d
\n
"
,
err_index
);
}
/* pdispparams.cNamedArgs is 1, yet pdispparams.rgdispidNamedArgs is NULL.
*
...
...
@@ -195,10 +189,7 @@ void test_DispGetParam(void)
err_index
=
0xdeadbeef
;
hr
=
DispGetParam
(
&
dispparams
,
2
,
VT_I2
,
NULL
,
&
err_index
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08x
\n
"
,
hr
);
todo_wine
{
ok
(
err_index
==
0
,
"Expected 0, got %d
\n
"
,
err_index
);
}
/* puArgErr is NULL. */
INIT_DISPPARAMS
(
dispparams
,
vararg
,
NULL
,
3
,
0
);
...
...
@@ -239,10 +230,7 @@ void test_DispGetParam(void)
ok
(
hr
==
DISP_E_OVERFLOW
,
"Expected DISP_E_OVERFLOW, got %08x
\n
"
,
hr
);
ok
(
V_VT
(
&
result
)
==
VT_EMPTY
,
"Expected VT_EMPTY, got %08x
\n
"
,
V_VT
(
&
result
));
todo_wine
{
ok
(
err_index
==
1
,
"Expected 1, got %d
\n
"
,
err_index
);
}
/* Coerce the third (VT_BSTR) param to VT_I2. */
INIT_DISPPARAMS
(
dispparams
,
vararg
,
NULL
,
3
,
0
);
...
...
@@ -263,10 +251,7 @@ void test_DispGetParam(void)
ok
(
hr
==
DISP_E_BADVARTYPE
,
"Expected DISP_E_BADVARTYPE, got %08x
\n
"
,
hr
);
ok
(
V_VT
(
&
result
)
==
VT_EMPTY
,
"Expected VT_EMPTY, got %08x
\n
"
,
V_VT
(
&
result
));
todo_wine
{
ok
(
err_index
==
0
,
"Expected 0, got %d
\n
"
,
err_index
);
}
CLEAR_VARARG
(
vararg
);
...
...
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