Commit eede817d authored by Paul Rupe's avatar Paul Rupe Committed by Alexandre Julliard

register_new_async sets status already. Do not overwrite it with the

function's return value.
parent 8219eb69
...@@ -375,6 +375,7 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent, ...@@ -375,6 +375,7 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
if (flags & (FD_FLAG_OVERLAPPED|FD_FLAG_TIMEOUT)) if (flags & (FD_FLAG_OVERLAPPED|FD_FLAG_TIMEOUT))
{ {
async_fileio* ovp; async_fileio* ovp;
NTSTATUS ret;
if (unix_handle < 0) return STATUS_INVALID_HANDLE; if (unix_handle < 0) return STATUS_INVALID_HANDLE;
...@@ -397,12 +398,9 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent, ...@@ -397,12 +398,9 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
ovp->fd_type = type; ovp->fd_type = type;
io_status->Information = 0; io_status->Information = 0;
io_status->u.Status = register_new_async(&ovp->async); ret = register_new_async(&ovp->async);
if (io_status->u.Status == STATUS_PENDING && hEvent) if (ret != STATUS_SUCCESS)
{ return ret;
finish_async(&ovp->async);
close(unix_handle);
}
return io_status->u.Status; return io_status->u.Status;
} }
switch (type) switch (type)
...@@ -531,6 +529,7 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent, ...@@ -531,6 +529,7 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent,
if (flags & (FD_FLAG_OVERLAPPED|FD_FLAG_TIMEOUT)) if (flags & (FD_FLAG_OVERLAPPED|FD_FLAG_TIMEOUT))
{ {
async_fileio* ovp; async_fileio* ovp;
NTSTATUS ret;
if (unix_handle < 0) return STATUS_INVALID_HANDLE; if (unix_handle < 0) return STATUS_INVALID_HANDLE;
...@@ -553,12 +552,9 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent, ...@@ -553,12 +552,9 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent,
ovp->fd_type = type; ovp->fd_type = type;
io_status->Information = 0; io_status->Information = 0;
io_status->u.Status = register_new_async(&ovp->async); ret = register_new_async(&ovp->async);
if (io_status->u.Status == STATUS_PENDING && hEvent) if (ret != STATUS_SUCCESS)
{ return ret;
finish_async(&ovp->async);
close(unix_handle);
}
return io_status->u.Status; return io_status->u.Status;
} }
switch (type) switch (type)
......
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