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
1478ac85
Commit
1478ac85
authored
Jan 31, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jan 31, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Clean up conformant struct handling.
Make the writing of conformant structures take advantage of the new type format string offset handling.
parent
5764d551
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
23 deletions
+26
-23
typegen.c
tools/widl/typegen.c
+26
-23
No files found.
tools/widl/typegen.c
View file @
1478ac85
...
...
@@ -796,6 +796,7 @@ static size_t write_struct_tfs(FILE *file, const type_t *type,
size_t
total_size
;
const
var_t
*
array
;
size_t
start_offset
;
size_t
array_offset
;
switch
(
type
->
type
)
{
...
...
@@ -827,6 +828,13 @@ static size_t write_struct_tfs(FILE *file, const type_t *type,
error
(
"structure size for parameter %s exceeds %d bytes by %d bytes
\n
"
,
name
,
USHRT_MAX
,
total_size
-
USHRT_MAX
);
array
=
find_array_or_string_in_struct
(
type
);
current_structure
=
type
;
array_offset
=
write_array_tfs
(
file
,
array
->
attrs
,
array
->
type
,
array
->
array
,
array
->
name
,
typestring_offset
);
current_structure
=
NULL
;
start_offset
=
*
typestring_offset
;
WRITE_FCTYPE
(
file
,
FC_CSTRUCT
,
*
typestring_offset
);
/* alignment */
...
...
@@ -834,19 +842,13 @@ static size_t write_struct_tfs(FILE *file, const type_t *type,
/* total size */
print_file
(
file
,
2
,
"NdrShort(0x%x), /* %u */
\n
"
,
total_size
,
total_size
);
*
typestring_offset
+=
4
;
/* FIXME: a fixed offset won't work when pointer layout is present */
print_file
(
file
,
2
,
"NdrShort(0x3), /* 3 */
\n
"
);
print_file
(
file
,
2
,
"NdrShort(0x%x), /* %d */
\n
"
,
array_offset
-
*
typestring_offset
,
array_offset
-
*
typestring_offset
);
*
typestring_offset
+=
2
;
print_file
(
file
,
2
,
"FC_END,
\n
"
);
*
typestring_offset
+=
1
;
array
=
find_array_or_string_in_struct
(
type
);
current_structure
=
type
;
write_array_tfs
(
file
,
array
->
attrs
,
array
->
type
,
array
->
array
,
array
->
name
,
typestring_offset
);
current_structure
=
NULL
;
return
start_offset
;
case
RPC_FC_CVSTRUCT
:
total_size
=
type_memsize
(
type
,
0
,
NULL
);
...
...
@@ -855,6 +857,18 @@ static size_t write_struct_tfs(FILE *file, const type_t *type,
error
(
"structure size for parameter %s exceeds %d bytes by %d bytes
\n
"
,
name
,
USHRT_MAX
,
total_size
-
USHRT_MAX
);
array
=
find_array_or_string_in_struct
(
type
);
current_structure
=
type
;
if
(
is_attr
(
array
->
attrs
,
ATTR_STRING
))
array_offset
=
write_string_tfs
(
file
,
array
->
attrs
,
array
->
type
,
array
->
array
,
array
->
name
,
typestring_offset
);
else
array_offset
=
write_array_tfs
(
file
,
array
->
attrs
,
array
->
type
,
array
->
array
,
array
->
name
,
typestring_offset
);
current_structure
=
NULL
;
start_offset
=
*
typestring_offset
;
WRITE_FCTYPE
(
file
,
FC_CVSTRUCT
,
*
typestring_offset
);
/* alignment */
...
...
@@ -862,24 +876,13 @@ static size_t write_struct_tfs(FILE *file, const type_t *type,
/* total size */
print_file
(
file
,
2
,
"NdrShort(0x%x), /* %u */
\n
"
,
total_size
,
total_size
);
*
typestring_offset
+=
4
;
/* FIXME: a fixed offset won't work when pointer layout is present */
print_file
(
file
,
2
,
"NdrShort(0x3), /* 3 */
\n
"
);
print_file
(
file
,
2
,
"NdrShort(0x%x), /* %d */
\n
"
,
array_offset
-
*
typestring_offset
,
array_offset
-
*
typestring_offset
);
*
typestring_offset
+=
2
;
print_file
(
file
,
2
,
"FC_END,
\n
"
);
*
typestring_offset
+=
1
;
array
=
find_array_or_string_in_struct
(
type
);
current_structure
=
type
;
if
(
is_attr
(
array
->
attrs
,
ATTR_STRING
))
write_string_tfs
(
file
,
array
->
attrs
,
array
->
type
,
array
->
array
,
array
->
name
,
typestring_offset
);
else
write_array_tfs
(
file
,
array
->
attrs
,
array
->
type
,
array
->
array
,
array
->
name
,
typestring_offset
);
current_structure
=
NULL
;
return
start_offset
;
default:
error
(
"write_struct_tfs: Unimplemented for type 0x%x
\n
"
,
type
->
type
);
...
...
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