https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1bef48796e4df655c71ddd92a00417dbe9e530ca
commit 1bef48796e4df655c71ddd92a00417dbe9e530ca Author: Pierre Schweitzer <pie...@reactos.org> AuthorDate: Sun Nov 12 21:11:22 2017 +0100 [NTOSKRNL] Add a FIXME in NtWriteFile() that explains how broken is our current implementation regarding read-only FSDs --- ntoskrnl/io/iomgr/iofunc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ntoskrnl/io/iomgr/iofunc.c b/ntoskrnl/io/iomgr/iofunc.c index 5aa67ee3e1..93f1fe4e5f 100644 --- a/ntoskrnl/io/iomgr/iofunc.c +++ b/ntoskrnl/io/iomgr/iofunc.c @@ -3499,7 +3499,13 @@ NtWriteFile(IN HANDLE FileHandle, CapturedByteOffset.QuadPart = 0; IOTRACE(IO_API_DEBUG, "FileHandle: %p\n", FileHandle); - /* Get File Object */ + /* Get File Object + * FIXME: We should call ObReferenceFileObjectForWrite() instead to + * check whether write access was actually granted. If not it will + * fail and we will return. + * That would allow avoiding ASSERT on FastIO later on if the FSD + * is read-only + */ Status = ObReferenceObjectByHandle(FileHandle, 0, IoFileObjectType,