diff --git a/DDrawCompat/DDraw/Surfaces/PrimarySurface.cpp b/DDrawCompat/DDraw/Surfaces/PrimarySurface.cpp index 97f332f..60dcc1c 100644 --- a/DDrawCompat/DDraw/Surfaces/PrimarySurface.cpp +++ b/DDrawCompat/DDraw/Surfaces/PrimarySurface.cpp @@ -52,6 +52,12 @@ namespace DDraw { LOG_FUNC("PrimarySurface::create", &dd, desc, surface); DDraw::RealPrimarySurface::destroyDefaultPrimary(); + if (g_primarySurface) + { + LOG_ONCE("Warning: suppressed an attempt to create multiple primary surfaces"); + return LOG_RESULT(DDERR_UNSUPPORTED); + } + const auto& dm = DDraw::DirectDraw::getDisplayMode(*CompatPtr::from(&dd)); g_monitorRect = D3dDdi::KernelModeThunks::getAdapterInfo(*CompatPtr::from(&dd)).monitorInfo.rcMonitor; g_monitorRect.right = g_monitorRect.left + dm.dwWidth; diff --git a/DDrawCompat/DDraw/Surfaces/TagSurface.cpp b/DDrawCompat/DDraw/Surfaces/TagSurface.cpp index 3dcb027..c8bc3b8 100644 --- a/DDrawCompat/DDraw/Surfaces/TagSurface.cpp +++ b/DDrawCompat/DDraw/Surfaces/TagSurface.cpp @@ -18,6 +18,7 @@ namespace DDraw , m_fullscreenWindowStyle(0) , m_fullscreenWindowExStyle(0) { + LOG_FUNC("TagSurface::TagSurface", Compat::hex(origCaps), ddLcl); m_ddInt.lpVtbl = &CompatVtable::s_origVtable; m_ddInt.lpLcl = ddLcl; m_ddInt.dwIntRefCnt = 1; @@ -25,6 +26,7 @@ namespace DDraw TagSurface::~TagSurface() { + LOG_FUNC("TagSurface::~TagSurface", m_ddInt.lpLcl); setFullscreenWindow(nullptr); g_ddObjects.erase(m_ddInt.lpLcl); }