Commit 883ca4d9 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

quartz: Implement AMGetErrorTextA on top of AMGetErrorTextW.

parent 89161a8d
......@@ -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);
}
/***********************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment