The CertFreeCertificateContext function frees a certificate context by decrementing its reference count. When the reference count goes to zero, CertFreeCertificateContext frees the memory occupied by a certificate context. Each context obtained by a get, find, enum, duplicate, or create must have a corresponding free.
#include <wincrypt.h>
BOOL WINAPI CertFreeCertificateContext(
PCCERT_CONTEXT pCertContext // in
);
Always returns TRUE.
See Example Code for Fundamental Certificate Store Operations.
Windows NT: Requires version 4.0 SP3 or later. Available also in IE 3.02 and later.
Windows: Requires Windows 95 OSR2 or later.
Windows CE: Unsupported.
Header: Declared in wincrypt.h.
Import Library: Use crypt32.lib.