From: Francois Gouget fgouget@codeweavers.com
The table size typically keeps increasing such that in some cases the size we got is already too small by the time we try to get the table content in the next iteration.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54328 --- This issue regularly causes NsiAllocateAndGetTable() to fail on my Linux box, maybe because there is always some network traffic. It would go like this: num=64 -> too small, num=264 -> too small, num=266 -> too small, num=267 -> too small, eventualy wasting all 5 attempts (and causing a crash when NsiAllocateAndGetTable() returned success despite it all). --- dlls/nsi/nsi.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/nsi/nsi.c b/dlls/nsi/nsi.c index ba1597e13a9..815c942eac9 100644 --- a/dlls/nsi/nsi.c +++ b/dlls/nsi/nsi.c @@ -71,6 +71,7 @@ DWORD WINAPI NsiAllocateAndGetTable( DWORD unk, const NPI_MODULEID *module, DWOR NsiFreeTable( data[0], data[1], data[2], data[3] ); memset( data, 0, sizeof(data) ); err = ERROR_OUTOFMEMORY; /* fail if this is the last attempt */ + num += num >> 4; /* num typically keeps increasing, get ahead */ }
if (!err)