I'm trying to read a database transaction log used by a DB engine. As the file is exclusively locked, I can't read it in any handles created by the user mode. Hence, I'm trying Kernel APIs such as ZwCreateFile, IoCreateFileSpecifyDeviceObjectHint, etc. The status is throwing a c0000043 error which maps to a STATUS_SHARING_VIOLATION. Here is the code I have tried:
ntstatus = ZwCreateFile(&handle,
GENERIC_READ,
&objAttr, &ioStatusBlock,
NULL,
FILE_ATTRIBUTE_NORMAL,
0,
FILE_OPEN,
FILE_SYNCHRONOUS_IO_NONALERT,
NULL, 0);
Any leads will help.