Determining if IRP is directory in PreCreate

Our precreate doesn’t care about creates for directories, only files. We check Parameters.Create.Options for FILE_DIRECTORY_FILE and OperationFlags for SL_OPEN_TARGET_DIRECTORY. But if the user just calls CreateFile() on a string that happens to be a directory, that should still work, right? And until post create, the system doesn’t know that it will be a directory.

Assuming that is correct, is there a way to determine if it is a directory in pre create shorter than using FltCreateFileEx() to open it, and then FltIsDirectory() to see if it is a directory? I believe the answer is no, since we don’t have a file object yet that we could use with IRP_MJ_QUERY_INFORMATION

_Ron

You are correct. No way to definitively know until the path is opened.

Thanks Scott