[Kernel] Added dummy XFileBasicInformation for NtSetInformationFile

This will prevent assertion spam in some games
Mostly games uses it for cache files after renaming to enable writing to file
This commit is contained in:
Gliniak 2024-08-12 19:20:59 +02:00
parent feb88ee6b1
commit 504e832b49
2 changed files with 15 additions and 0 deletions

View File

@ -58,6 +58,16 @@ enum X_FILE_INFORMATION_CLASS {
#pragma pack(push, 1)
// https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/ns-wdm-_file_basic_information
struct X_FILE_BASIC_INFORMATION {
be<uint64_t> creation_time;
be<uint64_t> last_access_time;
be<uint64_t> last_write_time;
be<uint64_t> change_time;
be<uint64_t> attributes;
};
static_assert_size(X_FILE_BASIC_INFORMATION, 0x28);
// https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/ns-ntifs-_file_internal_information
struct X_FILE_INTERNAL_INFORMATION {
be<uint64_t> index_number;

View File

@ -205,6 +205,11 @@ dword_result_t NtSetInformationFile_entry(
uint32_t out_length;
switch (info_class) {
case XFileBasicInformation: {
auto info = info_ptr.as<X_FILE_BASIC_INFORMATION*>();
out_length = sizeof(*info);
break;
}
case XFileRenameInformation: {
auto info = info_ptr.as<X_FILE_RENAME_INFORMATION*>();
// Compute path, possibly attrs relative.