Fix XamEnumerate returning a RESULT instead of a HRESULT in extended error.

This commit is contained in:
Dr. Chat 2015-07-27 21:49:17 -05:00
parent 297f5fdcd3
commit 1e0ba0b24c
1 changed files with 4 additions and 1 deletions

View File

@ -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;