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
2c911147
Commit
2c911147
authored
Feb 17, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Feb 17, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Fix crash in LoadTypeLib if typelib name is not specified.
parent
16785efc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
3 deletions
+31
-3
typelib.c
dlls/oleaut32/tests/typelib.c
+28
-0
typelib.c
dlls/oleaut32/typelib.c
+3
-3
No files found.
dlls/oleaut32/tests/typelib.c
View file @
2c911147
...
...
@@ -968,6 +968,33 @@ if(use_midl_tlb) {
return
;
}
static
void
test_CreateTypeLib
(
void
)
{
char
filename
[
MAX_PATH
];
WCHAR
filenameW
[
MAX_PATH
];
ICreateTypeLib2
*
createtl
;
ITypeLib
*
tl
;
HRESULT
hres
;
trace
(
"CreateTypeLib tests
\n
"
);
GetTempFileNameA
(
"."
,
"tlb"
,
0
,
filename
);
MultiByteToWideChar
(
CP_ACP
,
0
,
filename
,
-
1
,
filenameW
,
MAX_PATH
);
hres
=
CreateTypeLib2
(
SYS_WIN32
,
filenameW
,
&
createtl
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
hres
=
ICreateTypeLib2_SaveAllChanges
(
createtl
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ICreateTypeLib2_Release
(
createtl
);
hres
=
LoadTypeLib
(
filenameW
,
&
tl
);
ok
(
hres
==
S_OK
,
"got %08x
\n
"
,
hres
);
ITypeLib_Release
(
tl
);
DeleteFileA
(
filename
);
}
#if 0 /* use this to generate more tests */
#define OLE_CHECK(x) { HRESULT hr = x; if (FAILED(hr)) { printf(#x "failed - %x\n", hr); return; } }
...
...
@@ -1480,6 +1507,7 @@ START_TEST(typelib)
test_TypeInfo
();
test_QueryPathOfRegTypeLib
();
test_inheritance
();
test_CreateTypeLib
();
if
((
filename
=
create_test_typelib
()))
{
...
...
dlls/oleaut32/typelib.c
View file @
2c911147
...
...
@@ -552,7 +552,9 @@ HRESULT WINAPI RegisterTypeLib(
LPOLESTR
doc
;
/* Set the human-readable name of the typelib */
if
(
SUCCEEDED
(
ITypeLib_GetDocumentation
(
ptlib
,
-
1
,
NULL
,
&
doc
,
NULL
,
NULL
)))
if
(
FAILED
(
ITypeLib_GetDocumentation
(
ptlib
,
-
1
,
NULL
,
&
doc
,
NULL
,
NULL
)))
res
=
E_FAIL
;
else
if
(
doc
)
{
if
(
RegSetValueExW
(
key
,
NULL
,
0
,
REG_SZ
,
(
BYTE
*
)
doc
,
(
lstrlenW
(
doc
)
+
1
)
*
sizeof
(
OLECHAR
))
!=
ERROR_SUCCESS
)
...
...
@@ -560,8 +562,6 @@ HRESULT WINAPI RegisterTypeLib(
SysFreeString
(
doc
);
}
else
res
=
E_FAIL
;
/* Make up the name of the typelib path subkey */
if
(
!
get_lcid_subkey
(
attr
->
lcid
,
attr
->
syskind
,
tmp
))
res
=
E_FAIL
;
...
...
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