Index: trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/context.c
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/context.c	(revision 48979)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/context.c	(revision 48999)
@@ -1806,4 +1806,8 @@
             goto out;
         }
+
+#ifdef VBOX_WITH_WDDM
+        pVBoxCtxChromiumParameteriCR(ctx, GL_HOST_WND_CREATED_HIDDEN_CR,  GL_TRUE);
+#endif
 
 #ifndef VBOX
Index: trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/directx.c
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/directx.c	(revision 48979)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/directx.c	(revision 48999)
@@ -402,4 +402,8 @@
         goto fail;
     }
+
+#ifdef VBOX_WITH_WDDM
+        pVBoxCtxChromiumParameteriCR(ctx->gl_ctx, GL_HOST_WND_CREATED_HIDDEN_CR,  GL_TRUE);
+#endif
 
     /* Make it the current GL context. */
Index: trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/wined3d_gl.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/wined3d_gl.h	(revision 48979)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/wined3d_gl.h	(revision 48999)
@@ -192,4 +192,5 @@
 
 HGLRC (WINAPI *pVBoxCreateContext)(HDC, struct VBOXUHGSMI*) DECLSPEC_HIDDEN;
+void (WINAPI *pVBoxCtxChromiumParameteriCR)(HGLRC , GLenum , GLint) DECLSPEC_HIDDEN;
 void (WINAPI *pVBoxFlushToHost)(HGLRC) DECLSPEC_HIDDEN;
 GLint (WINAPI *pVBoxGetWindowId)(HDC)  DECLSPEC_HIDDEN;
@@ -201,4 +202,5 @@
 # define VBOX_GL_FUNCS_GEN \
         VBOX_USE_FUNC(VBoxCreateContext) \
+        VBOX_USE_FUNC(VBoxCtxChromiumParameteriCR) \
         VBOX_USE_FUNC(VBoxFlushToHost) \
         VBOX_USE_FUNC(VBoxGetWindowId) \
Index: trunk/src/VBox/Additions/common/crOpenGL/context.c
===================================================================
--- trunk/src/VBox/Additions/common/crOpenGL/context.c	(revision 48979)
+++ trunk/src/VBox/Additions/common/crOpenGL/context.c	(revision 48999)
@@ -106,4 +106,12 @@
     }
 #endif
+}
+
+void stubConChromiumParameteriCR(GLint con, GLenum param, GLint value)
+{
+    if (con)
+        stub.spu->dispatch_table.VBoxConChromiumParameteriCR(con, param, value);
+    else
+        crError("VBoxConChromiumParameteriCR called with null connection");
 }
 
@@ -1099,4 +1107,48 @@
 }
 
+GLboolean stubCtxCreate(ContextInfo *context)
+{
+    /*
+     * Create a Chromium context.
+     */
+#if defined(GLX) || defined(DARWIN)
+    GLint spuShareCtx = context->share ? context->share->spuContext : 0;
+#else
+    GLint spuShareCtx = 0;
+#endif
+    GLint spuConnection = 0;
+    CRASSERT(stub.spu);
+    CRASSERT(stub.spu->dispatch_table.CreateContext);
+    context->type = CHROMIUM;
+
+#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
+    if (context->pHgsmi)
+    {
+        spuConnection = stub.spu->dispatch_table.VBoxConCreate(context->pHgsmi);
+        if (!spuConnection)
+        {
+            crWarning("VBoxConCreate failed");
+            return GL_FALSE;
+        }
+        context->spuConnection = spuConnection;
+    }
+#endif
+
+    context->spuContext
+        = stub.spu->dispatch_table.VBoxCreateContext(spuConnection, context->dpyName,
+                                            context->visBits,
+                                            spuShareCtx);
+
+    return GL_TRUE;
+}
+
+GLboolean stubCtxCheckCreate(ContextInfo *context)
+{
+    if (context->type == UNDECIDED)
+        return stubCtxCreate(context);
+    return CHROMIUM == context->type;
+}
+
+
 GLboolean
 stubMakeCurrent( WindowInfo *window, ContextInfo *context )
@@ -1129,40 +1181,20 @@
 
         if (stubCheckUseChromium(window)) {
-            /*
-             * Create a Chromium context.
-             */
-#if defined(GLX) || defined(DARWIN)
-            GLint spuShareCtx = context->share ? context->share->spuContext : 0;
-#else
-            GLint spuShareCtx = 0;
-#endif
             GLint spuConnection = 0;
-            CRASSERT(stub.spu);
-            CRASSERT(stub.spu->dispatch_table.CreateContext);
-            context->type = CHROMIUM;
+
+            if (!stubCtxCreate(context))
+            {
+                crWarning("stubCtxCreate failed");
+                return GL_FALSE;
+            }
 
 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
-            if (context->pHgsmi)
-            {
-                spuConnection = stub.spu->dispatch_table.VBoxConCreate(context->pHgsmi);
-                if (!spuConnection)
-                {
-                    crWarning("VBoxConCreate failed");
-                    return GL_FALSE;
-                }
-                context->spuConnection = spuConnection;
-            }
-#endif
-
-            context->spuContext
-                = stub.spu->dispatch_table.VBoxCreateContext(spuConnection, context->dpyName,
-                                                    context->visBits,
-                                                    spuShareCtx);
+            spuConnection = context->spuConnection;
+#endif
+
             if (window->spuWindow == -1)
             {
                 /*crDebug("(1)stubMakeCurrent ctx=%p(%i) window=%p(%i)", context, context->spuContext, window, window->spuWindow);*/
-                window->spuWindow = stub.spu->dispatch_table.VBoxWindowCreate(
-                        spuConnection,
-                        window->dpyName, context->visBits );
+                window->spuWindow = stub.spu->dispatch_table.VBoxWindowCreate(spuConnection, window->dpyName, context->visBits );
 #ifdef CR_NEWWINTRACK
                 window->u32ClientID = stub.spu->dispatch_table.VBoxPackGetInjectID(spuConnection);
Index: trunk/src/VBox/Additions/common/crOpenGL/defs.py
===================================================================
--- trunk/src/VBox/Additions/common/crOpenGL/defs.py	(revision 48979)
+++ trunk/src/VBox/Additions/common/crOpenGL/defs.py	(revision 48999)
@@ -498,4 +498,5 @@
 crGetProcAddress
 VBoxCreateContext
+VBoxCtxChromiumParameteriCR
 VBoxGetWindowId
 VBoxGetContextId
Index: trunk/src/VBox/Additions/common/crOpenGL/defs64.py
===================================================================
--- trunk/src/VBox/Additions/common/crOpenGL/defs64.py	(revision 48979)
+++ trunk/src/VBox/Additions/common/crOpenGL/defs64.py	(revision 48999)
@@ -478,4 +478,5 @@
 crGetProcAddress
 VBoxCreateContext
+VBoxCtxChromiumParameteriCR
 VBoxGetWindowId
 VBoxGetContextId
Index: trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_context.c
===================================================================
--- trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_context.c	(revision 48979)
+++ trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_context.c	(revision 48999)
@@ -185,4 +185,62 @@
 }
 
+GLvoid PACKSPU_APIENTRY
+packspu_VBoxConChromiumParameteriCR(GLint con, GLenum param, GLint value)
+{
+    GET_THREAD(thread);
+    CRPackContext * curPacker = crPackGetContext();
+    ThreadInfo *curThread = thread;
+    int writeback = 1;
+    GLint serverCtx = (GLint) -1;
+    int slot;
+
+    CRASSERT(!curThread == !curPacker);
+    CRASSERT(!curThread || !curPacker || curThread->packer == curPacker);
+#ifdef CHROMIUM_THREADSAFE
+    crLockMutex(&_PackMutex);
+#endif
+
+#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
+    CRASSERT(!con == !CRPACKSPU_IS_WDDM_CRHGSMI());
+#endif
+
+    if (CRPACKSPU_IS_WDDM_CRHGSMI())
+    {
+        if (!con)
+        {
+            crError("connection should be specified!");
+            return -1;
+        }
+        thread = GET_THREAD_VAL_ID(con);
+    }
+    else
+    {
+        CRASSERT(!con);
+        if (!thread)
+        {
+            thread = packspuNewThread(
+#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
+                NULL
+#endif
+                );
+        }
+    }
+    CRASSERT(thread);
+    CRASSERT(thread->packer);
+
+    crPackSetContext( thread->packer );
+
+    packspu_ChromiumParameteriCR(param, value);
+
+#ifdef CHROMIUM_THREADSAFE
+    crUnlockMutex(&_PackMutex);
+#endif
+
+    if (CRPACKSPU_IS_WDDM_CRHGSMI())
+    {
+        /* restore the packer context to the tls */
+        crPackSetContext(curPacker);
+    }
+}
 
 GLint PACKSPU_APIENTRY
Index: trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_special
===================================================================
--- trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_special	(revision 48979)
+++ trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_special	(revision 48999)
@@ -108,4 +108,5 @@
 VBoxDetachThread
 VBoxCreateContext
+VBoxConChromiumParameteriCR
 VBoxWindowCreate
 VBoxWindowDestroy
Index: trunk/src/VBox/Additions/common/crOpenGL/stub.h
===================================================================
--- trunk/src/VBox/Additions/common/crOpenGL/stub.h	(revision 48979)
+++ trunk/src/VBox/Additions/common/crOpenGL/stub.h	(revision 48999)
@@ -343,4 +343,7 @@
 #endif
         );
+extern void stubConChromiumParameteriCR(GLint con, GLenum param, GLint value);
+extern GLboolean stubCtxCreate(ContextInfo *context);
+extern GLboolean stubCtxCheckCreate(ContextInfo *context);
 extern void stubDestroyContext( unsigned long contextId );
 extern GLboolean stubMakeCurrent( WindowInfo *window, ContextInfo *context );
@@ -348,5 +351,5 @@
 extern void stubDestroyWindow( GLint con, GLint window );
 extern void stubSwapBuffers(WindowInfo *window, GLint flags);
-extern void stubGetWindowGeometry(WindowInfo *win, int *x, int *y, unsigned int *w, unsigned int *h);
+extern void stubGetWindowGeometry(const WindowInfo *win, int *x, int *y, unsigned int *w, unsigned int *h);
 extern GLboolean stubUpdateWindowGeometry(WindowInfo *pWindow, GLboolean bForceUpdate);
 extern GLboolean stubIsWindowVisible(WindowInfo *win);
Index: trunk/src/VBox/Additions/common/crOpenGL/wgl.c
===================================================================
--- trunk/src/VBox/Additions/common/crOpenGL/wgl.c	(revision 48979)
+++ trunk/src/VBox/Additions/common/crOpenGL/wgl.c	(revision 48999)
@@ -296,4 +296,26 @@
 }
 
+DECLEXPORT(void) WINAPI VBoxCtxChromiumParameteriCR(HGLRC hglrc, GLenum param, GLint value)
+{
+    ContextInfo *context;
+
+    CR_DDI_PROLOGUE();
+
+//    crHashtableLock(stub.windowTable);
+    crHashtableLock(stub.contextTable);
+
+    context = (ContextInfo *) crHashtableSearch(stub.contextTable, (unsigned long) hglrc);
+
+    if (context)
+    {
+        stubCtxCheckCreate(context);
+        stubConChromiumParameteriCR(CR_CTX_CON(context), param, value);
+    }
+    else
+        crWarning("invalid context %#x", hglrc);
+
+    crHashtableUnlock(stub.contextTable);
+//    crHashtableUnlock(stub.windowTable);
+}
 
 DECLEXPORT(HGLRC) WINAPI VBoxCreateContext( HDC hdc, struct VBOXUHGSMI *pHgsmi )
@@ -410,4 +432,6 @@
     if (context)
         stubConFlush(CR_CTX_CON(context));
+    else
+        crWarning("invalid context %#x", hglrc);
 
     crHashtableUnlock(stub.contextTable);
