win/fs: check file handle with GetFileInformationByHandle when creating fs::file

On empty mounted drives CreateFileW may return a valid handle even if the drive is not usable.
We have to check the file handle early. Otherwise other functions may fail later as a result.
This commit is contained in:
Megamouse
2026-02-19 23:58:34 +01:00
committed by Elad
parent aaf84a8445
commit ff992a67c8
3 changed files with 32 additions and 22 deletions
+7 -7
View File
@@ -66,13 +66,13 @@ namespace fs
// File attributes (TODO)
struct stat_t
{
bool is_directory;
bool is_symlink;
bool is_writable;
u64 size;
s64 atime;
s64 mtime;
s64 ctime;
bool is_directory = false;
bool is_symlink = false;
bool is_writable = false;
u64 size = 0;
s64 atime = 0;
s64 mtime = 0;
s64 ctime = 0;
using enable_bitcopy = std::true_type;