I have made such code that will create contex for aes encryption (with Win32API support):
if (!CryptAcquireContext(&hProvs, NULL, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT))
{
if (!CryptAcquireContext(&hProvs, NULL, NULL, PROV_RSA_AES, CRYPT_NEWKEYSET | CRYPT_VERIFYCONTEXT))
{
printf("%d\n", GetLastError());
getchar();
ExitProcess(0);
}
}
It works fine on Windows 7 or higher but when I start it on Windows XP, I got no errors, just closed application. And nothing. What’s wrong?