https://bugs.winehq.org/show_bug.cgi?id=34851
--- Comment #6 from Nikolay Sivov bunglehead@gmail.com --- Hi, Michael.
Are you still working on this? Patch is dated one year back.
There's one thing that I don't like - the way -A call is forwarded to -W one, clean way would be to get back required W buffer length, then get a string, try to convert to A and see if it fits. According to docs input length does not include terminating NULL, and return value doesn't too, yet there's this check "if (result < charcount)", so strict equality will not fill out A buffer.