From 023d6fd9861da57da4c6e3ff30c44aad4ed2e405 Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Wed, 13 Jun 2007 12:17:06 +0200 Subject: [PATCH] crypt32/tests: Skip tests if we don't have enough rights. --- dlls/crypt32/tests/oid.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/crypt32/tests/oid.c b/dlls/crypt32/tests/oid.c index c1cde67a768..c42b891af6b 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,