[Bug 47762] LoadStringA fails instead of returning const pointer to string if buffer length is zero

WineHQ Bugzilla wine-bugs at winehq.org
Sun Sep 15 14:04:26 CDT 2019


https://bugs.winehq.org/show_bug.cgi?id=47762

--- Comment #3 from Stanislav <tsmx at tut.by> ---
(In reply to Alexandre Julliard from comment #2)
> String resources are stored in Unicode, so only LoadStringW is able to
> return a direct pointer. That's how it works on Windows. 

Ok, now I see. There is some kind of fixed-length Unicode and not UTF-8 used in
the compiled resources so we cannot just take ANSI-only Unicode string and say
it's a valid ASCII one.

But then how does Windows do it? Converting string to ASCII in some kind of
implicit temporary buffer? Telling resource compiler that it should pack string
data in non-Unicode mode if we will be using A-suffixed functions?

I mean, MS doc says black on white that LoadStringA should somehow work with
zero buflen, so this one probably shouldn't be completely ignored even if I'm
misunderstanding something.

> Is there an actual app that needs a different behavior?

No, not really. In fact, I've been just making one as my uni assignment and
stumbled upon this issue.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list