dlls/advapi32/registry.c patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch solves bug 842.
When RegEnumValuesA gets called with too small buffers, it should
return an error code (as it did already), but also correct buffer sizes (as it didn't) to 
allow calling app to make a new correct call.
Note : I didn't had time to investigate if others RegXXXX functions
suffer same problem, just fixed RegEnumValuesA !

Regards

Max

License : LGPL or X11
ChangeLog:
  Correct returned buffer sizes in case of buffers too small.



--- dlls/advapi32/registry.c	Sat Jul  6 01:29:08 2002
+++ /home/massimo/wine-patches/registry.c	Sat Jul  6 01:35:32 2002
@@ -1157,6 +1157,9 @@
             RtlUnicodeToMultiByteSize( &len, info->Name, info->NameLength );
             if (len >= *val_count)
             {
+		 /* MUST RETURN REQUESTED CORRECT BUFFER SIZE, NOT ONLY TELL IT'S WRONG */
+                *val_count = len + 1 ;
                 status = STATUS_BUFFER_OVERFLOW;
                 goto done;
             }
@@ -1174,6 +1177,9 @@
             {
                 if (len > *count)
                 {
+		     /* MUST RETURN REQUESTED CORRECT BUFFER SIZE, NOT ONLY TELL IT'S WRONG */
+                    *count = len+1 ;
                     status = STATUS_BUFFER_OVERFLOW;
                     goto done;
                 }

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux