Hi Christian,
As tested on Windows(R) 7 Home Premium x64, "CertRDNValueToStr" Doesn't handle the quoting. Instead it's made on "CertNameToStr" with CERT_X500_NAME_STR flag.
Adding tests that demonstrate that would help a great deal.
A minor comment regarding the patch itself:
+/* Only use this function internally. */ +static DWORD QuoteCertRDNValueToStrA(DWORD dwValueType, PCERT_RDN_VALUE_BLOB pValue,
Don't use Hungarian notation for internal functions, it's hard to distinguish them from Win32 API functions. --Juan