ole32: On big endian machines, copy strings to little endian order without mucking with the map they're stored in (try 2)
Alexandre Julliard
julliard at winehq.org
Wed Aug 19 05:06:28 CDT 2009
Juan Lang <juan.lang at gmail.com> writes:
> +#ifdef WORDS_BIGENDIAN
> +/* Returns a byte-swapped copy of str, to be freed with HeapFree(). */
> +static LPWSTR PropertyStorage_StringToLE(LPCWSTR str, size_t len)
> +{
> + LPWSTR leStr = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
> +
> + if (leStr)
> + {
> + memcpy(leStr, str, len * sizeof(WCHAR));
> + PropertyStorage_ByteSwapString(leStr, len);
> + }
> + return leStr;
> +}
> +#else
> +#define PropertyStorage_StringToLE(s, l) (LPWSTR)(s)
> +#endif
You are still casting away const...
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list