diff --git a/src/sys/write.c b/src/sys/write.c index 6e554a55..a508f576 100644 --- a/src/sys/write.c +++ b/src/sys/write.c @@ -47,6 +47,13 @@ static NTSTATUS FspFsvolWrite( goto exit; } + /* only regular files can be written */ + if (((FSP_FILE_NODE *)IrpSp->FileObject->FsContext)->IsDirectory) + { + Result = STATUS_INVALID_PARAMETER; + goto exit; + } + /* do we have anything to write? */ if (0 == IrpSp->Parameters.Write.Length) {