[XAM] Added XamUserCreateStatsEnumerator
This commit is contained in:
parent
068b3811d9
commit
413d60bf54
|
@ -808,9 +808,9 @@ dword_result_t XamSessionRefObjByHandle_entry(dword_t handle,
|
|||
}
|
||||
DECLARE_XAM_EXPORT1(XamSessionRefObjByHandle, kUserProfiles, kStub);
|
||||
|
||||
dword_result_t XamUserIsUnsafeProgrammingAllowed_entry(dword_t unk1, dword_t unk2,
|
||||
lpdword_t unk3, dword_t unk4,
|
||||
dword_t unk5, dword_t unk6) {
|
||||
dword_result_t XamUserIsUnsafeProgrammingAllowed_entry(
|
||||
dword_t unk1, dword_t unk2, lpdword_t unk3, dword_t unk4, dword_t unk5,
|
||||
dword_t unk6) {
|
||||
if (!unk3 || unk1 != 255 && unk1 >= 4) {
|
||||
return 87;
|
||||
}
|
||||
|
@ -819,9 +819,10 @@ dword_result_t XamUserIsUnsafeProgrammingAllowed_entry(dword_t unk1, dword_t unk
|
|||
}
|
||||
DECLARE_XAM_EXPORT1(XamUserIsUnsafeProgrammingAllowed, kUserProfiles, kStub);
|
||||
|
||||
dword_result_t XamUserGetSubscriptionType_entry(dword_t user_index, dword_t unk2,
|
||||
dword_t unk3, dword_t unk4,
|
||||
dword_t unk5, dword_t unk6) {
|
||||
dword_result_t XamUserGetSubscriptionType_entry(dword_t user_index,
|
||||
dword_t unk2, dword_t unk3,
|
||||
dword_t unk4, dword_t unk5,
|
||||
dword_t unk6) {
|
||||
if (!unk2 || !unk3 || user_index > 4) {
|
||||
return 0x80070057;
|
||||
}
|
||||
|
@ -830,6 +831,51 @@ dword_result_t XamUserGetSubscriptionType_entry(dword_t user_index, dword_t unk2
|
|||
}
|
||||
DECLARE_XAM_EXPORT1(XamUserGetSubscriptionType, kUserProfiles, kStub);
|
||||
|
||||
constexpr uint8_t kStatsMaxAmount = 64;
|
||||
|
||||
struct X_STATS_DETAILS {
|
||||
xe::be<uint32_t> id;
|
||||
xe::be<uint32_t> stats_amount;
|
||||
xe::be<uint16_t> stats[kStatsMaxAmount];
|
||||
};
|
||||
static_assert_size(X_STATS_DETAILS, 8 + kStatsMaxAmount * 2);
|
||||
|
||||
dword_result_t XamUserCreateStatsEnumerator_entry(
|
||||
dword_t title_id, dword_t user_index, dword_t count, dword_t flags,
|
||||
dword_t size, pointer_t<X_STATS_DETAILS> stats_ptr,
|
||||
lpdword_t buffer_size_ptr, lpdword_t handle_ptr) {
|
||||
if (!count || !buffer_size_ptr || !handle_ptr || !stats_ptr) {
|
||||
return X_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (user_index >= 4) {
|
||||
return X_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (!flags || flags > 0x64) {
|
||||
return X_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (!size) {
|
||||
return X_ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (buffer_size_ptr) {
|
||||
*buffer_size_ptr = sizeof(X_STATS_DETAILS) * stats_ptr->stats_amount;
|
||||
}
|
||||
|
||||
auto e = object_ref<XStaticUntypedEnumerator>(
|
||||
new XStaticUntypedEnumerator(kernel_state(), count, flags));
|
||||
const X_STATUS result = e->Initialize(user_index, 0xFB, 0xB0023, 0xB0024, 0);
|
||||
if (XFAILED(result)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
*handle_ptr = e->handle();
|
||||
return X_ERROR_SUCCESS;
|
||||
}
|
||||
DECLARE_XAM_EXPORT1(XamUserCreateStatsEnumerator, kUserProfiles, kSketchy);
|
||||
|
||||
} // namespace xam
|
||||
} // namespace kernel
|
||||
} // namespace xe
|
||||
|
|
Loading…
Reference in New Issue