[XAM] Fix ContentCreate to pass copy of root_name.

[XAM] Fix xeXamContentCreate to pass copy of root_name for deferred
operation, as the pointer may no longer be valid when the callback
is executed.
This commit is contained in:
Gliniak 2021-07-30 11:42:37 +02:00 committed by Rick Gibbed
parent 90c4950503
commit c9073e101f
1 changed files with 5 additions and 5 deletions

View File

@ -139,9 +139,9 @@ dword_result_t xeXamContentCreate(dword_t user_index, lpstring_t root_name,
*disposition_ptr = 0; *disposition_ptr = 0;
} }
auto run = [content_manager, root_name, flags, content_data, disposition_ptr, auto run = [content_manager, root_name = root_name.value(), flags,
license_mask_ptr](uint32_t& extended_error, content_data, disposition_ptr, license_mask_ptr](
uint32_t& length) -> X_RESULT { uint32_t& extended_error, uint32_t& length) -> X_RESULT {
X_RESULT result = X_ERROR_INVALID_PARAMETER; X_RESULT result = X_ERROR_INVALID_PARAMETER;
bool create = false; bool create = false;
bool open = false; bool open = false;
@ -203,9 +203,9 @@ dword_result_t xeXamContentCreate(dword_t user_index, lpstring_t root_name,
} }
if (create) { if (create) {
result = content_manager->CreateContent(root_name.value(), content_data); result = content_manager->CreateContent(root_name, content_data);
} else if (open) { } else if (open) {
result = content_manager->OpenContent(root_name.value(), content_data); result = content_manager->OpenContent(root_name, content_data);
} }
if (license_mask_ptr && XSUCCEEDED(result)) { if (license_mask_ptr && XSUCCEEDED(result)) {