0

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;
}
2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by cikara21
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.