Francois Gouget fgouget@codeweavers.com wrote:
@@ -314,7 +330,7 @@ static void test_registerOIDFunction(void) 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)
- if (!ret && GetLastError() == ERROR_ACCESS_DENIED && !is_process_elevated()) { skip("Need admin rights\n"); return;
@@ -393,7 +409,7 @@ static void test_registerDefaultOIDFunction(void) SetLastError(0xdeadbeef); ret = CryptRegisterDefaultOIDFunction(0, "CertDllOpenStoreProv", 0, bogusDll);
- if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
- if (!ret && GetLastError() == ERROR_ACCESS_DENIED && !is_process_elevated()) { skip("Need admin rights\n"); return;
@@ -499,7 +515,7 @@ static void test_getDefaultOIDFunctionAddress(void) SetLastError(0xdeadbeef); ret = CryptRegisterDefaultOIDFunction(0, "CertDllOpenStoreProv", 0, bogusDll);
- if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
- if (!ret && GetLastError() == ERROR_ACCESS_DENIED && !is_process_elevated()) skip("Need admin rights\n"); else ok(ret, "CryptRegisterDefaultOIDFunction failed: %08x\n", GetLastError());
In which cases the changes above are needed? It seems that this only complicates things without a reason and could potentially slow down the tests execution.
@@ -645,7 +661,11 @@ static void test_registerOIDInfo(void) info1.pszOID = test_oid; SetLastError(0xdeadbeef); ret = CryptUnregisterOIDInfo(&info1);
- ok(!ret, "should fail\n");
- if (!ret && GetLastError() == ERROR_ACCESS_DENIED && !is_process_elevated())
- {
skip("Need admin rights FIXME\n");
return;
- } ok(!ret, "should fail\n");
This change doesn't look right. Most likely it's not needed here.