[Kernel/IO] Return error creating dir as non-dir.
[Kernel/IO] Return error when creating directory with non-directory flag in NtCreateFile.
This commit is contained in:
@@ -142,7 +142,8 @@ dword_result_t NtCreateFile(lpdword_t handle_out, dword_t desired_access,
|
||||
X_STATUS result = kernel_state()->file_system()->OpenFile(
|
||||
root_entry, target_path,
|
||||
vfs::FileDisposition((uint32_t)creation_disposition), desired_access,
|
||||
(create_options & CreateOptions::FILE_DIRECTORY_FILE) != 0, &vfs_file,
|
||||
(create_options & CreateOptions::FILE_DIRECTORY_FILE) != 0,
|
||||
(create_options & CreateOptions::FILE_NON_DIRECTORY_FILE) != 0, &vfs_file,
|
||||
&file_action);
|
||||
object_ref<XFile> file = nullptr;
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ object_ref<XFile> XFile::Restore(KernelState* kernel_state,
|
||||
vfs::FileAction action;
|
||||
auto res = kernel_state->file_system()->OpenFile(
|
||||
nullptr, abs_path, vfs::FileDisposition::kOpen, access, is_directory,
|
||||
&vfs_file, &action);
|
||||
false, &vfs_file, &action);
|
||||
if (XFAILED(res)) {
|
||||
XELOGE("Failed to open XFile: error {:08X}", res);
|
||||
return object_ref<XFile>(file);
|
||||
|
||||
Reference in New Issue
Block a user