From f665fe8a221059be3787a1d59ae95b8fde65dd79 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Tue, 28 Sep 2004 12:50:23 +0000 Subject: [PATCH] Use FILE_APPEND_DATA access right to write log entries. svn path=/trunk/; revision=11103 --- reactos/ntoskrnl/io/bootlog.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/reactos/ntoskrnl/io/bootlog.c b/reactos/ntoskrnl/io/bootlog.c index 7dd03bbe1fb..c063fb9966b 100644 --- a/reactos/ntoskrnl/io/bootlog.c +++ b/reactos/ntoskrnl/io/bootlog.c @@ -1,4 +1,4 @@ -/* $Id: bootlog.c,v 1.4 2004/09/26 11:29:50 ekohl Exp $ +/* $Id: bootlog.c,v 1.5 2004/09/28 12:50:23 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -142,14 +142,11 @@ IopBootLog(PUNICODE_STRING DriverName, static NTSTATUS IopWriteLogFile(PWSTR LogText) { - FILE_STANDARD_INFORMATION FileInformation; OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING FileName; IO_STATUS_BLOCK IoStatusBlock; HANDLE FileHandle; - LARGE_INTEGER ByteOffset; PWSTR CrLf = L"\r\n"; - NTSTATUS Status; DPRINT("IopWriteLogFile() called\n"); @@ -163,7 +160,7 @@ IopWriteLogFile(PWSTR LogText) NULL); Status = NtCreateFile(&FileHandle, - FILE_WRITE_DATA, /* FILE_APPEND_DATA */ + FILE_APPEND_DATA, &ObjectAttributes, &IoStatusBlock, NULL, @@ -179,20 +176,6 @@ IopWriteLogFile(PWSTR LogText) return Status; } - Status = NtQueryInformationFile(FileHandle, - &IoStatusBlock, - &FileInformation, - sizeof(FILE_STANDARD_INFORMATION), - FileStandardInformation); - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtQueryInformationFile() failed (Status %lx)\n", Status); - return Status; - } - - - ByteOffset.QuadPart = FileInformation.EndOfFile.QuadPart; - if (LogText != NULL) { Status = NtWriteFile(FileHandle, @@ -202,7 +185,7 @@ IopWriteLogFile(PWSTR LogText) &IoStatusBlock, (PVOID)LogText, wcslen(LogText) * sizeof(WCHAR), - &ByteOffset, + NULL, NULL); if (!NT_SUCCESS(Status)) { @@ -210,8 +193,6 @@ IopWriteLogFile(PWSTR LogText) NtClose(FileHandle); return Status; } - - ByteOffset.QuadPart += (wcslen(LogText) * sizeof(WCHAR)); } /* L"\r\n" */ @@ -222,7 +203,7 @@ IopWriteLogFile(PWSTR LogText) &IoStatusBlock, (PVOID)CrLf, 2 * sizeof(WCHAR), - &ByteOffset, + NULL, NULL); NtClose(FileHandle);