Skip to content

Commit 4f7da49

Browse files
committed
os/windows/async_request: Support for Windows 7 and earlier
1 parent 0f9c23a commit 4f7da49

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

source/os/windows/async_request.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "async_request.hpp"
1919
#include "utility.hpp"
20+
#include <versionhelpers.h>
2021

2122
void os::windows::async_request::set_handle(HANDLE handle) {
2223
this->handle = handle;
@@ -95,7 +96,11 @@ void os::windows::async_request::call_callback() {
9596
os::error error = os::error::Success;
9697

9798
SetLastError(ERROR_SUCCESS);
98-
GetOverlappedResultEx(handle, ov, &bytes, FALSE, TRUE);
99+
if (IsWindows8OrGreater()) {
100+
GetOverlappedResultEx(handle, ov, &bytes, 0, TRUE);
101+
} else {
102+
GetOverlappedResult(handle, ov, &bytes, FALSE);
103+
}
99104
error = os::windows::utility::translate_error(GetLastError());
100105

101106
call_callback(error, (size_t)bytes);

0 commit comments

Comments
 (0)