mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
- Get rid of duplicated (and different) NB_LAST_STOCK definitions in gdi32 and win32k, now it's defined to 22 (19 being a last public stock object, other 2 are internal).
- Move a DEFAULT_BITMAP definiton from gdi32 into ntgdityp.h (not the best place, but could be moved to a better one later), and assign it a number 21, which it is on Windows XP (tested with a win32kntest framework, tests are committed). - Fix CreateBitmap to return a 1x1 stock bitmap object if the requested Width and Height are 0. - All of this work is based on Magnus Olsen's patches and Wine. svn path=/trunk/; revision=33418
This commit is contained in:
@@ -30,9 +30,6 @@ typedef INT
|
||||
#define METAFILE_MEMORY 1
|
||||
#define METAFILE_DISK 2
|
||||
|
||||
#define DEFAULT_BITMAP (STOCK_LAST+1)
|
||||
#define NB_STOCK_OBJECTS (STOCK_LAST+2)
|
||||
|
||||
/* TYPES *********************************************************************/
|
||||
|
||||
// Based on wmfapi.h and Wine.
|
||||
|
||||
@@ -1936,7 +1936,15 @@ CreateBitmap(INT Width,
|
||||
PCVOID pUnsafeBits)
|
||||
{
|
||||
/* FIXME some part should be done in user mode */
|
||||
return NtGdiCreateBitmap(Width, Height, Planes, BitsPixel, (LPBYTE) pUnsafeBits);
|
||||
if (Width && Height)
|
||||
{
|
||||
return NtGdiCreateBitmap(Width, Height, Planes, BitsPixel, (LPBYTE) pUnsafeBits);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Return 1x1 bitmap */
|
||||
return GetStockObject(DEFAULT_BITMAP);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -159,10 +159,12 @@ typedef enum GDILoObjType
|
||||
typedef DWORD FULLSCREENCONTROL;
|
||||
typedef DWORD LFTYPE;
|
||||
|
||||
/* NOTE DC_BITMAP or the value are not documented in MSDN or ms header
|
||||
* it return a 1x1 1Bpp Bitmap in all case from GetStockObject
|
||||
*/
|
||||
#define DC_BITMAP 21
|
||||
/* Public LAST_STOCK = 19, plus 2 more internal entries */
|
||||
#define NB_STOCK_OBJECTS 22
|
||||
|
||||
/* extra stock object: default 1x1 bitmap for memory DCs */
|
||||
#define DEFAULT_BITMAP (21)
|
||||
|
||||
|
||||
/* DEFINES *******************************************************************/
|
||||
|
||||
|
||||
@@ -8,11 +8,6 @@
|
||||
#define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */
|
||||
#define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */
|
||||
|
||||
/* Comments from reserve two extra entry for the stock default bitmap this is what Windows does too
|
||||
* and verify if it is true it is not. in XP/2003 it is 22 stockobjects for each bitmap
|
||||
*/
|
||||
#define PRV_STOCK_LAST 22
|
||||
|
||||
#define USER_HEADER_TO_BODY(ObjectHeader) \
|
||||
((PVOID)(((PUSER_OBJECT_HEADER)ObjectHeader) + 1))
|
||||
|
||||
|
||||
@@ -107,11 +107,6 @@ static LOGFONTW DefaultGuiFont =
|
||||
{ 11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
|
||||
0, 0, DEFAULT_QUALITY, VARIABLE_PITCH | FF_SWISS, L"MS Sans Serif" }; //Bitstream Vera Sans
|
||||
|
||||
/* Comments from reserve two extra entry for the stock default bitmap this is what Windows does too
|
||||
* and verify if it is true it is not. in XP/2003 it is 22 stockobjects for each bitmap
|
||||
*/
|
||||
#define NB_STOCK_OBJECTS (PRV_STOCK_LAST)
|
||||
|
||||
static HGDIOBJ StockObjects[NB_STOCK_OBJECTS];
|
||||
|
||||
/*!
|
||||
@@ -139,8 +134,8 @@ CreateStockObjects(void)
|
||||
StockObjects[DC_PEN] = IntGdiExtCreatePen(BlackPen.lopnStyle, BlackPen.lopnWidth.x, BS_SOLID, BlackPen.lopnColor, 0, 0, 0, NULL, 0, TRUE, NULL);
|
||||
StockObjects[NULL_PEN] = IntGdiExtCreatePen(NullPen.lopnStyle, NullPen.lopnWidth.x, BS_SOLID, NullPen.lopnColor, 0, 0, 0, NULL, 0, TRUE, NULL);
|
||||
|
||||
StockObjects[20] = NULL;
|
||||
StockObjects[DC_BITMAP] = IntGdiCreateBitmap (1, 1, 1, 1, NULL);
|
||||
StockObjects[20] = NULL; /* TODO: Unknown internal stock object */
|
||||
StockObjects[DEFAULT_BITMAP] = IntGdiCreateBitmap(1, 1, 1, 1, NULL);
|
||||
|
||||
(void) TextIntCreateFontIndirect(&OEMFixedFont, (HFONT*)&StockObjects[OEM_FIXED_FONT]);
|
||||
(void) TextIntCreateFontIndirect(&AnsiFixedFont, (HFONT*)&StockObjects[ANSI_FIXED_FONT]);
|
||||
|
||||
Reference in New Issue
Block a user