ReactOS 0.4.16-dev-2298-gcac013a
float.c File Reference
#include <win32k.h>
#include <debug.h>
Include dependency graph for float.c:

Go to the source code of this file.

Classes

struct  _WIN32K_FLOATING_SAVE
 

Macros

#define NDEBUG
 

Typedefs

typedef struct _WIN32K_FLOATING_SAVE WIN32K_FLOATING_SAVE
 
typedef struct _WIN32K_FLOATING_SAVEPWIN32K_FLOATING_SAVE
 

Functions

_Check_return_ _Success_ (return)
 Deletes the virtual mapping and optionally gives back the page & dirty bit.
 
_Check_return_ _Success_ (((pBuffer !=NULL &&cjBufferSize !=0) &&return==1)||((pBuffer==NULL||cjBufferSize==0) &&return > 0))
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file float.c.

Typedef Documentation

◆ PWIN32K_FLOATING_SAVE

◆ WIN32K_FLOATING_SAVE

Function Documentation

◆ _Success_() [1/2]

_Check_return_ _Success_ ( ((pBuffer !=NULL &&cjBufferSize !=0) &&return==1)||((pBuffer==NULL||cjBufferSize==0) &&return > 0)  )

Definition at line 61 of file float.c.

73{
76
77 if ((pBuffer == NULL) || (cjBufferSize == 0))
78 {
79 KFLOATING_SAVE TempBuffer;
80
81 /* Check for floating point support. */
82 Status = KeSaveFloatingPointState(&TempBuffer);
84 {
85 return(0);
86 }
87 KeRestoreFloatingPointState(&TempBuffer);
88 return sizeof(WIN32K_FLOATING_SAVE);
89 }
90
91 if (cjBufferSize < sizeof(WIN32K_FLOATING_SAVE))
92 {
93 return(0);
94 }
95
96 /* Per MSDN, "This buffer must be zero-initialized, and must be in nonpaged memory." */
98
99 if (State->IsFloatingPointSaved)
100 {
101 DPRINT1("The driver has attempted to save floating point state after already saving it.\n");
102 DPRINT1("This (probably ICafe AMD) driver has done an incorrect behavior.\n");
103 }
104
105 Status = KeSaveFloatingPointState(&State->FloatState);
106 if (!NT_SUCCESS(Status))
107 {
108 return FALSE;
109 }
110
111 State->IsFloatingPointSaved = TRUE;
112 return TRUE;
113}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
struct _WIN32K_FLOATING_SAVE * PWIN32K_FLOATING_SAVE
struct _WIN32K_FLOATING_SAVE WIN32K_FLOATING_SAVE
Status
Definition: gdiplustypes.h:25
#define KeSaveFloatingPointState(x)
Definition: kmixer.h:32
#define KeRestoreFloatingPointState(x)
Definition: kmixer.h:33
PVOID pBuffer
#define STATUS_SUCCESS
Definition: shellext.h:65

◆ _Success_() [2/2]

_Check_return_ _Success_ ( return  )

Deletes the virtual mapping and optionally gives back the page & dirty bit.

Parameters
Process- The process this address belongs to, or NULL if system address.
Address- The address to unmap.
WasDirty- Optional param receiving the dirty bit of the PTE.
Page- Optional param receiving the page number previously mapped to this address.
Returns
Whether there was actually a page mapped at the given address.

Definition at line 29 of file float.c.

38{
41
42 if (!State->IsFloatingPointSaved)
43 {
44 DPRINT1("The driver has attempted to restore floating point state after already restoring it.\n");
45 DPRINT1("This (probably ICafe AMD) driver has done an incorrect behavior.\n");
46 return FALSE;
47 }
48
49 State->IsFloatingPointSaved = FALSE;
50
52 if (!NT_SUCCESS(Status))
53 {
54 return FALSE;
55 }
56
57 return TRUE;
58}