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
bbdcccd3
Commit
bbdcccd3
authored
Jul 26, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jul 27, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Add validation of some more parameters in IFontDisp::Invoke.
parent
207ec43e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
0 deletions
+69
-0
olefont.c
dlls/oleaut32/olefont.c
+35
-0
olefont.c
dlls/oleaut32/tests/olefont.c
+34
-0
No files found.
dlls/oleaut32/olefont.c
View file @
bbdcccd3
...
...
@@ -1402,6 +1402,41 @@ static HRESULT WINAPI OLEFontImpl_Invoke(
OLEFontImpl
*
this
=
impl_from_IDispatch
(
iface
);
HRESULT
hr
;
/* validate parameters */
if
(
!
IsEqualIID
(
riid
,
&
IID_NULL
))
{
ERR
(
"riid was %s instead of IID_NULL
\n
"
,
debugstr_guid
(
riid
));
return
DISP_E_UNKNOWNINTERFACE
;
}
if
(
wFlags
&
DISPATCH_PROPERTYGET
)
{
if
(
!
pVarResult
)
{
ERR
(
"null pVarResult not allowed when DISPATCH_PROPERTYGET specified
\n
"
);
return
DISP_E_PARAMNOTOPTIONAL
;
}
}
else
if
(
wFlags
&
DISPATCH_PROPERTYPUT
)
{
if
(
!
pDispParams
)
{
ERR
(
"null pDispParams not allowed when DISPATCH_PROPERTYPUT specified
\n
"
);
return
DISP_E_PARAMNOTOPTIONAL
;
}
if
(
pDispParams
->
cArgs
!=
1
)
{
ERR
(
"param count for DISPATCH_PROPERTYPUT was %ld instead of 1
\n
"
,
pDispParams
->
cArgs
);
return
DISP_E_BADPARAMCOUNT
;
}
}
else
{
ERR
(
"one of DISPATCH_PROPERTYGET or DISPATCH_PROPERTYPUT must be specified
\n
"
);
return
DISP_E_MEMBERNOTFOUND
;
}
switch
(
dispIdMember
)
{
case
DISPID_FONT_NAME
:
if
(
wFlags
&
DISPATCH_PROPERTYGET
)
{
...
...
dlls/oleaut32/tests/olefont.c
View file @
bbdcccd3
...
...
@@ -425,6 +425,39 @@ void test_GetIDsOfNames(void)
DISPID_FONT_NAME
,
0
,
S_OK
,
1
);
}
static
void
test_Invoke
(
void
)
{
IFontDisp
*
fontdisp
;
HRESULT
hr
;
VARIANTARG
vararg
;
DISPPARAMS
dispparams
;
hr
=
pOleCreateFontIndirect
(
NULL
,
&
IID_IFontDisp
,
(
void
**
)
&
fontdisp
);
ok_ole_success
(
hr
,
"OleCreateFontIndirect
\n
"
);
V_VT
(
&
vararg
)
=
VT_BOOL
;
V_BOOL
(
&
vararg
)
=
FALSE
;
dispparams
.
cNamedArgs
=
0
;
dispparams
.
rgdispidNamedArgs
=
NULL
;
dispparams
.
cArgs
=
1
;
dispparams
.
rgvarg
=
&
vararg
;
hr
=
IFontDisp_Invoke
(
fontdisp
,
DISPID_FONT_BOLD
,
&
IID_IFontDisp
,
0
,
DISPATCH_PROPERTYPUT
,
&
dispparams
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
DISP_E_UNKNOWNINTERFACE
,
"IFontDisp_Invoke should have returned DISP_E_UNKNOWNINTERFACE instead of 0x%08lx
\n
"
,
hr
);
dispparams
.
cArgs
=
0
;
dispparams
.
rgvarg
=
NULL
;
hr
=
IFontDisp_Invoke
(
fontdisp
,
DISPID_FONT_BOLD
,
&
IID_NULL
,
0
,
DISPATCH_PROPERTYPUT
,
&
dispparams
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
DISP_E_BADPARAMCOUNT
,
"IFontDisp_Invoke should have returned DISP_E_BADPARAMCOUNT instead of 0x%08lx
\n
"
,
hr
);
hr
=
IFontDisp_Invoke
(
fontdisp
,
DISPID_FONT_BOLD
,
&
IID_NULL
,
0
,
DISPATCH_PROPERTYPUT
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
DISP_E_PARAMNOTOPTIONAL
,
"IFontDisp_Invoke should have returned DISP_E_PARAMNOTOPTIONAL instead of 0x%08lx
\n
"
,
hr
);
hr
=
IFontDisp_Invoke
(
fontdisp
,
DISPID_FONT_BOLD
,
&
IID_NULL
,
0
,
DISPATCH_PROPERTYGET
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
DISP_E_PARAMNOTOPTIONAL
,
"IFontDisp_Invoke should have returned DISP_E_PARAMNOTOPTIONAL instead of 0x%08lx
\n
"
,
hr
);
IFontDisp_Release
(
fontdisp
);
}
START_TEST
(
olefont
)
{
hOleaut32
=
LoadLibraryA
(
"oleaut32.dll"
);
...
...
@@ -447,4 +480,5 @@ START_TEST(olefont)
test_font_events_disp
();
test_GetIDsOfNames
();
test_Invoke
();
}
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