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
918425bb
Commit
918425bb
authored
Jan 20, 2016
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 23, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Create library block index right after the CompObj one.
Otherwise Wine's oleaut32 refuses to load a typelib. Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
parent
62223ed9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
12 deletions
+27
-12
write_sltg.c
tools/widl/write_sltg.c
+27
-12
No files found.
tools/widl/write_sltg.c
View file @
918425bb
...
...
@@ -354,28 +354,37 @@ static void init_library(struct sltg_typelib *sltg)
}
}
static
void
add_block
(
struct
sltg_typelib
*
sltg
,
void
*
data
,
int
length
,
const
char
*
name
)
static
void
add_block
_index
(
struct
sltg_typelib
*
sltg
,
void
*
data
,
int
length
,
int
index
)
{
chat
(
"add_block: %p,%d,
\"
%s
\"\n
"
,
data
,
length
,
name
);
sltg
->
blocks
=
xrealloc
(
sltg
->
blocks
,
sizeof
(
sltg
->
blocks
[
0
])
*
(
sltg
->
block_count
+
1
));
sltg
->
blocks
[
sltg
->
block_count
].
length
=
length
;
sltg
->
blocks
[
sltg
->
block_count
].
data
=
data
;
sltg
->
blocks
[
sltg
->
block_count
].
index_string
=
add_index
(
&
sltg
->
index
,
name
)
;
sltg
->
blocks
[
sltg
->
block_count
].
index_string
=
index
;
sltg
->
block_count
++
;
}
static
void
add_library_block
(
struct
sltg_typelib
*
typelib
)
static
void
add_block
(
struct
sltg_typelib
*
sltg
,
void
*
data
,
int
size
,
const
char
*
name
)
{
struct
sltg_block
*
block
=
xmalloc
(
sizeof
(
*
block
));
int
index
;
chat
(
"add_block: %p,%d,
\"
%s
\"\n
"
,
data
,
size
,
name
);
index
=
add_index
(
&
sltg
->
index
,
name
);
add_block_index
(
sltg
,
data
,
size
,
index
);
}
static
void
*
create_library_block
(
struct
sltg_typelib
*
typelib
,
int
*
size
,
int
*
index
)
{
void
*
block
;
short
*
p
;
int
size
;
size
=
sizeof
(
short
)
*
9
+
sizeof
(
int
)
*
3
+
sizeof
(
GUID
);
if
(
typelib
->
library
.
helpstring
)
size
+=
strlen
(
typelib
->
library
.
helpstring
);
if
(
typelib
->
library
.
helpfile
)
size
+=
strlen
(
typelib
->
library
.
helpfile
);
*
size
=
sizeof
(
short
)
*
9
+
sizeof
(
int
)
*
3
+
sizeof
(
GUID
);
if
(
typelib
->
library
.
helpstring
)
*
size
+=
strlen
(
typelib
->
library
.
helpstring
);
if
(
typelib
->
library
.
helpfile
)
*
size
+=
strlen
(
typelib
->
library
.
helpfile
);
block
=
xmalloc
(
size
);
block
=
xmalloc
(
*
size
);
p
=
block
;
*
p
++
=
0x51cc
;
/* magic */
*
p
++
=
3
;
/* res02 */
...
...
@@ -408,7 +417,9 @@ static void add_library_block(struct sltg_typelib *typelib)
p
+=
2
;
*
(
GUID
*
)
p
=
typelib
->
library
.
uuid
;
add_block
(
typelib
,
block
,
size
,
"dir"
);
*
index
=
add_index
(
&
typelib
->
index
,
"dir"
);
return
block
;
}
static
const
char
*
new_index_name
(
void
)
...
...
@@ -1687,6 +1698,8 @@ int create_sltg_typelib(typelib_t *typelib)
{
struct
sltg_typelib
sltg
;
const
statement_t
*
stmt
;
void
*
library_block
;
int
library_block_size
,
library_block_index
;
if
(
pointer_size
!=
4
)
error
(
"Only 32-bit platform is supported
\n
"
);
...
...
@@ -1703,12 +1716,14 @@ int create_sltg_typelib(typelib_t *typelib)
init_name_table
(
&
sltg
.
name_table
);
init_library
(
&
sltg
);
add_library_block
(
&
sltg
);
library_block
=
create_library_block
(
&
sltg
,
&
library_block_size
,
&
library_block_index
);
if
(
typelib
->
stmts
)
LIST_FOR_EACH_ENTRY
(
stmt
,
typelib
->
stmts
,
const
statement_t
,
entry
)
add_statement
(
&
sltg
,
stmt
);
add_block_index
(
&
sltg
,
library_block
,
library_block_size
,
library_block_index
);
save_all_changes
(
&
sltg
);
return
1
;
...
...
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