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.

svn path=/trunk/; revision=18834
This commit is contained in:
Thomas Bluemel 2005-10-28 15:33:05 +00:00
parent b1f73ba822
commit 98191672ef

View file

@ -3676,8 +3676,9 @@ static LPWSTR load_ttfname_from(LPCWSTR filename)
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 @@ static LPWSTR load_ttfname_from(LPCWSTR filename)
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 @@ static LPWSTR load_ttfname_from(LPCWSTR filename)
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 @@ static LPWSTR load_ttfname_from(LPCWSTR filename)
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);