Hi all;
I have a file which is written to by a kernel mode component. using these
parameters.
/* Create the file */
Status = ZwCreateFile(&(pCjjournalFile->cjFileHandle),
GENERIC_READ | GENERIC_WRITE,
&ObjectAttributes,
&IoStatusBlock,
NULL,
0 ,
FILE_SHARE_READ,
FILE_OPEN_IF,
FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT |
FILE_NO_INTERMEDIATE_BUFFERING ,
NULL,
0);
A user mode app needs to ONLY read from this file concurrently, for which i
use the following Paremeters.
/*Open the Target file for the present volume */
FileHandle = CreateFile(TargetPath,
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS,
NULL);
if (FileHandle == INVALID_HANDLE_VALUE ) {
return GetLastError();
}
The CreateFile() in user mode fails with error code 32 (The process cannot
access the file because it is being used by another process. ).
Is there any problem with ShareAccess parameter i have passes to the 2
functions or the FILE_SYNCHRONOUS_IO_NONALERT |
FILE_NO_INTERMEDIATE_BUFFERING playing some role in file not being accesible
from user mode.
Thanks And Regards
Faraz.