Hello, Sorry for the basic question. I need to create a file for write access in kernel mode and and allow other thread to read it, this can happen simultaneously. so This what I do when creating the file.
status = ZwCreateFile(&hfile,
works well, the file is created for write and later when I try to create another handle to read it I always get "STATUS_SHARING_VIOLATION"
here is how I do it.
ntstatus = ZwCreateFile(&OriFileHandle,
FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE,
Can anybody tell me what is it that I am doing wrong?
What I have tried:
I already read about ZwCreatefile and how to share a file for access by other thread but I am still getting that error.