eng/driverobj.c: DRIVEROBJ implementation.
eng/semaphor.c: Implement safe semaphore functions.
eng/window.c: Basic WNDOBJ implementation.
include/inteng.h: IntEngXxx functions for DRIVEROBJs.
main/dllmain.c: Cleanup DRIVEROBJs.
makefile: Add eng/driverobj.o and eng/window.o.
stubs/stubs.c, win32k.def: Add EngAllocPrivateUserMem and EngFreePrivateUserMem stubs.
Added: trunk/reactos/subsys/win32k/eng/driverobj.c
Modified: trunk/reactos/subsys/win32k/eng/objects.h
Modified: trunk/reactos/subsys/win32k/eng/semaphor.c
Added: trunk/reactos/subsys/win32k/eng/window.c
Modified: trunk/reactos/subsys/win32k/include/inteng.h
Modified: trunk/reactos/subsys/win32k/include/menu.h
Modified: trunk/reactos/subsys/win32k/include/tags.h
Modified: trunk/reactos/subsys/win32k/main/dllmain.c
Modified: trunk/reactos/subsys/win32k/makefile
Modified: trunk/reactos/subsys/win32k/stubs/stubs.c
Modified: trunk/reactos/subsys/win32k/win32k.def

Added: trunk/reactos/subsys/win32k/eng/driverobj.c
--- trunk/reactos/subsys/win32k/eng/driverobj.c	2005-01-06 22:22:13 UTC (rev 12856)
+++ trunk/reactos/subsys/win32k/eng/driverobj.c	2005-01-06 23:12:59 UTC (rev 12857)
@@ -0,0 +1,171 @@
+/*
+ *  ReactOS W32 Subsystem
+ *  Copyright (C) 2005 ReactOS Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/*
+ * COPYRIGHT:         See COPYING in the top level directory
+ * PROJECT:           ReactOS kernel
+ * PURPOSE:           GDI DRIVEROBJ Functions
+ * FILE:              subsys/win32k/eng/driverobj.c
+ * PROGRAMER:         Gregor Anich
+ * REVISION HISTORY:
+ *                 04/01/2005: Created
+ */
+#include <w32k.h>
+
+
+/*!\brief Called when the process is terminated.
+ *
+ * Calls the free-proc for each existing DRIVEROBJ.
+ *
+ * \param Process  Pointer to the EPROCESS struct for the process beeing terminated.
+ * \param Win32Process  Pointer to the W32PROCESS
+ */
+VOID FASTCALL
+IntEngCleanupDriverObjs(struct _EPROCESS *Process,
+                        PW32PROCESS Win32Process)
+{
+  PDRIVERGDI DrvObjInt;
+
+  IntEngLockProcessDriverObjs(PsGetWin32Process());
+  while (!IsListEmpty(&Win32Process->DriverObjListHead))
+    {
+      DrvObjInt = CONTAINING_RECORD(Win32Process->DriverObjListHead.Flink,
+                                    DRIVERGDI, ListEntry);
+      IntEngUnLockProcessDriverObjs(PsGetWin32Process());
+      EngDeleteDriverObj((HDRVOBJ)(&DrvObjInt->DriverObj), TRUE, FALSE);
+      IntEngLockProcessDriverObjs(PsGetWin32Process());
+    }
+  IntEngUnLockProcessDriverObjs(PsGetWin32Process());
+}
+
+
+/*
+ * @implemented
+ */
+HDRVOBJ
+STDCALL
+EngCreateDriverObj(
+	IN PVOID        pvObj,
+	IN FREEOBJPROC  pFreeObjProc,
+	IN HDEV         hdev
+	)
+{
+  PDRIVERGDI DrvObjInt;
+  PDRIVEROBJ DrvObjUser;
+
+  /* Create DRIVEROBJ */
+  DrvObjInt = EngAllocMem(0, sizeof (DRIVERGDI), TAG_DRIVEROBJ);
+  if (DrvObjInt == NULL)
+    {
+      DPRINT1("Failed to allocate memory for a DRIVERGDI structure!\n");
+      return NULL;
+    }
+
+  /* fill user object */
+  DrvObjUser = GDIToObj(DrvObjInt, DRIVER);
+  DrvObjUser->pvObj = pvObj;
+  DrvObjUser->pFreeProc = pFreeObjProc;
+  DrvObjUser->hdev = hdev;
+  DrvObjUser->dhpdev = ((GDIDEVICE*)hdev)->PDev;
+
+  /* fill internal object */
+  ExInitializeFastMutex(&DrvObjInt->Lock);
+  IntEngLockProcessDriverObjs(PsGetWin32Process());
+  InsertTailList(&PsGetWin32Process()->DriverObjListHead, &DrvObjInt->ListEntry);
+  IntEngUnLockProcessDriverObjs(PsGetWin32Process());
+
+  return (HDRVOBJ)DrvObjUser;
+}
+
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+EngDeleteDriverObj(
+	IN HDRVOBJ  hdo,
+	IN BOOL  bCallBack,
+	IN BOOL  bLocked
+	)
+{
+  PDRIVEROBJ DrvObjUser = (PDRIVEROBJ)hdo;
+  PDRIVERGDI DrvObjInt = ObjToGDI(DrvObjUser, DRIVER);
+  
+  /* Make sure the obj is locked */
+  if (!bLocked)
+    {
+      if (!ExTryToAcquireFastMutex(&DrvObjInt->Lock))
+        {
+          return FALSE;
+        }
+    }
+    
+  /* Call the free-proc */
+  if (bCallBack)
+    {
+      if (!DrvObjUser->pFreeProc(DrvObjUser))
+        {
+          return FALSE;
+        }
+    }
+  
+  /* Free the DRIVEROBJ */
+  IntEngLockProcessDriverObjs(PsGetWin32Process());
+  RemoveEntryList(&DrvObjInt->ListEntry);
+  IntEngUnLockProcessDriverObjs(PsGetWin32Process());
+  EngFreeMem(DrvObjInt);
+  
+  return TRUE;
+}
+
+
+/*
+ * @implemented
+ */
+PDRIVEROBJ
+STDCALL
+EngLockDriverObj( IN HDRVOBJ hdo )
+{
+  PDRIVEROBJ DrvObjUser = (PDRIVEROBJ)hdo;
+  PDRIVERGDI DrvObjInt = ObjToGDI(DrvObjUser, DRIVER);
+  
+  if (!ExTryToAcquireFastMutex(&DrvObjInt->Lock))
+    {
+      return NULL;
+    }
+
+  return DrvObjUser;
+}
+
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+EngUnlockDriverObj ( IN HDRVOBJ hdo )
+{
+  PDRIVERGDI DrvObjInt = ObjToGDI((PDRIVEROBJ)hdo, DRIVER);
+
+  ExReleaseFastMutex(&DrvObjInt->Lock);
+  return TRUE;
+}
+
+/* EOF */
+

Modified: trunk/reactos/subsys/win32k/eng/objects.h
--- trunk/reactos/subsys/win32k/eng/objects.h	2005-01-06 22:22:13 UTC (rev 12856)
+++ trunk/reactos/subsys/win32k/eng/objects.h	2005-01-06 23:12:59 UTC (rev 12857)
@@ -51,6 +51,12 @@
   ENUMRECTS EnumRects;
 } CLIPGDI, *PCLIPGDI;
 
+typedef struct _DRIVERGDI {
+  DRIVEROBJ    DriverObj;
+  LIST_ENTRY   ListEntry;
+  FAST_MUTEX   Lock;
+} DRIVERGDI, *PDRIVERGDI;
+
 /*ei What is this for? */
 typedef struct _DRVFUNCTIONSGDI {
   HDEV  hdev;
@@ -122,6 +128,14 @@
 
 typedef BOOL STDCALL (*PFN_GradientFill)(SURFOBJ*, CLIPOBJ*, XLATEOBJ*, TRIVERTEX*, ULONG, PVOID, ULONG, RECTL*, POINTL*, ULONG);
 
+typedef struct _WNDGDI {
+  WNDOBJ            WndObj;
+  CLIPOBJ           *ClientClipObj;
+  WNDOBJCHANGEPROC  ChangeProc;
+  FLONG             Flags;
+  int               PixelFormat;
+} WNDGDI, *PWNDGDI;
+
 typedef struct _XFORMGDI {
   ULONG Dummy;
   /* XFORMOBJ has no public members */

Modified: trunk/reactos/subsys/win32k/eng/semaphor.c
--- trunk/reactos/subsys/win32k/eng/semaphor.c	2005-01-06 22:22:13 UTC (rev 12856)
+++ trunk/reactos/subsys/win32k/eng/semaphor.c	2005-01-06 23:12:59 UTC (rev 12857)
@@ -80,3 +80,50 @@
   ASSERT(hsem);
   return ExIsResourceAcquiredExclusiveLite ( (PERESOURCE)hsem );
 }
+
+/*
+ * @implemented
+ */
+BOOL STDCALL
+EngInitializeSafeSemaphore(
+   OUT ENGSAFESEMAPHORE *Semaphore)
+{
+   HSEMAPHORE hSem;
+
+   if (InterlockedIncrement(&Semaphore->lCount) == 1)
+   {
+      /* Create the semaphore */
+      hSem = EngCreateSemaphore();
+      if (hSem == 0)
+      {
+         InterlockedDecrement(&Semaphore->lCount);
+         return FALSE;
+      }
+      InterlockedExchangePointer((volatile PVOID *)&Semaphore->hsem, hSem);
+   }
+   else
+   {
+      /* Wait for the other thread to create the semaphore */
+      ASSERT(Semaphore->lCount > 1);
+      ASSERT_IRQL(PASSIVE_LEVEL);
+      while (Semaphore->hsem == NULL);
+   }
+
+   return TRUE;
+}
+
+/*
+ * @implemented
+ */
+VOID STDCALL
+EngDeleteSafeSemaphore(
+   IN OUT ENGSAFESEMAPHORE *Semaphore)
+{
+   if (InterlockedDecrement(&Semaphore->lCount) == 0)
+   {
+      EngDeleteSemaphore(Semaphore->hsem);
+      InterlockedExchangePointer((volatile PVOID *)&Semaphore->hsem, NULL);
+   }
+}
+
+

Added: trunk/reactos/subsys/win32k/eng/window.c
--- trunk/reactos/subsys/win32k/eng/window.c	2005-01-06 22:22:13 UTC (rev 12856)
+++ trunk/reactos/subsys/win32k/eng/window.c	2005-01-06 23:12:59 UTC (rev 12857)
@@ -0,0 +1,200 @@
+/*
+ *  ReactOS W32 Subsystem
+ *  Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 ReactOS Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/* $Id: window.c,v 1.11 2004/05/10 17:07:17 blight Exp $
+ *
+ * COPYRIGHT:         See COPYING in the top level directory
+ * PROJECT:           ReactOS kernel
+ * PURPOSE:           GDI WNDOBJ Functions
+ * FILE:              subsys/win32k/eng/window.c
+ * PROGRAMER:         Gregor Anich
+ * REVISION HISTORY:
+ *                 16/11/2004: Created
+ */
+#include <w32k.h>
+
+/*
+ * Calls the WNDOBJCHANGEPROC of the given WNDOBJ
+ */
+VOID
+FASTCALL
+IntEngWndChanged(
+        IN WNDOBJ *pwo,
+        IN FLONG   flChanged)
+{
+  WNDGDI *WndObjInt = ObjToGDI(pwo, WND);
+  
+  if (WndObjInt->ChangeProc == NULL)
+    {
+      return;
+    }
+  
+  /* check flags of the WNDOBJ */
+  flChanged &= WndObjInt->Flags;
+  if (flChanged == 0)
+    {
+      return;
+    }
+
+  /* Call the WNDOBJCHANGEPROC */
+  if (flChanged == WOC_CHANGED)
+    {
+      pwo = NULL;
+    }
+
+  DPRINT1("Calling WNDOBJCHANGEPROC (0x%x), Changed = 0x%x\n",
+           WndObjInt->ChangeProc, flChanged);
+  WndObjInt->ChangeProc(pwo, flChanged);
+}
+
+/*
+ * @implemented
+ */
+WNDOBJ*
+STDCALL
+EngCreateWnd(
+	SURFOBJ          *pso,
+	HWND              hwnd,
+	WNDOBJCHANGEPROC  pfn,
+	FLONG             fl,
+	int               iPixelFormat
+	)
+{
+  WNDGDI *WndObjInt = NULL;
+  WNDOBJ *WndObjUser = NULL;
+  PWINDOW_OBJECT Window;
+  CLIPOBJ *ClientClipObj;
+
+  DPRINT("EngCreateWnd: WNDOBJCHANGEPROC = 0x%x, Flags = 0x%x\n", pfn, fl);
+
+  /* Get window object */
+  Window = IntGetWindowObject(hwnd);
+  if (Window == NULL)
+    {
+      return NULL;
+    }
+
+  /* Create WNDOBJ */
+  WndObjInt = EngAllocMem(0, sizeof (WNDGDI), TAG_WNDOBJ);
+  if (WndObjInt == NULL)
+    {
+      IntReleaseWindowObject(Window);
+      DPRINT1("Failed to allocate memory for a WND structure!\n");
+      return NULL;
+    }
+
+  ClientClipObj = IntEngCreateClipRegion(1, (PRECTL)&Window->ClientRect,
+                                         (PRECTL)&Window->ClientRect);
+  if (ClientClipObj == NULL)
+    {
+      IntReleaseWindowObject(Window);
+      EngFreeMem(WndObjInt);
+      return NULL;
+    }
+
+  /* fill user object */
+  WndObjUser = GDIToObj(WndObjInt, WND);
+  WndObjUser->psoOwner = pso;
+  WndObjUser->pvConsumer = NULL;
+  RtlCopyMemory(&WndObjUser->rclClient, &Window->ClientRect, sizeof (RECT));
+  RtlCopyMemory(&WndObjUser->coClient, ClientClipObj, sizeof (CLIPOBJ));
+
+  /* fill internal object */
+  WndObjInt->ChangeProc = pfn;
+  WndObjInt->Flags = fl;
+  WndObjInt->PixelFormat = iPixelFormat;
+  WndObjInt->ClientClipObj = ClientClipObj;
+
+  /* release resources */
+  IntReleaseWindowObject(Window);
+
+  /* HACKHACKHACK */
+  IntEngWndChanged(WndObjUser, WOC_RGN_CLIENT);
+
+  DPRINT("EngCreateWnd: SUCCESS!\n");
+  return WndObjUser;
+}
+
+
+/*
+ * @implemented
+ */
+VOID
+STDCALL
+EngDeleteWnd ( IN WNDOBJ *pwo )
+{
+  WNDGDI *WndObjInt = ObjToGDI(pwo, WND);
+  
+  DPRINT("EngDeleteWnd\n");
+
+  IntEngDeleteClipRegion(WndObjInt->ClientClipObj);
+  EngFreeMem(WndObjInt);
+}
+
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+WNDOBJ_bEnum(
+	IN WNDOBJ  *pwo,
+	IN ULONG  cj,
+	OUT ULONG  *pul
+	)
+{
+  WNDGDI *WndObjInt = ObjToGDI(pwo, WND);
+  DPRINT("WNDOBJ_bEnum\n");
+  return CLIPOBJ_bEnum(WndObjInt->ClientClipObj, cj, pul);
+}
+
+
+/*
+ * @implemented
+ */
+ULONG
+STDCALL
+WNDOBJ_cEnumStart(
+	IN WNDOBJ  *pwo,
+	IN ULONG  iType,
+	IN ULONG  iDirection,
+	IN ULONG  cLimit
+	)
+{
+  WNDGDI *WndObjInt = ObjToGDI(pwo, WND);
+  DPRINT("WNDOBJ_cEnumStart\n");
+  /* FIXME: Should we enumerate all rectangles or not? */
+  return CLIPOBJ_cEnumStart(WndObjInt->ClientClipObj, FALSE, iType, iDirection, cLimit);
+}
+
+
+/*
+ * @implemented
+ */
+VOID
+STDCALL
+WNDOBJ_vSetConsumer(
+	IN WNDOBJ  *pwo,
+	IN PVOID  pvConsumer
+	)
+{
+  pwo->pvConsumer = pvConsumer;
+}
+
+/* EOF */
+

Modified: trunk/reactos/subsys/win32k/include/inteng.h
--- trunk/reactos/subsys/win32k/include/inteng.h	2005-01-06 22:22:13 UTC (rev 12856)
+++ trunk/reactos/subsys/win32k/include/inteng.h	2005-01-06 23:12:59 UTC (rev 12857)
@@ -22,6 +22,17 @@
 
 /* Definitions of IntEngXxx functions */
 
+#define IntEngLockProcessDriverObjs(W32Process) \
+  ExAcquireFastMutex(&(W32Process)->DriverObjListLock)
+
+#define IntEngUnLockProcessDriverObjs(W32Process) \
+  ExReleaseFastMutex(&(W32Process)->DriverObjListLock)
+
+VOID FASTCALL
+IntEngCleanupDriverObjs(struct _EPROCESS *Process,
+                        PW32PROCESS Win32Process);
+
+
 BOOL STDCALL
 IntEngLineTo(BITMAPOBJ *Surface,
              CLIPOBJ *Clip,

Modified: trunk/reactos/subsys/win32k/include/menu.h
--- trunk/reactos/subsys/win32k/include/menu.h	2005-01-06 22:22:13 UTC (rev 12856)
+++ trunk/reactos/subsys/win32k/include/menu.h	2005-01-06 23:12:59 UTC (rev 12857)
@@ -45,16 +45,16 @@
 IntGetMenuObject(HMENU hMenu);
 
 #define IntLockMenuItems(MenuObj) \
-  ExAcquireFastMutex(&MenuObj->MenuItemsLock)
+  ExAcquireFastMutex(&(MenuObj)->MenuItemsLock)
 
 #define IntUnLockMenuItems(MenuObj) \
-  ExReleaseFastMutex(&MenuObj->MenuItemsLock)
+  ExReleaseFastMutex(&(MenuObj)->MenuItemsLock)
 
 #define IntLockProcessMenus(W32Process) \
-  ExAcquireFastMutex(&W32Process->MenuListLock)
+  ExAcquireFastMutex(&(W32Process)->MenuListLock)
 
 #define IntUnLockProcessMenus(W32Process) \
-  ExReleaseFastMutex(&W32Process->MenuListLock)
+  ExReleaseFastMutex(&(W32Process)->MenuListLock)
 
 #define IntReleaseMenuObject(MenuObj) \
   ObmDereferenceObject(MenuObj)

Modified: trunk/reactos/subsys/win32k/include/tags.h
--- trunk/reactos/subsys/win32k/include/tags.h	2005-01-06 22:22:13 UTC (rev 12856)
+++ trunk/reactos/subsys/win32k/include/tags.h	2005-01-06 23:12:59 UTC (rev 12857)
@@ -45,9 +45,11 @@
 
 /* Eng objects */
 #define TAG_CLIPOBJ	TAG('C', 'L', 'P', 'O') /* clip object */
-#define TAG_XLATEOBJ	TAG('X', 'L', 'A', 'O') /* xlate object */
+#define TAG_DRIVEROBJ	TAG('D', 'R', 'V', 'O') /* driver object */
 #define TAG_FONT	TAG('F', 'N', 'T', 'E') /* font entry */
 #define TAG_FONTOBJ	TAG('F', 'N', 'T', 'O') /* font object */
+#define TAG_WNDOBJ	TAG('W', 'N', 'D', 'O') /* window object */
+#define TAG_XLATEOBJ	TAG('X', 'L', 'A', 'O') /* xlate object */
 
 /* misc */
 #define TAG_DRIVER	TAG('G', 'D', 'R', 'V') /* video drivers */

Modified: trunk/reactos/subsys/win32k/main/dllmain.c
--- trunk/reactos/subsys/win32k/main/dllmain.c	2005-01-06 22:22:13 UTC (rev 12856)
+++ trunk/reactos/subsys/win32k/main/dllmain.c	2005-01-06 23:12:59 UTC (rev 12857)
@@ -1,6 +1,6 @@
 /*
  *  ReactOS W32 Subsystem
- *  Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
+ *  Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 ReactOS Team
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -71,6 +71,9 @@
       InitializeListHead(&Win32Process->PrivateFontListHead);
       ExInitializeFastMutex(&Win32Process->PrivateFontListLock);
       
+      InitializeListHead(&Win32Process->DriverObjListHead);
+      ExInitializeFastMutex(&Win32Process->DriverObjListLock);
+
       Win32Process->KeyboardLayout = W32kGetDefaultKeyLayout();
       
       /* setup process flags */
@@ -82,8 +85,10 @@
       IntRemoveProcessWndProcHandles((HANDLE)Process->UniqueProcessId);
       IntCleanupMenus(Process, Win32Process);
       IntCleanupCurIcons(Process, Win32Process);
+      IntEngCleanupDriverObjs(Process, Win32Process);
       CleanupMonitorImpl();
 
+
       GDI_CleanupForProcess(Process);
 
       IntGraphicsCheck(FALSE);

Modified: trunk/reactos/subsys/win32k/makefile
--- trunk/reactos/subsys/win32k/makefile	2005-01-06 22:22:13 UTC (rev 12856)
+++ trunk/reactos/subsys/win32k/makefile	2005-01-06 23:12:59 UTC (rev 12857)
@@ -55,7 +55,7 @@
     eng/clip.o eng/copybits.o eng/device.o eng/lineto.o \
     eng/paint.o eng/palette.o eng/perfcnt.o eng/semaphor.o eng/surface.o \
     eng/xlate.o eng/transblt.o eng/mouse.o eng/misc.o eng/sort.o \
-    eng/gradient.o eng/event.o eng/float.o
+    eng/gradient.o eng/event.o eng/float.o eng/driverobj.o eng/window.o
 
 MAIN_OBJECTS = main/dllmain.o main/svctabm.o
 

Modified: trunk/reactos/subsys/win32k/stubs/stubs.c
--- trunk/reactos/subsys/win32k/stubs/stubs.c	2005-01-06 22:22:13 UTC (rev 12856)
+++ trunk/reactos/subsys/win32k/stubs/stubs.c	2005-01-06 23:12:59 UTC (rev 12857)
@@ -129,22 +129,6 @@
 /*
  * @unimplemented
  */
-HDRVOBJ
-STDCALL
-EngCreateDriverObj(
-	PVOID        pvObj,
-	FREEOBJPROC  pFreeObjProc,
-	HDEV         hdev
-	)
-{
-  // www.osr.com/ddk/graphics/gdifncs_8svb.htm
-  UNIMPLEMENTED;
-  return NULL;
-}
-
-/*
- * @unimplemented
- */
 PATHOBJ*
 STDCALL
 EngCreatePath ( VOID )
@@ -157,40 +141,6 @@
 /*
  * @unimplemented
  */
-WNDOBJ*
-STDCALL
-EngCreateWnd(
-	SURFOBJ          *pso,
-	HWND              hwnd,
-	WNDOBJCHANGEPROC  pfn,
-	FLONG             fl,
-	int               iPixelFormat
-	)
-{
-  // www.osr.com/ddk/graphics/gdifncs_2ip3.htm
-  UNIMPLEMENTED;
-  return NULL;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-EngDeleteDriverObj(
-	IN HDRVOBJ  hdo,
-	IN BOOL  bCallBack,
-	IN BOOL  bLocked
-	)
-{
-  // www.osr.com/ddk/graphics/gdifncs_0qlj.htm
-  UNIMPLEMENTED;
-  return FALSE;
-}
-
-/*
- * @unimplemented
- */
 VOID
 STDCALL
 EngDeletePath ( IN PATHOBJ *ppo )
@@ -202,17 +152,6 @@
 /*
  * @unimplemented
  */
-VOID
-STDCALL
-EngDeleteWnd ( IN WNDOBJ *pwo )
-{
-  // www.osr.com/ddk/graphics/gdifncs_2z3b.htm
-  UNIMPLEMENTED;
-}
-
-/*
- * @unimplemented
- */
 BOOL
 STDCALL
 EngEnumForms (
@@ -425,18 +364,6 @@
 /*
  * @unimplemented
  */
-DRIVEROBJ*
-STDCALL
-EngLockDriverObj ( IN HDRVOBJ hdo )
-{
-  // www.osr.com/ddk/graphics/gdifncs_41if.htm
-  UNIMPLEMENTED;
-  return NULL;
-}
-
-/*
- * @unimplemented
- */
 PVOID
 STDCALL
 EngMapModule(
@@ -575,15 +502,6 @@
   UNIMPLEMENTED;
 }
 
-BOOL
-STDCALL
-EngUnlockDriverObj ( IN HDRVOBJ hdo )
-{
-  // www.osr.com/ddk/graphics/gdifncs_0l5z.htm
-  UNIMPLEMENTED;
-  return FALSE;
-}
-
 INT
 STDCALL
 EngWideCharToMultiByte(
@@ -1110,44 +1028,6 @@
 
 BOOL
 STDCALL
-WNDOBJ_bEnum(
-	IN WNDOBJ  *pwo,
-	IN ULONG  cj,
-	OUT ULONG  *pul
-	)
-{
-  // www.osr.com/ddk/graphics/gdifncs_3jqf.htm
-  UNIMPLEMENTED;
-  return FALSE;
-}
-
-ULONG
-STDCALL
-WNDOBJ_cEnumStart(
-	IN WNDOBJ  *pwo,
-	IN ULONG  iType,
-	IN ULONG  iDirection,
-	IN ULONG  cLimit
-	)
-{
-  // www.osr.com/ddk/graphics/gdifncs_18o7.htm
-  UNIMPLEMENTED;
-  return 0;
-}
-
-VOID
-STDCALL
-WNDOBJ_vSetConsumer(
-	IN WNDOBJ  *pwo,
-	IN PVOID  pvConsumer
-	)
-{
-  // www.osr.com/ddk/graphics/gdifncs_484n.htm
-  UNIMPLEMENTED;
-}
-
-BOOL
-STDCALL
 XFORMOBJ_bApplyXform(
 	IN XFORMOBJ  *pxo,
 	IN ULONG  iMode,
@@ -1270,6 +1150,19 @@
 /*
  * @unimplemented
  */
+PVOID STDCALL
+EngAllocPrivateUserMem(
+   IN PDD_SURFACE_LOCAL  psl,
+   IN SIZE_T  cj,
+   IN ULONG  tag)
+{
+   UNIMPLEMENTED;
+   return NULL;
+}
+
+/*
+ * @unimplemented
+ */
 VOID STDCALL
 EngClearEvent(
    IN PEVENT Event)
@@ -1292,8 +1185,9 @@
  * @unimplemented
  */
 VOID STDCALL
-EngDeleteSafeSemaphore(
-   IN OUT ENGSAFESEMAPHORE *Semaphore)
+EngFreePrivateUserMem(
+   IN PDD_SURFACE_LOCAL  psl,
+   IN PVOID  pv)
 {
    UNIMPLEMENTED;
 }
@@ -1329,17 +1223,6 @@
 /*
  * @unimplemented
  */
-BOOL STDCALL
-EngInitializeSafeSemaphore(
-   OUT ENGSAFESEMAPHORE *Semaphore)
-{
-   UNIMPLEMENTED;
-   return FALSE;
-}
-
-/*
- * @unimplemented
- */
 PDD_SURFACE_LOCAL STDCALL
 EngLockDirectDrawSurface(
    IN HANDLE Surface)

Modified: trunk/reactos/subsys/win32k/win32k.def
--- trunk/reactos/subsys/win32k/win32k.def	2005-01-06 22:22:13 UTC (rev 12856)
+++ trunk/reactos/subsys/win32k/win32k.def	2005-01-06 23:12:59 UTC (rev 12857)
@@ -15,6 +15,7 @@
 EngAlphaBlend@28
 EngAcquireSemaphore@4
 EngAllocMem@12
+EngAllocPrivateUserMem@12
 EngAllocUserMem@8
 EngAssociateSurface@12
 EngBitBlt@44
@@ -39,6 +40,7 @@
 EngDeleteEvent@4
 EngDeletePalette@4
 EngDeletePath@4
+EngDeleteSafeSemaphore@4
 EngDeleteSemaphore@4
 EngDeleteSurface@4
 EngDeleteWnd@4
@@ -51,6 +53,7 @@
 EngFindResource@16
 EngFreeMem@4
 EngFreeModule@4
+EngFreePrivateUserMem@8
 EngFreeUserMem@4
 EngGetCurrentCodePage@8=ntoskrnl.RtlGetCurrentCodePage
 EngGetCurrentProcessId@0
@@ -66,6 +69,7 @@
 EngGetProcessHandle@0
 EngGetType1FontList@24
 EngGradientFill@40
+EngInitializeSafeSemaphore@4
 EngLineTo@36
 EngLoadImage@4
 EngLoadModule@4