Commit in reactos on MAIN
include/defines.h+7-61.84 -> 1.85
lib/gdi32/misc/stubs.c+1-161.55 -> 1.56
lib/gdi32/objects/dc.c+131.30 -> 1.31
subsys/win32k/objects/dc.c+42-21.130 -> 1.131
+63-24
4 modified files
implemented GetCurrentObject()

reactos/include
defines.h 1.84 -> 1.85
diff -u -r1.84 -r1.85
--- defines.h	23 Mar 2004 00:18:54 -0000	1.84
+++ defines.h	25 Apr 2004 15:31:42 -0000	1.85
@@ -1092,19 +1092,20 @@
 #define TRUETYPE_FONTTYPE	(4)
 
 /* EnumObjects, GetCurrentObject, GetObjectType */
-#define OBJ_BRUSH	(2)
 #define OBJ_PEN	(1)
+#define OBJ_BRUSH	(2)
+#define OBJ_DC	(3)
+#define OBJ_METADC	(4)
 #define OBJ_PAL	(5)
 #define OBJ_FONT	(6)
 #define OBJ_BITMAP	(7)
-#define OBJ_EXTPEN	(11)
 #define OBJ_REGION	(8)
-#define OBJ_DC	(3)
-#define OBJ_MEMDC	(10)
 #define OBJ_METAFILE	(9)
-#define OBJ_METADC	(4)
-#define OBJ_ENHMETAFILE	(13)
+#define OBJ_MEMDC	(10)
+#define OBJ_EXTPEN	(11)
 #define OBJ_ENHMETADC	(12)
+#define OBJ_ENHMETAFILE	(13)
+#define OBJ_COLORSPACE	(14)
 
 /* EnumPrinters */
 

reactos/lib/gdi32/misc
stubs.c 1.55 -> 1.56
diff -u -r1.55 -r1.56
--- stubs.c	25 Apr 2004 14:46:53 -0000	1.55
+++ stubs.c	25 Apr 2004 15:31:43 -0000	1.56
@@ -1,4 +1,4 @@
-/* $Id: stubs.c,v 1.55 2004/04/25 14:46:53 weiden Exp $
+/* $Id: stubs.c,v 1.56 2004/04/25 15:31:43 weiden Exp $
  *
  * reactos/lib/gdi32/misc/stubs.c
  *
@@ -259,21 +259,6 @@
 /*
  * @unimplemented
  */
-HGDIOBJ
-STDCALL
-GetCurrentObject(
-	HDC	a0,
-	UINT	a1
-	)
-{
-	SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-	return 0;
-}
-
-
-/*
- * @unimplemented
- */
 DWORD
 STDCALL
 GetFontData(

reactos/lib/gdi32/objects
dc.c 1.30 -> 1.31
diff -u -r1.30 -r1.31
--- dc.c	25 Apr 2004 14:46:54 -0000	1.30
+++ dc.c	25 Apr 2004 15:31:43 -0000	1.31
@@ -1030,3 +1030,16 @@
   return FALSE;
 }
 
+
+/*
+ * @implemented
+ */
+HGDIOBJ
+STDCALL
+GetCurrentObject(
+	HDC	hdc,
+	UINT	uObjectType
+	)
+{
+  return NtGdiGetCurrentObject(hdc, uObjectType);
+}

reactos/subsys/win32k/objects
dc.c 1.130 -> 1.131
diff -u -r1.130 -r1.131
--- dc.c	25 Apr 2004 12:51:53 -0000	1.130
+++ dc.c	25 Apr 2004 15:31:43 -0000	1.131
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: dc.c,v 1.130 2004/04/25 12:51:53 weiden Exp $
+/* $Id: dc.c,v 1.131 2004/04/25 15:31:43 weiden Exp $
  *
  * DC.C - Device context functions
  *
@@ -56,6 +56,10 @@
 #define NDEBUG
 #include <win32k/debug1.h>
 
+#ifndef OBJ_COLORSPACE
+#define OBJ_COLORSPACE	(14)
+#endif
+
 static GDIDEVICE PrimarySurface;
 
 /* FIXME: DCs should probably be thread safe  */
@@ -962,7 +966,43 @@
 HGDIOBJ STDCALL
 NtGdiGetCurrentObject(HDC  hDC, UINT  ObjectType)
 {
-  UNIMPLEMENTED;
+  HGDIOBJ SelObject;
+  DC *dc;
+  
+  if(!(dc = DC_LockDc(hDC)))
+  {
+    SetLastWin32Error(ERROR_INVALID_HANDLE);
+    return NULL;
+  }
+  
+  switch(ObjectType)
+  {
+    case OBJ_PEN:
+      SelObject = dc->w.hPen;
+      break;
+    case OBJ_BRUSH:
+      SelObject = dc->w.hBrush;
+      break;
+    case OBJ_PAL:
+      DPRINT1("FIXME: NtGdiGetCurrentObject() ObjectType OBJ_PAL not supported yet!\n");
+      break;
+    case OBJ_FONT:
+      SelObject = dc->w.hFont;
+      break;
+    case OBJ_BITMAP:
+      SelObject = dc->w.hBitmap;
+      break;
+    case OBJ_COLORSPACE:
+      DPRINT1("FIXME: NtGdiGetCurrentObject() ObjectType OBJ_COLORSPACE not supported yet!\n");
+      break;
+    default:
+      SelObject = NULL;
+      SetLastWin32Error(ERROR_INVALID_PARAMETER);
+      break;
+  }
+  
+  DC_UnlockDc(hDC);
+  return SelObject;
 }
 
 DC_GET_VAL_EX ( GetCurrentPositionEx, w.CursPosX, w.CursPosY, POINT, x, y )
CVSspam 0.2.8