Topic: ZwCreateFile - how to be in time at BSOD?
How to make, that performance did not proceed, while he really does not create a file? LARGE_INTEGER AllocationSize; UNICODE_STRING LogFileName; IO_STATUS_BLOCK IoStatusBlock; OBJECT_ATTRIBUTES ObjectAttributes; HANDLE LogFileHandle; NTSTATUS Status;////Open the Log File for writing.//RtlInitUnicodeString (L "\\?? \\C: \\FP_1.log", fullPath); InitializeObjectAttributes (&ObjectAttributes, &LogFileName, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, NULL, NULL); Status = ZwCreateFile (&LogFileHandle, GENERIC_WRITE, &ObjectAttributes, &IoStatusBlock, NULL, FILE_ATTRIBUTE_NORMAL, 0, FILE_OVERWRITE_IF, FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0); ZwClose (LogFileHandle); If to launch as usual the file forms. But if AFTER these lines there will be something provoking BSOD - that is then found out that the file is not present. It turns out, at first the code continues performance, and then the file forms actually. How to correct?