gdi32: Do not omit mandatory argument to WriteFile.

This commit is contained in:
Thomas Faber 2014-07-12 10:35:15 +02:00 committed by Alexandre Julliard
parent 5bd5c89596
commit 07ca1afbd3
2 changed files with 9 additions and 5 deletions

View File

@ -193,6 +193,7 @@ static BOOL EMFDRV_DeleteDC( PHYSDEV dev )
BOOL EMFDRV_WriteRecord( PHYSDEV dev, EMR *emr )
{
DWORD len;
DWORD bytes_written;
ENHMETAHEADER *emh;
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE *)dev;
@ -205,7 +206,7 @@ BOOL EMFDRV_WriteRecord( PHYSDEV dev, EMR *emr )
physDev->emh->nRecords++;
if(physDev->hFile) {
if (!WriteFile(physDev->hFile, emr, emr->nSize, NULL, NULL))
if (!WriteFile(physDev->hFile, emr, emr->nSize, &bytes_written, NULL))
return FALSE;
} else {
DWORD nEmfSize = HeapSize(GetProcessHeap(), 0, physDev->emh);
@ -316,6 +317,7 @@ HDC WINAPI CreateEnhMetaFileW(
EMFDRV_PDEVICE *physDev;
HANDLE hFile;
DWORD size = 0, length = 0;
DWORD bytes_written;
TRACE("%s\n", debugstr_w(filename) );
@ -407,7 +409,7 @@ HDC WINAPI CreateEnhMetaFileW(
free_dc_ptr( dc );
return 0;
}
if (!WriteFile( hFile, physDev->emh, size, NULL, NULL )) {
if (!WriteFile( hFile, physDev->emh, size, &bytes_written, NULL )) {
free_dc_ptr( dc );
CloseHandle( hFile );
return 0;

View File

@ -321,6 +321,7 @@ HDC WINAPI CreateMetaFileW( LPCWSTR filename )
DC *dc;
METAFILEDRV_PDEVICE *physDev;
HANDLE hFile;
DWORD bytes_written;
TRACE("%s\n", debugstr_w(filename) );
@ -335,8 +336,8 @@ HDC WINAPI CreateMetaFileW( LPCWSTR filename )
free_dc_ptr( dc );
return 0;
}
if (!WriteFile( hFile, physDev->mh, sizeof(*physDev->mh), NULL,
NULL )) {
if (!WriteFile( hFile, physDev->mh, sizeof(*physDev->mh),
&bytes_written, NULL )) {
free_dc_ptr( dc );
CloseHandle (hFile );
return 0;
@ -387,6 +388,7 @@ static DC *MFDRV_CloseMetaFile( HDC hdc )
{
DC *dc;
METAFILEDRV_PDEVICE *physDev;
DWORD bytes_written;
TRACE("(%p)\n", hdc );
@ -423,7 +425,7 @@ static DC *MFDRV_CloseMetaFile( HDC hdc )
physDev->mh->mtType = METAFILE_MEMORY; /* This is what windows does */
if (!WriteFile(physDev->hFile, physDev->mh, sizeof(*physDev->mh),
NULL, NULL)) {
&bytes_written, NULL)) {
free_dc_ptr( dc );
return 0;
}