Merge pull request #371 from DrChat/xam_enumerate_fix
Fix XamEnumerate returning a RESULT instead of a HRESULT
This commit is contained in:
commit
dffc1f0e14
|
@ -218,6 +218,9 @@ dword_result_t XamEnumerate(dword_t handle, dword_t flags, lpvoid_t buffer,
|
||||||
buffer.Zero(buffer_length);
|
buffer.Zero(buffer_length);
|
||||||
X_RESULT result =
|
X_RESULT result =
|
||||||
e->WriteItem(buffer) ? X_ERROR_SUCCESS : X_ERROR_NO_MORE_FILES;
|
e->WriteItem(buffer) ? X_ERROR_SUCCESS : X_ERROR_NO_MORE_FILES;
|
||||||
|
|
||||||
|
// Return X_ERROR_NO_MORE_FILES in HRESULT form.
|
||||||
|
X_HRESULT extended_result = result != 0 ? 0x80070012 : 0;
|
||||||
if (items_returned) {
|
if (items_returned) {
|
||||||
assert_true(!overlapped);
|
assert_true(!overlapped);
|
||||||
*items_returned = result == X_ERROR_SUCCESS ? 1 : 0;
|
*items_returned = result == X_ERROR_SUCCESS ? 1 : 0;
|
||||||
|
@ -226,7 +229,7 @@ dword_result_t XamEnumerate(dword_t handle, dword_t flags, lpvoid_t buffer,
|
||||||
} else if (overlapped) {
|
} else if (overlapped) {
|
||||||
assert_true(!items_returned);
|
assert_true(!items_returned);
|
||||||
kernel_state()->CompleteOverlappedImmediateEx(
|
kernel_state()->CompleteOverlappedImmediateEx(
|
||||||
overlapped, result, result,
|
overlapped, result, extended_result,
|
||||||
result == X_ERROR_SUCCESS ? e->item_count() : 0);
|
result == X_ERROR_SUCCESS ? e->item_count() : 0);
|
||||||
|
|
||||||
return X_ERROR_IO_PENDING;
|
return X_ERROR_IO_PENDING;
|
||||||
|
|
Loading…
Reference in New Issue