Paul Vriens : crypt32/tests: Skip tests if we don't have enough rights.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jun 13 06:14:09 CDT 2007


Module: wine
Branch: master
Commit: 023d6fd9861da57da4c6e3ff30c44aad4ed2e405
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=023d6fd9861da57da4c6e3ff30c44aad4ed2e405

Author: Paul Vriens <paul.vriens.wine at gmail.com>
Date:   Wed Jun 13 12:17:06 2007 +0200

crypt32/tests: Skip tests if we don't have enough rights.

---

 dlls/crypt32/tests/oid.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/dlls/crypt32/tests/oid.c b/dlls/crypt32/tests/oid.c
index c1cde67..c42b891 100644
--- a/dlls/crypt32/tests/oid.c
+++ b/dlls/crypt32/tests/oid.c
@@ -286,8 +286,14 @@ static void test_registerOIDFunction(void)
     ret = CryptRegisterOIDFunction(X509_ASN_ENCODING, "foo",
      "1.2.3.4.5.6.7.8.9.10", NULL, NULL);
     ok(ret, "Expected pseudo-success, got %d\n", GetLastError());
+    SetLastError(0xdeadbeef);
     ret = CryptRegisterOIDFunction(X509_ASN_ENCODING, "CryptDllEncodeObject",
      "1.2.3.4.5.6.7.8.9.10", bogusDll, NULL);
+    if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
+    {
+        skip("Need admin rights\n");
+        return;
+    }
     ok(ret, "CryptRegisterOIDFunction failed: %d\n", GetLastError());
     ret = CryptUnregisterOIDFunction(X509_ASN_ENCODING, "CryptDllEncodeObject",
      "1.2.3.4.5.6.7.8.9.10");
@@ -334,8 +340,14 @@ static void test_registerDefaultOIDFunction(void)
     ret = CryptRegisterDefaultOIDFunction(0, NULL, 0, bogusDll);
      */
     /* Register one at index 0 */
+    SetLastError(0xdeadbeef);
     ret = CryptRegisterDefaultOIDFunction(0, "CertDllOpenStoreProv", 0,
      bogusDll);
+    if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
+    {
+        skip("Need admin rights\n");
+        return;
+    }
     ok(ret, "CryptRegisterDefaultOIDFunction failed: %08x\n", GetLastError());
     /* Reregistering should fail */
     ret = CryptRegisterDefaultOIDFunction(0, "CertDllOpenStoreProv", 0,




More information about the wine-cvs mailing list