Author: jimtabor
Date: Sat Apr 21 02:44:37 2007
New Revision: 26442
URL:
http://svn.reactos.org/svn/reactos?rev=26442&view=rev
Log:
Reimplement GetStockObject, based on Wine. It is bypassed in the def file. Init support
code is not added yet.
Modified:
trunk/reactos/dll/win32/gdi32/include/gdi32p.h
trunk/reactos/dll/win32/gdi32/objects/dc.c
Modified: trunk/reactos/dll/win32/gdi32/include/gdi32p.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/include/gd…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/include/gdi32p.h (original)
+++ trunk/reactos/dll/win32/gdi32/include/gdi32p.h Sat Apr 21 02:44:37 2007
@@ -28,6 +28,10 @@
#define METAFILE_MEMORY 1
#define METAFILE_DISK 2
+
+#define STOCK_LAST 19
+#define DEFAULT_BITMAP (STOCK_LAST+1)
+#define NB_STOCK_OBJECTS (STOCK_LAST+2)
/* TYPES *********************************************************************/
Modified: trunk/reactos/dll/win32/gdi32/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/dc…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/dc.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/dc.c Sat Apr 21 02:44:37 2007
@@ -2,6 +2,8 @@
#define NDEBUG
#include <debug.h>
+
+HGDIOBJ stock_objects[NB_STOCK_OBJECTS]; // temp location.
HDC
FASTCALL
@@ -577,3 +579,28 @@
}
+/*
+ * @implemented
+ */
+HGDIOBJ
+WINAPI
+GetStockObject(
+ INT h
+ )
+{
+ HGDIOBJ Ret = NULL;
+ if ((h < 0) || (h >= NB_STOCK_OBJECTS)) return Ret;
+ Ret = stock_objects[h];
+ if (!Ret)
+ {
+ HGDIOBJ Obj = NtGdiGetStockObject( h );
+
+ if (GdiIsHandleValid(Obj))
+ {
+ stock_objects[h] = Obj;
+ return Obj;
+ }// Returns Null anyway.
+ }
+ return Ret;
+}
+