diff --git a/reactos/dll/win32/gdi32/include/gdi32p.h b/reactos/dll/win32/gdi32/include/gdi32p.h index dd5c86fe680..a5e6a9ebcd8 100644 --- a/reactos/dll/win32/gdi32/include/gdi32p.h +++ b/reactos/dll/win32/gdi32/include/gdi32p.h @@ -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. diff --git a/reactos/dll/win32/gdi32/misc/stubs.c b/reactos/dll/win32/gdi32/misc/stubs.c index 0e1c9b54e36..2b46c56c53e 100644 --- a/reactos/dll/win32/gdi32/misc/stubs.c +++ b/reactos/dll/win32/gdi32/misc/stubs.c @@ -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); + } } /* diff --git a/reactos/include/reactos/win32k/ntgdityp.h b/reactos/include/reactos/win32k/ntgdityp.h index c8c00a58a49..8b8926bbcb5 100644 --- a/reactos/include/reactos/win32k/ntgdityp.h +++ b/reactos/include/reactos/win32k/ntgdityp.h @@ -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 *******************************************************************/ diff --git a/reactos/subsystems/win32/win32k/include/object.h b/reactos/subsystems/win32/win32k/include/object.h index cd02d1b1325..33ed973368c 100644 --- a/reactos/subsystems/win32/win32k/include/object.h +++ b/reactos/subsystems/win32/win32k/include/object.h @@ -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)) diff --git a/reactos/subsystems/win32/win32k/objects/stockobj.c b/reactos/subsystems/win32/win32k/objects/stockobj.c index 20c624bf94a..d6bdfdd8546 100644 --- a/reactos/subsystems/win32/win32k/objects/stockobj.c +++ b/reactos/subsystems/win32/win32k/objects/stockobj.c @@ -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]);