[XAM] Added profile and create content enumerator wrappers
This commit is contained in:
@@ -157,8 +157,9 @@ dword_result_t XamContentCreateEnumerator_entry(
|
||||
xuid = user->xuid();
|
||||
}
|
||||
|
||||
auto e = make_object<XStaticEnumerator<XCONTENT_DATA>>(kernel_state(),
|
||||
items_per_enumerate);
|
||||
auto e = object_ref<ContentEnumerator>(
|
||||
new ContentEnumerator(kernel_state(), items_per_enumerate));
|
||||
|
||||
auto result = e->Initialize(XUserIndexAny, 0xFE, 0x20005, 0x20007, 0);
|
||||
if (XFAILED(result)) {
|
||||
return result;
|
||||
@@ -206,8 +207,7 @@ dword_result_t XamContentCreateEnumerator_entry(
|
||||
}
|
||||
|
||||
for (const auto& content_data : enumerated_content) {
|
||||
auto item = e->AppendItem();
|
||||
*item = content_data;
|
||||
e->AppendItem(content_data);
|
||||
XELOGI("{}: Adding: {} (Filename: {}) to enumerator result", __func__,
|
||||
xe::to_utf8(content_data.display_name()), content_data.file_name());
|
||||
}
|
||||
|
||||
@@ -165,7 +165,8 @@ dword_result_t XamProfileCreateEnumerator_entry(dword_t device_id,
|
||||
return X_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
auto e = new XStaticEnumerator<X_PROFILEENUMRESULT>(kernel_state(), 1);
|
||||
auto e =
|
||||
object_ref<ProfileEnumerator>(new ProfileEnumerator(kernel_state(), 1));
|
||||
|
||||
auto result =
|
||||
e->Initialize(XUserIndexAny, 0xFE, 0x23001, 0x23003, 0, 0x28, nullptr);
|
||||
@@ -178,11 +179,7 @@ dword_result_t XamProfileCreateEnumerator_entry(dword_t device_id,
|
||||
kernel_state()->xam_state()->profile_manager()->GetAccounts();
|
||||
|
||||
for (const auto& [xuid, account] : *accounts) {
|
||||
X_PROFILEENUMRESULT* profile = e->AppendItem();
|
||||
|
||||
profile->xuid_offline = xuid;
|
||||
profile->device_id = 1;
|
||||
memcpy(&profile->account, &account, sizeof(X_XAMACCOUNTINFO));
|
||||
e->AppendItem({xuid, account, 1});
|
||||
}
|
||||
|
||||
*handle_ptr = e->handle();
|
||||
|
||||
Reference in New Issue
Block a user