From d373bd32e7aefbd0a3eaeb23beada7116415d27a Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Mon, 20 Jun 2005 21:35:05 +0000 Subject: [PATCH] Build GDI32 with NDK and without DDK. svn path=/trunk/; revision=16186 --- reactos/include/win32k/bitmaps.h | 7 ++++--- reactos/include/win32k/coord.h | 2 -- reactos/include/win32k/dc.h | 13 ++++++++----- reactos/include/win32k/driver.h | 5 ++++- reactos/include/win32k/gdiobj.h | 14 ++++++++++---- reactos/include/win32k/kapi.h | 7 ++++--- reactos/lib/gdi32/include/precomp.h | 13 +++++-------- reactos/lib/gdi32/objects/font.c | 4 ++-- reactos/subsys/win32k/main/svctabm.c | 1 + reactos/subsys/win32k/ntddraw/ddraw.c | 1 + reactos/subsys/win32k/ntddraw/stubs.c | 1 + 11 files changed, 40 insertions(+), 28 deletions(-) diff --git a/reactos/include/win32k/bitmaps.h b/reactos/include/win32k/bitmaps.h index 9875d6949a6..9814dfb709f 100644 --- a/reactos/include/win32k/bitmaps.h +++ b/reactos/include/win32k/bitmaps.h @@ -2,9 +2,6 @@ #ifndef __WIN32K_BITMAPS_H #define __WIN32K_BITMAPS_H -#include -#include - /* GDI logical bitmap object */ typedef struct _BITMAPOBJ { @@ -15,8 +12,12 @@ typedef struct _BITMAPOBJ to get width/height of bitmap, use bitmap.bmWidth/bitmap.bmHeight for that */ +#ifdef NTOS_MODE_USER + PVOID BitsLock; +#else PFAST_MUTEX BitsLock; /* You need to hold this lock before you touch the actual bits in the bitmap */ +#endif /* For device-independent bitmaps: */ DIBSECTION *dib; diff --git a/reactos/include/win32k/coord.h b/reactos/include/win32k/coord.h index 7bbf868c5db..f19d087b35f 100644 --- a/reactos/include/win32k/coord.h +++ b/reactos/include/win32k/coord.h @@ -1,8 +1,6 @@ #ifndef __WIN32K_COORD_H #define __WIN32K_COORD_H -#include "dc.h" - BOOL STDCALL NtGdiCombineTransform ( diff --git a/reactos/include/win32k/dc.h b/reactos/include/win32k/dc.h index 292de8aa289..8463c80b31d 100644 --- a/reactos/include/win32k/dc.h +++ b/reactos/include/win32k/dc.h @@ -2,11 +2,6 @@ #ifndef __WIN32K_DC_H #define __WIN32K_DC_H -#include -#include -#include -#include - typedef struct _WIN_DC_INFO { int flags; @@ -135,7 +130,11 @@ typedef struct GDIINFO GDIInfo; DEVINFO DevInfo; DRIVER_FUNCTIONS DriverFunctions; +#ifdef NTOS_MODE_USER + PVOID VideoFileObject; +#else PFILE_OBJECT VideoFileObject; +#endif BOOLEAN PreparedDriver; ULONG DisplayNumber; @@ -149,6 +148,8 @@ typedef struct /* Internal functions */ +#ifndef NTOS_MODE_USER + #define DC_LockDc(hDC) \ ((PDC) GDIOBJ_LockObj ((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC)) #define DC_UnlockDc(pDC) \ @@ -167,6 +168,8 @@ VOID FASTCALL DC_SetOwnership(HDC DC, PEPROCESS Owner); VOID FASTCALL DC_UpdateXforms(PDC dc); BOOL FASTCALL DC_InvertXform(const XFORM *xformSrc, XFORM *xformDest); +#endif + /* User entry points */ BOOL STDCALL NtGdiCancelDC(HDC hDC); diff --git a/reactos/include/win32k/driver.h b/reactos/include/win32k/driver.h index 246b239452a..f4207f8c637 100644 --- a/reactos/include/win32k/driver.h +++ b/reactos/include/win32k/driver.h @@ -2,7 +2,6 @@ #ifndef __WIN32K_DRIVER_H #define __WIN32K_DRIVER_H -#include #include typedef BOOL (STDCALL *PGD_ENABLEDRIVER)(ULONG, ULONG, PDRVENABLEDATA); @@ -176,6 +175,8 @@ typedef struct _DRIVER_FUNCTIONS PGD_ALPHABLEND AlphaBlend; } DRIVER_FUNCTIONS, *PDRIVER_FUNCTIONS; +#ifndef NTOS_MODE_USER + BOOL DRIVER_RegisterDriver(LPCWSTR Name, PGD_ENABLEDRIVER EnableDriver); PGD_ENABLEDRIVER DRIVER_FindDDIDriver(LPCWSTR Name); PFILE_OBJECT DRIVER_FindMPDriver(ULONG DisplayNumber); @@ -187,3 +188,5 @@ INT DRIVER_UnreferenceDriver (LPCWSTR Name); #endif +#endif + diff --git a/reactos/include/win32k/gdiobj.h b/reactos/include/win32k/gdiobj.h index 3e33a23db84..111fb666b67 100644 --- a/reactos/include/win32k/gdiobj.h +++ b/reactos/include/win32k/gdiobj.h @@ -6,8 +6,6 @@ #ifndef __WIN32K_GDIOBJ_H #define __WIN32K_GDIOBJ_H -#include - /* base address where the handle table is mapped to */ #define GDI_HANDLE_TABLE_BASE_ADDRESS (0x400000) @@ -67,7 +65,11 @@ typedef BOOL (INTERNAL_CALL *GDICLEANUPPROC)(PVOID ObjectBody); */ typedef struct _GDIOBJHDR { +#ifdef NTOS_MODE_USER + PVOID LockingThread; +#else PETHREAD LockingThread; /* only assigned if a thread is holding the lock! */ +#endif ULONG Locks; #ifdef GDI_DEBUG const char* createdfile; @@ -77,6 +79,8 @@ typedef struct _GDIOBJHDR #endif } GDIOBJHDR, *PGDIOBJHDR; +#ifndef NTOS_MODE_USER + BOOL INTERNAL_CALL GDIOBJ_OwnedByCurrentProcess(HGDIOBJ ObjectHandle); void INTERNAL_CALL GDIOBJ_SetOwnership(HGDIOBJ ObjectHandle, PEPROCESS Owner); void INTERNAL_CALL GDIOBJ_CopyOwnership(HGDIOBJ CopyFrom, HGDIOBJ CopyTo); @@ -108,10 +112,12 @@ PGDIOBJ INTERNAL_CALL GDIOBJ_ShareLockObj (HGDIOBJ hObj, DWORD ObjectType); #endif /* GDI_DEBUG */ +PVOID INTERNAL_CALL GDI_MapHandleTable(PEPROCESS Process); + +#endif + #define GDIOBJFLAG_DEFAULT (0x0) #define GDIOBJFLAG_IGNOREPID (0x1) #define GDIOBJFLAG_IGNORELOCK (0x2) -PVOID INTERNAL_CALL GDI_MapHandleTable(PEPROCESS Process); - #endif diff --git a/reactos/include/win32k/kapi.h b/reactos/include/win32k/kapi.h index a37437a7ab4..9582c29d2f1 100644 --- a/reactos/include/win32k/kapi.h +++ b/reactos/include/win32k/kapi.h @@ -5,13 +5,15 @@ #define INTERNAL_CALL STDCALL #endif -#include #include #include #include -#include #include +#include +#include #include +#include +#include #include #include #include @@ -22,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/reactos/lib/gdi32/include/precomp.h b/reactos/lib/gdi32/include/precomp.h index 824c6cbffca..a8784f0e823 100644 --- a/reactos/lib/gdi32/include/precomp.h +++ b/reactos/lib/gdi32/include/precomp.h @@ -1,16 +1,13 @@ -#include #include -#include -#include -#include +#define NTOS_MODE_USER +#include #include -#include +#include #include +#include +#include #include #include -#include -#define NTOS_MODE_USER -#include #define NtUserGetDCBrushColor(hbr) \ (COLORREF)NtUserCallTwoParam((DWORD)(hbr), OBJ_BRUSH, TWOPARAM_ROUTINE_GETDCCOLOR) diff --git a/reactos/lib/gdi32/objects/font.c b/reactos/lib/gdi32/objects/font.c index 7ac049fde3c..ebccc9e61eb 100644 --- a/reactos/lib/gdi32/objects/font.c +++ b/reactos/lib/gdi32/objects/font.c @@ -404,10 +404,10 @@ GetCharacterPlacementW( /* Treat the case where no special handling was requested in a fastpath way */ /* copy will do if the GCP_REORDER flag is not set */ if(lpResults->lpOutString) - strncpyW( lpResults->lpOutString, lpString, nSet ); + lstrcpynW( lpResults->lpOutString, lpString, nSet ); if(lpResults->lpGlyphs) - strncpyW( lpResults->lpGlyphs, lpString, nSet ); + lstrcpynW( lpResults->lpGlyphs, lpString, nSet ); if(lpResults->lpOrder) { diff --git a/reactos/subsys/win32k/main/svctabm.c b/reactos/subsys/win32k/main/svctabm.c index 6b0e9f802f4..0844d079368 100644 --- a/reactos/subsys/win32k/main/svctabm.c +++ b/reactos/subsys/win32k/main/svctabm.c @@ -45,6 +45,7 @@ #define NTOS_MODE_KERNEL #include #include +#include #include /* diff --git a/reactos/subsys/win32k/ntddraw/ddraw.c b/reactos/subsys/win32k/ntddraw/ddraw.c index b7a8353d084..15eb929e496 100644 --- a/reactos/subsys/win32k/ntddraw/ddraw.c +++ b/reactos/subsys/win32k/ntddraw/ddraw.c @@ -11,6 +11,7 @@ #include #include +#include #include #include #include diff --git a/reactos/subsys/win32k/ntddraw/stubs.c b/reactos/subsys/win32k/ntddraw/stubs.c index 5be49a317c6..d4073a85cba 100644 --- a/reactos/subsys/win32k/ntddraw/stubs.c +++ b/reactos/subsys/win32k/ntddraw/stubs.c @@ -10,6 +10,7 @@ */ #include #include +#include #include #define NDEBUG