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
ad53edfa
Commit
ad53edfa
authored
Nov 11, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Windows file formats are always little-endian.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
af046fe6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
51 deletions
+10
-51
typelib_struct.h
tools/widl/typelib_struct.h
+0
-20
utils.c
tools/widl/utils.c
+10
-16
utils.h
tools/widl/utils.h
+0
-1
write_msft.c
tools/widl/write_msft.c
+0
-14
No files found.
tools/widl/typelib_struct.h
View file @
ad53edfa
...
...
@@ -138,13 +138,8 @@ typedef struct tagMSFT_TypeInfoBase {
/*040*/
INT
helpstringcontext
;
/* */
INT
helpcontext
;
/* */
INT
oCustData
;
/* offset in customer data table */
#ifdef WORDS_BIGENDIAN
INT16
cbSizeVft
;
/* virtual table size, including inherits */
INT16
cImplTypes
;
/* nr of implemented interfaces */
#else
INT16
cImplTypes
;
/* nr of implemented interfaces */
INT16
cbSizeVft
;
/* virtual table size, including inherits */
#endif
/*050*/
INT
size
;
/* size in bytes, at least for structures */
/* FIXME: name of this field */
INT
datatype1
;
/* position in type description table */
...
...
@@ -174,13 +169,8 @@ typedef struct {
/* INT recsize; record size including some extra stuff */
INT
DataType
;
/* data type of the member, eg return of function */
INT
Flags
;
/* something to do with attribute flags (LOWORD) */
#ifdef WORDS_BIGENDIAN
INT16
funcdescsize
;
/* size of reconstituted FUNCDESC and related structs */
INT16
VtableOffset
;
/* offset in vtable */
#else
INT16
VtableOffset
;
/* offset in vtable */
INT16
funcdescsize
;
/* size of reconstituted FUNCDESC and related structs */
#endif
INT
FKCCIC
;
/* bit string with the following */
/* meaning (bit 0 is the lsb): */
/* bits 0 - 2: FUNCKIND */
...
...
@@ -191,13 +181,8 @@ typedef struct {
/* bit 13: oEntry is numeric */
/* bit 14: has retval param */
/* bits 16 - 31: index of next function with same id */
#ifdef WORDS_BIGENDIAN
INT16
nroargs
;
/* nr of optional arguments */
INT16
nrargs
;
/* number of arguments (including optional ????) */
#else
INT16
nrargs
;
/* number of arguments (including optional ????) */
INT16
nroargs
;
/* nr of optional arguments */
#endif
/* optional attribute fields, the number of them is variable */
INT
OptAttr
[
1
];
/*
...
...
@@ -230,13 +215,8 @@ typedef struct {
/* INT recsize; // record size including some extra stuff */
INT
DataType
;
/* data type of the variable */
INT
Flags
;
/* VarFlags (LOWORD) */
#ifdef WORDS_BIGENDIAN
INT16
vardescsize
;
/* size of reconstituted VARDESC and related structs */
INT16
VarKind
;
/* VarKind */
#else
INT16
VarKind
;
/* VarKind */
INT16
vardescsize
;
/* size of reconstituted VARDESC and related structs */
#endif
INT
OffsValue
;
/* value of the variable or the offset */
/* in the data structure */
/* optional attribute fields, the number of them is variable */
...
...
tools/widl/utils.c
View file @
ad53edfa
...
...
@@ -211,7 +211,6 @@ size_t strappend(char **buf, size_t *len, size_t pos, const char* fmt, ...)
* Function for writing to a memory buffer.
*/
int
byte_swapped
=
0
;
unsigned
char
*
output_buffer
;
size_t
output_buffer_pos
;
size_t
output_buffer_size
;
...
...
@@ -351,29 +350,24 @@ void put_byte( unsigned char val )
void
put_word
(
unsigned
short
val
)
{
if
(
byte_swapped
)
val
=
(
val
<<
8
)
|
(
val
>>
8
);
put_data
(
&
val
,
sizeof
(
val
)
);
check_output_buffer_space
(
2
);
output_buffer
[
output_buffer_pos
++
]
=
val
;
output_buffer
[
output_buffer_pos
++
]
=
val
>>
8
;
}
void
put_dword
(
unsigned
int
val
)
{
if
(
byte_swapped
)
val
=
((
val
<<
24
)
|
((
val
<<
8
)
&
0x00ff0000
)
|
((
val
>>
8
)
&
0x0000ff00
)
|
(
val
>>
24
));
put_data
(
&
val
,
sizeof
(
val
)
);
check_output_buffer_space
(
4
);
output_buffer
[
output_buffer_pos
++
]
=
val
;
output_buffer
[
output_buffer_pos
++
]
=
val
>>
8
;
output_buffer
[
output_buffer_pos
++
]
=
val
>>
16
;
output_buffer
[
output_buffer_pos
++
]
=
val
>>
24
;
}
void
put_qword
(
unsigned
int
val
)
{
if
(
byte_swapped
)
{
put_dword
(
0
);
put_dword
(
val
);
}
else
{
put_dword
(
val
);
put_dword
(
0
);
}
put_dword
(
val
);
put_dword
(
0
);
}
/* pointer-sized word */
...
...
tools/widl/utils.h
View file @
ad53edfa
...
...
@@ -40,7 +40,6 @@ int is_valid_uuid(const char *s);
/* buffer management */
extern
int
byte_swapped
;
extern
unsigned
char
*
output_buffer
;
extern
size_t
output_buffer_pos
;
extern
size_t
output_buffer_size
;
...
...
tools/widl/write_msft.c
View file @
ad53edfa
...
...
@@ -302,17 +302,10 @@ static int ctl2_encode_name(
value
=
lhash_val_of_name_sys
(
typelib
->
typelib_header
.
varflags
&
0x0f
,
typelib
->
typelib_header
.
lcid
,
converted_name
+
4
);
#ifdef WORDS_BIGENDIAN
converted_name
[
3
]
=
length
&
0xff
;
converted_name
[
2
]
=
length
>>
8
;
converted_name
[
1
]
=
value
;
converted_name
[
0
]
=
value
>>
8
;
#else
converted_name
[
0
]
=
length
&
0xff
;
converted_name
[
1
]
=
length
>>
8
;
converted_name
[
2
]
=
value
;
converted_name
[
3
]
=
value
>>
8
;
#endif
for
(
offset
=
(
4
-
length
)
&
3
;
offset
;
offset
--
)
converted_name
[
length
+
offset
+
3
]
=
0x57
;
...
...
@@ -349,14 +342,8 @@ static int ctl2_encode_string(
if
(
length
<
3
)
size
+=
4
;
converted_string
=
xmalloc
(
size
);
memcpy
(
converted_string
+
2
,
string
,
length
);
#ifdef WORDS_BIGENDIAN
converted_string
[
1
]
=
length
&
0xff
;
converted_string
[
0
]
=
(
length
>>
8
)
&
0xff
;
#else
converted_string
[
0
]
=
length
&
0xff
;
converted_string
[
1
]
=
(
length
>>
8
)
&
0xff
;
#endif
if
(
length
<
3
)
{
/* strings of this length are padded with up to 8 bytes incl the 2 byte length */
for
(
offset
=
0
;
offset
<
4
;
offset
++
)
...
...
@@ -2738,7 +2725,6 @@ static void save_all_changes(msft_typelib_t *typelib)
ctl2_finalize_typeinfos
(
typelib
,
filepos
);
byte_swapped
=
0
;
init_output_buffer
();
put_data
(
&
typelib
->
typelib_header
,
sizeof
(
typelib
->
typelib_header
));
...
...
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