I'm trying to open a directory in my file system filter driver. I'd like to open "C:\Ax\Bx\Cx\"
I don't know if this directory exists, but if it does not I'd like to create it. If it does, then I plan to write a file to it
So I've called IoCreateFile with the path = "C:\" because if it does not exist, I'll need to create this path before moving on to
"C:\Ax", etc. But I'm returning from the initial call with
#define STATUS_ACCESS_VIOLATION ((NTSTATUS)0xC0000005L)
What's going on
THE CODE:
InitializeObjectAttributes(&ObjAttrs,&Path, OBJ_KERNEL_HANDLE,NULL,NULL)
Status = IoCreateFile(&FileHandle
FILE_WRITE_ATTRIBUTES|FILE_WRITE_DATA
&ObjAttrs
&StatusBlock
0, //allocation siz
FILE_ATTRIBUTE_DIRECTORY
FILE_SHARE_WRITE, //share acces
FILE_OPEN_IF, // dispositio
FILE_DIRECTORY_FILE, // CreateOptions
0, // EaBuffer OPTIONAL
0 , // EaLengt
CreateFileTypeNone, // CreateFileTyp
NULL, // extra param
IO_FORCE_ACCESS_CHECK // Option
)
Thank
Finecat