[XAM] Store XGI contexts
This commit is contained in:
@@ -53,6 +53,11 @@ X_HRESULT XgiApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
|
|||||||
title_xdbf.GetStringTableEntry(title_language, context.string_id);
|
title_xdbf.GetStringTableEntry(title_language, context.string_id);
|
||||||
XELOGD("XGIUserSetContextEx: {} - Set to value: {}", desc,
|
XELOGD("XGIUserSetContextEx: {} - Set to value: {}", desc,
|
||||||
context_value);
|
context_value);
|
||||||
|
|
||||||
|
UserProfile* user_profile = kernel_state_->user_profile(user_index);
|
||||||
|
if (user_profile) {
|
||||||
|
user_profile->contexts_[context_id] = context_value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return X_E_SUCCESS;
|
return X_E_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -155,6 +160,13 @@ X_HRESULT XgiApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
|
|||||||
context_ptr, context_id);
|
context_ptr, context_id);
|
||||||
uint32_t value = 0;
|
uint32_t value = 0;
|
||||||
if (context) {
|
if (context) {
|
||||||
|
UserProfile* user_profile = kernel_state_->user_profile(user_index);
|
||||||
|
if (user_profile) {
|
||||||
|
if (user_profile->contexts_.find(context_id) !=
|
||||||
|
user_profile->contexts_.cend()) {
|
||||||
|
value = user_profile->contexts_[context_id];
|
||||||
|
}
|
||||||
|
}
|
||||||
xe::store_and_swap<uint32_t>(context + 4, value);
|
xe::store_and_swap<uint32_t>(context + 4, value);
|
||||||
}
|
}
|
||||||
return X_E_FAIL;
|
return X_E_FAIL;
|
||||||
|
|||||||
@@ -232,6 +232,8 @@ class UserProfile {
|
|||||||
void AddSetting(std::unique_ptr<Setting> setting);
|
void AddSetting(std::unique_ptr<Setting> setting);
|
||||||
Setting* GetSetting(uint32_t setting_id);
|
Setting* GetSetting(uint32_t setting_id);
|
||||||
|
|
||||||
|
std::map<uint32_t, uint32_t> contexts_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint64_t xuid_;
|
uint64_t xuid_;
|
||||||
std::string name_;
|
std::string name_;
|
||||||
|
|||||||
Reference in New Issue
Block a user