From ff5ecfd89a24ac98f220096268519c605140727b Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Mon, 30 Aug 2004 18:40:06 +0000 Subject: [PATCH] For non-overlapped writes the lpNumberOfBytesWritten parameter of WriteFile mustn't be NULL. --- dlls/oleaut32/typelib2.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/oleaut32/typelib2.c b/dlls/oleaut32/typelib2.c index 955b80139a1..4463443571f 100644 --- a/dlls/oleaut32/typelib2.c +++ b/dlls/oleaut32/typelib2.c @@ -3222,14 +3222,19 @@ static HRESULT WINAPI ICreateTypeLib2_fnSetLibFlags(ICreateTypeLib2 * iface, UIN static int ctl2_write_chunk(HANDLE hFile, void *segment, int length) { - if (!WriteFile(hFile, segment, length, NULL, 0)) {CloseHandle(hFile); return 0;} + DWORD dwWritten; + if (!WriteFile(hFile, segment, length, &dwWritten, 0)) { + CloseHandle(hFile); + return 0; + } return -1; } static int ctl2_write_segment(ICreateTypeLib2Impl *This, HANDLE hFile, int segment) { + DWORD dwWritten; if (!WriteFile(hFile, This->typelib_segment_data[segment], - This->typelib_segdir[segment].length, NULL, 0)) { + This->typelib_segdir[segment].length, &dwWritten, 0)) { CloseHandle(hFile); return 0; }