[GDI32] Fix 64 bit issues
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 4 Mar 2018 15:06:54 +0000 (16:06 +0100)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 4 Aug 2018 17:19:34 +0000 (19:19 +0200)
win32ss/gdi/gdi32/include/gdi32p.h
win32ss/gdi/gdi32/misc/gdientry.c
win32ss/gdi/gdi32/objects/dc.c
win32ss/gdi/gdi32/objects/font.c
win32ss/gdi/gdi32/objects/region.c
win32ss/gdi/gdi32/wine/rosglue.c

index 1b7c518..ace5d57 100644 (file)
@@ -136,7 +136,7 @@ typedef struct tagENHMETAFILE
 #define UMPDEV_SUPPORT_ESCAPE 0x0004
 typedef struct _UMPDEV
 {
-    DWORD           Sig;            // Init with PDEV_UMPD_ID
+    DWORD_PTR           Sig;            // Init with PDEV_UMPD_ID
     struct _UMPDEV *pumpdNext;
     PDRIVER_INFO_5W pdi5Info;
     HMODULE         hModule;
index 2ff32a8..61943bf 100644 (file)
@@ -1431,7 +1431,7 @@ bDDCreateSurface(LPDDRAWI_DDRAWSURFACE_LCL pSurface,
     }
 
     /* Create the object */
-    pSurface->hDDSurface = (DWORD)NtGdiDdCreateSurfaceObject(GetDdHandle(pSurface->lpGbl->lpDD->hDD),
+    pSurface->hDDSurface = (DWORD_PTR)NtGdiDdCreateSurfaceObject(GetDdHandle(pSurface->lpGbl->lpDD->hDD),
                            (HANDLE)pSurface->hDDSurface,
                            &SurfaceLocal,
                            &SurfaceMore,
index f6d36ec..7ea146a 100644 (file)
@@ -1509,7 +1509,7 @@ SelectObject(
     switch (GDI_HANDLE_GET_TYPE(hobj))
     {
         case GDILoObjType_LO_REGION_TYPE:
-            return (HGDIOBJ)ExtSelectClipRgn(hdc, hobj, RGN_COPY);
+            return (HGDIOBJ)UlongToHandle(ExtSelectClipRgn(hdc, hobj, RGN_COPY));
 
         case GDILoObjType_LO_BITMAP_TYPE:
         case GDILoObjType_LO_DIBSECTION_TYPE:
index 0763ff7..871ea50 100644 (file)
@@ -1097,19 +1097,19 @@ GetOutlineTextMetricsA(
     needed = sizeof(OUTLINETEXTMETRICA);
     if(lpOTMW->otmpFamilyName)
         needed += WideCharToMultiByte(CP_ACP, 0,
-                                      (WCHAR*)((char*)lpOTMW + (int)lpOTMW->otmpFamilyName), -1,
+                                      (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFamilyName), -1,
                                       NULL, 0, NULL, NULL);
     if(lpOTMW->otmpFaceName)
         needed += WideCharToMultiByte(CP_ACP, 0,
-                                      (WCHAR*)((char*)lpOTMW + (int)lpOTMW->otmpFaceName), -1,
+                                      (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFaceName), -1,
                                       NULL, 0, NULL, NULL);
     if(lpOTMW->otmpStyleName)
         needed += WideCharToMultiByte(CP_ACP, 0,
-                                      (WCHAR*)((char*)lpOTMW + (int)lpOTMW->otmpStyleName), -1,
+                                      (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpStyleName), -1,
                                       NULL, 0, NULL, NULL);
     if(lpOTMW->otmpFullName)
         needed += WideCharToMultiByte(CP_ACP, 0,
-                                      (WCHAR*)((char*)lpOTMW + (int)lpOTMW->otmpFullName), -1,
+                                      (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFullName), -1,
                                       NULL, 0, NULL, NULL);
 
     if(!lpOTM)
@@ -1168,7 +1168,7 @@ GetOutlineTextMetricsA(
     {
         output->otmpFamilyName = (LPSTR)(ptr - (char*)output);
         len = WideCharToMultiByte(CP_ACP, 0,
-                                  (WCHAR*)((char*)lpOTMW + (int)lpOTMW->otmpFamilyName), -1,
+                                  (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFamilyName), -1,
                                   ptr, left, NULL, NULL);
         left -= len;
         ptr += len;
@@ -1180,7 +1180,7 @@ GetOutlineTextMetricsA(
     {
         output->otmpFaceName = (LPSTR)(ptr - (char*)output);
         len = WideCharToMultiByte(CP_ACP, 0,
-                                  (WCHAR*)((char*)lpOTMW + (int)lpOTMW->otmpFaceName), -1,
+                                  (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFaceName), -1,
                                   ptr, left, NULL, NULL);
         left -= len;
         ptr += len;
@@ -1192,7 +1192,7 @@ GetOutlineTextMetricsA(
     {
         output->otmpStyleName = (LPSTR)(ptr - (char*)output);
         len = WideCharToMultiByte(CP_ACP, 0,
-                                  (WCHAR*)((char*)lpOTMW + (int)lpOTMW->otmpStyleName), -1,
+                                  (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpStyleName), -1,
                                   ptr, left, NULL, NULL);
         left -= len;
         ptr += len;
@@ -1204,7 +1204,7 @@ GetOutlineTextMetricsA(
     {
         output->otmpFullName = (LPSTR)(ptr - (char*)output);
         len = WideCharToMultiByte(CP_ACP, 0,
-                                  (WCHAR*)((char*)lpOTMW + (int)lpOTMW->otmpFullName), -1,
+                                  (WCHAR*)((char*)lpOTMW + (intptr_t)lpOTMW->otmpFullName), -1,
                                   ptr, left, NULL, NULL);
         left -= len;
     }
@@ -2122,7 +2122,8 @@ NewEnumFontFamiliesExW(
     LPARAM lParam,
     DWORD dwFlags)
 {
-    ULONG_PTR idEnum, cbDataSize, cbRetSize;
+    ULONG_PTR idEnum;
+    ULONG cbDataSize, cbRetSize;
     PENUMFONTDATAW pEfdw;
     PBYTE pBuffer;
     PBYTE pMax;
index 128d403..ce593b2 100644 (file)
@@ -575,7 +575,7 @@ HRGN
 WINAPI
 CreatePolygonRgn( const POINT * lppt, int cPoints, int fnPolyFillMode)
 {
-    return (HRGN) NtGdiPolyPolyDraw( (HDC) fnPolyFillMode, (PPOINT) lppt, (PULONG) &cPoints, 1, GdiPolyPolyRgn);
+    return (HRGN) NtGdiPolyPolyDraw( (HDC)UlongToHandle(fnPolyFillMode), (PPOINT) lppt, (PULONG) &cPoints, 1, GdiPolyPolyRgn);
 }
 
 /*
@@ -588,7 +588,7 @@ CreatePolyPolygonRgn( const POINT* lppt,
                       int nCount,
                       int fnPolyFillMode)
 {
-    return (HRGN) NtGdiPolyPolyDraw(  (HDC) fnPolyFillMode, (PPOINT) lppt, (PULONG) lpPolyCounts, (ULONG) nCount, GdiPolyPolyRgn );
+    return (HRGN) NtGdiPolyPolyDraw(  (HDC)UlongToHandle(fnPolyFillMode), (PPOINT) lppt, (PULONG) lpPolyCounts, (ULONG) nCount, GdiPolyPolyRgn );
 }
 
 /*
index 2305101..d5d99d8 100644 (file)
@@ -731,7 +731,7 @@ HRGN
 DRIVER_PathToRegion(PHYSDEV physdev)
 {
     DPRINT1("DRIVER_PathToRegion\n");
-    return (HRGN)physdev->funcs->pAbortPath( physdev );
+    return (HRGN)(ULONG_PTR)physdev->funcs->pAbortPath( physdev );
 }