Commit 05d2ab17 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Implement CertRDNValueToStr for UTF-8 strings.

parent 59b2365c
......@@ -59,6 +59,17 @@ DWORD WINAPI CertRDNValueToStrA(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue,
}
}
break;
case CERT_RDN_UTF8_STRING:
if (!psz || !csz)
ret = WideCharToMultiByte(CP_UTF8, 0, (LPWSTR)pValue->pbData,
pValue->cbData / sizeof(WCHAR) + 1, NULL, 0, NULL, NULL);
else
{
ret = WideCharToMultiByte(CP_UTF8, 0, (LPWSTR)pValue->pbData,
pValue->cbData / sizeof(WCHAR) + 1, psz, csz - 1, NULL, NULL);
csz -= ret;
}
break;
default:
FIXME("string type %d unimplemented\n", dwValueType);
}
......@@ -110,6 +121,24 @@ DWORD WINAPI CertRDNValueToStrW(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue,
}
}
break;
case CERT_RDN_UTF8_STRING:
if (!psz || !csz)
ret = pValue->cbData / sizeof(WCHAR);
else
{
DWORD chars = min(pValue->cbData / sizeof(WCHAR), csz - 1);
if (chars)
{
DWORD i;
for (i = 0; i < chars; i++)
psz[i] = *((LPWSTR)pValue->pbData + i);
ret += chars;
csz -= chars;
}
}
break;
default:
FIXME("string type %d unimplemented\n", dwValueType);
}
......
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