From 1803fb49f01875bd8895280548935fa3e5a6484b Mon Sep 17 00:00:00 2001 From: Jefferson Carpenter Date: Tue, 10 Mar 2020 09:56:30 +0000 Subject: [PATCH] services: Initialize OVERLAPPED Offset and OffsetHigh to 0. MSDN specifies the Offset and OffsetHigh members must be zero when writing to a file that does not support seeking(1). In this case the file is the control_pipe belonging to a process_entry, and in general pipes do not support seeking. (1): https://docs.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-overlapped Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48735 Signed-off-by: Jefferson Carpenter --- programs/services/rpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/programs/services/rpc.c b/programs/services/rpc.c index a657492a5f..0958ee87c4 100644 --- a/programs/services/rpc.c +++ b/programs/services/rpc.c @@ -1133,6 +1133,8 @@ static BOOL process_send_command(struct process_entry *process, const void *data DWORD count, ret; BOOL r; + overlapped.u.Offset = 0; + overlapped.u.OffsetHigh = 0; overlapped.hEvent = process->overlapped_event; r = WriteFile(process->control_pipe, data, size, &count, &overlapped); if (!r && GetLastError() == ERROR_IO_PENDING) -- 2.23.0