Byte Swapping in storage32.c for solaris

Warren_Baird at cimmetry.com Warren_Baird at cimmetry.com
Fri Apr 26 11:08:39 CDT 2002



I've been running into some problems with byte swapping in ole related code - it
looks like the relevant stuff is in storage32.c - I've modified
StorageUtl_{Read,Write}Word and DWord to byteswap on bigendian platforms, and
that seems to help, but I'm also running into problems with the wchar property
names in StorageImpl_{Read,Write}Property - the individual characters are
showing up in the wrong order, so "Data" is showing up as  0x44006100
0x74006100  instead of 0x00440061 0x00740061 as I would expect...

Is it safe to use the same approach here?  should ReadProperty byteswap each
wchar and then WriteProperty byteswap it again?  There seem to be a lot of
places things like this happen:

  StorageImpl_ReadProperty(This, propertyIndex, &chainProperty);

  chainProperty.startingBlock = bbHeadOfChain;

  StorageImpl_WriteProperty(This, propertyIndex, &chainProperty);

and I'm not sure how else to handle these cases...


Also - at the moment the only byteswapping macros actually appear in
tools/wrc/wrctypes.h - would it make sense to move them to one of the top-level
include directories, and use them in both storage32.c and in wrc?  If so, which
include file should I drop them in?

Thanks!

Warren





More information about the wine-devel mailing list