test_TCS_OWNERDRAWFIXED in dlls/comctl32/tests/tab has the following
code:
LPARAM lparam, lparam2;
:
lparam = 0;
memset(&lparam, 0xde, 4);
memset(&lparam2, 0xde, sizeof(LPARAM)-1);
ok(g_drawitem.itemData == lparam || broken(g_drawitem.itemData == lparam2) /*
win98 */,
"got 0x%lx, expected 0x%lx\n", g_drawitem.itemData, lparam);
I have two questions on this. First, why does the memset use the constant
4 and not sizeof(LPARAM)?
Second, why initialize lparam with 0 when this is immediately followed by
a memset covering it's fully size?
Third, lparam2 is partially uninitialized and will have a couple of random
bits from all I can tell since lparam2 is never initialized and the memset
only covers a portion of it.
I'm wondering, should lparam = 0 just read lparam2 = 0? Whatever may be
the case, the current code does not look right.
Gerald