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
c395ae56
Commit
c395ae56
authored
Dec 22, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Basic parameter validation tests for some GetTypeInfo* methods.
parent
18a71522
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
7 deletions
+45
-7
typelib.c
dlls/oleaut32/tests/typelib.c
+34
-0
typelib.c
dlls/oleaut32/typelib.c
+4
-4
typelib2.c
dlls/oleaut32/typelib2.c
+7
-3
No files found.
dlls/oleaut32/tests/typelib.c
View file @
c395ae56
...
@@ -502,10 +502,31 @@ static void test_TypeInfo(void)
...
@@ -502,10 +502,31 @@ static void test_TypeInfo(void)
DISPPARAMS
dispparams
;
DISPPARAMS
dispparams
;
GUID
bogusguid
=
{
0x806afb4f
,
0x13f7
,
0x42d2
,{
0x89
,
0x2c
,
0x6c
,
0x97
,
0xc3
,
0x6a
,
0x36
,
0xc1
}};
GUID
bogusguid
=
{
0x806afb4f
,
0x13f7
,
0x42d2
,{
0x89
,
0x2c
,
0x6c
,
0x97
,
0xc3
,
0x6a
,
0x36
,
0xc1
}};
VARIANT
var
;
VARIANT
var
;
UINT
count
;
TYPEKIND
kind
;
hr
=
LoadTypeLib
(
wszStdOle2
,
&
pTypeLib
);
hr
=
LoadTypeLib
(
wszStdOle2
,
&
pTypeLib
);
ok_ole_success
(
hr
,
LoadTypeLib
);
ok_ole_success
(
hr
,
LoadTypeLib
);
count
=
ITypeLib_GetTypeInfoCount
(
pTypeLib
);
ok
(
count
>
0
,
"got %d
\n
"
,
count
);
/* invalid index */
hr
=
ITypeLib_GetTypeInfo
(
pTypeLib
,
count
,
&
pTypeInfo
);
ok
(
hr
==
TYPE_E_ELEMENTNOTFOUND
,
"got 0x%08x
\n
"
,
hr
);
hr
=
ITypeLib_GetTypeInfo
(
pTypeLib
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
hr
=
ITypeLib_GetTypeInfoType
(
pTypeLib
,
count
,
&
kind
);
ok
(
hr
==
TYPE_E_ELEMENTNOTFOUND
,
"got 0x%08x
\n
"
,
hr
);
hr
=
ITypeLib_GetTypeInfoType
(
pTypeLib
,
count
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
hr
=
ITypeLib_GetTypeInfoType
(
pTypeLib
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
hr
=
ITypeLib_GetTypeInfoOfGuid
(
pTypeLib
,
&
IID_IFont
,
&
pTypeInfo
);
hr
=
ITypeLib_GetTypeInfoOfGuid
(
pTypeLib
,
&
IID_IFont
,
&
pTypeInfo
);
ok_ole_success
(
hr
,
ITypeLib_GetTypeInfoOfGuid
);
ok_ole_success
(
hr
,
ITypeLib_GetTypeInfoOfGuid
);
...
@@ -1307,6 +1328,7 @@ static void test_CreateTypeLib(void) {
...
@@ -1307,6 +1328,7 @@ static void test_CreateTypeLib(void) {
int
impltypeflags
;
int
impltypeflags
;
VARIANT
cust_data
;
VARIANT
cust_data
;
HRESULT
hres
;
HRESULT
hres
;
TYPEKIND
kind
;
trace
(
"CreateTypeLib tests
\n
"
);
trace
(
"CreateTypeLib tests
\n
"
);
...
@@ -1328,6 +1350,18 @@ static void test_CreateTypeLib(void) {
...
@@ -1328,6 +1350,18 @@ static void test_CreateTypeLib(void) {
hres
=
ICreateTypeLib_QueryInterface
(
createtl
,
&
IID_ITypeLib
,
(
void
**
)
&
tl
);
hres
=
ICreateTypeLib_QueryInterface
(
createtl
,
&
IID_ITypeLib
,
(
void
**
)
&
tl
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ITypeLib_GetTypeInfo
(
tl
,
0
,
NULL
);
ok
(
hres
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hres
);
hres
=
ITypeLib_GetTypeInfoType
(
tl
,
0
,
&
kind
);
ok
(
hres
==
TYPE_E_ELEMENTNOTFOUND
,
"got 0x%08x
\n
"
,
hres
);
hres
=
ITypeLib_GetTypeInfoType
(
tl
,
0
,
NULL
);
ok
(
hres
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hres
);
hres
=
ITypeLib_GetTypeInfoType
(
tl
,
0
,
NULL
);
ok
(
hres
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hres
);
hres
=
ITypeLib_GetLibAttr
(
tl
,
&
libattr
);
hres
=
ITypeLib_GetLibAttr
(
tl
,
&
libattr
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
...
...
dlls/oleaut32/typelib.c
View file @
c395ae56
...
@@ -4278,13 +4278,13 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoType(
...
@@ -4278,13 +4278,13 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoType(
UINT
i
;
UINT
i
;
ITypeInfoImpl
*
pTInfo
=
This
->
pTypeInfo
;
ITypeInfoImpl
*
pTInfo
=
This
->
pTypeInfo
;
if
(
ITypeLib2_fnGetTypeInfoCount
(
iface
)
<
index
+
1
)
TRACE
(
"(%p, %d, %p)
\n
"
,
This
,
index
,
pTKind
);
return
TYPE_E_ELEMENTNOTFOUND
;
TRACE
(
"(%p) index %d
\n
"
,
This
,
index
);
if
(
!
pTKind
)
return
E_INVALIDARG
;
if
(
!
pTKind
)
return
E_INVALIDARG
;
if
(
ITypeLib2_GetTypeInfoCount
(
iface
)
<=
index
)
return
TYPE_E_ELEMENTNOTFOUND
;
/* search element n in list */
/* search element n in list */
for
(
i
=
0
;
i
<
index
;
i
++
)
for
(
i
=
0
;
i
<
index
;
i
++
)
{
{
...
...
dlls/oleaut32/typelib2.c
View file @
c395ae56
...
@@ -4862,6 +4862,8 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfo(
...
@@ -4862,6 +4862,8 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfo(
TRACE
(
"(%p,%d,%p)
\n
"
,
iface
,
index
,
ppTInfo
);
TRACE
(
"(%p,%d,%p)
\n
"
,
iface
,
index
,
ppTInfo
);
if
(
!
ppTInfo
)
return
E_INVALIDARG
;
if
(
index
>=
This
->
typelib_header
.
nrtypeinfos
)
{
if
(
index
>=
This
->
typelib_header
.
nrtypeinfos
)
{
return
TYPE_E_ELEMENTNOTFOUND
;
return
TYPE_E_ELEMENTNOTFOUND
;
}
}
...
@@ -4877,17 +4879,19 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfo(
...
@@ -4877,17 +4879,19 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfo(
static
HRESULT
WINAPI
ITypeLib2_fnGetTypeInfoType
(
static
HRESULT
WINAPI
ITypeLib2_fnGetTypeInfoType
(
ITypeLib2
*
iface
,
ITypeLib2
*
iface
,
UINT
index
,
UINT
index
,
TYPEKIND
*
pTK
ind
)
TYPEKIND
*
k
ind
)
{
{
ICreateTypeLib2Impl
*
This
=
impl_from_ITypeLib2
(
iface
);
ICreateTypeLib2Impl
*
This
=
impl_from_ITypeLib2
(
iface
);
TRACE
(
"(%p,%d,%p)
\n
"
,
iface
,
index
,
pTKind
);
TRACE
(
"(%p,%d,%p)
\n
"
,
iface
,
index
,
kind
);
if
(
!
kind
)
return
E_INVALIDARG
;
if
(
index
>=
This
->
typelib_header
.
nrtypeinfos
)
{
if
(
index
>=
This
->
typelib_header
.
nrtypeinfos
)
{
return
TYPE_E_ELEMENTNOTFOUND
;
return
TYPE_E_ELEMENTNOTFOUND
;
}
}
*
pTKind
=
(
This
->
typelib_segment_data
[
MSFT_SEG_TYPEINFO
][
This
->
typelib_typeinfo_offsets
[
index
]])
&
15
;
*
kind
=
(
This
->
typelib_segment_data
[
MSFT_SEG_TYPEINFO
][
This
->
typelib_typeinfo_offsets
[
index
]])
&
0xF
;
return
S_OK
;
return
S_OK
;
}
}
...
...
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