diff --git a/ntoskrnl/io/iomgr/file.c b/ntoskrnl/io/iomgr/file.c index 548c7f28db7..bfe11ab295b 100644 --- a/ntoskrnl/io/iomgr/file.c +++ b/ntoskrnl/io/iomgr/file.c @@ -857,7 +857,7 @@ IopParseDevice(IN PVOID ParseObject, } /* Clear the file object */ - RtlZeroMemory(FileObject, sizeof(FILE_OBJECT)); + RtlZeroMemory(FileObject, ObjectSize); /* Check if this is Synch I/O */ if (OpenPacket->CreateOptions & @@ -917,6 +917,7 @@ IopParseDevice(IN PVOID ParseObject, /* Make sure the file object knows it has an extension */ FileObject->Flags |= FO_FILE_OBJECT_HAS_EXTENSION; + /* Initialize file object extension */ FileObjectExtension = (PFILE_OBJECT_EXTENSION)(FileObject + 1); FileObject->FileObjectExtension = FileObjectExtension;