Juan Lang <juan.lang(a)gmail.com> writes:
> +static void dump_element(PCCERT_CONTEXT cert)
> +{
> + LPWSTR name = NULL;
> + DWORD len, i;
> +
> + TRACE_(chain)("%p\n", cert);
> + len = CertGetNameStringW(cert, CERT_NAME_SIMPLE_DISPLAY_TYPE,
> + CERT_NAME_ISSUER_FLAG, NULL, NULL, 0);
> + name = CryptMemAlloc(len * sizeof(WCHAR));
> + if (name)
> + {
> + CertGetNameStringW(cert, CERT_NAME_SIMPLE_DISPLAY_TYPE,
> + CERT_NAME_ISSUER_FLAG, NULL, name, len);
> + TRACE_(chain)("issued by %s\n", debugstr_w(name));
> + CryptMemFree(name);
> + }
> + len = CertGetNameStringW(cert, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0, NULL,
> + NULL, 0);
> + name = CryptMemAlloc(len * sizeof(WCHAR));
> + if (name)
> + {
> + CertGetNameStringW(cert, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0, NULL,
> + name, len);
> + TRACE_(chain)("issued to %s\n", debugstr_w(name));
> + CryptMemFree(name);
> + }
You probably don't want to do all this work unless tracing is enabled.
--
Alexandre Julliard
julliard(a)winehq.org