Reimplement GetStockObject, based on Wine. It is bypassed in the def file. Init support code is not added yet.

svn path=/trunk/; revision=26442
This commit is contained in:
James Tabor 2007-04-20 22:44:37 +00:00
parent cf933b1f2b
commit 7b205923df
2 changed files with 31 additions and 0 deletions

View file

@ -29,6 +29,10 @@ typedef INT
#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 *********************************************************************/
// Based on wmfapi.h and Wine. This is the DC_ATTR for a MetaDC file.

View file

@ -3,6 +3,8 @@
#define NDEBUG
#include <debug.h>
HGDIOBJ stock_objects[NB_STOCK_OBJECTS]; // temp location.
HDC
FASTCALL
IntCreateDICW ( LPCWSTR lpwszDriver,
@ -577,3 +579,28 @@ GetObjectType(
}
/*
* @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;
}