Content enumeration.

This commit is contained in:
Ben Vanik
2015-02-12 16:15:45 -08:00
parent 1e1a123fba
commit 1ddb8f0c8f
8 changed files with 130 additions and 26 deletions

View File

@@ -160,15 +160,17 @@ SHIM_CALL XamEnumerate_shim(PPCContext* ppc_state, KernelState* state) {
return;
}
// 0 items.
auto item_count = e->item_count();
e->WriteItems(SHIM_MEM_ADDR(buffer_ptr));
X_RESULT result;
if (item_count_ptr) {
assert_zero(overlapped_ptr);
SHIM_SET_MEM_32(item_count_ptr, 0);
SHIM_SET_MEM_32(item_count_ptr, item_count);
result = X_ERROR_SUCCESS;
} else if (overlapped_ptr) {
assert_zero(item_count_ptr);
state->CompleteOverlappedImmediate(overlapped_ptr, 0, 0);
state->CompleteOverlappedImmediate(overlapped_ptr, 0, item_count);
result = X_ERROR_IO_PENDING;
} else {
assert_always();