dlls/advapi32/registry.c patch for RegEnumValuesA
Tony Lambregts
tony_lambregts at telusplanet.net
Fri Jul 5 07:54:07 CDT 2002
Massimo wrote:
>Resubmitting as for Tony Lambregts request :)
>
>Well, finally found and corrected a bug that made AutoCAD R14 hang...
>I guess some other apps could have the same problem solved, but
>had no time to test more :)
>
>In RegEnumValueA, when the size for requested data buffer is too small,
>function should return an error (as it does), but also return correct
>buffer size (as it doesn't).
>Found in AutoCAD; it asked for a reistry key value, got error, and then
>looped forever trying to get val with wrong buffer size.
>
>I guess, but had no time yet to check, that this problem could happen
>somwhere else in Registry.c, I'll check it out next days.
>
>With this patch, finally AutoCAD R14 is perfectly usable in wine, even without
>a native windows installed !
>
>Change log: Change In RegEnumValueA, when the size for requested data
>buffer is too small, function should return an error (as it did), and
>also return correct buffer size (now it does).
>
>
>Max max at com.veneto [reversed :) ]
>-----
>
>
>
>
>
>------------------------------------------------------------------------
>
>--- 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;
> }
>
>
It looks great to me. Please submit it to wine patches.
Tony Lambregts
More information about the wine-devel
mailing list