- Code: Select all
static BOOL Handle_WM_MEASUREITEM (HWND hWnd, LPMEASUREITEMSTRUCT lpMis)
{
TEXTMETRIC tm;
HDC hDC = GetDC(hWnd);
HFONT hOldFont = (HFONT)SelectObject(hDC,hLBFont);
GetTextMetrics(hDC,&tm);
lpMis->itemHeight = tm.tmHeight+2;
SelectObject(hDC,hOldFont);
ReleaseDC(hWnd,hDC);
return TRUE;
}
0:000> kL 100
ChildEBP RetAddr
0012c028 01626814 ntdll!DbgBreakPoint
0012ce78 016269dc Vcps!failwithmessage+0x224
0012d2a0 01625e85 Vcps!_RTC_StackFailure+0x10c
0012d2c0 0162175f Vcps!_RTC_CheckStackVars+0x45
0012d324 01621680 Vcps!Handle_WM_MEASUREITEM+0xaf
0012d338 0162335e Vcps!PSLBProcessCommands+0x40
0012d480 77d48734 Vcps!PSWndProc+0xbfe
0012d4ac 77d48816 user32!InternalCallWinProc+0x28
0012d514 77d4b89b user32!UserCallWinProcCheckWow+0x150
0012d550 77d4b903 user32!SendMessageWorker+0x4a5
0012d570 77d620c0 user32!SendMessageW+0x7f
0012d5ac 77d6600a user32!xxxLBCreate+0x286
0012d630 77d4fd29 user32!ListBoxWndProcWorker+0x23b
0012d660 7c90eae3 user32!__fnINLPCREATESTRUCT+0x8b
0012d6cc 77d5013e ntdll!KiUserCallbackDispatcher+0x13
0012db70 77d501f7 user32!NtUserCreateWindowEx+0xc
0012dc1c 77d4ff83 user32!_CreateWindowEx+0x1ed
0012dc58 016215be user32!CreateWindowExW+0x33
0012dc94 016228df Vcps!CreatePSLB+0x3e
0012ddd8 77d48734 Vcps!PSWndProc+0x17f
0012de04 77d48816 user32!InternalCallWinProc+0x28
0012de6c 77d4b4c0 user32!UserCallWinProcCheckWow+0x150
0012dec0 77d4fd29 user32!DispatchClientMessage+0xa3
0012def0 7c90eae3 user32!__fnINLPCREATESTRUCT+0x8b
0012df5c 77d5013e ntdll!KiUserCallbackDispatcher+0x13
0012e400 77d501f7 user32!NtUserCreateWindowEx+0xc
0012e4ac 77d4ff83 user32!_CreateWindowEx+0x1ed
0012e4e8 01622705 user32!CreateWindowExW+0x33
0012e558 0040fbd0 Vcps!CreatePS+0xf5
0012f1f0 77d48734 opentask!MainWndProc+0xd10
0012f21c 77d48816 user32!InternalCallWinProc+0x28
0012f284 77d4b4c0 user32!UserCallWinProcCheckWow+0x150
0012f2d8 77d4fd29 user32!DispatchClientMessage+0xa3
0012f308 7c90eae3 user32!__fnINLPCREATESTRUCT+0x8b
0012f38c 77d5013e ntdll!KiUserCallbackDispatcher+0x13
0012f830 77d501f7 user32!NtUserCreateWindowEx+0xc
0012f8dc 77d4ff83 user32!_CreateWindowEx+0x1ed
0012f918 0040e369 user32!CreateWindowExW+0x33
0012ff0c 00422176 opentask!WinMain+0x729
0012ffb8 00421eed opentask!__tmainCRTStartup+0x286
0012ffc0 7c816d4f opentask!WinMainCRTStartup+0xd
0012fff0 00000000 kernel32!BaseProcessStart+0x23
I don't understand why we have it here. I don't see any buffer overrun here.