From 80aa7fd7f964ec5fcdff3542b9e087e4b14c3e51 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 6 May 2017 12:18:21 +0000 Subject: [PATCH] [WIN32K:NTGDI] - Avoid using floating point operations in kernel mode. CORE-10893 svn path=/trunk/; revision=74486 --- reactos/win32ss/gdi/ntgdi/brush.h | 2 +- reactos/win32ss/gdi/ntgdi/pen.c | 2 +- reactos/win32ss/gdi/ntgdi/stockobj.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/win32ss/gdi/ntgdi/brush.h b/reactos/win32ss/gdi/ntgdi/brush.h index e16a2dae3c5..c72e444be9f 100644 --- a/reactos/win32ss/gdi/ntgdi/brush.h +++ b/reactos/win32ss/gdi/ntgdi/brush.h @@ -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; diff --git a/reactos/win32ss/gdi/ntgdi/pen.c b/reactos/win32ss/gdi/ntgdi/pen.c index 2dbd4fcb796..76b6cd2a2f8 100644 --- a/reactos/win32ss/gdi/ntgdi/pen.c +++ b/reactos/win32ss/gdi/ntgdi/pen.c @@ -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; diff --git a/reactos/win32ss/gdi/ntgdi/stockobj.c b/reactos/win32ss/gdi/ntgdi/stockobj.c index 676ea5db944..ac339b6bcd5 100644 --- a/reactos/win32ss/gdi/ntgdi/stockobj.c +++ b/reactos/win32ss/gdi/ntgdi/stockobj.c @@ -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; -- 2.17.1