[crypt32] Remove bogus tests
Paul Vriens
Paul.Vriens at xs4all.nl
Tue Oct 3 07:37:41 CDT 2006
Hi,
it turns out that native doesn't check for cbSize. This again was an issue
that a last error was picked up on the road and nothing was resetting this.
Native checks for DllCanUnloadNow in a dll (dll is located in the registry).
Wintrust.dll doesn't have DllCanUnloadNow, so last error is set to
ERROR_PROC_NOT_FOUND.
As CryptSIPLoad cashes stuff, the second time around this check wasn't done
anymore which made the 'All OK' succeed without setting last error.
Changelog
Remove bogus tests
Cheers,
Paul.
---
dlls/crypt32/tests/sip.c | 31 ++++++-------------------------
1 files changed, 6 insertions(+), 25 deletions(-)
diff --git a/dlls/crypt32/tests/sip.c b/dlls/crypt32/tests/sip.c
index afdaf1a..3b57f43 100644
--- a/dlls/crypt32/tests/sip.c
+++ b/dlls/crypt32/tests/sip.c
@@ -291,43 +291,24 @@ static void test_SIPLoad(void)
"Expected TRUST_E_SUBJECT_FORM_UNKNOWN, got 0x%08x\n", GetLastError());
ok( sdi.pfGet == (pCryptSIPGetSignedDataMsg)0xdeadbeef, "Expected no change to the function pointer\n");
- /* cbSize not initialized */
- SetLastError(0xdeadbeef);
- memset(&sdi, 0, sizeof(SIP_DISPATCH_INFO));
- sdi.pfGet = (pCryptSIPGetSignedDataMsg)0xdeadbeef;
- ret = CryptSIPLoad(&dummySubject, 0, &sdi);
- ok ( !ret, "Expected CryptSIPLoad to fail\n");
- todo_wine
- ok ( GetLastError() == TRUST_E_SUBJECT_FORM_UNKNOWN,
- "Expected TRUST_E_SUBJECT_FORM_UNKNOWN, got 0x%08x\n", GetLastError());
- ok( sdi.pfGet == (pCryptSIPGetSignedDataMsg)0xdeadbeef, "Expected no change to the function pointer\n");
-
- /* cbSize not initialized, but valid subject (named unknown but registered by wintrust) */
+ /* All OK */
SetLastError(0xdeadbeef);
memset(&sdi, 0, sizeof(SIP_DISPATCH_INFO));
+ sdi.cbSize = sizeof(SIP_DISPATCH_INFO);
sdi.pfGet = (pCryptSIPGetSignedDataMsg)0xdeadbeef;
ret = CryptSIPLoad(&unknown, 0, &sdi);
todo_wine
{
ok ( ret, "Expected CryptSIPLoad to succeed\n");
+ /* This error will always be there as native searches for the function DllCanUnloadNow
+ * in WINTRUST.DLL (in this case). This function is not available in WINTRUST.DLL.
+ * For now there's no need to implement this is Wine.
+ */
ok ( GetLastError() == ERROR_PROC_NOT_FOUND,
"Expected ERROR_PROC_NOT_FOUND, got 0x%08x\n", GetLastError());
ok( sdi.pfGet != (pCryptSIPGetSignedDataMsg)0xdeadbeef, "Expected a function pointer to be loaded.\n");
}
- /* All OK */
- SetLastError(0xdeadbeef);
- memset(&sdi, 0, sizeof(SIP_DISPATCH_INFO));
- sdi.cbSize = sizeof(SIP_DISPATCH_INFO);
- sdi.pfGet = (pCryptSIPGetSignedDataMsg)0xdeadbeef;
- ret = CryptSIPLoad(&unknown, 0, &sdi);
- todo_wine
- ok ( ret, "Expected CryptSIPLoad to succeed\n");
- ok ( GetLastError() == 0xdeadbeef,
- "Expected 0xdeadbeef, got 0x%08x\n", GetLastError());
- todo_wine
- ok( sdi.pfGet != (pCryptSIPGetSignedDataMsg)0xdeadbeef, "Expected a function pointer to be loaded.\n");
-
/* The function addresses returned by CryptSIPLoad are actually the addresses of
* crypt32's own functions. A function calling these addresses will end up first
* calling crypt32 functions which in it's turn call the equivalent in the SIP
--
1.4.2.3
More information about the wine-patches
mailing list