Index: /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxCrHgsmi.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxCrHgsmi.cpp	(revision 33683)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxCrHgsmi.cpp	(revision 33684)
@@ -122,11 +122,16 @@
             hClient = g_VBoxCrHgsmiCallbacks.pfnClientCreate(&pHgsmiGL->BasePrivate.Base);
             Assert(hClient);
-            pHgsmiGL->BasePrivate.hClient = hClient;
-            gt_pHgsmiGL = pHgsmiGL;
-        }
-    }
-    else
-        hClient = NULL;
-    return hClient;
+            if (hClient)
+            {
+                pHgsmiGL->BasePrivate.hClient = hClient;
+                gt_pHgsmiGL = pHgsmiGL;
+                return hClient;
+            }
+            vboxUhgsmiKmtDestroy(pHgsmiGL);
+        }
+        RTMemFree(pHgsmiGL);
+    }
+
+    return NULL;
 }
 
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp	(revision 33683)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp	(revision 33684)
@@ -1883,5 +1883,4 @@
         else if (pSwapchain->iBB == iRt)
         {
-            Assert(0);
             pSwapchain->iBB = 0;
         }
@@ -1997,7 +1996,4 @@
     if (!pSwapchain)
     {
-#ifdef DEBUG_misha
-        Assert(0);
-#endif
         /* first search for the swapchain the alloc might be added to */
         PVBOXWDDMDISP_SWAPCHAIN pCur = RTListNodeGetFirst(&pDevice->SwapchainList, VBOXWDDMDISP_SWAPCHAIN, ListEntry);
@@ -5391,4 +5387,5 @@
 //                Assert(pScreen->hWnd);
 //                Assert(pScreen->pDevice9If);
+                hr = E_FAIL;
                 Assert(0);
             }
@@ -6722,5 +6719,4 @@
     {
         case D3DDDIQUERYTYPE_EVENT:
-            Assert(0);
             pQuery->data.bData = TRUE;
             Assert(pData->pData);
@@ -8180,4 +8176,5 @@
         case 0x40010006: /* <- OutputDebugString exception, ignore */
         case 0xe06d7363: /* <- ms compiler - generated exception related to C++ exception */
+        case 0x000006d9: /* <- RPC exception, ignore */
             break;
         default:
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxUhgsmiKmt.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxUhgsmiKmt.cpp	(revision 33683)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxUhgsmiKmt.cpp	(revision 33684)
@@ -170,4 +170,8 @@
             return VINF_SUCCESS;
         }
+        else
+        {
+            rc = VERR_OUT_OF_RESOURCES;
+        }
 
         RTMemFree(pBuf);
@@ -325,4 +329,8 @@
 
             return VINF_SUCCESS;
+        }
+        else
+        {
+            rc = VERR_OUT_OF_RESOURCES;
         }
 
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp	(revision 33683)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp	(revision 33684)
@@ -1575,5 +1575,4 @@
     pDevExt->bNotifyDxDpc = TRUE;
     BOOLEAN bDpcQueued = pDevExt->u.primary.DxgkInterface.DxgkCbQueueDpc(pDevExt->u.primary.DxgkInterface.DeviceHandle);
-    Assert(bDpcQueued);
 
     return bDpcQueued;
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp	(revision 33683)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp	(revision 33684)
@@ -1066,5 +1066,4 @@
         {
             BOOLEAN bDpcQueued = pDevExt->u.primary.DxgkInterface.DxgkCbQueueDpc(pDevExt->u.primary.DxgkInterface.DeviceHandle);
-            Assert(bDpcQueued);
         }
     }
@@ -2871,7 +2870,4 @@
                     if (pBuildPagingBuffer->Transfer.Source.SegmentId)
                     {
-#ifdef DEBUG_misha
-                        Assert(pBuildPagingBuffer->Transfer.Source.SegmentAddress.QuadPart);
-#endif
                         uint64_t off = pBuildPagingBuffer->Transfer.Source.SegmentAddress.QuadPart;
                         off += pBuildPagingBuffer->Transfer.TransferOffset + cbTransfered;
@@ -2898,7 +2894,4 @@
                     if (pBuildPagingBuffer->Transfer.Destination.SegmentId)
                     {
-#ifdef DEBUG_misha
-                        Assert(pBuildPagingBuffer->Transfer.Destination.SegmentAddress.QuadPart);
-#endif
                         uint64_t off = pBuildPagingBuffer->Transfer.Destination.SegmentAddress.QuadPart;
                         off += pBuildPagingBuffer->Transfer.TransferOffset;
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/context.c
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/context.c	(revision 33683)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/context.c	(revision 33684)
@@ -757,7 +757,4 @@
 {
 #ifdef VBOX_WITH_WDDM
-# ifdef DEBUG_misha
-    Assert(0);
-# endif
     TRACE("Updating context %p window from %p to %p.\n",
             context, context->win_handle, swapchain->win_handle);
@@ -1293,8 +1290,4 @@
     HDC hdc;
 
-#if defined(VBOX_WITH_WDDM) && defined(DEBUG_misha)
-    Assert(0);
-#endif
-
     TRACE("swapchain %p, target %p, window %p.\n", swapchain, target, swapchain->win_handle);
 
@@ -1618,5 +1611,5 @@
     context_setup_target(device, context, target);
     context_enter(context);
-    Assert(context->valid);
+//    Assert(context->valid);
     if (!context->valid) return FALSE;
 
Index: /trunk/src/VBox/GuestHost/OpenGL/util/error.c
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/util/error.c	(revision 33683)
+++ /trunk/src/VBox/GuestHost/OpenGL/util/error.c	(revision 33684)
@@ -241,5 +241,5 @@
         va_end( args );
 
-#if defined(WINDOWS) && defined(DEBUG) && !defined(IN_GUEST)
+#if defined(WINDOWS) && defined(DEBUG) && !defined(IN_GUEST) && !defined(DEBUG_misha)
         DebugBreak();
 #endif
@@ -322,5 +322,5 @@
             output = stderr;
         }
-#ifndef DEBUG
+#if !defined(DEBUG) || defined(DEBUG_misha)
         /* Release mode: only emit crDebug messages if CR_DEBUG
          * or CR_DEBUG_FILE is set.
Index: /trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c	(revision 33683)
+++ /trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c	(revision 33684)
@@ -50,4 +50,10 @@
 #endif
 
+#ifdef DEBUG_misha
+#ifdef CRASSERT
+# undef CRASSERT
+#endif
+#define CRASSERT Assert
+#endif
 //#define IN_GUEST
 //#if defined(IN_GUEST)
@@ -1378,5 +1384,5 @@
         if (RT_SUCCESS(rc))
         {
-            rc = pHgsmi->pfnBufferCreate(pHgsmi, CRVBOXHGSMI_PAGE_ALIGN(0x800000),
+            rc = pHgsmi->pfnBufferCreate(pHgsmi, CRVBOXHGSMI_PAGE_ALIGN(1),
                                             VBOXUHGSMI_SYNCHOBJECT_TYPE_EVENT,
                                             NULL,
@@ -1389,4 +1395,5 @@
                 return (HVBOXCRHGSMI_CLIENT) pClient;
             }
+            pClient->pCmdBuffer->pfnDestroy(pClient->pCmdBuffer);
         }
     }
