[XAM] Fixed issue with XamContentCreate reassigning already assigned symlinks

This commit is contained in:
Gliniak
2026-02-17 22:57:31 +01:00
committed by Radosław Gliński
parent bc69b95db6
commit 9bfaff5040
9 changed files with 43 additions and 12 deletions

View File

@@ -621,7 +621,7 @@ const object_ref<UserModule> KernelState::LoadTitleUpdate(
"UPDATE", 0, *title_update, content_license, disc_number);
std::string mount_path = "";
if (!file_system()->FindSymbolicLink("game:", mount_path)) {
if (!file_system()->FindSymbolicLink(kDefaultGameSymbolicLink, mount_path)) {
return nullptr;
}
@@ -630,7 +630,8 @@ const object_ref<UserModule> KernelState::LoadTitleUpdate(
}
std::string resolved_path = "";
if (!file_system()->FindSymbolicLink("UPDATE:", resolved_path)) {
if (!file_system()->FindSymbolicLink(kDefaultUpdateSymbolicLink,
resolved_path)) {
return nullptr;
}

View File

@@ -251,8 +251,8 @@ std::vector<XCONTENT_AGGREGATE_DATA> ContentManager::ListContentODD(
fmt::format("{:08X}", static_cast<uint32_t>(content_type));
const std::filesystem::path game_content_path =
std::filesystem::path("GAME:") / "content" / xuid_str / title_id_str /
content_type_str;
std::filesystem::path(kDefaultGameSymbolicLink) / "content" / xuid_str /
title_id_str / content_type_str;
auto entry = kernel_state_->file_system()->ResolvePath(
xe::path_to_utf8(game_content_path));

View File

@@ -244,6 +244,16 @@ dword_result_t xeXamContentCreate(dword_t user_index, lpstring_t root_name,
return X_ERROR_INVALID_NAME;
}
// Check if we have something under provided symlink.
std::string symlink_path = root_name.value();
if (!symlink_path.ends_with(':')) {
symlink_path += ':';
}
if (kernel_state()->file_system()->IsSymbolicLinkRegistered(symlink_path)) {
return X_ERROR_INVALID_PARAMETER;
}
XCONTENT_AGGREGATE_DATA content_data;
if (content_data_size == sizeof(XCONTENT_DATA)) {
content_data = *content_data_ptr.as<XCONTENT_DATA*>();

View File

@@ -26,7 +26,7 @@ namespace xam {
void AddODDContentTest(object_ref<XStaticEnumerator<XCONTENT_AGGREGATE_DATA>> e,
XContentType content_type) {
auto root_entry = kernel_state()->file_system()->ResolvePath(
"game:\\Content\\0000000000000000");
"GAME:\\Content\\0000000000000000");
if (!root_entry) {
return;
}

View File

@@ -116,8 +116,8 @@ void XamModule::SaveLoaderData() {
}
};
remove_prefix("game:\\");
remove_prefix("d:\\");
remove_prefix(fmt::format("{}\\", kDefaultGameSymbolicLink));
remove_prefix(fmt::format("{}\\", kDefaultPartitionSymbolicLink));
if (host_path.extension() == ".xex") {
host_path.remove_filename();