mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 22:08:40 +00:00
The calls docs/runtime_imports.md listed as not mapped now follow the RT-97
rules, under kernel32, kernelbase and the api-ms-win-core-file-* sets:
- CreateDirectory/CreateDirectoryEx make the folder in the overlay; a name the
title can already see, package-only folders included, is ERROR_ALREADY_EXISTS.
- RemoveDirectory needs the folder empty in the title's view. An overlay folder
is removed; a package folder is hidden by a .gta6rt-dir marker file inside its
marker folder and stays on disk (deleted() now also checks that file, on top
of the regular-file rule from 3f26a95a).
- MoveFile/MoveFileEx write the destination in the overlay; a moved package file
is copied there and its old name deleted by a marker. MOVEFILE_WRITE_THROUGH
flushes that copy and the marker before returning (review on #1742). Package
folders are not moved (ERROR_ACCESS_DENIED), GAME: <-> host is
ERROR_NOT_SAME_DEVICE and MOVEFILE_DELAY_UNTIL_REBOOT is ERROR_INVALID_PARAMETER.
- CopyFile/CopyFileEx/CopyFile2 read like a read and write a GAME: destination
in the overlay; fail-if-exists counts names only the package has.
- SetFileAttributes sets the overlay copy (copy-up or folder mirror first).
file_system: 123/123 checks. No game files.
AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
1.7 KiB
C++
31 lines
1.7 KiB
C++
// Console (GDK) file paths for a mapped title.
|
|
//
|
|
// A title's file API sees the console's drives: "GAME:\\data\\shaders\\x.sps" is a file inside the installed game
|
|
// folder. ivall/xcl (GPL-2.0-only; facts only here) documents for Xbox Series GDK titles that GAME: names the game
|
|
// folder and that writes go to a writable overlay rather than to the package, which is read-only. gta6rt does the
|
|
// same:
|
|
// GAME:<rest> a read opens the overlay copy when one exists, else <game dir>\<rest>;
|
|
// an open that can write opens <overlay dir>\<rest>, copying the package file there first when the
|
|
// disposition keeps its contents, so the package is never modified;
|
|
// a delete leaves a marker in the overlay instead of removing a package file.
|
|
// anything else is a host path and is passed through unchanged.
|
|
// A GAME: path that climbs above the root with ".." or names another drive is refused with ERROR_INVALID_NAME.
|
|
//
|
|
// The shims that use this live in file_system.cpp: CreateFile*, FindFirstFile*/FindNextFile*/FindClose,
|
|
// GetFileAttributes*/GetFileAttributesEx*, DeleteFile*, CreateDirectory*/RemoveDirectory*, MoveFile*/MoveFileEx*,
|
|
// CopyFile*/CopyFileEx*/CopyFile2 and SetFileAttributes* (the rules for each are in docs/runtime_imports.md).
|
|
#pragma once
|
|
|
|
#include <filesystem>
|
|
|
|
namespace rt::fs {
|
|
|
|
// Sets the roots. main.cpp calls this once, before anything is mapped; the test calls it per case. The overlay is
|
|
// created on the first write, not here.
|
|
void configure(const std::filesystem::path& game_dir, const std::filesystem::path& overlay_dir);
|
|
|
|
std::filesystem::path game_dir();
|
|
std::filesystem::path overlay_dir();
|
|
|
|
} // namespace rt::fs
|