mirror of
https://github.com/decompals/wibo.git
synced 2025-12-13 07:06:18 +00:00
ReadFile/WriteFile: Require overlapped I/O on overlapped handles (#99)
This commit is contained in:
@@ -718,6 +718,15 @@ BOOL WIN_FUNC WriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWr
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (lpNumberOfBytesWritten && (!file->overlapped || lpOverlapped == nullptr)) {
|
||||
*lpNumberOfBytesWritten = 0;
|
||||
}
|
||||
|
||||
if (file->overlapped && lpOverlapped == nullptr) {
|
||||
wibo::lastError = ERROR_INVALID_PARAMETER;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
std::optional<off_t> offset;
|
||||
bool updateFilePointer = true;
|
||||
if (lpOverlapped != nullptr) {
|
||||
@@ -808,6 +817,11 @@ BOOL WIN_FUNC ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead
|
||||
*lpNumberOfBytesRead = 0;
|
||||
}
|
||||
|
||||
if (file->overlapped && lpOverlapped == nullptr) {
|
||||
wibo::lastError = ERROR_INVALID_PARAMETER;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
std::optional<off_t> offset;
|
||||
bool updateFilePointer = true;
|
||||
if (lpOverlapped != nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user