Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MFC program hangs: broken Comctl32.dll after update KB3059317 on Vista?

I have an MFC-based program which worked fine just before applying update 3059317:

MS15-060: Vulnerability in Microsoft common controls could allow remote code execution: June 9, 2015)

The update replaces Comctl32.dll with a new version.

After applying this update, opening a dialog just hangs the program. Not all dialogs seem to be affected, but the print preview is consistently hanging, without crashing the program, though. It just becomes unresponsive.

I've no idea how I could try to debug this problem in order to find a way around it. Creating a memory dump when the program is hung gives following stack trace:

comctl32.dll!751f8505() 
Xxx.exe!CWnd::WindowProc(unsigned int message, unsigned int wParam, long lParam) Line 2095 + 0x13 bytes
Xxx.exe!AfxCallWndProc(CWnd * pWnd, HWND__ * hWnd, unsigned int nMsg, unsigned int wParam, long lParam) Line 285
Xxxx.exe!AfxWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned int wParam, long lParam) Line 434 + 0x10 bytes
user32.dll!76aafd72() 
user32.dll!76aa84de() 
user32.dll!76aafd72() 
user32.dll!76aa9f8d() 
ntdll.dll!77dd5a7e() 
user32.dll!76aaa2af() 
comctl32.dll!75249cfb() 
comctl32.dll!751fb559() 
user32.dll!76aafd72() 
user32.dll!76aafe4a() 
user32.dll!76ab09d3() 
user32.dll!76abb759() 
Xxx.exe!CWnd::DefWindowProcA(unsigned int nMsg, unsigned int wParam, long lParam) Line 1116 + 0x7 bytes
Xxx.exe!CWnd::Default() Line 315 + 0x13 bytes
Xxx.exe!CParsedEdit::OnPaint() Line 1603
Xxx.exe!CBannerEdit::OnPaint() Line 368

So we are indeed stuck in Comctl32.dll - now what?

By the way, in some cases, uninstalling the update solves the issue.

UPDATE

In all cases, turning off Aero always solves the issue. And KB3059317 seems not to be the only June 2015 update to Windows Vista which exhibits this weird behaviour.

like image 467
Pierre Arnaud Avatar asked Nov 01 '22 01:11

Pierre Arnaud


1 Answers

It fails with Areo Vista at least for one dialog in our app: the dialog is just not painted. It is present, but it is just not visible.

To resolved the problem on Vista Aero, remove any calls to SetRedraw() function while executing OnInitDialog() and OnSize() methods.

It seems that SetRedraw(TRUE) has no (positive) effect, at least in these two cases.

like image 64
Skywalker13 Avatar answered Nov 15 '22 03:11

Skywalker13