mirror of
https://github.com/reactos/reactos.git
synced 2025-07-25 12:33:39 +00:00
[NTFS]
On opening, check the file found matches the requested dispositions from the caller svn path=/trunk/; revision=64692
This commit is contained in:
parent
c440495495
commit
e8d374127e
1 changed files with 24 additions and 0 deletions
|
@ -221,6 +221,30 @@ NtfsCreateFile(PDEVICE_OBJECT DeviceObject,
|
||||||
FileObject->FileName.Buffer,
|
FileObject->FileName.Buffer,
|
||||||
&Fcb);
|
&Fcb);
|
||||||
|
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
if (RequestedDisposition == FILE_CREATE)
|
||||||
|
{
|
||||||
|
Irp->IoStatus.Information = FILE_EXISTS;
|
||||||
|
NtfsCloseFile(DeviceExt, FileObject);
|
||||||
|
return STATUS_OBJECT_NAME_COLLISION;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RequestedOptions & FILE_NON_DIRECTORY_FILE &&
|
||||||
|
NtfsFCBIsDirectory(Fcb))
|
||||||
|
{
|
||||||
|
NtfsCloseFile(DeviceExt, FileObject);
|
||||||
|
return STATUS_FILE_IS_A_DIRECTORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RequestedOptions & FILE_DIRECTORY_FILE &&
|
||||||
|
!NtfsFCBIsDirectory(Fcb))
|
||||||
|
{
|
||||||
|
NtfsCloseFile(DeviceExt, FileObject);
|
||||||
|
return STATUS_NOT_A_DIRECTORY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the directory containing the file to open doesn't exist then
|
* If the directory containing the file to open doesn't exist then
|
||||||
* fail immediately
|
* fail immediately
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue