ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

float.c
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:         See COPYING in the top level directory
00003  * PROJECT:           ReactOS kernel
00004  * PURPOSE:           Engine floating point functions
00005  * FILE:              subsys/win32k/eng/float.c
00006  * PROGRAMER:         David Welch
00007  */
00008 
00009 /* INCLUDES *****************************************************************/
00010 
00011 #include <win32k.h>
00012 
00013 #define NDEBUG
00014 #include <debug.h>
00015 
00016 /* FUNCTIONS *****************************************************************/
00017 
00018 BOOL
00019 APIENTRY
00020 EngRestoreFloatingPointState(
00021     IN VOID *Buffer)
00022 {
00023     NTSTATUS Status;
00024 
00025     Status = KeRestoreFloatingPointState((PKFLOATING_SAVE)Buffer);
00026     if (!NT_SUCCESS(Status))
00027     {
00028         return FALSE;
00029     }
00030 
00031     return TRUE;
00032 }
00033 
00034 ULONG
00035 APIENTRY
00036 EngSaveFloatingPointState(
00037     OUT VOID *Buffer,
00038     IN ULONG BufferSize)
00039 {
00040     KFLOATING_SAVE TempBuffer;
00041     NTSTATUS Status;
00042 
00043     if ((Buffer == NULL) || (BufferSize == 0))
00044     {
00045         /* Check for floating point support. */
00046         Status = KeSaveFloatingPointState(&TempBuffer);
00047         if (Status != STATUS_SUCCESS)
00048         {
00049             return(0);
00050         }
00051 
00052         KeRestoreFloatingPointState(&TempBuffer);
00053         return(sizeof(KFLOATING_SAVE));
00054     }
00055 
00056     if (BufferSize < sizeof(KFLOATING_SAVE))
00057     {
00058         return(0);
00059     }
00060 
00061     Status = KeSaveFloatingPointState((PKFLOATING_SAVE)Buffer);
00062     if (!NT_SUCCESS(Status))
00063     {
00064         return FALSE;
00065     }
00066 
00067     return TRUE;
00068 }
00069 

Generated on Sun May 27 2012 04:38:20 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.