RegSetValueExA on Win9x

Andreas Mohr andi at rhlx01.fht-esslingen.de
Wed Apr 14 15:26:20 CDT 2004


Hi all,

the setup of http://www.free-av.de calls RegSetValueExA with REG_SZ
and data set to NULL. This should return ERROR_INVALID_PARAMETER in Win98
mode. When setting the Wine version to nt40, however, the call isn't
being made by the setup program, so I guess NT-based versions don't contain
this weird check (don't have any NT version here to test).

RegSetValueA has the same behaviour, so since it calls down to RegSetValueExA
on Wine, all should be fine.

I don't know how to handle version-dependent checks (win98) in the test suite,
otherwise I'd have added a test, too.

Unfortunately the virus scanner then crashes later during program start.
I'll try to fix it as well, seems trivial.

And yes, just believe it: it's a patch by me again :-)

Andreas Mohr
-------------- next part --------------
Determining best CVS host...
Using CVSROOT :pserver:cvs at rhlx01.fht-esslingen.de:/home/wine
Index: dlls/advapi32/registry.c
===================================================================
RCS file: /home/wine/wine/dlls/advapi32/registry.c,v
retrieving revision 1.61
diff -u -r1.61 registry.c
--- dlls/advapi32/registry.c	18 Mar 2004 01:34:23 -0000	1.61
+++ dlls/advapi32/registry.c	14 Apr 2004 20:17:31 -0000
@@ -904,7 +904,16 @@
 
     if (!is_version_nt())  /* win95 */
     {
-        if (type == REG_SZ) count = strlen(data) + 1;
+        if (type == REG_SZ)
+	{
+		/* Win98 seems to have a weird check
+		 * for NULL data specifically when using REG_SZ.
+		 * NT doesn't seem to have it. */
+		if (NULL == data)
+			return ERROR_INVALID_PARAMETER;
+
+		count = strlen(data) + 1;
+	}
     }
     else if (count && is_string(type))
     {


More information about the wine-patches mailing list