#4 Support both little/big-endian ".res" formats

open
nobody
None
5
2013-01-23
2004-12-31
Terry Teague
No

If you take a Windows resource ".res" file built on Intel
architecture (I used Cywgin/MinGW on VirtualPC), and try to use it
with DarWINE (on PowerPC architecture), you will get an error
message displayed when trying to build a DarWINE application that
includes that ".res" file :

winebuild: testWINE.res is not a valid Win32 resource file

Using hexdump -C on ".res" files generated on both Intel (little-
endian) and PowerPC (big-endian) architectures, look at the
headers :

Intel (little-endian) :

00000000 00 00 00 00 00 00 00 20 ff ff 00 00 ff ff 00 00 |.......
........|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|................|

PowerOC (big-endian) :

00000000 00 00 00 00 20 00 00 00 ff ff 00 00 ff ff 00 00 |....
...........|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|................|

'winebuild' does a simple check of the ".res" file header when
loading resources, and if not in the correct format, issues the
above error message.

obviously the "header size" field (DWORD) = 0x00000020 is
represented in either little-endian or big-endian format. This is
what causes 'winebuild' to fail the header check on little-endian
format ".res" files.

I would request one or more of the following be implemented :

(a) Only support little-endian ".res" format files - this seems to be
the opinions of the WINE experts. This would require 'wrc' on
DarWINE to perhaps default endianness to little-endian.

(b) Allow a command line option to 'winebuild' (or other tools) to
specify the endianness to use.

(c) At 'winebuild' runtime, automatically accept ".res" files of either
format, and convert on the fly (if necessary). The final executable
should be in the format that DarWINE expects (which I assume for
the moment is big-endian).

I will see if I can modify the DarWINE sources to implement some
of this.

Discussion

  • Logged In: YES
    user_id=373286

    Would you submit that as a bug to the WineHQ?