Graphics
Intel® graphics drivers and software, compatibility, troubleshooting, performance, and optimization
23657 Discussions

Access violation when call SetPixelFormat

Yuya_Fukazawa_bn7
30 Views
static void InitPixelFormat(HDC hDC)
{
	PIXELFORMATDESCRIPTOR pixelFormatDescriptor{};
	pixelFormatDescriptor.nSize      = sizeof(PIXELFORMATDESCRIPTOR);
	pixelFormatDescriptor.nVersion   = 1;
	pixelFormatDescriptor.dwFlags    = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
	pixelFormatDescriptor.iPixelType = PFD_TYPE_RGBA;
	pixelFormatDescriptor.cColorBits = 24;
	pixelFormatDescriptor.iLayerType = PFD_MAIN_PLANE;

	int pixelFormat = ::ChoosePixelFormat(hDC, &pixelFormatDescriptor);
	ThrowIfFailed(pixelFormat != 0);

	BOOL result = ::SetPixelFormat(hDC, pixelFormat, &pixelFormatDescriptor);
	ThrowIfFailed(result != FALSE);
}

static void CreateWindowAndSetPixelFormat()
{
	HWND hWindow = MyCreateWindow(1, 1);

	HDC hDC = ::GetDC(hWindow);
	ThrowIfFailed(hDC != NULL);

	InitPixelFormat(hDC);

	::ReleaseDC    (hWindow, hDC);
	::DestroyWindow(hWindow);
}

int main(void)
{
	std::thread thread(CreateWindowAndSetPixelFormat);
	thread.join();

	CreateWindowAndSetPixelFormat();    // 0xC0000005 (Access violation) in igxelpicd64.dll when call SetPixelFormat

	return 0;
}

 

When call SetPixelFormat after the thread that called SetPixelFormat has terminated,
an exception (0xC0000005, Access violation) occurs in igxelpicd64.dll.

 

Isn't this a driver bug?

 

I have attached some files.

  • SSUScanInfo.txt .. Intel System Support Utility output.
  • SetPixelFormatTest .. Visual Studio Solution (Reproduction environment)
0 Kudos
0 Replies
Reply