XamEnumerate: Return X_ERROR_FUNCTION_FAILED for overlapped failures

This commit is contained in:
Gliniak 2021-11-03 22:43:47 +01:00
parent c4d64a0501
commit c20c7c930c
1 changed files with 5 additions and 2 deletions

View File

@ -37,8 +37,8 @@ uint32_t xeXamEnumerate(uint32_t handle, uint32_t flags, lpvoid_t buffer_ptr,
return X_ERROR_INVALID_HANDLE;
}
auto run = [e, buffer_ptr](uint32_t& extended_error,
uint32_t& length) -> X_RESULT {
auto run = [e, buffer_ptr, overlapped_ptr](uint32_t& extended_error,
uint32_t& length) -> X_RESULT {
X_RESULT result;
uint32_t item_count = 0;
if (!buffer_ptr) {
@ -49,6 +49,9 @@ uint32_t xeXamEnumerate(uint32_t handle, uint32_t flags, lpvoid_t buffer_ptr,
}
extended_error = X_HRESULT_FROM_WIN32(result);
length = item_count;
if (result && overlapped_ptr) {
result = X_ERROR_FUNCTION_FAILED;
}
return result;
};