crypt32(5/6): accept ERROR_BADKEY in addition to ERROR_INVALID_HANDLE

Juan Lang juan.lang at gmail.com
Fri Jun 29 15:10:58 CDT 2007


--Juan
-------------- next part --------------
From 083e4e616ab1924c50d58b98a7e5f7795c777054 Mon Sep 17 00:00:00 2001
From: Juan Lang <juanlang at juan.corp.google.com>
Date: Fri, 29 Jun 2007 12:56:43 -0700
Subject: [PATCH] Accept ERROR_BADKEY in addition to ERROR_INVALID_HANDLE
---
 dlls/crypt32/tests/store.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/dlls/crypt32/tests/store.c b/dlls/crypt32/tests/store.c
index 84eba11..549c0c6 100644
--- a/dlls/crypt32/tests/store.c
+++ b/dlls/crypt32/tests/store.c
@@ -595,14 +595,16 @@ static void testRegStore(void)
     HCERTSTORE store;
     LONG rc;
     HKEY key = NULL;
-    DWORD disp;
+    DWORD disp, GLE;
 
     store = CertOpenStore(CERT_STORE_PROV_REG, 0, 0, 0, NULL);
-    ok(!store && GetLastError() == ERROR_INVALID_HANDLE,
-     "Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError());
+    GLE = GetLastError();
+    ok(!store && (GLE == ERROR_INVALID_HANDLE || GLE == ERROR_BADKEY),
+     "Expected ERROR_INVALID_HANDLE or ERROR_BADKEY, got %d\n", GLE);
     store = CertOpenStore(CERT_STORE_PROV_REG, 0, 0, 0, key);
-    ok(!store && GetLastError() == ERROR_INVALID_HANDLE,
-     "Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError());
+    GLE = GetLastError();
+    ok(!store && (GLE == ERROR_INVALID_HANDLE || GLE == ERROR_BADKEY),
+     "Expected ERROR_INVALID_HANDLE or ERROR_BADKEY, got %d\n", GLE);
 
     /* Opening up any old key works.. */
     key = HKEY_CURRENT_USER;
-- 
1.4.1


More information about the wine-patches mailing list