https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7ad5f405cbddd9a7609f4…
commit 7ad5f405cbddd9a7609f4c09dc5638248ea7d6d3
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sun Mar 4 16:06:54 2018 +0100
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sat Aug 4 19:19:34 2018 +0200
[GDI32] Fix 64 bit issues
---
win32ss/gdi/gdi32/include/gdi32p.h | 2 +-
win32ss/gdi/gdi32/misc/gdientry.c | 2 +-
win32ss/gdi/gdi32/objects/dc.c | 2 +-
win32ss/gdi/gdi32/objects/font.c | 19 ++++++++++---------
win32ss/gdi/gdi32/objects/region.c | 4 ++--
win32ss/gdi/gdi32/wine/rosglue.c | 2 +-
6 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/win32ss/gdi/gdi32/include/gdi32p.h b/win32ss/gdi/gdi32/include/gdi32p.h
index 1b7c51856d..ace5d574a2 100644
--- a/win32ss/gdi/gdi32/include/gdi32p.h
+++ b/win32ss/gdi/gdi32/include/gdi32p.h
@@ -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;
diff --git a/win32ss/gdi/gdi32/misc/gdientry.c b/win32ss/gdi/gdi32/misc/gdientry.c
index 2ff32a8de6..61943bfa5b 100644
--- a/win32ss/gdi/gdi32/misc/gdientry.c
+++ b/win32ss/gdi/gdi32/misc/gdientry.c
@@ -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,
diff --git a/win32ss/gdi/gdi32/objects/dc.c b/win32ss/gdi/gdi32/objects/dc.c
index f6d36ec1b7..7ea146ab20 100644
--- a/win32ss/gdi/gdi32/objects/dc.c
+++ b/win32ss/gdi/gdi32/objects/dc.c
@@ -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:
diff --git a/win32ss/gdi/gdi32/objects/font.c b/win32ss/gdi/gdi32/objects/font.c
index 0763ff7df2..871ea50952 100644
--- a/win32ss/gdi/gdi32/objects/font.c
+++ b/win32ss/gdi/gdi32/objects/font.c
@@ -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;
diff --git a/win32ss/gdi/gdi32/objects/region.c b/win32ss/gdi/gdi32/objects/region.c
index 128d403267..ce593b26dc 100644
--- a/win32ss/gdi/gdi32/objects/region.c
+++ b/win32ss/gdi/gdi32/objects/region.c
@@ -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 );
}
/*
diff --git a/win32ss/gdi/gdi32/wine/rosglue.c b/win32ss/gdi/gdi32/wine/rosglue.c
index 230510148f..d5d99d8c3b 100644
--- a/win32ss/gdi/gdi32/wine/rosglue.c
+++ b/win32ss/gdi/gdi32/wine/rosglue.c
@@ -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 );
}