[WIN32K:NTGDI]
authorThomas Faber <thomas.faber@reactos.org>
Sat, 6 May 2017 12:18:21 +0000 (12:18 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sat, 6 May 2017 12:18:21 +0000 (12:18 +0000)
- Avoid using floating point operations in kernel mode.
CORE-10893

svn path=/trunk/; revision=74486

reactos/win32ss/gdi/ntgdi/brush.h
reactos/win32ss/gdi/ntgdi/pen.c
reactos/win32ss/gdi/ntgdi/stockobj.c

index e16a2da..c72e444 100644 (file)
@@ -33,7 +33,7 @@ typedef struct _BRUSHBODY
 
     /* The following members are for PENs only */
     LONG lWidth;
-    FLOAT eWidth;
+    FLOATOBJ eWidth;
     ULONG ulPenStyle;
     DWORD *pStyle;
     ULONG dwStyleCount;
index 2dbd4fc..76b6cd2 100644 (file)
@@ -122,7 +122,7 @@ IntGdiExtCreatePen(
         dwWidth = 1;
 
     pbrushPen->lWidth = dwWidth;
-    pbrushPen->eWidth = (FLOAT)pbrushPen->lWidth;
+    FLOATOBJ_SetLong(&pbrushPen->eWidth, pbrushPen->lWidth);
     pbrushPen->ulPenStyle = dwPenStyle;
     pbrushPen->BrushAttr.lbColor = ulColor;
     pbrushPen->iBrushStyle = ulBrushStyle;
index 676ea5d..ac339b6 100644 (file)
@@ -116,7 +116,7 @@ IntCreateStockPen(DWORD dwPenStyle,
 
     pbrushPen->iHatch = 0;
     pbrushPen->lWidth = abs(dwWidth);
-    pbrushPen->eWidth = (FLOAT)pbrushPen->lWidth;
+    FLOATOBJ_SetLong(&pbrushPen->eWidth, pbrushPen->lWidth);
     pbrushPen->ulPenStyle = dwPenStyle;
     pbrushPen->BrushAttr.lbColor = ulColor;
     pbrushPen->iBrushStyle = ulBrushStyle;