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
97f501be
Commit
97f501be
authored
May 27, 2013
by
Tatyana Fokina
Committed by
Alexandre Julliard
May 28, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Ignore NULL ppTLib/pIndex in ITypeInfo2_fnGetContainingTypeLib.
parent
e558925d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
3 deletions
+55
-3
typelib.c
dlls/oleaut32/tests/typelib.c
+49
-0
typelib2.c
dlls/oleaut32/typelib2.c
+6
-3
No files found.
dlls/oleaut32/tests/typelib.c
View file @
97f501be
...
...
@@ -3385,6 +3385,54 @@ todo_wine {
ITypeLib_Release
(
tl
);
}
static
void
test_TypeInfo2_GetContainingTypeLib
(
void
)
{
static
const
WCHAR
test
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'.'
,
't'
,
'l'
,
'b'
,
0
};
static
OLECHAR
testTI
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'T'
,
'y'
,
'p'
,
'e'
,
'I'
,
'n'
,
'f'
,
'o'
,
0
};
ICreateTypeLib2
*
ctl2
;
ICreateTypeInfo
*
cti
;
ITypeInfo2
*
ti2
;
ITypeLib
*
tl
;
UINT
Index
;
HRESULT
hr
;
hr
=
CreateTypeLib2
(
SYS_WIN32
,
test
,
&
ctl2
);
ok_ole_success
(
hr
,
CreateTypeLib2
);
hr
=
ICreateTypeLib2_CreateTypeInfo
(
ctl2
,
testTI
,
TKIND_DISPATCH
,
&
cti
);
ok_ole_success
(
hr
,
ICreateTypeLib2_CreateTypeInfo
);
hr
=
ICreateTypeInfo_QueryInterface
(
cti
,
&
IID_ITypeInfo2
,
(
void
**
)
&
ti2
);
ok_ole_success
(
hr
,
ICreateTypeInfo2_QueryInterface
);
tl
=
NULL
;
Index
=
888
;
hr
=
ITypeInfo2_GetContainingTypeLib
(
ti2
,
&
tl
,
&
Index
);
ok_ole_success
(
hr
,
ITypeInfo2_GetContainingTypeLib
);
ok
(
tl
!=
NULL
,
"ITypeInfo2_GetContainingTypeLib returned empty TypeLib"
);
ok
(
Index
==
0
,
"ITypeInfo2_GetContainingTypeLib returned Index = %u, expected 0
\n
"
,
Index
);
if
(
tl
)
ITypeLib_Release
(
tl
);
tl
=
NULL
;
hr
=
ITypeInfo2_GetContainingTypeLib
(
ti2
,
&
tl
,
NULL
);
ok_ole_success
(
hr
,
ITypeInfo2_GetContainingTypeLib
);
ok
(
tl
!=
NULL
,
"ITypeInfo2_GetContainingTypeLib returned empty TypeLib"
);
if
(
tl
)
ITypeLib_Release
(
tl
);
Index
=
888
;
hr
=
ITypeInfo2_GetContainingTypeLib
(
ti2
,
NULL
,
&
Index
);
ok_ole_success
(
hr
,
ITypeInfo2_GetContainingTypeLib
);
ok
(
Index
==
0
,
"ITypeInfo2_GetContainingTypeLib returned Index = %u, expected 0
\n
"
,
Index
);
hr
=
ITypeInfo2_GetContainingTypeLib
(
ti2
,
NULL
,
NULL
);
ok_ole_success
(
hr
,
ITypeInfo2_GetContainingTypeLib
);
ITypeInfo2_Release
(
ti2
);
ICreateTypeInfo_Release
(
cti
);
ICreateTypeLib2_Release
(
ctl2
);
}
START_TEST
(
typelib
)
{
const
char
*
filename
;
...
...
@@ -3416,4 +3464,5 @@ START_TEST(typelib)
test_register_typelib
(
FALSE
);
test_create_typelibs
();
test_LoadTypeLib
();
test_TypeInfo2_GetContainingTypeLib
();
}
dlls/oleaut32/typelib2.c
View file @
97f501be
...
...
@@ -3707,9 +3707,12 @@ static HRESULT WINAPI ITypeInfo2_fnGetContainingTypeLib(
TRACE
(
"(%p,%p,%p)
\n
"
,
iface
,
ppTLib
,
pIndex
);
*
ppTLib
=
(
ITypeLib
*
)
&
This
->
typelib
->
ITypeLib2_iface
;
ICreateTypeLib_AddRef
((
ICreateTypeLib
*
)
This
->
typelib
);
*
pIndex
=
This
->
typeinfo
->
typekind
>>
16
;
if
(
ppTLib
)
{
*
ppTLib
=
(
ITypeLib
*
)
&
This
->
typelib
->
ITypeLib2_iface
;
ICreateTypeLib2_AddRef
(
&
This
->
typelib
->
ICreateTypeLib2_iface
);
}
if
(
pIndex
)
*
pIndex
=
This
->
typeinfo
->
typekind
>>
16
;
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