quartz: Implement AMGetErrorTextA on top of AMGetErrorTextW.

This commit is contained in:
Maarten Lankhorst 2010-12-03 09:38:11 +01:00 committed by Alexandre Julliard
parent 89161a8ded
commit 883ca4d9d0
1 changed files with 7 additions and 9 deletions

View File

@ -297,17 +297,15 @@ LONG WINAPI DBToAmpFactor(LONG db)
*/ */
DWORD WINAPI AMGetErrorTextA(HRESULT hr, LPSTR buffer, DWORD maxlen) DWORD WINAPI AMGetErrorTextA(HRESULT hr, LPSTR buffer, DWORD maxlen)
{ {
unsigned int len; DWORD res;
static const char format[] = "Error: 0x%x"; WCHAR errorW[MAX_ERROR_TEXT_LEN];
char error[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; res = AMGetErrorTextW(hr, errorW, sizeof(errorW)/sizeof(*errorW));
wsprintfA(error, format, hr); return WideCharToMultiByte(CP_ACP, 0, errorW, res, buffer, maxlen, 0, 0);
if ((len = strlen(error)) >= maxlen) return 0;
lstrcpyA(buffer, error);
return len;
} }
/*********************************************************************** /***********************************************************************