Hi Ian,

>   We were mallocing a byte per tchar, but tchars are normally 2 bytes big...
>   I think they are at most 4 bytes, so we now malloc 4 * #tchars. Not sure
>   if there is a proper function I should be using for this?

TCHAR is #ifdef'd to be either CHAR on Win 9x/ME (1 byte), or WCHAR on
Win 2k/XP/Vista (2 bytes). In C you'd just do sizeof(TCHAR), not sure
if there is a way of doing this from Haskell. Remember that you may
wish to malloc 2*(#tchars+1) since the Registry has rather weird
semantics if it can't fit in a trailing zero - in some cases it
doesn't null terminate the string, because it runs out of space, but
still returns success. I think also it wants you to tell it the size
of the buffer minus the space it might need for the trailing zero -
not the size of the buffer.

Thanks

Neil
_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to