IRP_MJ_CREATE vs. directory vs. FILE_FLAG_BACKUP_SEMANTICS

At the file system level, there is no requirement that directory CREATEs have the FILE_FLAG_BACKUP_SEMANTICS flag.

Even from user mode, callers can open directories without the FILE_FLAG_BACKUP_SEMANTICS flag by using NtCreateFile.

So, your feeling is correct - FILE_FLAG_BACKUP_SEMANTICS probably shouldn’t be silently added. I’ve always found it strange that CreateFile overloads this flag in such a strange way.

Of course, I don’t know anything about your custom file system. Does it make later assumptions about FILE_FLAG_BACKUP_SEMANTICS in a directory open?

Thanks,
Alnoor