Win32 Application no longer terminates after using Windows GDI ChoosePixelFormat

Ilia Vorobyov
1
Reputation point
Since a few days my Win32 C++ application no longer terminates once the ExitInstance() function is finished. The same application was working fine a few weeks ago. The problem occurred on various of Terminal Servers when the Device Number of adjacent color bits for each pixel is 16 and I believe a gdi32.dll patch is the root cause.
{count} votes
It is MFC Application 32 bits with using Win32 API functions.
If you believe a gdi32.dll patch has been the cause, can you remove the update and resolves the problem?
Which update is it?
I can't remove the patch, because this occurs on several clients computers.
@Ilia Vorobyov ,
Could you please share a minimal demo to help us reproduce the issue? Please don't include any private info in the demo.
int s_nColors = 32;
BOOL CMyApp::InitInstance()
{
...
HDC hDC = GetDC(NULL);
if(hDC)
{
s_nColors = ::GetDeviceCaps(hDC,BITSPIXEL);
if(s_nColors == 16)
{
PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR),
1,
PFD_DRAW_TO_WINDOW |
PFD_SUPPORT_OPENGL |
PFD_TYPE_RGBA,
24,
0, 0, 0, 0, 0, 0,
0,
0,
0,
0, 0, 0, 0,
32,
0,
0,
PFD_MAIN_PLANE,
0,
0, 0, 0
};
...
}
According to the code, I couldn't reproduce the issue, my application could terminates normally. As far as I'm concerned, as you said, a gdi32.dll patch is the root cause. I suggest you could send feedback to Microsoft with the Feedback Hub app: https://support.microsoft.com/en-us/windows/send-feedback-to-microsoft-with-the-feedback-hub-app-f59187f8-8739-22d6-ba93-f66612949332
Sign in to comment