2

I create a clipper and setHWnd. Code like:

m_ddraw->CreateClipper(0, &m_clipper, NULL);
m_clipper->SetHWnd(0, wnd);
m_primarySurface->SetClipper(m_clipper);

In windows10, it worked correctly. But in windows11,sometimes it caused 引发的异常: 0xC0000005: 读取位置 0x0000000000000014 时发生访问冲突。 When I SetHWnd(0,NULL),it doesn't happen.

psxc233
  • 21
  • 1
  • Which line is it actually crashing on? Add error checking to be sure all variables involved are valid and check the return codes from functions that supply them. – Retired Ninja Jul 07 '22 at 05:24
  • hr = m_primarySurface->Blt(&dstRect, m_offScreenSurface, &srcRect, DDBLT_WAIT, NULL); The return code is 0x88760037, "DDERR_EXCEPTION", "An exception was encountered while performing the requested operation" – psxc233 Jul 07 '22 at 05:28
  • And the whole program work fine in win10 – psxc233 Jul 07 '22 at 05:30

0 Answers0