From 2f596c1ce88a2717d70da74f1a8be6a49dd46a5d Mon Sep 17 00:00:00 2001 From: David Welch Date: Thu, 11 Mar 2004 21:38:58 +0000 Subject: [PATCH] - Implemented EngSaveFloatingPointState and EngRestoreFloatingState. svn path=/trunk/; revision=8650 --- reactos/subsys/win32k/eng/float.c | 85 +++++++++++++++++++++++++++++ reactos/subsys/win32k/makefile | 4 +- reactos/subsys/win32k/stubs/stubs.c | 21 ------- 3 files changed, 87 insertions(+), 23 deletions(-) create mode 100644 reactos/subsys/win32k/eng/float.c diff --git a/reactos/subsys/win32k/eng/float.c b/reactos/subsys/win32k/eng/float.c new file mode 100644 index 00000000000..62329c3d9bd --- /dev/null +++ b/reactos/subsys/win32k/eng/float.c @@ -0,0 +1,85 @@ +/* + * ReactOS W32 Subsystem + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* $Id: float.c,v 1.1 2004/03/11 21:38:58 dwelch Exp $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * PURPOSE: Engine floating point functions + * FILE: subsys/win32k/eng/float.c + * PROGRAMER: Jason Filby + * REVISION HISTORY: + */ + +#include +#include +#include +#include +#include +#include +#include +#include "handle.h" +#include "../dib/dib.h" + +#define NDEBUG +#include + +BOOL +STDCALL +EngRestoreFloatingPointState ( IN VOID *Buffer ) +{ + NTSTATUS Status; + Status = KeRestoreFloatingPointState((PKFLOATING_SAVE)Buffer); + if (Status != STATUS_SUCCESS) + { + return FALSE; + } + return TRUE; +} + +BOOL +STDCALL +EngSaveFloatingPointState(OUT VOID *Buffer, + IN ULONG BufferSize) +{ + KFLOATING_SAVE TempBuffer; + NTSTATUS Status; + if (Buffer == NULL || BufferSize == 0) + { + /* Check for floating point support. */ + Status = KeSaveFloatingPointState(&TempBuffer); + if (Status != STATUS_SUCCESS) + { + return(0); + } + KeRestoreFloatingPointState(&TempBuffer); + return(sizeof(KFLOATING_SAVE)); + } + if (BufferSize < sizeof(KFLOATING_SAVE)) + { + return(0); + } + Status = KeSaveFloatingPointState((PKFLOATING_SAVE)Buffer); + if (!NT_SUCCESS(Status)) + { + return FALSE; + } + return TRUE; +} + + diff --git a/reactos/subsys/win32k/makefile b/reactos/subsys/win32k/makefile index 9bb1da04d55..d0b29a4aff6 100644 --- a/reactos/subsys/win32k/makefile +++ b/reactos/subsys/win32k/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.95 2004/03/08 07:04:56 dwelch Exp $ +# $Id: makefile,v 1.96 2004/03/11 21:38:58 dwelch Exp $ PATH_TO_TOP = ../.. @@ -42,7 +42,7 @@ ENG_OBJECTS= eng/debug.o eng/error.o eng/mem.o eng/brush.o eng/bitblt.o \ eng/clip.o eng/copybits.o eng/device.o eng/handle.o eng/lineto.o \ eng/paint.o eng/palette.o eng/perfcnt.o eng/semaphor.o eng/surface.o \ eng/xlate.o eng/transblt.o eng/mouse.o eng/misc.o eng/nls.o eng/sort.o \ - eng/gradient.o eng/event.o + eng/gradient.o eng/event.o eng/float.o MAIN_OBJECTS = main/dllmain.o main/svctabm.o diff --git a/reactos/subsys/win32k/stubs/stubs.c b/reactos/subsys/win32k/stubs/stubs.c index f8be6b7bc4c..e53a6f852ac 100644 --- a/reactos/subsys/win32k/stubs/stubs.c +++ b/reactos/subsys/win32k/stubs/stubs.c @@ -506,27 +506,6 @@ EngQueryPalette( return 0; } -BOOL -STDCALL -EngRestoreFloatingPointState ( IN VOID *pBuffer ) -{ - // www.osr.com/ddk/graphics/gdifncs_9l0n.htm - UNIMPLEMENTED; - return FALSE; -} - -ULONG -STDCALL -EngSaveFloatingPointState( - OUT VOID *pBuffer, - IN ULONG cjBufferSize - ) -{ - // www.osr.com/ddk/graphics/gdifncs_9tif.htm - UNIMPLEMENTED; - return 0; -} - BOOL STDCALL EngSetPointerTag(