mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[NTOSKRNL] In NtWriteFile, quit using ObReferenceObjectByHandle in favor of ObReferenceFileObjectForWrite().
This avoids RO FSDs being called for write operations. CORE-14003
This commit is contained in:
parent
3b64f7f8fb
commit
c3d5a3f2bd
1 changed files with 5 additions and 13 deletions
|
@ -3499,19 +3499,11 @@ NtWriteFile(IN HANDLE FileHandle,
|
|||
CapturedByteOffset.QuadPart = 0;
|
||||
IOTRACE(IO_API_DEBUG, "FileHandle: %p\n", FileHandle);
|
||||
|
||||
/* 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,
|
||||
PreviousMode,
|
||||
(PVOID*)&FileObject,
|
||||
&ObjectHandleInfo);
|
||||
/* Get File Object for write */
|
||||
Status = ObReferenceFileObjectForWrite(FileHandle,
|
||||
PreviousMode,
|
||||
&FileObject,
|
||||
&ObjectHandleInfo);
|
||||
if (!NT_SUCCESS(Status)) return Status;
|
||||
|
||||
/* Validate User-Mode Buffers */
|
||||
|
|
Loading…
Reference in a new issue