don't pass NULL as the last two parameters to ReadFile. This fixes a
crash while installing OOo 2.0. Patch also submitted to winehq.
Modified: trunk/reactos/lib/msi/action.c
_____
Modified: trunk/reactos/lib/msi/action.c
--- trunk/reactos/lib/msi/action.c 2005-10-28 14:31:38 UTC (rev
18833)
+++ trunk/reactos/lib/msi/action.c 2005-10-28 15:33:05 UTC (rev
18834)
@@ -3676,8 +3676,9 @@
TT_TABLE_DIRECTORY tblDir;
BOOL bFound = FALSE;
TT_OFFSET_TABLE ttOffsetTable;
+ DWORD dwRead;
- ReadFile(handle,&ttOffsetTable,
sizeof(TT_OFFSET_TABLE),NULL,NULL);
+ ReadFile(handle,&ttOffsetTable,
sizeof(TT_OFFSET_TABLE),&dwRead,NULL);
ttOffsetTable.uNumOfTables =
SWAPWORD(ttOffsetTable.uNumOfTables);
ttOffsetTable.uMajorVersion =
SWAPWORD(ttOffsetTable.uMajorVersion);
ttOffsetTable.uMinorVersion =
SWAPWORD(ttOffsetTable.uMinorVersion);
@@ -3688,7 +3689,7 @@
for (i=0; i< ttOffsetTable.uNumOfTables; i++)
{
- ReadFile(handle,&tblDir,
sizeof(TT_TABLE_DIRECTORY),NULL,NULL);
+ ReadFile(handle,&tblDir,
sizeof(TT_TABLE_DIRECTORY),&dwRead,NULL);
if (strncmp(tblDir.szTag,"name",4)==0)
{
bFound = TRUE;
@@ -3705,14 +3706,14 @@
SetFilePointer(handle, tblDir.uOffset, NULL, FILE_BEGIN);
ReadFile(handle,&ttNTHeader, sizeof(TT_NAME_TABLE_HEADER),
- NULL,NULL);
+ &dwRead,NULL);
ttNTHeader.uNRCount = SWAPWORD(ttNTHeader.uNRCount);
ttNTHeader.uStorageOffset =
SWAPWORD(ttNTHeader.uStorageOffset);
bFound = FALSE;
for(i=0; i<ttNTHeader.uNRCount; i++)
{
- ReadFile(handle,&ttRecord,
sizeof(TT_NAME_RECORD),NULL,NULL);
+ ReadFile(handle,&ttRecord,
sizeof(TT_NAME_RECORD),&dwRead,NULL);
ttRecord.uNameID = SWAPWORD(ttRecord.uNameID);
/* 4 is the Full Font Name */
if(ttRecord.uNameID == 4)
@@ -3730,7 +3731,7 @@
NULL, FILE_BEGIN);
buf = msi_alloc( ttRecord.uStringLength + 1 +
strlen(tt) );
memset(buf, 0, ttRecord.uStringLength + 1 +
strlen(tt));
- ReadFile(handle, buf, ttRecord.uStringLength, NULL,
NULL);
+ ReadFile(handle, buf, ttRecord.uStringLength,
&dwRead, NULL);
if (strlen(buf) > 0)
{
strcat(buf,tt);