[PATCH 1/3] dssenh/tests: Add CryptAcquireContextA last error check.
Rémi Bernon
rbernon at codeweavers.com
Tue May 25 10:14:08 CDT 2021
When container key doesn't exist yet.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=30244
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
dlls/dssenh/tests/dssenh.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/dlls/dssenh/tests/dssenh.c b/dlls/dssenh/tests/dssenh.c
index 4d33fc86cd8..8a53e210ce3 100644
--- a/dlls/dssenh/tests/dssenh.c
+++ b/dlls/dssenh/tests/dssenh.c
@@ -71,6 +71,20 @@ static void test_acquire_context(void)
/* test base DSS provider (PROV_DSS) */
+ SetLastError(0xdeadbeef);
+ result = CryptAcquireContextA(&hProv, NULL, NULL, PROV_DSS, 0);
+ if (!result)
+ {
+ todo_wine ok(GetLastError() == NTE_BAD_KEYSET, "Expected NTE_BAD_KEYSET, got %08x\n", GetLastError());
+ SetLastError(0xdeadbeef);
+ result = CryptAcquireContextA(&hProv, NULL, NULL, PROV_DSS, CRYPT_NEWKEYSET);
+ }
+ ok(result, "CryptAcquireContextA succeeded\n");
+ ok(GetLastError() == 0, "Expected 0, got %08x\n", GetLastError());
+
+ result = CryptReleaseContext(hProv, 0);
+ ok(result, "CryptReleaseContext failed.\n");
+
result = CryptAcquireContextA(
&hProv, NULL, MS_DEF_DSS_PROV_A, PROV_DSS, CRYPT_VERIFYCONTEXT);
if(!result)
--
2.31.0
More information about the wine-devel
mailing list