*
* NOTES
* Adding definitions is basically only adding relevant information
- * to the registry. No verification takes place whether a DLL or it's
+ * to the registry. No verification takes place whether a DLL or its
* entrypoints exist.
* Information in the registry will always be overwritten.
*
NewProv.pwszVerifyFuncName = CryptSIPVerifyIndirectData;
NewProv.pwszRemoveFuncName = CryptSIPRemoveSignedDataMsg;
NewProv.pwszIsFunctionNameFmt2 = NULL;
+ NewProv.pwszGetCapFuncName = NULL;
Ret = CryptSIPAddProvider(&NewProv);
HRESULT CryptRegisterRes = S_OK;
HRESULT TrustProviderRes = S_OK;
HRESULT SIPAddProviderRes = S_OK;
+ HCRYPTPROV crypt_provider;
+ BOOL ret;
TRACE("\n");
/* Testing on native shows that when an error is encountered in one of the CryptRegisterOIDFunction calls
- * the rest of these calls is skipped. Registering is however continued for the trust providers.
+ * the rest of these calls are skipped. Registering is however continued for the trust providers.
*
- * We are not totally in line with native as there all decoding functions are registered after all encoding
- * functions.
+ * We are not totally in line with native as all decoding functions are registered after all encoding
+ * functions there.
*/
#define WINTRUST_REGISTEROID( oid, encode_funcname, decode_funcname ) \
do { \
* a trust provider without a diagnostic policy).
*/
+ /* Create a dummy context to force creation of the MachineGuid registry key. */
+ ret = CryptAcquireContextW(&crypt_provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
+ if (ret) CryptReleaseContext(crypt_provider, 0);
+ else ERR("Failed to acquire cryptographic context: %u\n", GetLastError());
+
/* If CryptRegisterRes is not S_OK it will always overrule the return value. */
if (CryptRegisterRes != S_OK)
return CryptRegisterRes;