Commit 07ca1afb authored by Thomas Faber's avatar Thomas Faber Committed by Alexandre Julliard

gdi32: Do not omit mandatory argument to WriteFile.

parent 5bd5c895
......@@ -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;
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment