shlwapi: Resupply array sizes stripped by function interface

Andrew Talbot Andrew.Talbot at talbotville.com
Mon Sep 25 16:04:22 CDT 2006


Dan Kegel wrote:

> BTW the way you define the new size, as a magic constant, seems
> bad.  Can you use 4 * sizeof(WCHAR), or whatever, instead of 8?
> And even then, the '4' seems almost as bad.
> - Dan

Yes, I did feel uneasy about using a magic constant, I must admit. Another
way to handle it would be to call GetLocaleInfoW() twice for each buffer.
The first time with its lpLCData parameter equal to NULL and its cchData
parameter equal to zero, which should return the number of characters
required for the buffer. The second time to then retrieve the required
locale information. I had originally decided against this, because I felt
that it might be over-engineering, but how does that sound to you?

Also, if you would like to suggest a clearer changelog line, I would be very
happy to use it.

Thanks,

-- Andy.





More information about the wine-devel mailing list