Commit 3e20458a authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/imagelist: Get rid of magic field, use vtable pointer instead. Keep original layout.

parent 1b966267
......@@ -81,11 +81,7 @@ static INTERNALDRAG InternalDrag = { 0, 0, 0, 0, 0, 0, FALSE, 0 };
static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count, UINT width);
static HRESULT ImageListImpl_CreateInstance(const IUnknown *pUnkOuter, REFIID iid, void** ppv);
static inline BOOL is_valid(HIMAGELIST himl)
{
return himl && himl->magic == IMAGELIST_MAGIC;
}
static inline BOOL is_valid(HIMAGELIST himl);
/*
* An imagelist with N images is tiled like this:
......@@ -607,7 +603,6 @@ ImageList_Create (INT cx, INT cy, UINT flags,
cGrow = (cGrow < 4) ? 4 : (cGrow + 3) & ~3;
himl->magic = IMAGELIST_MAGIC;
himl->cx = cx;
himl->cy = cy;
himl->flags = flags;
......@@ -3320,6 +3315,11 @@ static const IImageListVtbl ImageListImpl_Vtbl = {
ImageListImpl_GetOverlayImage
};
static inline BOOL is_valid(HIMAGELIST himl)
{
return himl && himl->lpVtbl == &ImageListImpl_Vtbl;
}
/*************************************************************************
* HIMAGELIST_QueryInterface [COMCTL32.@]
*
......
......@@ -30,31 +30,31 @@
struct _IMAGELIST
{
const struct IImageListVtbl *lpVtbl; /* 00: IImageList vtable */
LONG ref; /* 04: reference count */
DWORD magic; /* 08: 'SAMX' */
INT cCurImage; /* 0C: ImageCount */
INT cMaxImage; /* 10: maximages */
INT cGrow; /* 14: cGrow */
INT cx; /* 18: cx */
INT cy; /* 1C: cy */
INT cCurImage; /* 04: ImageCount */
INT cMaxImage; /* 08: maximages */
INT cGrow; /* 0C: cGrow */
INT cx; /* 10: cx */
INT cy; /* 14: cy */
DWORD x4;
UINT flags; /* 24: flags */
COLORREF clrFg; /* 28: foreground color */
COLORREF clrBk; /* 2C: background color */
UINT flags; /* 1C: flags */
COLORREF clrFg; /* 20: foreground color */
COLORREF clrBk; /* 24: background color */
HBITMAP hbmImage; /* 30: images Bitmap */
HBITMAP hbmMask; /* 34: masks Bitmap */
HDC hdcImage; /* 38: images MemDC */
HDC hdcMask; /* 3C: masks MemDC */
INT nOvlIdx[15]; /* 40: overlay images index */
HBITMAP hbmImage; /* 28: images Bitmap */
HBITMAP hbmMask; /* 2C: masks Bitmap */
HDC hdcImage; /* 30: images MemDC */
HDC hdcMask; /* 34: masks MemDC */
INT nOvlIdx[15]; /* 38: overlay images index */
/* not yet found out */
HBRUSH hbrBlend25;
HBRUSH hbrBlend50;
INT cInitial;
UINT uBitsPixel;
LONG ref; /* reference count */
};
#define IMAGELIST_MAGIC 0x53414D58
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment