mirror of
https://github.com/xenia-project/xenia.git
synced 2025-12-06 07:12:03 +01:00
[XAM] Added overlap to XamUserReadProfileSettings
- Removed delay on CompleteOverlappedDeferredEx
This commit is contained in:
parent
96c2fb13f7
commit
31ce3e0c71
|
|
@ -49,8 +49,6 @@ DECLARE_string(cl);
|
||||||
namespace xe {
|
namespace xe {
|
||||||
namespace kernel {
|
namespace kernel {
|
||||||
|
|
||||||
constexpr uint32_t kDeferredOverlappedDelayMillis = 100;
|
|
||||||
|
|
||||||
// This is a global object initialized with the XboxkrnlModule.
|
// This is a global object initialized with the XboxkrnlModule.
|
||||||
// It references the current kernel state object that all kernel methods should
|
// It references the current kernel state object that all kernel methods should
|
||||||
// be using to stash their variables.
|
// be using to stash their variables.
|
||||||
|
|
@ -1024,8 +1022,6 @@ void KernelState::CompleteOverlappedDeferredEx(
|
||||||
if (pre_callback) {
|
if (pre_callback) {
|
||||||
pre_callback();
|
pre_callback();
|
||||||
}
|
}
|
||||||
xe::threading::Sleep(
|
|
||||||
std::chrono::milliseconds(kDeferredOverlappedDelayMillis));
|
|
||||||
uint32_t extended_error, length;
|
uint32_t extended_error, length;
|
||||||
auto result = completion_callback(extended_error, length);
|
auto result = completion_callback(extended_error, length);
|
||||||
CompleteOverlappedEx(overlapped_ptr, result, extended_error, length);
|
CompleteOverlappedEx(overlapped_ptr, result, extended_error, length);
|
||||||
|
|
|
||||||
|
|
@ -256,6 +256,7 @@ uint32_t XamUserReadProfileSettingsEx(uint32_t title_id, uint32_t user_index,
|
||||||
return X_ERROR_INSUFFICIENT_BUFFER;
|
return X_ERROR_INSUFFICIENT_BUFFER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto run = [=](uint32_t& extended_error, uint32_t& length) {
|
||||||
auto user_profile = kernel_state()->xam_state()->GetUserProfile(user_index);
|
auto user_profile = kernel_state()->xam_state()->GetUserProfile(user_index);
|
||||||
|
|
||||||
if (!user_profile && !xuids) {
|
if (!user_profile && !xuids) {
|
||||||
|
|
@ -275,7 +276,8 @@ uint32_t XamUserReadProfileSettingsEx(uint32_t title_id, uint32_t user_index,
|
||||||
}
|
}
|
||||||
|
|
||||||
auto out_header = reinterpret_cast<X_USER_READ_PROFILE_SETTINGS*>(buffer);
|
auto out_header = reinterpret_cast<X_USER_READ_PROFILE_SETTINGS*>(buffer);
|
||||||
auto out_setting = reinterpret_cast<X_USER_PROFILE_SETTING*>(&out_header[1]);
|
auto out_setting =
|
||||||
|
reinterpret_cast<X_USER_PROFILE_SETTING*>(&out_header[1]);
|
||||||
out_header->setting_count = static_cast<uint32_t>(setting_count);
|
out_header->setting_count = static_cast<uint32_t>(setting_count);
|
||||||
out_header->settings_ptr =
|
out_header->settings_ptr =
|
||||||
kernel_state()->memory()->HostToGuestVirtual(out_setting);
|
kernel_state()->memory()->HostToGuestVirtual(out_setting);
|
||||||
|
|
@ -288,12 +290,10 @@ uint32_t XamUserReadProfileSettingsEx(uint32_t title_id, uint32_t user_index,
|
||||||
|
|
||||||
for (uint32_t n = 0; n < setting_count; ++n) {
|
for (uint32_t n = 0; n < setting_count; ++n) {
|
||||||
const uint32_t setting_id = setting_ids[n];
|
const uint32_t setting_id = setting_ids[n];
|
||||||
|
|
||||||
if (!UserSetting::is_setting_valid(setting_id)) {
|
if (!UserSetting::is_setting_valid(setting_id)) {
|
||||||
if (setting_id != 0) {
|
if (setting_id != 0) {
|
||||||
XELOGE(
|
XELOGE(
|
||||||
"xeXamUserReadProfileSettingsEx requested unimplemented "
|
"xeXamUserReadProfileSettingsEx requested unimplemented setting "
|
||||||
"setting "
|
|
||||||
"{:08X}",
|
"{:08X}",
|
||||||
setting_id);
|
setting_id);
|
||||||
}
|
}
|
||||||
|
|
@ -318,12 +318,18 @@ uint32_t XamUserReadProfileSettingsEx(uint32_t title_id, uint32_t user_index,
|
||||||
++out_setting;
|
++out_setting;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (overlapped_ptr) {
|
extended_error = X_HRESULT_FROM_WIN32(X_STATUS_SUCCESS);
|
||||||
kernel_state()->CompleteOverlappedImmediate(overlapped_ptr.value(),
|
length = 0;
|
||||||
X_STATUS_SUCCESS);
|
|
||||||
return X_ERROR_IO_PENDING;
|
|
||||||
}
|
|
||||||
return X_STATUS_SUCCESS;
|
return X_STATUS_SUCCESS;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!overlapped_ptr) {
|
||||||
|
uint32_t extended_error, length;
|
||||||
|
return run(extended_error, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
kernel_state()->CompleteOverlappedDeferredEx(run, overlapped_ptr);
|
||||||
|
return X_ERROR_IO_PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
dword_result_t XamUserReadProfileSettings_entry(
|
dword_result_t XamUserReadProfileSettings_entry(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue