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
fbdf119e
Commit
fbdf119e
authored
Jun 16, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Try to find imported typelib using .tlb extension if it wasn't specified.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cb563dba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
8 deletions
+28
-8
typelib.c
tools/widl/typelib.c
+28
-8
No files found.
tools/widl/typelib.c
View file @
fbdf119e
...
...
@@ -326,22 +326,42 @@ static void read_msft_importlib(importlib_t *importlib, int fd)
free
(
typeinfo_offs
);
}
static
void
read_importlib
(
importlib_t
*
importlib
)
static
int
open_typelib
(
const
char
*
name
)
{
int
fd
;
INT
magic
;
char
*
file_name
;
int
fd
;
file_name
=
wpp_find_include
(
name
,
NULL
);
if
(
!
file_name
)
return
open
(
name
,
O_RDONLY
|
O_BINARY
);
file_name
=
wpp_find_include
(
importlib
->
name
,
NULL
);
if
(
file_name
)
{
fd
=
open
(
file_name
,
O_RDONLY
|
O_BINARY
);
free
(
file_name
);
}
else
{
fd
=
open
(
importlib
->
name
,
O_RDONLY
|
O_BINARY
);
return
fd
;
}
static
void
read_importlib
(
importlib_t
*
importlib
)
{
int
fd
;
INT
magic
;
fd
=
open_typelib
(
importlib
->
name
);
/* widl extension: if importlib name has no .tlb extension, try using .tlb */
if
(
fd
<
0
)
{
const
char
*
p
=
strrchr
(
importlib
->
name
,
'.'
);
size_t
len
=
p
?
p
-
importlib
->
name
:
strlen
(
importlib
->
name
);
if
(
strcmp
(
importlib
->
name
+
len
,
".tlb"
))
{
char
*
tlb_name
=
xmalloc
(
len
+
5
);
memcpy
(
tlb_name
,
importlib
->
name
,
len
);
strcpy
(
tlb_name
+
len
,
".tlb"
);
fd
=
open_typelib
(
tlb_name
);
free
(
tlb_name
);
}
}
if
(
fd
<
0
)
error
(
"Could not
open
importlib %s.
\n
"
,
importlib
->
name
);
error
(
"Could not
find
importlib %s.
\n
"
,
importlib
->
name
);
tlb_read
(
fd
,
&
magic
,
sizeof
(
magic
));
...
...
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