Build GDI32 with NDK and without DDK.
Modified: trunk/reactos/include/win32k/bitmaps.h
Modified: trunk/reactos/include/win32k/coord.h
Modified: trunk/reactos/include/win32k/dc.h
Modified: trunk/reactos/include/win32k/driver.h
Modified: trunk/reactos/include/win32k/gdiobj.h
Modified: trunk/reactos/include/win32k/kapi.h
Modified: trunk/reactos/lib/gdi32/include/precomp.h
Modified: trunk/reactos/lib/gdi32/objects/font.c
Modified: trunk/reactos/subsys/win32k/main/svctabm.c
Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c
Modified: trunk/reactos/subsys/win32k/ntddraw/stubs.c

Modified: trunk/reactos/include/win32k/bitmaps.h
--- trunk/reactos/include/win32k/bitmaps.h	2005-06-20 21:16:59 UTC (rev 16185)
+++ trunk/reactos/include/win32k/bitmaps.h	2005-06-20 21:35:05 UTC (rev 16186)
@@ -2,9 +2,6 @@
 #ifndef __WIN32K_BITMAPS_H
 #define __WIN32K_BITMAPS_H
 
-#include <win32k/dc.h>
-#include <win32k/gdiobj.h>
-
 /* GDI logical bitmap object */
 typedef struct _BITMAPOBJ
 {
@@ -15,8 +12,12 @@
                                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;

Modified: trunk/reactos/include/win32k/coord.h
--- trunk/reactos/include/win32k/coord.h	2005-06-20 21:16:59 UTC (rev 16185)
+++ trunk/reactos/include/win32k/coord.h	2005-06-20 21:35:05 UTC (rev 16186)
@@ -1,8 +1,6 @@
 #ifndef __WIN32K_COORD_H
 #define __WIN32K_COORD_H
 
-#include "dc.h"
-
 BOOL
 STDCALL
 NtGdiCombineTransform (

Modified: trunk/reactos/include/win32k/dc.h
--- trunk/reactos/include/win32k/dc.h	2005-06-20 21:16:59 UTC (rev 16185)
+++ trunk/reactos/include/win32k/dc.h	2005-06-20 21:35:05 UTC (rev 16186)
@@ -2,11 +2,6 @@
 #ifndef __WIN32K_DC_H
 #define __WIN32K_DC_H
 
-#include <windows.h>
-#include <win32k/driver.h>
-#include <win32k/gdiobj.h>
-#include <win32k/path.h>
-
 typedef struct _WIN_DC_INFO
 {
   int  flags;
@@ -135,7 +130,11 @@
   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 @@
 
 /*  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_UpdateXforms(PDC  dc);
 BOOL FASTCALL DC_InvertXform(const XFORM *xformSrc, XFORM *xformDest);
 
+#endif
+
 /*  User entry points */
 
 BOOL STDCALL  NtGdiCancelDC(HDC  hDC);

Modified: trunk/reactos/include/win32k/driver.h
--- trunk/reactos/include/win32k/driver.h	2005-06-20 21:16:59 UTC (rev 16185)
+++ trunk/reactos/include/win32k/driver.h	2005-06-20 21:35:05 UTC (rev 16186)
@@ -2,7 +2,6 @@
 #ifndef __WIN32K_DRIVER_H
 #define __WIN32K_DRIVER_H
 
-#include <ddk/ntddk.h>
 #include <ddk/winddi.h>
 
 typedef BOOL (STDCALL *PGD_ENABLEDRIVER)(ULONG, ULONG, PDRVENABLEDATA);
@@ -176,6 +175,8 @@
   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 @@
 
 #endif
 
+#endif
+

Modified: trunk/reactos/include/win32k/gdiobj.h
--- trunk/reactos/include/win32k/gdiobj.h	2005-06-20 21:16:59 UTC (rev 16185)
+++ trunk/reactos/include/win32k/gdiobj.h	2005-06-20 21:35:05 UTC (rev 16186)
@@ -6,8 +6,6 @@
 #ifndef __WIN32K_GDIOBJ_H
 #define __WIN32K_GDIOBJ_H
 
-#include <ddk/ntddk.h>
-
 /* base address where the handle table is mapped to */
 #define GDI_HANDLE_TABLE_BASE_ADDRESS (0x400000)
 
@@ -67,7 +65,11 @@
 */
 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 @@
 #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 @@
 
 #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

Modified: trunk/reactos/include/win32k/kapi.h
--- trunk/reactos/include/win32k/kapi.h	2005-06-20 21:16:59 UTC (rev 16185)
+++ trunk/reactos/include/win32k/kapi.h	2005-06-20 21:35:05 UTC (rev 16186)
@@ -5,13 +5,15 @@
 #define INTERNAL_CALL STDCALL
 #endif
 
-#include <win32k/bitmaps.h>
 #include <win32k/brush.h>
 #include <win32k/cliprgn.h>
 #include <win32k/color.h>
-#include <win32k/coord.h>
 #include <win32k/cursoricon.h>
+#include <win32k/path.h>
+#include <win32k/driver.h>
 #include <win32k/dc.h>
+#include <win32k/coord.h>
+#include <win32k/bitmaps.h>
 #include <win32k/debug.h>
 #include <win32k/fillshap.h>
 #include <win32k/font.h>
@@ -22,7 +24,6 @@
 #include <win32k/misc.h>
 #include <win32k/ntuser.h>
 #include <win32k/paint.h>
-#include <win32k/path.h>
 #include <win32k/pen.h>
 #include <win32k/print.h>
 #include <win32k/region.h>

Modified: trunk/reactos/lib/gdi32/include/precomp.h
--- trunk/reactos/lib/gdi32/include/precomp.h	2005-06-20 21:16:59 UTC (rev 16185)
+++ trunk/reactos/lib/gdi32/include/precomp.h	2005-06-20 21:35:05 UTC (rev 16186)
@@ -1,16 +1,13 @@
-#include <wine/windef.h>
 #include <windows.h>
+#define NTOS_MODE_USER
+#include <ndk/ntndk.h>
+#include <ddentry.h>
 #include <ddraw.h>
+#include <ddk/prntfont.h>
 #include <string.h>
-#include <ddk/ntddk.h>
-#include <ddentry.h>
 #include <win32k/kapi.h>
-#include <ddk/prntfont.h>
 #include <rosrtl/logfont.h>
 #include <rosrtl/devmode.h>
-#include <wine/unicode.h>
-#define NTOS_MODE_USER
-#include <ntos.h>
 
 #define NtUserGetDCBrushColor(hbr) \
   (COLORREF)NtUserCallTwoParam((DWORD)(hbr), OBJ_BRUSH, TWOPARAM_ROUTINE_GETDCCOLOR)

Modified: trunk/reactos/lib/gdi32/objects/font.c
--- trunk/reactos/lib/gdi32/objects/font.c	2005-06-20 21:16:59 UTC (rev 16185)
+++ trunk/reactos/lib/gdi32/objects/font.c	2005-06-20 21:35:05 UTC (rev 16186)
@@ -404,10 +404,10 @@
     /* 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)
     {

Modified: trunk/reactos/subsys/win32k/main/svctabm.c
--- trunk/reactos/subsys/win32k/main/svctabm.c	2005-06-20 21:16:59 UTC (rev 16185)
+++ trunk/reactos/subsys/win32k/main/svctabm.c	2005-06-20 21:35:05 UTC (rev 16186)
@@ -45,6 +45,7 @@
 #define NTOS_MODE_KERNEL
 #include <ntos.h>
 #include <win32k/ntddraw.h>
+#include <ddk/winddi.h>
 #include <win32k/win32k.h>
 
 /*

Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c
--- trunk/reactos/subsys/win32k/ntddraw/ddraw.c	2005-06-20 21:16:59 UTC (rev 16185)
+++ trunk/reactos/subsys/win32k/ntddraw/ddraw.c	2005-06-20 21:35:05 UTC (rev 16186)
@@ -11,6 +11,7 @@
 
 #include <ddk/ntddk.h>
 #include <win32k/ntddraw.h>
+#include <ddk/winddi.h>
 #include <win32k/win32k.h>
 #include <include/intddraw.h>
 #include <win32k/gdiobj.h>

Modified: trunk/reactos/subsys/win32k/ntddraw/stubs.c
--- trunk/reactos/subsys/win32k/ntddraw/stubs.c	2005-06-20 21:16:59 UTC (rev 16185)
+++ trunk/reactos/subsys/win32k/ntddraw/stubs.c	2005-06-20 21:35:05 UTC (rev 16186)
@@ -10,6 +10,7 @@
  */
 #include <ddk/ntddk.h>
 #include <win32k/ntddraw.h>
+#include <ddk/winddi.h>
 #include <win32k/win32k.h>
 
 #define NDEBUG