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
1c23b501
Commit
1c23b501
authored
Sep 24, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 24, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: LoadRegTypeLib() should check actual typelib version.
parent
4be30130
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
2 deletions
+39
-2
typelib.c
dlls/oleaut32/tests/typelib.c
+25
-2
typelib.c
dlls/oleaut32/typelib.c
+14
-0
No files found.
dlls/oleaut32/tests/typelib.c
View file @
1c23b501
...
...
@@ -4734,7 +4734,6 @@ static void test_LoadRegTypeLib(void)
if
(
hr
==
S_OK
)
ITypeLib_Release
(
tl
);
hr
=
LoadRegTypeLib
(
&
LIBID_register_test
,
2
,
0
,
LOCALE_NEUTRAL
,
&
tl
);
todo_wine
ok
(
hr
==
TYPE_E_LIBNOTREGISTERED
,
"got 0x%08x
\n
"
,
hr
);
/* manifest version is 2.7, actual is 2.5 */
...
...
@@ -4755,7 +4754,6 @@ todo_wine
if
(
hr
==
S_OK
)
ITypeLib_Release
(
tl
);
hr
=
LoadRegTypeLib
(
&
LIBID_TestTypelib
,
2
,
7
,
LOCALE_NEUTRAL
,
&
tl
);
todo_wine
ok
(
hr
==
TYPE_E_LIBNOTREGISTERED
,
"got 0x%08x
\n
"
,
hr
);
hr
=
LoadRegTypeLib
(
&
LIBID_TestTypelib
,
2
,
5
,
LOCALE_NEUTRAL
,
&
tl
);
...
...
@@ -5025,6 +5023,30 @@ static void test_SetTypeDescAlias(SYSKIND kind)
DeleteFileA
(
filenameA
);
}
static
void
test_GetLibAttr
(
void
)
{
ULONG
ref1
,
ref2
;
TLIBATTR
*
attr
;
ITypeLib
*
tl
;
HRESULT
hr
;
hr
=
LoadTypeLib
(
wszStdOle2
,
&
tl
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ref1
=
ITypeLib_AddRef
(
tl
);
ITypeLib_Release
(
tl
);
hr
=
ITypeLib_GetLibAttr
(
tl
,
&
attr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ref2
=
ITypeLib_AddRef
(
tl
);
ITypeLib_Release
(
tl
);
ok
(
ref2
==
ref1
,
"got %d, %d
\n
"
,
ref2
,
ref1
);
ITypeLib_ReleaseTLibAttr
(
tl
,
attr
);
ITypeLib_Release
(
tl
);
}
START_TEST
(
typelib
)
{
const
char
*
filename
;
...
...
@@ -5062,4 +5084,5 @@ START_TEST(typelib)
test_LoadTypeLib
();
test_TypeInfo2_GetContainingTypeLib
();
test_LoadRegTypeLib
();
test_GetLibAttr
();
}
dlls/oleaut32/typelib.c
View file @
1c23b501
...
...
@@ -536,6 +536,20 @@ HRESULT WINAPI LoadRegTypeLib(
{
res
=
LoadTypeLib
(
bstr
,
ppTLib
);
SysFreeString
(
bstr
);
if
(
*
ppTLib
)
{
TLIBATTR
*
attr
;
res
=
ITypeLib_GetLibAttr
(
*
ppTLib
,
&
attr
);
if
(
res
==
S_OK
&&
(
attr
->
wMajorVerNum
!=
wVerMajor
||
attr
->
wMinorVerNum
<
wVerMinor
))
{
ITypeLib_ReleaseTLibAttr
(
*
ppTLib
,
attr
);
ITypeLib_Release
(
*
ppTLib
);
*
ppTLib
=
NULL
;
res
=
TYPE_E_LIBNOTREGISTERED
;
}
}
}
TRACE
(
"(IID: %s) load %s (%p)
\n
"
,
debugstr_guid
(
rguid
),
SUCCEEDED
(
res
)
?
"SUCCESS"
:
"FAILED"
,
*
ppTLib
);
...
...
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