[PATCH 1/3] winmm: mciSendString always returns a response string (albeit empty).

Joerg-Cyril.Hoehle at t-systems.com Joerg-Cyril.Hoehle at t-systems.com
Mon Nov 1 11:03:54 CDT 2010


Hi,

tests justify the early setting of lpstrRet[0] = \0 in mciSendString.

Actually, there's more to say about these 3 patches.
Dan Kegel's July 2009 patch was both correct (given the code in Wine
at that time) and incorrect (the MCI always produces a string, so the
old code was right to apply WideCharToMB in all cases on the output).
The issue did not exist prior to the A/W split in 2005.

I left in Dan's check (!ret in mciSendStringA) as a performance
improvement, given that my next patches proove that there's no output
from the MCI_* commands in case of error, so there's nothing to convert.
This is ok given the new *lpstrRet=\0 a few lines above.

Now that we know there's always a valid 0-terminated string,
the tests could be shortened a bit to eliminate the buf[0]=0 initialisations.

Regards,
 Jörg Höhle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-winmm-mciSendString-always-returns-a-response-strin.patch
Type: application/octet-stream
Size: 5144 bytes
Desc: 0001-winmm-mciSendString-always-returns-a-response-strin.patch
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20101101/29b7e9c0/attachment.obj>


More information about the wine-patches mailing list