From ea5a6f2db5e6f05acf38f9257278cbcad58ab898 Mon Sep 17 00:00:00 2001 From: Dan Kegel Date: Fri, 3 Jul 2009 21:52:38 -0700 Subject: [PATCH] winmm: Don't convert return string in mciSendStringA on error. --- dlls/winmm/mci.c | 2 +- dlls/winmm/tests/mci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/winmm/mci.c b/dlls/winmm/mci.c index 262d62ddca5..6fca0138128 100644 --- a/dlls/winmm/mci.c +++ b/dlls/winmm/mci.c @@ -1506,7 +1506,7 @@ DWORD WINAPI mciSendStringA(LPCSTR lpstrCommand, LPSTR lpstrRet, } } ret = mciSendStringW(lpwstrCommand, lpwstrRet, uRetLen, hwndCallback); - if (lpwstrRet) + if (!ret && lpwstrRet) WideCharToMultiByte( CP_ACP, 0, lpwstrRet, -1, lpstrRet, uRetLen, NULL, NULL ); HeapFree(GetProcessHeap(), 0, lpwstrCommand); HeapFree(GetProcessHeap(), 0, lpwstrRet); diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c index 8764b307f17..5f8698507a8 100644 --- a/dlls/winmm/tests/mci.c +++ b/dlls/winmm/tests/mci.c @@ -53,7 +53,7 @@ START_TEST(mci) memset(buf, 0, sizeof(buf)); err = mciSendString(command_close_all, buf, sizeof(buf), hwnd); todo_wine ok(!err,"mciSendString(%s, buf, sizeof(buf) , NULL) returned error: %d\n", command_close_all, err); - todo_wine ok(buf[0] == 0, "mciSendString(%s, buf, sizeof(buf) , NULL) changed output buffer: %s\n", command_close_all, buf); + ok(buf[0] == 0, "mciSendString(%s, buf, sizeof(buf) , NULL) changed output buffer: %s\n", command_close_all, buf); memset(buf, 0, sizeof(buf)); err = mciSendString(command_sysinfo, buf, sizeof(buf), NULL);