fixing a memory overwrite bug I miskate intrudes

the private size of stackobject list contain 22 object, and we do not want mix up the private size and the user mode size for different version. 

svn path=/trunk/; revision=33415
This commit is contained in:
Magnus Olsen 2008-05-10 18:07:41 +00:00
parent 4ec8e30269
commit c6d6043053
2 changed files with 8 additions and 3 deletions

View file

@ -8,6 +8,10 @@
#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))

View file

@ -107,10 +107,10 @@ 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 wine reserve two extra entry for the stock default bitmap this is what Windows does too
* and verify if it it is true it is not. in XP/2003 it is 22 stockobjects for each bitmap
/* 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 (STOCK_LAST + 3)
#define NB_STOCK_OBJECTS (PRV_STOCK_LAST)
static HGDIOBJ StockObjects[NB_STOCK_OBJECTS];
@ -139,6 +139,7 @@ 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);
(void) TextIntCreateFontIndirect(&OEMFixedFont, (HFONT*)&StockObjects[OEM_FIXED_FONT]);