From 883ca4d9d02356b01ef11259085336321d3f2346 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Fri, 3 Dec 2010 09:38:11 +0100 Subject: [PATCH] quartz: Implement AMGetErrorTextA on top of AMGetErrorTextW. --- dlls/quartz/main.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/dlls/quartz/main.c b/dlls/quartz/main.c index 93c93a06a49..c40d2204481 100644 --- a/dlls/quartz/main.c +++ b/dlls/quartz/main.c @@ -297,17 +297,15 @@ LONG WINAPI DBToAmpFactor(LONG db) */ DWORD WINAPI AMGetErrorTextA(HRESULT hr, LPSTR buffer, DWORD maxlen) { - unsigned int len; - static const char format[] = "Error: 0x%x"; - char error[MAX_ERROR_TEXT_LEN]; + DWORD res; + WCHAR errorW[MAX_ERROR_TEXT_LEN]; - FIXME("(%x,%p,%d) stub\n", hr, buffer, maxlen); + TRACE("(%x,%p,%d)\n", hr, buffer, maxlen); + if (!buffer) + return 0; - if (!buffer) return 0; - wsprintfA(error, format, hr); - if ((len = strlen(error)) >= maxlen) return 0; - lstrcpyA(buffer, error); - return len; + res = AMGetErrorTextW(hr, errorW, sizeof(errorW)/sizeof(*errorW)); + return WideCharToMultiByte(CP_ACP, 0, errorW, res, buffer, maxlen, 0, 0); } /***********************************************************************