NtCreateFile - Return error while trying to create directory with non-directory flag
This commit is contained in:
parent
b3103c6327
commit
90d1772c4a
|
@ -105,6 +105,11 @@ dword_result_t NtCreateFile(lpdword_t handle_out, dword_t desired_access,
|
|||
return X_STATUS_OBJECT_NAME_INVALID;
|
||||
}
|
||||
|
||||
if (target_path.back() == '\\' &&
|
||||
create_options & CreateOptions::FILE_NON_DIRECTORY_FILE) {
|
||||
return X_STATUS_FILE_IS_A_DIRECTORY;
|
||||
}
|
||||
|
||||
if (object_attrs->root_directory != 0xFFFFFFFD && // ObDosDevices
|
||||
object_attrs->root_directory != 0) {
|
||||
auto root_file = kernel_state()->object_table()->LookupObject<XFile>(
|
||||
|
|
|
@ -64,6 +64,7 @@ typedef uint32_t X_STATUS;
|
|||
#define X_STATUS_PROCEDURE_NOT_FOUND ((X_STATUS)0xC000007AL)
|
||||
#define X_STATUS_INSUFFICIENT_RESOURCES ((X_STATUS)0xC000009AL)
|
||||
#define X_STATUS_MEMORY_NOT_ALLOCATED ((X_STATUS)0xC00000A0L)
|
||||
#define X_STATUS_FILE_IS_A_DIRECTORY ((X_STATUS)0xC00000BAL)
|
||||
#define X_STATUS_NOT_SUPPORTED ((X_STATUS)0xC00000BBL)
|
||||
#define X_STATUS_INVALID_PARAMETER_1 ((X_STATUS)0xC00000EFL)
|
||||
#define X_STATUS_INVALID_PARAMETER_2 ((X_STATUS)0xC00000F0L)
|
||||
|
|
Loading…
Reference in New Issue