From 841b0b2958a759d23d5123df2fe1c6b90c51130d Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Sun, 14 Mar 2004 13:20:10 +0000 Subject: [PATCH] implemented GetFileSizeEx() svn path=/trunk/; revision=8711 --- reactos/lib/kernel32/file/file.c | 33 ++++++++++++++++++++++++++++++- reactos/lib/kernel32/misc/stubs.c | 16 +-------------- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/reactos/lib/kernel32/file/file.c b/reactos/lib/kernel32/file/file.c index a2bd8dec2e6..731daa1cc55 100644 --- a/reactos/lib/kernel32/file/file.c +++ b/reactos/lib/kernel32/file/file.c @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.50 2004/03/14 13:11:55 weiden Exp $ +/* $Id: file.c,v 1.51 2004/03/14 13:20:10 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -444,6 +444,37 @@ GetFileSize(HANDLE hFile, } +/* + * @implemented + */ +BOOL +STDCALL +GetFileSizeEx( + HANDLE hFile, + PLARGE_INTEGER lpFileSize + ) +{ + NTSTATUS errCode; + FILE_STANDARD_INFORMATION FileStandard; + IO_STATUS_BLOCK IoStatusBlock; + + errCode = NtQueryInformationFile(hFile, + &IoStatusBlock, + &FileStandard, + sizeof(FILE_STANDARD_INFORMATION), + FileStandardInformation); + if (!NT_SUCCESS(errCode)) + { + SetLastErrorByStatus(errCode); + return FALSE; + } + if (lpFileSize) + *lpFileSize = FileStandard.EndOfFile; + + return TRUE; +} + + /* * @implemented */ diff --git a/reactos/lib/kernel32/misc/stubs.c b/reactos/lib/kernel32/misc/stubs.c index a801be286a4..45e4b16a15a 100644 --- a/reactos/lib/kernel32/misc/stubs.c +++ b/reactos/lib/kernel32/misc/stubs.c @@ -1,4 +1,4 @@ -/* $Id: stubs.c,v 1.65 2004/03/14 13:11:55 weiden Exp $ +/* $Id: stubs.c,v 1.66 2004/03/14 13:20:10 weiden Exp $ * * KERNEL32.DLL stubs (unimplemented functions) * Remove from this file, if you implement them. @@ -875,20 +875,6 @@ GetDevicePowerState( return 0; } -/* - * @unimplemented - */ -BOOL -STDCALL -GetFileSizeEx( - HANDLE hFile, - PLARGE_INTEGER lpFileSize - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - /* * @unimplemented */