mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[NTOS:KD] KdpDebugLogInit: Fix ZwCreateFile flags for appending to debug logging file.
However, ReactOS currently doesn't handle FILE_APPEND_DATA correctly, so temporarily add a hack for fixing its support. CORE-18789
This commit is contained in:
parent
a8b09eddc4
commit
a49732e5b6
1 changed files with 36 additions and 2 deletions
|
@ -272,8 +272,9 @@ KdpDebugLogInit(
|
|||
NULL,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
FILE_SHARE_READ,
|
||||
FILE_SUPERSEDE,
|
||||
FILE_WRITE_THROUGH | FILE_SYNCHRONOUS_IO_NONALERT,
|
||||
FILE_OPEN_IF,
|
||||
FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT |
|
||||
FILE_SEQUENTIAL_ONLY | FILE_WRITE_THROUGH,
|
||||
NULL,
|
||||
0);
|
||||
|
||||
|
@ -285,6 +286,39 @@ KdpDebugLogInit(
|
|||
return;
|
||||
}
|
||||
|
||||
/** HACK for FILE_APPEND_DATA **
|
||||
** Remove once CORE-18789 is fixed. **
|
||||
** Enforce to go to the end of file **/
|
||||
{
|
||||
FILE_STANDARD_INFORMATION FileInfo;
|
||||
FILE_POSITION_INFORMATION FilePosInfo;
|
||||
|
||||
Status = ZwQueryInformationFile(KdpLogFileHandle,
|
||||
&Iosb,
|
||||
&FileInfo,
|
||||
sizeof(FileInfo),
|
||||
FileStandardInformation);
|
||||
DPRINT("Status: 0x%08lx - EOF offset: %I64d\n",
|
||||
Status, FileInfo.EndOfFile.QuadPart);
|
||||
|
||||
Status = ZwQueryInformationFile(KdpLogFileHandle,
|
||||
&Iosb,
|
||||
&FilePosInfo,
|
||||
sizeof(FilePosInfo),
|
||||
FilePositionInformation);
|
||||
DPRINT("Status: 0x%08lx - Position: %I64d\n",
|
||||
Status, FilePosInfo.CurrentByteOffset.QuadPart);
|
||||
|
||||
FilePosInfo.CurrentByteOffset.QuadPart = FileInfo.EndOfFile.QuadPart;
|
||||
Status = ZwSetInformationFile(KdpLogFileHandle,
|
||||
&Iosb,
|
||||
&FilePosInfo,
|
||||
sizeof(FilePosInfo),
|
||||
FilePositionInformation);
|
||||
DPRINT("ZwSetInformationFile(FilePositionInfo) returned: 0x%08lx\n", Status);
|
||||
}
|
||||
/** END OF HACK **/
|
||||
|
||||
KeInitializeEvent(&KdpLoggerThreadEvent, SynchronizationEvent, TRUE);
|
||||
|
||||
/* Create the logger thread */
|
||||
|
|
Loading…
Reference in a new issue