I am getting an Illegal Indirection Error on this code, and I am not quite sure what I am doing wrong.
http://msdn.microsoft.com/en-us/library/aa376065(VS.85).aspx
That link shows the function and what it should do. Am I on the right track? What do I have to do to fix the error.
#include <iostream>
#include "windows.h"
#include "Wincrypt.h"
int main()
{
PCCERT_CHAIN_CONTEXT chainContext;
HCERTSTORE certStore = "MY";
DWORD dwCertEncodingType = X509_ASN_ENCODING;
DWORD dwFindFlags = CERT_CHAIN_FIND_BY_ISSUER_NO_KEY_FLAG;
DWORD dwFindType = CERT_CHAIN_FIND_BY_ISSUER;
const void *pvFindPara = "MyIssuer";
PCCERT_CHAIN_CONTEXT pPrevChainContext = NULL;
while (chainContext = CertFindChainInStore(certStore,
dwCertEncodingType,
dwFindFlags,
dwFindType,
*pvFindPara, //This line contains the error.
pPrevChainContext))
{
printf((const char*)chainContext);
}
system("PAUSE");
return 0;
}