PATCH: crypt debug

Marcus Meissner marcus at jet.franken.de
Sun Sep 21 15:52:24 CDT 2003


Hi,

Ciao, Marcus

Changelog:
	Print fixmes if we do not find a crypto providers for a specified
	type/name and other failures.

Index: crypt.c
===================================================================
RCS file: /home/wine/wine/dlls/advapi32/crypt.c,v
retrieving revision 1.25
diff -u -r1.25 crypt.c
--- dlls/advapi32/crypt.c	21 Jul 2003 23:50:39 -0000	1.25
+++ dlls/advapi32/crypt.c	20 Sep 2003 14:37:20 -0000
@@ -176,6 +176,7 @@
 	if ( !(provider->hModule = LoadLibraryA(pImage)) )
 	{
 		errorcode = (GetLastError() == ERROR_FILE_NOT_FOUND) ? NTE_PROV_DLL_NOT_FOUND : NTE_PROVIDER_DLL_FAIL;
+		FIXME("Failed to load dll %s\n", debugstr_a(pImage));
 		goto error;
 	}
 
@@ -277,14 +278,21 @@
 		/* No CSP name specified so try the user default CSP first
 		 * then try the machine default CSP
 		 */
-		if ( !(keyname = CRYPT_GetTypeKeyName(dwProvType, TRUE)) )
+		if ( !(keyname = CRYPT_GetTypeKeyName(dwProvType, TRUE)) ) {
+			FIXME("No provider registered for crypto provider type %ld.\n", dwProvType);
 			CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY);
+		}
 		if (RegOpenKeyA(HKEY_CURRENT_USER, keyname, &key))
 		{
 			CRYPT_Free(keyname);
-			if ( !(keyname = CRYPT_GetTypeKeyName(dwProvType, FALSE)) )
+			if ( !(keyname = CRYPT_GetTypeKeyName(dwProvType, FALSE)) ) {
+				FIXME("No type registered for crypto provider type %ld.\n", dwProvType);
 				CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY);
-			if (RegOpenKeyA(HKEY_LOCAL_MACHINE, keyname, &key)) goto error;
+			}
+			if (RegOpenKeyA(HKEY_LOCAL_MACHINE, keyname, &key)) {
+				FIXME("Did not find registry entry of crypto provider for %s.\n", debugstr_a(keyname)); 
+				goto error;
+			}
 		}
 		CRYPT_Free(keyname);
 		RegQueryValueExA(key, "Name", NULL, &keytype, NULL, &len);
@@ -304,6 +312,7 @@
 	RegQueryValueExA(key, "Type", NULL, NULL, (BYTE*)&type, &len);
 	if (type != dwProvType)
 	{
+		FIXME("Crypto provider has wrong type (%ld vs expected %ld).\n", type, dwProvType);
 		SetLastError(NTE_BAD_PROV_TYPE);
 		goto error;
 	}
@@ -327,8 +336,10 @@
 	pProv = CRYPT_LoadProvider(imagepath);
 	CRYPT_Free(temp);
 	CRYPT_Free(imagepath);
-	if (!pProv) goto error;
-
+	if (!pProv) {
+		FIXME("Could not load crypto provider from DLL %s\n", debugstr_a(imagepath));
+		goto error;
+	}
 	if (pProv->pFuncs->pCPAcquireContext(&pProv->hPrivate, (CHAR*)pszContainer, dwFlags, pProv->pVTable))
 	{
 		/* MSDN: When this flag is set, the value returned in phProv is undefined,



More information about the wine-patches mailing list