mirror of
https://github.com/reactos/reactos.git
synced 2024-07-01 02:10:07 +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
|
@ -272,8 +272,9 @@ KdpDebugLogInit(
|
||||||
NULL,
|
NULL,
|
||||||
FILE_ATTRIBUTE_NORMAL,
|
FILE_ATTRIBUTE_NORMAL,
|
||||||
FILE_SHARE_READ,
|
FILE_SHARE_READ,
|
||||||
FILE_SUPERSEDE,
|
FILE_OPEN_IF,
|
||||||
FILE_WRITE_THROUGH | FILE_SYNCHRONOUS_IO_NONALERT,
|
FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT |
|
||||||
|
FILE_SEQUENTIAL_ONLY | FILE_WRITE_THROUGH,
|
||||||
NULL,
|
NULL,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
|
@ -285,6 +286,39 @@ KdpDebugLogInit(
|
||||||
return;
|
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);
|
KeInitializeEvent(&KdpLoggerThreadEvent, SynchronizationEvent, TRUE);
|
||||||
|
|
||||||
/* Create the logger thread */
|
/* Create the logger thread */
|
||||||
|
|
Loading…
Reference in a new issue