[VFS] Change file attributes or timestamps.

Changing these options is only viable for r/w mounted host devices (Cache)
Changing attributes works only on windows
Changing timestamps is mocked and logged to see if there is any title that uses it
This commit is contained in:
Gliniak
2024-08-15 17:13:19 +02:00
parent c68b09d717
commit 49584ff664
8 changed files with 86 additions and 0 deletions

View File

@@ -207,6 +207,26 @@ dword_result_t NtSetInformationFile_entry(
switch (info_class) {
case XFileBasicInformation: {
auto info = info_ptr.as<X_FILE_BASIC_INFORMATION*>();
bool basic_result = true;
if (info->creation_time) {
basic_result &= file->entry()->SetCreateTimestamp(info->creation_time);
}
if (info->last_access_time) {
basic_result &=
file->entry()->SetAccessTimestamp(info->last_access_time);
}
if (info->last_write_time) {
basic_result &= file->entry()->SetWriteTimestamp(info->last_write_time);
}
basic_result &= file->entry()->SetAttributes(info->attributes);
if (!basic_result) {
result = X_STATUS_UNSUCCESSFUL;
}
out_length = sizeof(*info);
break;
}