Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ BOOLEAN BufferBytes(HANDLE File, void* Buf, unsigned long BufSize)

if (BufSize > CurSpace && CurSpace < WRITEBUF_SIZE) {
// Flush write buffer to make space for the new bytes.
if (!WriteFile(File, WriteBuf, WriteBufNext, NULL, NULL)) {
DWORD at;
if (!WriteFile(File, WriteBuf, WriteBufNext, &at, NULL)) {
return FALSE;
}
WriteBufNext = 0;
Expand All @@ -70,7 +71,8 @@ BOOLEAN BufferBytes(HANDLE File, void* Buf, unsigned long BufSize)
if (BufSize > CurSpace) {
// The buffer is empty and we still don't have enough space.
// Bypass the buffer and write directly to the file.
if (!WriteFile(File, Buf, BufSize, NULL, NULL)) {
DWORD at;
if (!WriteFile(File, Buf, BufSize, &at, NULL)) {
return FALSE;
}
} else {
Expand All @@ -83,7 +85,8 @@ BOOLEAN BufferBytes(HANDLE File, void* Buf, unsigned long BufSize)

BOOLEAN FlushBufferBytes(HANDLE File)
{
if (!WriteFile(File, WriteBuf, WriteBufNext, NULL, NULL)) {
DWORD at;
if (!WriteFile(File, WriteBuf, WriteBufNext, &at, NULL)) {
return FALSE;
}
WriteBufNext = 0;
Expand Down