Index: trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.h	(revision 53206)
+++ trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.h	(revision 53206)
@@ -0,0 +1,40 @@
+/** @file
+ * VirtualBox OpenGL Cocoa Window System Helper Implementation.
+ */
+
+/*
+ * Copyright (C) 2014 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __DevVGA_SVGA3d_cocoa_h
+#define __DevVGA_SVGA3d_cocoa_h
+
+#include <iprt/cdefs.h>
+#include <VBox/VBoxCocoa.h>
+#include <OpenGL/OpenGL.h>
+
+RT_C_DECLS_BEGIN
+
+ADD_COCOA_NATIVE_REF(NSView);
+ADD_COCOA_NATIVE_REF(NSOpenGLContext);
+
+__attribute__ ((visibility("default"))) void vmsvga3dCocoaCreateContext(NativeNSOpenGLContextRef *ppCtx, NativeNSOpenGLContextRef pShareCtx);
+__attribute__ ((visibility("default"))) void vmsvga3dCocoaDestroyContext(NativeNSOpenGLContextRef pCtrx);
+__attribute__ ((visibility("default"))) void vmsvga3dCocoaCreateView(NativeNSViewRef *ppView, NativeNSViewRef pParentView);
+__attribute__ ((visibility("default"))) void vmsvga3dCocoaDestroyView(NativeNSViewRef pView);
+__attribute__ ((visibility("default"))) void vmsvga3dCocoaViewSetPosition(NativeNSViewRef pView, NativeNSViewRef pParentView, int x, int y);
+__attribute__ ((visibility("default"))) void vmsvga3dCocoaViewSetSize(NativeNSViewRef pView, int w, int h);
+__attribute__ ((visibility("default"))) void vmsvga3dCocoaViewMakeCurrentContext(NativeNSViewRef pView, NativeNSOpenGLContextRef pCtx);
+__attribute__ ((visibility("default"))) void vmsvga3dCocoaSwapBuffers(NativeNSOpenGLContextRef pCtx);
+
+RT_C_DECLS_END
+
+#endif /* !__DevVGA_SVGA3d_cocoa_h */
Index: trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.m
===================================================================
--- trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.m	(revision 53206)
+++ trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.m	(revision 53206)
@@ -0,0 +1,575 @@
+/** @file
+ * VirtualBox OpenGL Cocoa Window System Helper Implementation.
+ */
+
+/*
+ * Copyright (C) 2009-2014 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#include "DevVGA-SVGA3d-cocoa.h"
+#import <Cocoa/Cocoa.h>
+#import <OpenGL/gl.h>
+
+#include <iprt/thread.h>
+
+# define DEBUG_MSG(text) \
+    do {} while (0)
+#ifdef DEBUG_VERBOSE
+# define DEBUG_MSG_1(text) \
+    DEBUG_MSG(text)
+#else
+# define DEBUG_MSG_1(text) \
+    do {} while (0)
+#endif
+
+# define CHECK_GL_ERROR()\
+    do {} while (0)
+
+/** Custom OpenGL context class.
+ *
+ * This implementation doesn't allow to set a view to the
+ * context, but save the view for later use. Also it saves a copy of the
+ * pixel format used to create that context for later use. */
+@interface VMSVGA3DOpenGLContext: NSOpenGLContext
+{
+@private
+    NSOpenGLPixelFormat *m_pPixelFormat;
+    NSView              *m_pView;
+}
+- (NSOpenGLPixelFormat*)openGLPixelFormat;
+@end
+
+@interface VMSVGA3DOverlayView: NSView
+{
+@private
+    NSView          *m_pParentView;
+    NSWindow        *m_pOverlayWin;
+    
+    NSOpenGLContext *m_pGLCtx;
+    
+    /* position/size */
+    NSPoint          m_Pos;
+    NSSize           m_Size;
+    
+    /** This is necessary for clipping on the root window */
+    NSRect           m_RootRect;
+    float            m_yInvRootOffset;
+}
+- (id)initWithFrame:(NSRect)frame parentView:(NSView*)pparentView;
+- (void)setGLCtx:(NSOpenGLContext*)pCtx;
+- (NSOpenGLContext*)glCtx;
+- (void)setOverlayWin: (NSWindow*)win;
+- (NSWindow*)overlayWin;
+- (void)setPos:(NSPoint)pos;
+- (NSPoint)pos;
+- (void)setSize:(NSSize)size;
+- (NSSize) size;
+- (void)updateViewportCS;
+- (void)reshape;
+@end
+
+/** Helper view.
+ *
+ * This view is added as a sub view of the parent view to track
+ * main window changes. Whenever the main window is changed
+ * (which happens on fullscreen/seamless entry/exit) the overlay
+ * window is informed & can add them self as a child window
+ * again. */
+@class VMSVGA3DOverlayWindow;
+@interface VMSVGA3DOverlayHelperView: NSView
+{
+@private
+    VMSVGA3DOverlayWindow *m_pOverlayWindow;
+}
+-(id)initWithOverlayWindow:(VMSVGA3DOverlayWindow*)pOverlayWindow;
+@end
+
+/** Custom window class.
+ *
+ * This is the overlay window which contains our custom NSView.
+ * Its a direct child of the Qt Main window. It marks its background
+ * transparent & non opaque to make clipping possible. It also disable mouse
+ * events and handle frame change events of the parent view. */
+@interface VMSVGA3DOverlayWindow: NSWindow
+{
+@private
+    NSView                    *m_pParentView;
+    VMSVGA3DOverlayView       *m_pOverlayView;
+    VMSVGA3DOverlayHelperView *m_pOverlayHelperView;
+    NSThread                  *m_Thread;
+}
+- (id)initWithParentView:(NSView*)pParentView overlayView:(VMSVGA3DOverlayView*)pOverlayView;
+- (void)parentWindowFrameChanged:(NSNotification *)note;
+- (void)parentWindowChanged:(NSWindow*)pWindow;
+@end
+
+
+/********************************************************************************
+*
+* VMSVGA3DOpenGLContext class implementation
+*
+********************************************************************************/
+@implementation VMSVGA3DOpenGLContext
+
+-(id)initWithFormat:(NSOpenGLPixelFormat*)format shareContext:(NSOpenGLContext*)share
+{
+    m_pPixelFormat = NULL;
+    m_pView = NULL;
+
+    self = [super initWithFormat:format shareContext:share];
+    if (self)
+        m_pPixelFormat = format;
+
+    DEBUG_MSG(("OCTX(%p): init VMSVGA3DOpenGLContext\n", (void*)self));
+
+    return self;
+}
+
+- (void)dealloc
+{
+    DEBUG_MSG(("OCTX(%p): dealloc VMSVGA3DOpenGLContext\n", (void*)self));
+
+    [m_pPixelFormat release];
+
+    [super dealloc];
+}
+
+-(bool)isDoubleBuffer
+{
+    GLint val;
+    [m_pPixelFormat getValues:&val forAttribute:NSOpenGLPFADoubleBuffer forVirtualScreen:0];
+    return val == 1 ? YES : NO;
+}
+
+-(void)setView:(NSView*)view
+{
+    DEBUG_MSG(("OCTX(%p): setView: new view: %p\n", (void*)self, (void*)view));
+
+    m_pView = view;
+}
+
+-(NSView*)view
+{
+    return m_pView;
+}
+
+-(void)clearDrawable
+{
+    DEBUG_MSG(("OCTX(%p): clearDrawable\n", (void*)self));
+
+    m_pView = NULL;;
+    [super clearDrawable];
+}
+
+-(NSOpenGLPixelFormat*)openGLPixelFormat
+{
+    return m_pPixelFormat;
+}
+
+@end
+
+
+
+@implementation VMSVGA3DOverlayView
+
+- (id)initWithFrame:(NSRect) frame parentView:(NSView*)pParentView
+{
+    m_pParentView    = pParentView;
+    m_pGLCtx         = nil;
+    m_Pos            = NSZeroPoint;
+    m_Size           = NSMakeSize(1, 1);
+    m_RootRect       = NSMakeRect(0, 0, m_Size.width, m_Size.height);
+    m_yInvRootOffset = 0;
+    
+    self = [super initWithFrame: frame];
+    
+    return self;
+}
+
+- (void)setGLCtx:(NSOpenGLContext*)pCtx
+{
+    if (m_pGLCtx == pCtx)
+        return;
+    if (m_pGLCtx)
+        [m_pGLCtx clearDrawable];
+    m_pGLCtx = pCtx;
+}
+
+- (NSOpenGLContext*)glCtx
+{
+    return m_pGLCtx;
+}
+
+- (void)setOverlayWin:(NSWindow*)pWin
+{
+    m_pOverlayWin = pWin;
+}
+
+- (NSWindow*)overlayWin
+{
+    return m_pOverlayWin;
+}
+
+- (void)setPos:(NSPoint)pos
+{
+    m_Pos = pos;
+    [self reshape];
+}
+
+- (NSPoint)pos
+{
+    return m_Pos;
+}
+
+- (void)setSize:(NSSize)size
+{
+    m_Size = size;
+    [self reshape];
+}
+
+- (NSSize)size
+{
+    return m_Size;
+}
+
+- (void)updateViewportCS
+{
+    DEBUG_MSG(("OVIW(%p): updateViewport\n", (void*)self));
+
+    /* Update the viewport for our OpenGL view */
+/*    [m_pSharedGLCtx update]; */
+        
+    /* Clear background to transparent */
+//    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+- (void)reshape
+{
+    NSRect parentFrame = NSZeroRect;
+    NSPoint parentPos  = NSZeroPoint;
+    NSPoint childPos   = NSZeroPoint;
+    NSRect childFrame  = NSZeroRect;
+    NSRect newFrame    = NSZeroRect;
+
+    DEBUG_MSG(("OVIW(%p): reshape\n", (void*)self));
+
+    /* Getting the right screen coordinates of the parents frame is a little bit
+     * complicated. */
+    parentFrame = [m_pParentView frame];
+    parentPos = [[m_pParentView window] convertBaseToScreen:[[m_pParentView superview] convertPointToBase:NSMakePoint(parentFrame.origin.x, parentFrame.origin.y + parentFrame.size.height)]];
+    parentFrame.origin.x = parentPos.x;
+    parentFrame.origin.y = parentPos.y;
+
+    /* Calculate the new screen coordinates of the overlay window. */
+    childPos = NSMakePoint(m_Pos.x, m_Pos.y + m_Size.height);
+    childPos = [[m_pParentView window] convertBaseToScreen:[[m_pParentView superview] convertPointToBase:childPos]];
+
+    /* Make a frame out of it. */
+    childFrame = NSMakeRect(childPos.x, childPos.y, m_Size.width, m_Size.height);
+
+    /* We have to make sure that the overlay window will not be displayed out
+     * of the parent window. So intersect both frames & use the result as the new
+     * frame for the window. */
+    newFrame = NSIntersectionRect(parentFrame, childFrame);
+
+    DEBUG_MSG(("[%#p]: parentFrame pos[%f : %f] size[%f : %f]\n",
+          (void*)self, 
+         parentFrame.origin.x, parentFrame.origin.y,
+         parentFrame.size.width, parentFrame.size.height));
+    DEBUG_MSG(("[%#p]: childFrame pos[%f : %f] size[%f : %f]\n",
+          (void*)self, 
+         childFrame.origin.x, childFrame.origin.y,
+         childFrame.size.width, childFrame.size.height));
+         
+    DEBUG_MSG(("[%#p]: newFrame pos[%f : %f] size[%f : %f]\n",
+          (void*)self, 
+         newFrame.origin.x, newFrame.origin.y,
+         newFrame.size.width, newFrame.size.height));
+    
+    /* Later we have to correct the texture position in the case the window is
+     * out of the parents window frame. So save the shift values for later use. */ 
+    m_RootRect.origin.x = newFrame.origin.x - childFrame.origin.x;
+    m_RootRect.origin.y =  childFrame.size.height + childFrame.origin.y - (newFrame.size.height + newFrame.origin.y);
+    m_RootRect.size = newFrame.size;
+    m_yInvRootOffset = newFrame.origin.y - childFrame.origin.y;
+    
+    DEBUG_MSG(("[%#p]: m_RootRect pos[%f : %f] size[%f : %f]\n",
+         (void*)self, 
+         m_RootRect.origin.x, m_RootRect.origin.y,
+         m_RootRect.size.width, m_RootRect.size.height));
+
+    /* Set the new frame. */
+    [[self window] setFrame:newFrame display:YES];
+
+#if 0
+    /* Make sure the context is updated according */
+    /* [self updateViewport]; */
+    if (m_pSharedGLCtx)
+    {
+        VBOX_CR_RENDER_CTX_INFO CtxInfo; 
+        vboxCtxEnter(m_pSharedGLCtx, &CtxInfo);
+    
+        [self updateViewportCS];
+    
+        vboxCtxLeave(&CtxInfo);
+    }
+#endif
+}
+
+@end
+
+/********************************************************************************
+*
+* VMSVGA3DOverlayHelperView class implementation
+*
+********************************************************************************/
+@implementation VMSVGA3DOverlayHelperView
+
+-(id)initWithOverlayWindow:(VMSVGA3DOverlayWindow*)pOverlayWindow
+{
+    self = [super initWithFrame:NSZeroRect];
+
+    m_pOverlayWindow = pOverlayWindow;
+
+    return self;
+}
+
+-(void)viewDidMoveToWindow
+{
+    DEBUG_MSG(("OHVW(%p): viewDidMoveToWindow: new win: %p\n", (void*)self, (void*)[self window]));
+
+    [m_pOverlayWindow parentWindowChanged:[self window]];
+}
+
+@end
+
+
+/********************************************************************************
+*
+* VMSVGA3DOverlayWindow class implementation
+*
+********************************************************************************/
+@implementation VMSVGA3DOverlayWindow
+
+- (id)initWithParentView:(NSView*)pParentView overlayView:(VMSVGA3DOverlayView*)pOverlayView
+{
+    NSWindow *pParentWin = nil;
+
+    if((self = [super initWithContentRect:NSZeroRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]))
+    {
+        m_pParentView = pParentView;
+        m_pOverlayView = pOverlayView;
+        m_Thread = [NSThread currentThread];
+
+        [m_pOverlayView setOverlayWin: self];
+
+        m_pOverlayHelperView = [[VMSVGA3DOverlayHelperView alloc] initWithOverlayWindow:self];
+        /* Add the helper view as a child of the parent view to get notifications */
+        [pParentView addSubview:m_pOverlayHelperView];
+
+        /* Make sure this window is transparent */
+#ifdef SHOW_WINDOW_BACKGROUND
+        /* For debugging */
+        [self setBackgroundColor:[NSColor colorWithCalibratedRed:1.0 green:0.0 blue:0.0 alpha:0.7]];
+#else
+        [self setBackgroundColor:[NSColor clearColor]];
+#endif
+        [self setOpaque:NO];
+        [self setAlphaValue:.999];
+        /* Disable mouse events for this window */
+        [self setIgnoresMouseEvents:YES];
+
+        pParentWin = [m_pParentView window];
+
+        /* Initial set the position to the parents view top/left (Compiz fix). */
+        [self setFrameOrigin:
+            [pParentWin convertBaseToScreen:
+                [m_pParentView convertPoint:NSZeroPoint toView:nil]]];
+
+        /* Set the overlay view as our content view */
+        [self setContentView:m_pOverlayView];
+
+        /* Add ourself as a child to the parent views window. Note: this has to
+         * be done last so that everything else is setup in
+         * parentWindowChanged. */
+        [pParentWin addChildWindow:self ordered:NSWindowAbove];
+    }
+    DEBUG_MSG(("OWIN(%p): init OverlayWindow\n", (void*)self));
+
+    return self;
+}
+
+- (void)dealloc
+{
+    DEBUG_MSG(("OWIN(%p): dealloc OverlayWindow\n", (void*)self));
+
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+
+    [m_pOverlayHelperView removeFromSuperview];
+    [m_pOverlayHelperView release];
+
+    [super dealloc];
+}
+
+- (void)parentWindowFrameChanged:(NSNotification*)pNote
+{
+    DEBUG_MSG(("OWIN(%p): parentWindowFrameChanged\n", (void*)self));
+
+    [m_pOverlayView reshape];
+}
+
+- (void)parentWindowChanged:(NSWindow*)pWindow
+{
+    DEBUG_MSG(("OWIN(%p): parentWindowChanged\n", (void*)self));
+
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+
+    if(pWindow != nil)
+    {
+        /* Ask to get notifications when our parent window frame changes. */
+        [[NSNotificationCenter defaultCenter]
+            addObserver:self
+            selector:@selector(parentWindowFrameChanged:)
+            name:NSWindowDidResizeNotification
+            object:pWindow];
+        /* Add us self as child window */
+        [pWindow addChildWindow:self ordered:NSWindowAbove];
+        [m_pOverlayView reshape];
+    }
+}
+
+@end
+
+
+void vmsvga3dCocoaCreateContext(NativeNSOpenGLContextRef *ppCtx, NativeNSOpenGLContextRef pShareCtx)
+{
+    NSOpenGLPixelFormat *pFmt = nil;
+
+    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
+
+#if 1
+    NSOpenGLPixelFormatAttribute attribs[] =
+    {
+        NSOpenGLPFAWindow,
+        NSOpenGLPFADoubleBuffer,
+        NSOpenGLPFAAccelerated,
+        NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute)24,
+        NSOpenGLPFAAlphaSize, (NSOpenGLPixelFormatAttribute)8,
+        NSOpenGLPFADepthSize, (NSOpenGLPixelFormatAttribute)24,
+        0
+    };
+#else
+    NSOpenGLPixelFormatAttribute attribs[] =
+    {
+        NSOpenGLPFADoubleBuffer,
+        NSOpenGLPFAAccelerated,
+        NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute)24,
+        NSOpenGLPFADepthSize, 24,
+        NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core,
+        0
+    };
+#endif
+
+    /* Choose a pixel format */
+    pFmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs];
+
+    if (pFmt)
+    {
+        *ppCtx = [[VMSVGA3DOpenGLContext alloc] initWithFormat:pFmt shareContext:pShareCtx];
+        DEBUG_MSG(("New context %X\n", (uint)*ppCtx));
+    }
+
+    [pPool release];
+}
+
+void vmsvga3dCocoaDestroyContext(NativeNSOpenGLContextRef pCtx)
+{
+    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
+    [pCtx release];
+    [pPool release];
+}
+
+void vmsvga3dCocoaCreateView(NativeNSViewRef *ppView, NativeNSViewRef pParentView)
+{
+    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
+    
+    /* Create our worker view */
+    VMSVGA3DOverlayView* pView = [[VMSVGA3DOverlayView alloc] initWithFrame:NSZeroRect parentView:pParentView];
+
+    if (pView)
+    {
+        /* We need a real window as container for the view */
+        [[VMSVGA3DOverlayWindow alloc] initWithParentView:pParentView overlayView:pView];
+        /* Return the freshly created overlay view */
+        *ppView = pView;
+    }
+    
+    [pPool release];
+}
+
+void vmsvga3dCocoaDestroyView(NativeNSViewRef pView)
+{
+    NSWindow *pWin = nil;
+    
+    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
+    [pView setHidden: YES];
+    
+    [pWin release];
+    [pView release];
+    [pPool release];
+}
+
+void vmsvga3dCocoaViewSetPosition(NativeNSViewRef pView, NativeNSViewRef pParentView, int x, int y)
+{
+    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
+
+    [(VMSVGA3DOverlayView*)pView setPos:NSMakePoint(x, y)];
+
+    [pPool release];
+}
+
+void vmsvga3dCocoaViewSetSize(NativeNSViewRef pView, int w, int h)
+{
+    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
+
+    [(VMSVGA3DOverlayView*)pView setSize:NSMakeSize(w, h)];
+
+    [pPool release];
+}
+
+void vmsvga3dCocoaViewMakeCurrentContext(NativeNSViewRef pView, NativeNSOpenGLContextRef pCtx)
+{
+    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
+
+    DEBUG_MSG(("cocoaViewMakeCurrentContext(%p, %p)\n", (void*)pView, (void*)pCtx));
+
+    if (pView)
+    {
+        [(VMSVGA3DOverlayView*)pView setGLCtx:pCtx];
+//        [(VMSVGA3DOverlayView*)pView makeCurrentFBO];
+        [pCtx makeCurrentContext];
+    }
+    else
+    {
+    	[NSOpenGLContext clearCurrentContext];
+    }
+
+    [pPool release];
+}
+
+void vmsvga3dCocoaSwapBuffers(NativeNSOpenGLContextRef pCtx)
+{
+    NSAutoreleasePool *pPool = [[NSAutoreleasePool alloc] init];
+    
+    [pCtx flushBuffer];
+    
+    [pPool release];
+}
Index: trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
===================================================================
--- trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp	(revision 53206)
+++ trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp	(revision 53206)
@@ -0,0 +1,6188 @@
+/** @file
+ * DevVMWare - VMWare SVGA device
+ */
+
+/*
+ * Copyright (C) 2013 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#define LOG_GROUP LOG_GROUP_DEV_VMSVGA
+#include <VBox/vmm/pdmdev.h>
+#include <VBox/version.h>
+#include <VBox/err.h>
+#include <VBox/log.h>
+#include <VBox/vmm/pgm.h>
+
+#include <iprt/assert.h>
+#include <iprt/semaphore.h>
+#include <iprt/uuid.h>
+#include <iprt/mem.h>
+#include <iprt/avl.h>
+
+#include <VBox/VMMDev.h>
+#include <VBox/VBoxVideo.h>
+#include <VBox/bioslogo.h>
+
+/* should go BEFORE any other DevVGA include to make all DevVGA.h config defines be visible */
+#include "DevVGA.h"
+
+#include "DevVGA-SVGA.h"
+#include "DevVGA-SVGA3d.h"
+#include "vmsvga/svga_reg.h"
+#include "vmsvga/svga3d_reg.h"
+#include "vmsvga/svga3d_shaderdefs.h"
+#ifdef RT_OS_WINDOWS
+#include <GL/gl.h>
+#include "vmsvga_glext/wglext.h"
+#elif RT_OS_DARWIN
+#include <OpenGL/OpenGL.h>
+#include <OpenGL/gl3.h>
+#include <OpenGL/gl3ext.h>
+#define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
+#include <OpenGL/gl.h>
+#include <OpenGL/glext.h>
+#include "DevVGA-SVGA3d-cocoa.h"
+/* work around conflicting definition of GLhandleARB in VMware's glext.h */
+//#define GL_ARB_shader_objects
+// HACK
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+#define GL_RGBA_S3TC 0x83A2
+#define GL_ALPHA8_EXT 0x803c
+#define GL_LUMINANCE8_EXT 0x8040
+#define GL_LUMINANCE16_EXT 0x8042
+#define GL_LUMINANCE4_ALPHA4_EXT 0x8043
+#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
+#define GL_INT_2_10_10_10_REV 0x8D9F
+#else
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <GL/gl.h>
+#include <GL/glx.h>
+#include <GL/glext.h>
+//HACK FOR NOW
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
+#endif
+#include "vmsvga_glext/glext.h"
+
+#include "shaderlib/shaderlib.h"
+
+#include <stdlib.h>
+#include <math.h>
+#include <float.h>
+
+#ifdef RT_OS_WINDOWS
+#define OGLGETPROCADDRESS       wglGetProcAddress
+#elif RT_OS_DARWIN
+#include <dlfcn.h>
+void *MyNSGLGetProcAddress(const char *name)
+{
+    static void *image = NULL;
+    if (image == NULL)
+        image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY);
+    return (image ? dlsym(image, name) : NULL);
+}
+# define OGLGETPROCADDRESS       MyNSGLGetProcAddress
+#else
+#define OGLGETPROCADDRESS(x)    glXGetProcAddress((const GLubyte *)x)
+#endif
+
+/* Invert y-coordinate for OpenGL's bottom left origin. */
+#define D3D_TO_OGL_Y_COORD(ptrSurface, y_coordinate)                (ptrSurface->pMipmapLevels[0].size.height - (y_coordinate))
+#define D3D_TO_OGL_Y_COORD_MIPLEVEL(ptrMipLevel, y_coordinate)      (ptrMipLevel->size.height - (y_coordinate))
+
+#define OPENGL_INVALID_ID               0
+
+//#define MANUAL_FLIP_SURFACE_DATA
+/* Enable to render the result of DrawPrimitive in a seperate window. */
+//#define DEBUG_GFX_WINDOW
+
+/*******************************************************************************
+*   Structures and Typedefs                                                    *
+*******************************************************************************/
+#define VMSVGA3D_CLEAR_CURRENT_CONTEXT(pState)                          \
+    pState->idActiveContext = OPENGL_INVALID_ID;
+
+#ifdef RT_OS_WINDOWS
+# define VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext)                   \
+    if (pState->idActiveContext != pContext->id)                          \
+    {                                                                     \
+        BOOL makecurret = wglMakeCurrent(pContext->hdc, pContext->hglrc); \
+        Assert(makecurret == TRUE);                                       \
+        pState->idActiveContext = pContext->id;                           \
+    }
+
+#elif RT_OS_DARWIN
+# define VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext) \
+    if (pState->idActiveContext != pContext->id)                        \
+    {                                                                   \
+        vmsvga3dCocoaViewMakeCurrentContext(pContext->cocoaView, pContext->cocoaContext); \
+        pState->idActiveContext = pContext->id;                         \
+    }
+#else
+# define VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext) \
+    if (pState->idActiveContext != pContext->id)                        \
+    {                                                                   \
+        Bool makecurret = glXMakeCurrent(pState->display,              \
+                                         pContext->window,              \
+                                         pContext->glxContext);         \
+        Assert(makecurret == True);                                     \
+        pState->idActiveContext = pContext->id;                         \
+    }
+#endif
+
+#ifdef DEBUG
+# define VMSVGA3D_CHECK_LAST_ERROR(pState, pContext)                        \
+    Assert(pState->idActiveContext == pContext->id);                        \
+    pContext->lastError = glGetError();                                     \
+    AssertMsgReturn(pContext->lastError == GL_NO_ERROR, ("%s (%d): last error 0x%x\n", __FUNCTION__, __LINE__, pContext->lastError), VERR_INTERNAL_ERROR);
+#else
+# define VMSVGA3D_CHECK_LAST_ERROR(pState, pContext)                   ;
+#endif
+
+#ifdef DEBUG
+# define VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext)                   \
+    Assert(pState->idActiveContext == pContext->id);                        \
+    pContext->lastError = glGetError();                                     \
+    AssertMsg(pContext->lastError == GL_NO_ERROR, ("%s (%d): last error 0x%x\n", __FUNCTION__, __LINE__, pContext->lastError));
+#else
+# define VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext)                   ;
+#endif
+
+typedef struct
+{
+    SVGA3dSize              size;
+    uint32_t                cbSurface;
+    uint32_t                cbSurfacePitch;
+    void                   *pSurfaceData;
+    bool                    fDirty;
+} VMSVGA3DMIPMAPLEVEL, *PVMSVGA3DMIPMAPLEVEL;
+
+/**
+ * SSM descriptor table for the VMSVGA3DMIPMAPLEVEL structure.
+ */
+static SSMFIELD const g_aVMSVGA3DMIPMAPLEVELFields[] =
+{
+    SSMFIELD_ENTRY(                 VMSVGA3DMIPMAPLEVEL, size),
+    SSMFIELD_ENTRY(                 VMSVGA3DMIPMAPLEVEL, cbSurface),
+    SSMFIELD_ENTRY(                 VMSVGA3DMIPMAPLEVEL, cbSurfacePitch),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DMIPMAPLEVEL, pSurfaceData),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DMIPMAPLEVEL, fDirty),
+    SSMFIELD_ENTRY_TERM()
+};
+
+typedef struct
+{
+    uint32_t                id;
+    uint32_t                idAssociatedContext;
+    uint32_t                flags;
+    SVGA3dSurfaceFormat     format; 
+    GLint                   internalFormatGL;
+    GLint                   formatGL;
+    GLint                   typeGL;
+    union
+    {
+        GLuint              texture;
+        GLuint              buffer;
+        GLuint              renderbuffer;
+    } oglId;
+    SVGA3dSurfaceFace       faces[SVGA3D_MAX_SURFACE_FACES];
+    uint32_t                cFaces;
+    PVMSVGA3DMIPMAPLEVEL    pMipmapLevels; 
+    uint32_t                multiSampleCount;
+    SVGA3dTextureFilter     autogenFilter;
+    uint32_t                cbBlock;        /* block/pixel size in bytes */
+    /* Dirty state; surface was manually updated. */
+    bool                    fDirty;
+} VMSVGA3DSURFACE, *PVMSVGA3DSURFACE;
+
+/**
+ * SSM descriptor table for the VMSVGA3DSURFACE structure.
+ */
+static SSMFIELD const g_aVMSVGA3DSURFACEFields[] =
+{
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, id),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, idAssociatedContext),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, flags),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, format),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, internalFormatGL),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, formatGL),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, typeGL),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSURFACE, id),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, faces),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, cFaces),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSURFACE, pMipmapLevels),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, multiSampleCount),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, autogenFilter),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, cbBlock),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSURFACE, fDirty),
+    SSMFIELD_ENTRY_TERM()
+};
+
+typedef struct
+{
+    uint32_t                        id;
+    uint32_t                        cid;
+    SVGA3dShaderType                type;
+    uint32_t                        cbData;
+    void                           *pShaderProgram;
+    union
+    {
+        void                       *pVertexShader;
+        void                       *pPixelShader;
+    } u;
+} VMSVGA3DSHADER, *PVMSVGA3DSHADER;
+
+/**
+ * SSM descriptor table for the VMSVGA3DSHADER structure.
+ */
+static SSMFIELD const g_aVMSVGA3DSHADERFields[] =
+{
+    SSMFIELD_ENTRY(                 VMSVGA3DSHADER, id),
+    SSMFIELD_ENTRY(                 VMSVGA3DSHADER, cid),
+    SSMFIELD_ENTRY(                 VMSVGA3DSHADER, type),
+    SSMFIELD_ENTRY(                 VMSVGA3DSHADER, cbData),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSHADER, pShaderProgram),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSHADER, u.pVertexShader),
+    SSMFIELD_ENTRY_TERM()
+};
+
+typedef struct
+{
+    bool        fValid;
+    float       matrix[16];
+} VMSVGATRANSFORMSTATE, *PVMSVGATRANSFORMSTATE;
+
+typedef struct
+{
+    bool            fValid;
+    SVGA3dMaterial  material;
+} VMSVGAMATERIALSTATE, *PVMSVGAMATERIALSTATE;
+
+typedef struct
+{
+    bool            fValid;
+    float           plane[4];
+} VMSVGACLIPPLANESTATE, *PVMSVGACLIPPLANESTATE;
+
+typedef struct
+{
+    bool            fEnabled;
+    bool            fValidData;
+    SVGA3dLightData data;
+} VMSVGALIGHTSTATE, *PVMSVGALIGHTSTATE;
+
+typedef struct
+{
+    bool                    fValid;
+    SVGA3dShaderConstType   ctype;
+    uint32_t                value[4];
+} VMSVGASHADERCONST, *PVMSVGASHADERCONST;
+
+/**
+ * SSM descriptor table for the VMSVGASHADERCONST structure.
+ */
+static SSMFIELD const g_aVMSVGASHADERCONSTFields[] =
+{
+    SSMFIELD_ENTRY(                 VMSVGASHADERCONST, fValid),
+    SSMFIELD_ENTRY(                 VMSVGASHADERCONST, ctype),
+    SSMFIELD_ENTRY(                 VMSVGASHADERCONST, value),
+    SSMFIELD_ENTRY_TERM()
+};
+
+#define VMSVGA3D_UPDATE_SCISSORRECT     RT_BIT(0)
+#define VMSVGA3D_UPDATE_ZRANGE          RT_BIT(1)
+#define VMSVGA3D_UPDATE_VIEWPORT        RT_BIT(2)
+#define VMSVGA3D_UPDATE_VERTEXSHADER    RT_BIT(3)
+#define VMSVGA3D_UPDATE_PIXELSHADER     RT_BIT(4)
+#define VMSVGA3D_UPDATE_TRANSFORM       RT_BIT(5)
+#define VMSVGA3D_UPDATE_MATERIAL        RT_BIT(6)
+
+typedef struct
+{
+    uint32_t                id;
+#ifdef RT_OS_WINDOWS
+    /* Device context of the context window. */
+    HDC                     hdc;
+    /* OpenGL rendering context handle. */
+    HGLRC                   hglrc;
+    /* Device context window handle. */
+    HWND                    hwnd;
+#elif RT_OS_DARWIN
+    /* OpenGL rendering context */
+    NativeNSOpenGLContextRef cocoaContext;
+    NativeNSViewRef          cocoaView;
+#else
+    /** XGL rendering context handle */
+    GLXContext              glxContext;
+    /** Device context window handle */
+    Window                  window;
+    /** flag whether the window is mapped (=visible) */
+    bool                    fMapped;
+#endif
+    /* Framebuffer object associated with this context. */
+    GLuint                  idFramebuffer;
+    /* Read and draw framebuffer objects for various operations. */
+    GLuint                  idReadFramebuffer;
+    GLuint                  idDrawFramebuffer;
+    /* Last GL error recorded. */
+    GLenum                  lastError;
+
+    /* Current active render target (if any) */
+    uint32_t                sidRenderTarget;
+    /* Current selected texture surfaces (if any) */
+    uint32_t                aSidActiveTexture[SVGA3D_MAX_TEXTURE_STAGE];
+    /* Per context pixel and vertex shaders. */
+    uint32_t                cPixelShaders;
+    PVMSVGA3DSHADER         paPixelShader;
+    uint32_t                cVertexShaders;
+    PVMSVGA3DSHADER         paVertexShader;
+    void                   *pShaderContext;
+    /* Keep track of the internal state to be able to recreate the context properly (save/restore, window resize). */
+    struct
+    {
+        uint32_t                u32UpdateFlags;
+
+        SVGA3dRenderState       aRenderState[SVGA3D_RS_MAX];
+        SVGA3dTextureState      aTextureState[SVGA3D_MAX_TEXTURE_STAGE][SVGA3D_TS_MAX];
+        VMSVGATRANSFORMSTATE    aTransformState[SVGA3D_TRANSFORM_MAX];
+        VMSVGAMATERIALSTATE     aMaterial[SVGA3D_FACE_MAX];
+        VMSVGACLIPPLANESTATE    aClipPlane[SVGA3D_CLIPPLANE_MAX];
+        VMSVGALIGHTSTATE        aLightData[SVGA3D_MAX_LIGHTS];
+
+        uint32_t                aRenderTargets[SVGA3D_RT_MAX];
+        SVGA3dRect              RectScissor;
+        SVGA3dRect              RectViewPort;
+        SVGA3dZRange            zRange;
+        uint32_t                shidPixel;
+        uint32_t                shidVertex;
+
+        uint32_t                cPixelShaderConst;
+        PVMSVGASHADERCONST      paPixelShaderConst;
+        uint32_t                cVertexShaderConst;
+        PVMSVGASHADERCONST      paVertexShaderConst;
+    } state;
+} VMSVGA3DCONTEXT, *PVMSVGA3DCONTEXT;
+
+/**
+ * SSM descriptor table for the VMSVGA3DCONTEXT structure.
+ */
+static SSMFIELD const g_aVMSVGA3DCONTEXTFields[] =
+{
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, id),
+#ifdef RT_OS_WINDOWS
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DCONTEXT, hdc),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DCONTEXT, hglrc),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DCONTEXT, hwnd),
+#endif
+
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DCONTEXT, idFramebuffer),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DCONTEXT, idReadFramebuffer),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DCONTEXT, idDrawFramebuffer),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, lastError),
+
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DCONTEXT, sidRenderTarget),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DCONTEXT, aSidActiveTexture),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, cPixelShaders),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DCONTEXT, paPixelShader),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, cVertexShaders),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DCONTEXT, paVertexShader),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DCONTEXT, pShaderContext),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.u32UpdateFlags),
+
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.aRenderState),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.aTextureState),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.aTransformState),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.aMaterial),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.aClipPlane),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.aLightData),
+
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.aRenderTargets),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.RectScissor),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.RectViewPort),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.zRange),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.shidPixel),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.shidVertex),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.cPixelShaderConst),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DCONTEXT, state.paPixelShaderConst),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.cVertexShaderConst),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DCONTEXT, state.paVertexShaderConst),
+    SSMFIELD_ENTRY_TERM()
+};
+
+typedef struct
+{
+#ifdef RT_OS_WINDOWS
+    /** Window Thread. */
+    R3PTRTYPE(RTTHREAD)     pWindowThread;
+    DWORD                   idWindowThread;
+    HMODULE                 hInstance;
+    /** Window request semaphore. */
+    RTSEMEVENT              WndRequestSem;
+#elif RT_OS_LINUX
+    /* The X display */
+    Display                 *display;
+    R3PTRTYPE(RTTHREAD)    pWindowThread;
+    bool                    bTerminate;
+#endif
+
+    float                   fGLVersion;
+    /* Current active context. */
+    uint32_t                idActiveContext;
+
+    struct
+    {
+        PFNGLISRENDERBUFFERPROC                         glIsRenderbuffer;
+        PFNGLBINDRENDERBUFFERPROC                       glBindRenderbuffer;
+        PFNGLDELETERENDERBUFFERSPROC                    glDeleteRenderbuffers;
+        PFNGLGENRENDERBUFFERSPROC                       glGenRenderbuffers;
+        PFNGLRENDERBUFFERSTORAGEPROC                    glRenderbufferStorage;
+        PFNGLGETRENDERBUFFERPARAMETERIVPROC             glGetRenderbufferParameteriv;
+        PFNGLISFRAMEBUFFERPROC                          glIsFramebuffer;
+        PFNGLBINDFRAMEBUFFERPROC                        glBindFramebuffer;
+        PFNGLDELETEFRAMEBUFFERSPROC                     glDeleteFramebuffers;
+        PFNGLGENFRAMEBUFFERSPROC                        glGenFramebuffers;
+        PFNGLCHECKFRAMEBUFFERSTATUSPROC                 glCheckFramebufferStatus;
+        PFNGLFRAMEBUFFERTEXTURE1DPROC                   glFramebufferTexture1D;
+        PFNGLFRAMEBUFFERTEXTURE2DPROC                   glFramebufferTexture2D;
+        PFNGLFRAMEBUFFERTEXTURE3DPROC                   glFramebufferTexture3D;
+        PFNGLFRAMEBUFFERRENDERBUFFERPROC                glFramebufferRenderbuffer;
+        PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC    glGetFramebufferAttachmentParameteriv;
+        PFNGLGENERATEMIPMAPPROC                         glGenerateMipmap;
+        PFNGLBLITFRAMEBUFFERPROC                        glBlitFramebuffer;
+        PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC         glRenderbufferStorageMultisample;
+        PFNGLFRAMEBUFFERTEXTURELAYERPROC                glFramebufferTextureLayer;
+        PFNGLPOINTPARAMETERFPROC                        glPointParameterf;
+        PFNGLBLENDEQUATIONPROC                          glBlendEquation;
+        PFNGLBLENDEQUATIONSEPARATEPROC                  glBlendEquationSeparate;
+        PFNGLBLENDFUNCSEPARATEPROC                      glBlendFuncSeparate;
+        PFNGLSTENCILOPSEPARATEPROC                      glStencilOpSeparate;
+        PFNGLSTENCILFUNCSEPARATEPROC                    glStencilFuncSeparate;
+        PFNGLBLENDCOLORPROC                             glBlendColor;
+        PFNGLBINDBUFFERPROC                             glBindBuffer;
+        PFNGLDELETEBUFFERSPROC                          glDeleteBuffers;
+        PFNGLGENBUFFERSPROC                             glGenBuffers;
+        PFNGLBUFFERDATAPROC                             glBufferData;
+        PFNGLMAPBUFFERPROC                              glMapBuffer;
+        PFNGLUNMAPBUFFERPROC                            glUnmapBuffer;
+        PFNGLENABLEVERTEXATTRIBARRAYPROC                glEnableVertexAttribArray;
+        PFNGLDISABLEVERTEXATTRIBARRAYPROC               glDisableVertexAttribArray;
+        PFNGLVERTEXATTRIBPOINTERPROC                    glVertexAttribPointer;
+        PFNGLFOGCOORDPOINTERPROC                        glFogCoordPointer;
+        PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC        glDrawElementsInstancedBaseVertex;
+        PFNGLDRAWELEMENTSBASEVERTEXPROC                 glDrawElementsBaseVertex;
+        PFNGLACTIVETEXTUREPROC                          glActiveTexture;
+        PFNGLCLIENTACTIVETEXTUREPROC                    glClientActiveTexture;
+        PFNGLGETPROGRAMIVARBPROC                        glGetProgramivARB;
+        PFNGLPROVOKINGVERTEXPROC                        glProvokingVertex;
+        bool                                            fEXT_stencil_two_side;
+    } ext;
+
+    struct
+    {
+        GLint                           maxActiveLights;
+        GLint                           maxTextureBufferSize;
+        GLint                           maxTextures;
+        GLint                           maxClipDistances;
+        GLint                           maxColorAttachments;
+        GLint                           maxRectangleTextureSize;
+        GLint                           maxTextureAnisotropy;
+        GLint                           maxVertexShaderInstructions;
+        GLint                           maxFragmentShaderInstructions;
+        GLint                           maxVertexShaderTemps;
+        GLint                           maxFragmentShaderTemps;
+        GLfloat                         flPointSize[2];
+        SVGA3dPixelShaderVersion        fragmentShaderVersion;
+        SVGA3dVertexShaderVersion       vertexShaderVersion;
+        bool                            fS3TCSupported;
+    } caps;
+
+    uint32_t                cContexts;
+    PVMSVGA3DCONTEXT        paContext;
+    uint32_t                cSurfaces;
+    PVMSVGA3DSURFACE        paSurface;
+#ifdef DEBUG_GFX_WINDOW_TEST_CONTEXT
+    uint32_t                idTestContext;
+#endif
+} VMSVGA3DSTATE, *PVMSVGA3DSTATE;
+
+/**
+ * SSM descriptor table for the VMSVGA3DSTATE structure.
+ */
+static SSMFIELD const g_aVMSVGA3DSTATEFields[] =
+{
+#ifdef RT_OS_WINDOWS
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSTATE, pWindowThread),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSTATE, idWindowThread),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSTATE, hInstance),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSTATE, WndRequestSem),
+#elif defined(RT_OS_LINUX)
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSTATE, display),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSTATE, pWindowThread),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSTATE, bTerminate),
+#endif
+    SSMFIELD_ENTRY(                 VMSVGA3DSTATE, fGLVersion),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSTATE, idActiveContext),
+
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSTATE, ext),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSTATE, caps),
+
+    SSMFIELD_ENTRY(                 VMSVGA3DSTATE, cContexts),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSTATE, paContext),
+    SSMFIELD_ENTRY(                 VMSVGA3DSTATE, cSurfaces),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSTATE, paSurface),
+    SSMFIELD_ENTRY_TERM()
+};
+
+
+/* Define the default light parameters as specified by MSDN. */
+/* @todo move out; fetched from Wine */
+const SVGA3dLightData vmsvga3d_default_light =
+{
+    SVGA3D_LIGHTTYPE_DIRECTIONAL,   /* type */
+    false,                          /* inWorldSpace */
+    { 1.0f, 1.0f, 1.0f, 0.0f },     /* diffuse r,g,b,a */
+    { 0.0f, 0.0f, 0.0f, 0.0f },     /* specular r,g,b,a */
+    { 0.0f, 0.0f, 0.0f, 0.0f },     /* ambient r,g,b,a, */
+    { 0.0f, 0.0f, 0.0f },           /* position x,y,z */
+    { 0.0f, 0.0f, 1.0f },           /* direction x,y,z */
+    0.0f,                           /* range */
+    0.0f,                           /* falloff */
+    0.0f, 0.0f, 0.0f,               /* attenuation 0,1,2 */
+    0.0f,                           /* theta */
+    0.0f                            /* phi */
+};
+
+RT_C_DECLS_BEGIN
+static int vmsvga3dCreateTexture(PVMSVGA3DSTATE pState, PVMSVGA3DCONTEXT pContext, uint32_t idAssociatedContext, PVMSVGA3DSURFACE pSurface);
+static void vmsvgaColor2GLFloatArray(uint32_t color, GLfloat *pRed, GLfloat *pGreen, GLfloat *pBlue, GLfloat *pAlpha);
+RT_C_DECLS_END
+
+static bool vmsvga3dCheckGLExtension(const char *pExtensionName)
+{
+    char *pSupportedExtensions = (char *)glGetString(GL_EXTENSIONS);
+    char *pExtensionSupported  = pSupportedExtensions;
+    size_t cbExtension         = strlen(pExtensionName);
+
+    while (true)
+    {
+        pExtensionSupported = strstr(pExtensionSupported, pExtensionName);
+        if (pExtensionSupported == NULL)
+            break;
+
+        if (    (    pExtensionSupported == pSupportedExtensions
+                 || *(pExtensionSupported-1) == ' ')
+            &&  (    pExtensionSupported[cbExtension] == ' '
+                 ||  pExtensionSupported[cbExtension] == 0)
+           )
+            return true;
+
+        pExtensionSupported += cbExtension;
+    }
+    return false;
+}
+
+int vmsvga3dInit(PVGASTATE pThis)
+{
+    PVMSVGA3DSTATE   pState;
+    int              rc;
+
+    AssertCompile(GL_TRUE == 1);
+    AssertCompile(GL_FALSE == 0);
+
+    pThis->svga.p3dState = RTMemAllocZ(sizeof(VMSVGA3DSTATE));
+    AssertReturn(pThis->svga.p3dState, VERR_NO_MEMORY);
+    pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+
+#ifdef RT_OS_WINDOWS
+    /* Create event semaphore. */
+    rc = RTSemEventCreate(&pState->WndRequestSem);
+    if (RT_FAILURE(rc))
+    {
+        Log(("%s: Failed to create event semaphore for window handling.\n", __FUNCTION__));
+        return rc;
+    }
+
+    /* Create the async IO thread. */
+    rc = RTThreadCreate(&pState->pWindowThread, vmsvga3dWindowThread, pState->WndRequestSem, 0, RTTHREADTYPE_GUI, 0, "VMSVGA3DWND");
+    if (RT_FAILURE(rc))
+    {
+        AssertMsgFailed(("%s: Async IO Thread creation for 3d window handling failed rc=%d\n", __FUNCTION__, rc));
+        return rc;
+    }
+#endif
+    return VINF_SUCCESS;
+}
+
+/* We must delay window creation until the PowerOn phase. Init is too early and will cause failures. */
+int vmsvga3dPowerOn(PVGASTATE pThis)
+{
+    PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pThis->svga.p3dState, VERR_NO_MEMORY);
+    PVMSVGA3DCONTEXT pContext;
+    int              rc;
+
+    if (pState->fGLVersion != 0.0)
+        return VINF_SUCCESS;    /* already initialized (load state) */
+
+    /* OpenGL function calls aren't possible without a valid current context, so create a fake one here. */
+    rc = vmsvga3dContextDefine(pThis, 1);
+    AssertRCReturn(rc, rc);
+
+    pContext = &pState->paContext[1];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    LogRel(("VMSVGA3d: OpenGL version: %s\nOpenGL Vendor: %s\nOpenGL Renderer: %s\n", glGetString(GL_VERSION), glGetString(GL_VENDOR), glGetString(GL_RENDERER)));
+    LogRel(("VMSVGA3d: OpenGL shader language version: %s\n", glGetString(GL_SHADING_LANGUAGE_VERSION)));
+    LogRel(("VMSVGA3d: OpenGL extensions: %s\n\n", glGetString(GL_EXTENSIONS)));
+    pState->fGLVersion     = atof((const char *)glGetString(GL_VERSION));
+
+    if (vmsvga3dCheckGLExtension("GL_ARB_framebuffer_object"))
+    {
+        pState->ext.glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)OGLGETPROCADDRESS("glIsRenderbuffer");
+        pState->ext.glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)OGLGETPROCADDRESS("glBindRenderbuffer");
+        pState->ext.glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)OGLGETPROCADDRESS("glDeleteRenderbuffers");
+        pState->ext.glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)OGLGETPROCADDRESS("glGenRenderbuffers");
+        pState->ext.glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)OGLGETPROCADDRESS("glRenderbufferStorage");
+        pState->ext.glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)OGLGETPROCADDRESS("glGetRenderbufferParameteriv");
+        pState->ext.glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)OGLGETPROCADDRESS("glIsFramebuffer");
+        pState->ext.glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)OGLGETPROCADDRESS("glBindFramebuffer");
+        pState->ext.glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)OGLGETPROCADDRESS("glDeleteFramebuffers");
+        pState->ext.glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)OGLGETPROCADDRESS("glGenFramebuffers");
+        pState->ext.glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)OGLGETPROCADDRESS("glCheckFramebufferStatus");
+        pState->ext.glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)OGLGETPROCADDRESS("glFramebufferTexture1D");
+        pState->ext.glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)OGLGETPROCADDRESS("glFramebufferTexture2D");
+        pState->ext.glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)OGLGETPROCADDRESS("glFramebufferTexture3D");
+        pState->ext.glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)OGLGETPROCADDRESS("glFramebufferRenderbuffer");
+        pState->ext.glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)OGLGETPROCADDRESS("glGetFramebufferAttachmentParameteriv");
+        pState->ext.glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)OGLGETPROCADDRESS("glGenerateMipmap");
+        pState->ext.glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)OGLGETPROCADDRESS("glBlitFramebuffer");
+        pState->ext.glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)OGLGETPROCADDRESS("glRenderbufferStorageMultisample");
+        pState->ext.glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)OGLGETPROCADDRESS("glFramebufferTextureLayer");
+    }
+    pState->ext.glPointParameterf           = (PFNGLPOINTPARAMETERFPROC)OGLGETPROCADDRESS("glPointParameterf");
+    AssertMsgReturn(pState->ext.glPointParameterf, ("glPointParameterf missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glBlendEquation             = (PFNGLBLENDEQUATIONPROC)OGLGETPROCADDRESS("glBlendEquation");
+    AssertMsgReturn(pState->ext.glBlendEquation, ("glBlendEquation missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glBlendEquationSeparate     = (PFNGLBLENDEQUATIONSEPARATEPROC)OGLGETPROCADDRESS("glBlendEquationSeparate");
+    AssertMsgReturn(pState->ext.glBlendEquationSeparate, ("glBlendEquationSeparate missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glBlendFuncSeparate         = (PFNGLBLENDFUNCSEPARATEPROC)OGLGETPROCADDRESS("glBlendFuncSeparate");
+    AssertMsgReturn(pState->ext.glBlendFuncSeparate, ("glBlendFuncSeparate missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glStencilOpSeparate         = (PFNGLSTENCILOPSEPARATEPROC)OGLGETPROCADDRESS("glStencilOpSeparate");
+    AssertMsgReturn(pState->ext.glStencilOpSeparate, ("glStencilOpSeparate missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glStencilFuncSeparate       = (PFNGLSTENCILFUNCSEPARATEPROC)OGLGETPROCADDRESS("glStencilFuncSeparate");
+    AssertMsgReturn(pState->ext.glStencilFuncSeparate, ("glStencilFuncSeparate missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glBlendColor                = (PFNGLBLENDCOLORPROC)OGLGETPROCADDRESS("glBlendColor");
+    AssertMsgReturn(pState->ext.glBlendColor, ("glBlendColor missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glBindBuffer                = (PFNGLBINDBUFFERPROC)OGLGETPROCADDRESS("glBindBuffer");
+    AssertMsgReturn(pState->ext.glBindBuffer, ("glBindBuffer missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glDeleteBuffers             = (PFNGLDELETEBUFFERSPROC)OGLGETPROCADDRESS("glDeleteBuffers");
+    AssertMsgReturn(pState->ext.glDeleteBuffers, ("glDeleteBuffers missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glGenBuffers                = (PFNGLGENBUFFERSPROC)OGLGETPROCADDRESS("glGenBuffers");
+    AssertMsgReturn(pState->ext.glGenBuffers, ("glGenBuffers missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glBufferData                = (PFNGLBUFFERDATAPROC)OGLGETPROCADDRESS("glBufferData");
+    AssertMsgReturn(pState->ext.glBufferData, ("glBufferData missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glMapBuffer                 = (PFNGLMAPBUFFERPROC)OGLGETPROCADDRESS("glMapBuffer");
+    AssertMsgReturn(pState->ext.glMapBuffer, ("glMapBuffer missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glUnmapBuffer               = (PFNGLUNMAPBUFFERPROC)OGLGETPROCADDRESS("glUnmapBuffer");
+    AssertMsgReturn(pState->ext.glUnmapBuffer, ("glUnmapBuffer missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glEnableVertexAttribArray   = (PFNGLENABLEVERTEXATTRIBARRAYPROC)OGLGETPROCADDRESS("glEnableVertexAttribArray");
+    AssertMsgReturn(pState->ext.glEnableVertexAttribArray, ("glEnableVertexAttribArray missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glDisableVertexAttribArray  = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)OGLGETPROCADDRESS("glDisableVertexAttribArray");
+    AssertMsgReturn(pState->ext.glDisableVertexAttribArray, ("glDisableVertexAttribArray missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glVertexAttribPointer       = (PFNGLVERTEXATTRIBPOINTERPROC)OGLGETPROCADDRESS("glVertexAttribPointer");
+    AssertMsgReturn(pState->ext.glVertexAttribPointer, ("glVertexAttribPointer missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glFogCoordPointer           = (PFNGLFOGCOORDPOINTERPROC)OGLGETPROCADDRESS("glFogCoordPointer");
+    AssertMsgReturn(pState->ext.glFogCoordPointer, ("glFogCoordPointer missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glActiveTexture             = (PFNGLACTIVETEXTUREPROC)OGLGETPROCADDRESS("glActiveTexture");
+    AssertMsgReturn(pState->ext.glActiveTexture, ("glActiveTexture missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glClientActiveTexture       = (PFNGLCLIENTACTIVETEXTUREPROC)OGLGETPROCADDRESS("glClientActiveTexture");
+    AssertMsgReturn(pState->ext.glClientActiveTexture, ("glClientActiveTexture missing"), VERR_NOT_IMPLEMENTED);
+    pState->ext.glGetProgramivARB           = (PFNGLGETPROGRAMIVARBPROC)OGLGETPROCADDRESS("glGetProgramivARB");
+    AssertMsgReturn(pState->ext.glGetProgramivARB, ("glGetProgramivARB missing"), VERR_NOT_IMPLEMENTED);
+
+    /* OpenGL 3.2 core */
+    if (vmsvga3dCheckGLExtension("GL_ARB_draw_elements_base_vertex"))
+    {
+        pState->ext.glDrawElementsBaseVertex          = (PFNGLDRAWELEMENTSBASEVERTEXPROC)OGLGETPROCADDRESS("glDrawElementsBaseVertex");
+        pState->ext.glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)OGLGETPROCADDRESS("glDrawElementsInstancedBaseVertex");
+    }
+    else
+        LogRel(("VMSVGA3d: missing extension GL_ARB_draw_elements_base_vertex\n"));
+
+    /* OpenGL 3.2 core */
+    if (vmsvga3dCheckGLExtension("GL_ARB_provoking_vertex"))
+    {
+        pState->ext.glProvokingVertex                 = (PFNGLPROVOKINGVERTEXPROC)OGLGETPROCADDRESS("glProvokingVertex");
+    }
+    else
+        LogRel(("VMSVGA3d: missing extension GL_ARB_provoking_vertex\n"));
+
+    /* Extension support */
+    pState->ext.fEXT_stencil_two_side = vmsvga3dCheckGLExtension("GL_EXT_stencil_two_side");
+
+    /* First set sensible defaults. */
+    pState->caps.maxActiveLights               = 1;
+    pState->caps.maxTextureBufferSize          = 65536;
+    pState->caps.maxTextures                   = 1;
+    pState->caps.maxClipDistances              = 4;
+    pState->caps.maxColorAttachments           = 1;
+    pState->caps.maxRectangleTextureSize       = 2048;
+    pState->caps.maxTextureAnisotropy          = 2;
+    pState->caps.maxVertexShaderInstructions   = 1024;
+    pState->caps.maxFragmentShaderInstructions = 1024;
+    pState->caps.vertexShaderVersion           = SVGA3DVSVERSION_NONE;
+    pState->caps.fragmentShaderVersion         = SVGA3DPSVERSION_NONE;
+
+    /* Query capabilities */
+    glGetIntegerv(GL_MAX_LIGHTS, &pState->caps.maxActiveLights);
+    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+    glGetIntegerv(GL_MAX_TEXTURE_BUFFER_SIZE, &pState->caps.maxTextureBufferSize);
+    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+    glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &pState->caps.maxTextures);
+    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+    glGetIntegerv(GL_MAX_CLIP_DISTANCES, &pState->caps.maxClipDistances);
+    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+    glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &pState->caps.maxColorAttachments);
+    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+    glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE, &pState->caps.maxRectangleTextureSize);
+    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+    glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &pState->caps.maxTextureAnisotropy);
+    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+    glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, pState->caps.flPointSize);
+    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+    if (pState->ext.glGetProgramivARB)
+    {
+        pState->ext.glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, &pState->caps.maxFragmentShaderTemps);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+        pState->ext.glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, &pState->caps.maxFragmentShaderInstructions);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+        pState->ext.glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, &pState->caps.maxVertexShaderTemps);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+        pState->ext.glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, &pState->caps.maxVertexShaderInstructions);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+    }
+    pState->caps.fS3TCSupported = vmsvga3dCheckGLExtension("GL_EXT_texture_compression_s3tc");
+
+    /* http://http://www.opengl.org/wiki/Detecting_the_Shader_Model 
+     * ARB Assembly Language
+     * These are done through testing the presence of extensions. You should test them in this order:
+     * GL_NV_gpu_program4: SM 4.0 or better.
+     * GL_NV_vertex_program3: SM 3.0 or better.
+     * GL_ARB_fragment_program: SM 2.0 or better.
+     * ATI does not support higher than SM 2.0 functionality in assembly shaders.
+     *
+     * @todo: distinguish between vertex and pixel shaders???
+     */
+    if (vmsvga3dCheckGLExtension("GL_NV_gpu_program4"))
+    {
+        pState->caps.vertexShaderVersion   = SVGA3DVSVERSION_40;
+        pState->caps.fragmentShaderVersion = SVGA3DPSVERSION_40;
+    }
+    else
+    if (    vmsvga3dCheckGLExtension("GL_NV_vertex_program3")
+        ||  vmsvga3dCheckGLExtension("GL_ARB_shader_texture_lod"))  /* Wine claims this suggests SM 3.0 support */
+    {
+        pState->caps.vertexShaderVersion   = SVGA3DVSVERSION_30;
+        pState->caps.fragmentShaderVersion = SVGA3DPSVERSION_30;
+    }
+    else
+    if (vmsvga3dCheckGLExtension("GL_ARB_fragment_program"))
+    {
+        pState->caps.vertexShaderVersion   = SVGA3DVSVERSION_20;
+        pState->caps.fragmentShaderVersion = SVGA3DPSVERSION_20;
+    }
+    else
+    {
+        LogRel(("VMSVGA3D: WARNING: unknown support for assembly shaders!!\n"));
+        pState->caps.vertexShaderVersion   = SVGA3DVSVERSION_11;
+        pState->caps.fragmentShaderVersion = SVGA3DPSVERSION_11;
+    }
+
+    if (!vmsvga3dCheckGLExtension("GL_ARB_vertex_array_bgra"))
+    {
+        /* @todo Intel drivers don't support this extension! */
+        LogRel(("VMSVGA3D: WARNING: Missing required extension GL_ARB_vertex_array_bgra (d3dcolor)!!!\n"));
+    }
+#if 0
+   SVGA3D_DEVCAP_MAX_FIXED_VERTEXBLEND             = 11,
+   SVGA3D_DEVCAP_QUERY_TYPES                       = 15,
+   SVGA3D_DEVCAP_TEXTURE_GRADIENT_SAMPLING         = 16,
+   SVGA3D_DEVCAP_MAX_POINT_SIZE                    = 17,
+   SVGA3D_DEVCAP_MAX_SHADER_TEXTURES               = 18,
+   SVGA3D_DEVCAP_MAX_VOLUME_EXTENT                 = 21,
+   SVGA3D_DEVCAP_MAX_TEXTURE_REPEAT                = 22,
+   SVGA3D_DEVCAP_MAX_TEXTURE_ASPECT_RATIO          = 23,
+   SVGA3D_DEVCAP_MAX_TEXTURE_ANISOTROPY            = 24,
+   SVGA3D_DEVCAP_MAX_PRIMITIVE_COUNT               = 25,
+   SVGA3D_DEVCAP_MAX_VERTEX_INDEX                  = 26,
+   SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_INSTRUCTIONS  = 28,
+   SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEMPS           = 29,
+   SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_TEMPS         = 30,
+   SVGA3D_DEVCAP_TEXTURE_OPS                       = 31,
+   SVGA3D_DEVCAP_SURFACEFMT_X8R8G8B8               = 32,
+   SVGA3D_DEVCAP_SURFACEFMT_A8R8G8B8               = 33,
+   SVGA3D_DEVCAP_SURFACEFMT_A2R10G10B10            = 34,
+   SVGA3D_DEVCAP_SURFACEFMT_X1R5G5B5               = 35,
+   SVGA3D_DEVCAP_SURFACEFMT_A1R5G5B5               = 36,
+   SVGA3D_DEVCAP_SURFACEFMT_A4R4G4B4               = 37,
+   SVGA3D_DEVCAP_SURFACEFMT_R5G6B5                 = 38,
+   SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE16            = 39,
+   SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8_ALPHA8      = 40,
+   SVGA3D_DEVCAP_SURFACEFMT_ALPHA8                 = 41,
+   SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8             = 42,
+   SVGA3D_DEVCAP_SURFACEFMT_Z_D16                  = 43,
+   SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8                = 44,
+   SVGA3D_DEVCAP_SURFACEFMT_Z_D24X8                = 45,
+   SVGA3D_DEVCAP_SURFACEFMT_DXT1                   = 46,
+   SVGA3D_DEVCAP_SURFACEFMT_DXT2                   = 47,
+   SVGA3D_DEVCAP_SURFACEFMT_DXT3                   = 48,
+   SVGA3D_DEVCAP_SURFACEFMT_DXT4                   = 49,
+   SVGA3D_DEVCAP_SURFACEFMT_DXT5                   = 50,
+   SVGA3D_DEVCAP_SURFACEFMT_BUMPX8L8V8U8           = 51,
+   SVGA3D_DEVCAP_SURFACEFMT_A2W10V10U10            = 52,
+   SVGA3D_DEVCAP_SURFACEFMT_BUMPU8V8               = 53,
+   SVGA3D_DEVCAP_SURFACEFMT_Q8W8V8U8               = 54,
+   SVGA3D_DEVCAP_SURFACEFMT_CxV8U8                 = 55,
+   SVGA3D_DEVCAP_SURFACEFMT_R_S10E5                = 56,
+   SVGA3D_DEVCAP_SURFACEFMT_R_S23E8                = 57,
+   SVGA3D_DEVCAP_SURFACEFMT_RG_S10E5               = 58,
+   SVGA3D_DEVCAP_SURFACEFMT_RG_S23E8               = 59,
+   SVGA3D_DEVCAP_SURFACEFMT_ARGB_S10E5             = 60,
+   SVGA3D_DEVCAP_SURFACEFMT_ARGB_S23E8             = 61,
+   SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEXTURES        = 63,
+   SVGA3D_DEVCAP_SURFACEFMT_V16U16                 = 65,
+   SVGA3D_DEVCAP_SURFACEFMT_G16R16                 = 66,
+   SVGA3D_DEVCAP_SURFACEFMT_A16B16G16R16           = 67,
+   SVGA3D_DEVCAP_SURFACEFMT_UYVY                   = 68,
+   SVGA3D_DEVCAP_SURFACEFMT_YUY2                   = 69,
+   SVGA3D_DEVCAP_MULTISAMPLE_NONMASKABLESAMPLES    = 70,
+   SVGA3D_DEVCAP_MULTISAMPLE_MASKABLESAMPLES       = 71,
+   SVGA3D_DEVCAP_ALPHATOCOVERAGE                   = 72,
+   SVGA3D_DEVCAP_SUPERSAMPLE                       = 73,
+   SVGA3D_DEVCAP_AUTOGENMIPMAPS                    = 74,
+   SVGA3D_DEVCAP_SURFACEFMT_NV12                   = 75,
+   SVGA3D_DEVCAP_SURFACEFMT_AYUV                   = 76,
+   SVGA3D_DEVCAP_SURFACEFMT_Z_DF16                 = 79,
+   SVGA3D_DEVCAP_SURFACEFMT_Z_DF24                 = 80,
+   SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT            = 81,
+   SVGA3D_DEVCAP_SURFACEFMT_BC4_UNORM              = 82,
+   SVGA3D_DEVCAP_SURFACEFMT_BC5_UNORM              = 83,
+#endif
+
+    /* Initialize the shader library. */
+    rc = ShaderInitLib();
+    AssertRC(rc);
+
+    /* Cleanup */
+    rc = vmsvga3dContextDestroy(pThis, 1);
+    AssertRC(rc);
+
+#ifndef RT_OS_DARWIN
+    /* on the Mac, OpenGL 3 came very late so we have a capable 2.1 implementation */
+    if (pState->fGLVersion < 3.0)
+    {
+        LogRel(("VMSVGA3d: unsupported OpenGL version; minimum is 3.0\n"));
+        return VERR_NOT_IMPLEMENTED;
+    }
+#endif
+    if (    !pState->ext.glIsRenderbuffer
+        ||  !pState->ext.glBindRenderbuffer
+        ||  !pState->ext.glDeleteRenderbuffers
+        ||  !pState->ext.glGenRenderbuffers
+        ||  !pState->ext.glRenderbufferStorage
+        ||  !pState->ext.glGetRenderbufferParameteriv
+        ||  !pState->ext.glIsFramebuffer
+        ||  !pState->ext.glBindFramebuffer
+        ||  !pState->ext.glDeleteFramebuffers
+        ||  !pState->ext.glGenFramebuffers
+        ||  !pState->ext.glCheckFramebufferStatus
+        ||  !pState->ext.glFramebufferTexture1D
+        ||  !pState->ext.glFramebufferTexture2D
+        ||  !pState->ext.glFramebufferTexture3D
+        ||  !pState->ext.glFramebufferRenderbuffer
+        ||  !pState->ext.glGetFramebufferAttachmentParameteriv
+        ||  !pState->ext.glGenerateMipmap
+        ||  !pState->ext.glBlitFramebuffer
+        ||  !pState->ext.glRenderbufferStorageMultisample
+        ||  !pState->ext.glFramebufferTextureLayer)
+    {
+        LogRel(("VMSVGA3d: missing required OpenGL extension; aborting\n"));
+        return VERR_NOT_IMPLEMENTED;
+    }
+
+#ifdef DEBUG_DEBUG_GFX_WINDOW_TEST_CONTEXT
+    pState->idTestContext = SVGA_ID_INVALID;
+#endif
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dReset(PVGASTATE pThis)
+{
+    PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pThis->svga.p3dState, VERR_NO_MEMORY);
+
+    /* Destroy all leftover surfaces. */
+    for (uint32_t i = 0; i < pState->cSurfaces; i++)
+    {
+        if (pState->paSurface[i].id != SVGA3D_INVALID_ID)
+            vmsvga3dSurfaceDestroy(pThis, pState->paSurface[i].id);
+    }
+
+    /* Destroy all leftover contexts. */
+    for (uint32_t i = 0; i < pState->cContexts; i++)
+    {
+        if (pState->paContext[i].id != SVGA3D_INVALID_ID)
+            vmsvga3dContextDestroy(pThis, pState->paContext[i].id);
+    }
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dTerminate(PVGASTATE pThis)
+{
+    PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pThis->svga.p3dState, VERR_NO_MEMORY);
+    int            rc;
+
+    rc = vmsvga3dReset(pThis);
+    AssertRCReturn(rc, rc);
+
+    /* Terminate the shader library. */
+    rc = ShaderDestroyLib();
+    AssertRC(rc);
+
+#ifdef RT_OS_WINDOWS
+    /* Terminate the window creation thread. */
+    rc = vmsvga3dSendThreadMessage(pState->pWindowThread, pState->WndRequestSem, WM_VMSVGA3D_EXIT, 0, 0);
+    AssertRCReturn(rc, rc);
+
+    RTSemEventDestroy(pState->WndRequestSem);
+#elif RT_OS_DARWIN
+
+#elif RT_OS_LINUX
+    /* signal to the thread that it is supposed to exit */
+    pState->bTerminate = true;
+    /* wait for it to terminate */
+    rc = RTThreadWait(pState->pWindowThread, 10000, NULL);
+    AssertRC(rc);
+    XCloseDisplay(pState->display);
+#endif
+
+    return VINF_SUCCESS;
+}
+
+/* Shared functions that depend on private structure definitions. */
+#define VMSVGA3D_OPENGL
+#include "DevVGA-SVGA3d-shared.h"
+
+static uint32_t vmsvga3dGetSurfaceFormatSupport(PVMSVGA3DSTATE pState3D, uint32_t idx3dCaps)
+{
+    uint32_t result = 0;
+
+    /* @todo missing:
+     * 
+     * SVGA3DFORMAT_OP_PIXELSIZE
+     */
+
+    switch (idx3dCaps)
+    {
+    case SVGA3D_DEVCAP_SURFACEFMT_X8R8G8B8:
+    case SVGA3D_DEVCAP_SURFACEFMT_X1R5G5B5:
+    case SVGA3D_DEVCAP_SURFACEFMT_R5G6B5:
+        result |= SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB 
+               |  SVGA3DFORMAT_OP_CONVERT_TO_ARGB
+               |  SVGA3DFORMAT_OP_DISPLAYMODE           /* Should not be set for alpha formats. */
+               |  SVGA3DFORMAT_OP_3DACCELERATION;       /* implies OP_DISPLAYMODE */
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_A8R8G8B8:
+    case SVGA3D_DEVCAP_SURFACEFMT_A2R10G10B10:
+    case SVGA3D_DEVCAP_SURFACEFMT_A1R5G5B5:
+    case SVGA3D_DEVCAP_SURFACEFMT_A4R4G4B4:
+        result |=     SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB 
+                  |   SVGA3DFORMAT_OP_CONVERT_TO_ARGB
+                  |   SVGA3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET;
+        break;
+    }
+
+    /* @todo check hardware caps! */
+    switch (idx3dCaps)
+    {
+    case SVGA3D_DEVCAP_SURFACEFMT_X8R8G8B8:
+    case SVGA3D_DEVCAP_SURFACEFMT_A8R8G8B8:
+    case SVGA3D_DEVCAP_SURFACEFMT_A2R10G10B10:
+    case SVGA3D_DEVCAP_SURFACEFMT_X1R5G5B5:
+    case SVGA3D_DEVCAP_SURFACEFMT_A1R5G5B5:
+    case SVGA3D_DEVCAP_SURFACEFMT_A4R4G4B4:
+    case SVGA3D_DEVCAP_SURFACEFMT_R5G6B5:
+    case SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE16:
+    case SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8_ALPHA8:
+    case SVGA3D_DEVCAP_SURFACEFMT_ALPHA8:
+    case SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8:
+        result |= SVGA3DFORMAT_OP_TEXTURE
+               |  SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET
+               |  SVGA3DFORMAT_OP_OFFSCREENPLAIN
+               |  SVGA3DFORMAT_OP_SAME_FORMAT_RENDERTARGET
+               |  SVGA3DFORMAT_OP_VOLUMETEXTURE
+               |  SVGA3DFORMAT_OP_CUBETEXTURE
+               |  SVGA3DFORMAT_OP_SRGBREAD
+               |  SVGA3DFORMAT_OP_SRGBWRITE;
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_D16:
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8:
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_D24X8:
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_DF16:
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_DF24:
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT:
+        result |= SVGA3DFORMAT_OP_ZSTENCIL
+               |  SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH
+               |  SVGA3DFORMAT_OP_TEXTURE /* Necessary for Ubuntu Unity */;
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT1:
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT3:
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT5:
+        result |= SVGA3DFORMAT_OP_TEXTURE
+               |  SVGA3DFORMAT_OP_VOLUMETEXTURE
+               |  SVGA3DFORMAT_OP_CUBETEXTURE
+               |  SVGA3DFORMAT_OP_SRGBREAD;
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_BUMPX8L8V8U8:
+    case SVGA3D_DEVCAP_SURFACEFMT_A2W10V10U10:
+    case SVGA3D_DEVCAP_SURFACEFMT_BUMPU8V8:
+    case SVGA3D_DEVCAP_SURFACEFMT_Q8W8V8U8:
+    case SVGA3D_DEVCAP_SURFACEFMT_CxV8U8:
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_R_S10E5:
+    case SVGA3D_DEVCAP_SURFACEFMT_R_S23E8:
+    case SVGA3D_DEVCAP_SURFACEFMT_RG_S10E5:
+    case SVGA3D_DEVCAP_SURFACEFMT_RG_S23E8:
+    case SVGA3D_DEVCAP_SURFACEFMT_ARGB_S10E5:
+    case SVGA3D_DEVCAP_SURFACEFMT_ARGB_S23E8:
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_V16U16:
+    case SVGA3D_DEVCAP_SURFACEFMT_G16R16:
+    case SVGA3D_DEVCAP_SURFACEFMT_A16B16G16R16:
+
+    case SVGA3D_DEVCAP_SURFACEFMT_UYVY:
+    case SVGA3D_DEVCAP_SURFACEFMT_YUY2:
+    case SVGA3D_DEVCAP_SURFACEFMT_NV12:
+    case SVGA3D_DEVCAP_SURFACEFMT_AYUV:
+        break;
+    }
+    Log(("CAPS: %s =\n%s\n", vmsvga3dGetCapString(idx3dCaps), vmsvga3dGet3dFormatString(result)));
+
+    return result;
+}
+
+static uint32_t vmsvga3dGetDepthFormatSupport(PVMSVGA3DSTATE pState3D, uint32_t idx3dCaps)
+{
+    uint32_t result = 0;
+
+    /* @todo test this somehow */
+    result = SVGA3DFORMAT_OP_ZSTENCIL | SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH;
+
+    Log(("CAPS: %s =\n%s\n", vmsvga3dGetCapString(idx3dCaps), vmsvga3dGet3dFormatString(result)));
+    return result;
+}
+
+
+int vmsvga3dQueryCaps(PVGASTATE pThis, uint32_t idx3dCaps, uint32_t *pu32Val)
+{
+    PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+    int       rc = VINF_SUCCESS;
+
+    *pu32Val = 0;
+
+    switch (idx3dCaps)
+    {
+    case SVGA3D_DEVCAP_3D:
+        *pu32Val = 1; /* boolean? */
+        break;
+
+    case SVGA3D_DEVCAP_MAX_LIGHTS:
+        *pu32Val = pState->caps.maxActiveLights;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_TEXTURES:
+        *pu32Val = pState->caps.maxTextures;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_CLIP_PLANES:
+        *pu32Val = pState->caps.maxClipDistances;
+        break;
+
+    case SVGA3D_DEVCAP_VERTEX_SHADER_VERSION:
+        *pu32Val = pState->caps.vertexShaderVersion;
+        break;
+
+    case SVGA3D_DEVCAP_VERTEX_SHADER:
+        /* boolean? */
+        *pu32Val = (pState->caps.vertexShaderVersion != SVGA3DVSVERSION_NONE);
+        break;
+
+    case SVGA3D_DEVCAP_FRAGMENT_SHADER_VERSION:
+        *pu32Val = pState->caps.fragmentShaderVersion;
+        break;
+
+    case SVGA3D_DEVCAP_FRAGMENT_SHADER:
+        /* boolean? */
+        *pu32Val = (pState->caps.fragmentShaderVersion != SVGA3DPSVERSION_NONE);
+        break;
+
+    case SVGA3D_DEVCAP_S23E8_TEXTURES:
+    case SVGA3D_DEVCAP_S10E5_TEXTURES:
+        /* Must be obsolete by now; surface format caps specify the same thing. */
+        rc = VERR_INVALID_PARAMETER;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_FIXED_VERTEXBLEND:
+        break;
+
+    /*
+     *   2. The BUFFER_FORMAT capabilities are deprecated, and they always
+     *      return TRUE. Even on physical hardware that does not support
+     *      these formats natively, the SVGA3D device will provide an emulation
+     *      which should be invisible to the guest OS.
+     */
+    case SVGA3D_DEVCAP_D16_BUFFER_FORMAT:
+    case SVGA3D_DEVCAP_D24S8_BUFFER_FORMAT:
+    case SVGA3D_DEVCAP_D24X8_BUFFER_FORMAT:
+        *pu32Val = 1;
+        break;
+
+    case SVGA3D_DEVCAP_QUERY_TYPES:
+        break;
+
+    case SVGA3D_DEVCAP_TEXTURE_GRADIENT_SAMPLING:
+        break;
+
+    case SVGA3D_DEVCAP_MAX_POINT_SIZE:
+        AssertCompile(sizeof(uint32_t) == sizeof(float));
+        *(float *)pu32Val = pState->caps.flPointSize[1];
+        break;
+
+    case SVGA3D_DEVCAP_MAX_SHADER_TEXTURES:
+        /* @todo ?? */
+        rc = VERR_INVALID_PARAMETER;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_TEXTURE_WIDTH:
+    case SVGA3D_DEVCAP_MAX_TEXTURE_HEIGHT:
+        *pu32Val = pState->caps.maxRectangleTextureSize;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_VOLUME_EXTENT:
+        //*pu32Val = pCaps->MaxVolumeExtent;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_TEXTURE_REPEAT:
+        *pu32Val = 32768;   /* hardcoded in Wine */
+        break;
+
+    case SVGA3D_DEVCAP_MAX_TEXTURE_ASPECT_RATIO:
+        //*pu32Val = pCaps->MaxTextureAspectRatio;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_TEXTURE_ANISOTROPY:
+        *pu32Val = pState->caps.maxTextureAnisotropy;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_PRIMITIVE_COUNT:
+    case SVGA3D_DEVCAP_MAX_VERTEX_INDEX:
+        *pu32Val =  0xFFFFF; /* hardcoded in Wine */
+        break;
+
+    case SVGA3D_DEVCAP_MAX_VERTEX_SHADER_INSTRUCTIONS:
+        *pu32Val = pState->caps.maxVertexShaderInstructions;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_INSTRUCTIONS:
+        *pu32Val = pState->caps.maxFragmentShaderInstructions;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEMPS:
+        *pu32Val = pState->caps.maxVertexShaderTemps;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_TEMPS:
+        *pu32Val = pState->caps.maxFragmentShaderTemps;
+        break;
+
+    case SVGA3D_DEVCAP_TEXTURE_OPS:
+        break;
+
+    case SVGA3D_DEVCAP_MULTISAMPLE_NONMASKABLESAMPLES:
+        break;
+
+    case SVGA3D_DEVCAP_MULTISAMPLE_MASKABLESAMPLES:
+        break;
+
+    case SVGA3D_DEVCAP_ALPHATOCOVERAGE:
+        break;
+
+    case SVGA3D_DEVCAP_SUPERSAMPLE:
+        break;
+
+    case SVGA3D_DEVCAP_AUTOGENMIPMAPS:
+        //*pu32Val = !!(pCaps->Caps2 & D3DCAPS2_CANAUTOGENMIPMAP);
+        break;
+
+    case SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEXTURES:
+        break;
+
+    case SVGA3D_DEVCAP_MAX_RENDER_TARGETS:  /* @todo same thing? */
+    case SVGA3D_DEVCAP_MAX_SIMULTANEOUS_RENDER_TARGETS:
+        *pu32Val = pState->caps.maxColorAttachments;
+        break;
+
+    /*
+     * This is the maximum number of SVGA context IDs that the guest
+     * can define using SVGA_3D_CMD_CONTEXT_DEFINE.
+     */
+    case SVGA3D_DEVCAP_MAX_CONTEXT_IDS:
+        *pu32Val = SVGA3D_MAX_CONTEXT_IDS;
+        break;
+
+    /*
+     * This is the maximum number of SVGA surface IDs that the guest
+     * can define using SVGA_3D_CMD_SURFACE_DEFINE*.
+     */
+    case SVGA3D_DEVCAP_MAX_SURFACE_IDS:
+        *pu32Val = SVGA3D_MAX_SURFACE_IDS;
+        break;
+
+    /* Supported surface formats. */
+    case SVGA3D_DEVCAP_SURFACEFMT_X8R8G8B8:
+    case SVGA3D_DEVCAP_SURFACEFMT_A8R8G8B8:
+    case SVGA3D_DEVCAP_SURFACEFMT_A2R10G10B10:
+    case SVGA3D_DEVCAP_SURFACEFMT_X1R5G5B5:
+    case SVGA3D_DEVCAP_SURFACEFMT_A1R5G5B5:
+    case SVGA3D_DEVCAP_SURFACEFMT_A4R4G4B4:
+    case SVGA3D_DEVCAP_SURFACEFMT_R5G6B5:
+    case SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE16:
+    case SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8_ALPHA8:
+    case SVGA3D_DEVCAP_SURFACEFMT_ALPHA8:
+    case SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8:
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_D16:
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8:
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_D24X8:
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_DF16:
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_DF24:
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT:
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT1:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT2:
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT4:
+        *pu32Val = 0;   /* apparently not supported in OpenGL */
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT3:
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT5:
+    case SVGA3D_DEVCAP_SURFACEFMT_BUMPX8L8V8U8:
+    case SVGA3D_DEVCAP_SURFACEFMT_A2W10V10U10:
+    case SVGA3D_DEVCAP_SURFACEFMT_BUMPU8V8:
+    case SVGA3D_DEVCAP_SURFACEFMT_Q8W8V8U8:
+    case SVGA3D_DEVCAP_SURFACEFMT_CxV8U8:
+    case SVGA3D_DEVCAP_SURFACEFMT_R_S10E5:
+    case SVGA3D_DEVCAP_SURFACEFMT_R_S23E8:
+    case SVGA3D_DEVCAP_SURFACEFMT_RG_S10E5:
+    case SVGA3D_DEVCAP_SURFACEFMT_RG_S23E8:
+    case SVGA3D_DEVCAP_SURFACEFMT_ARGB_S10E5:
+    case SVGA3D_DEVCAP_SURFACEFMT_ARGB_S23E8:
+    case SVGA3D_DEVCAP_SURFACEFMT_V16U16:
+    case SVGA3D_DEVCAP_SURFACEFMT_G16R16:
+    case SVGA3D_DEVCAP_SURFACEFMT_A16B16G16R16:
+    case SVGA3D_DEVCAP_SURFACEFMT_UYVY:
+    case SVGA3D_DEVCAP_SURFACEFMT_YUY2:
+    case SVGA3D_DEVCAP_SURFACEFMT_NV12:
+    case SVGA3D_DEVCAP_SURFACEFMT_AYUV:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_BC4_UNORM:
+    case SVGA3D_DEVCAP_SURFACEFMT_BC5_UNORM:
+        Log(("CAPS: Unknown CAP %s\n", vmsvga3dGetCapString(idx3dCaps)));
+        rc = VERR_INVALID_PARAMETER;
+        *pu32Val = 0;
+        break;
+
+    default:
+        Log(("CAPS: Unexpected CAP %d\n", idx3dCaps));
+        rc = VERR_INVALID_PARAMETER;
+        break;
+    }
+
+    Log(("CAPS: %s - %x\n", vmsvga3dGetCapString(idx3dCaps), *pu32Val));
+    return rc;
+}
+
+/**
+ * Convert SVGA format value to its OpenGL equivalent
+ */
+static void vmsvga3dSurfaceFormat2OGL(PVMSVGA3DSURFACE pSurface, SVGA3dSurfaceFormat format)
+{
+    switch (format)
+    {
+    case SVGA3D_X8R8G8B8:
+        pSurface->internalFormatGL = GL_RGB8;
+        pSurface->formatGL = GL_BGRA;
+        pSurface->typeGL = GL_UNSIGNED_INT_8_8_8_8_REV;
+        break;
+    case SVGA3D_A8R8G8B8:
+        pSurface->internalFormatGL = GL_RGBA8;
+        pSurface->formatGL = GL_BGRA;
+        pSurface->typeGL = GL_UNSIGNED_INT_8_8_8_8_REV;
+        break;
+    case SVGA3D_R5G6B5:
+        pSurface->internalFormatGL = GL_RGB;
+        pSurface->formatGL = GL_RGB;
+        pSurface->typeGL = GL_UNSIGNED_SHORT_5_6_5;
+        break;
+    case SVGA3D_X1R5G5B5:
+        pSurface->internalFormatGL = GL_RGB;
+        pSurface->formatGL = GL_RGB;
+        pSurface->typeGL = GL_UNSIGNED_SHORT_1_5_5_5_REV;
+        break;
+    case SVGA3D_A1R5G5B5:
+        pSurface->internalFormatGL = GL_RGBA;
+        pSurface->formatGL = GL_RGB;
+        pSurface->typeGL = GL_UNSIGNED_SHORT_1_5_5_5_REV;
+        break;
+    case SVGA3D_A4R4G4B4:
+        pSurface->internalFormatGL = GL_RGBA;
+        pSurface->formatGL = GL_RGBA;
+        pSurface->typeGL =  GL_UNSIGNED_SHORT_4_4_4_4;
+        break;
+
+    case SVGA3D_Z_D32:
+        pSurface->internalFormatGL = GL_DEPTH_COMPONENT32;
+        pSurface->formatGL = GL_DEPTH_COMPONENT;
+        pSurface->typeGL = GL_UNSIGNED_INT;
+        break;
+    case SVGA3D_Z_D16:
+        pSurface->internalFormatGL = GL_DEPTH_COMPONENT16;
+        pSurface->formatGL = GL_DEPTH_COMPONENT;
+        pSurface->typeGL = GL_UNSIGNED_SHORT;
+        break;
+    case SVGA3D_Z_D24S8:
+        pSurface->internalFormatGL = GL_DEPTH24_STENCIL8;
+        pSurface->formatGL = GL_DEPTH_STENCIL;
+        pSurface->typeGL = GL_UNSIGNED_INT;
+        break;
+    case SVGA3D_Z_D15S1:
+        pSurface->internalFormatGL = GL_DEPTH_COMPONENT16;  /* @todo ??? */
+        pSurface->formatGL = GL_DEPTH_STENCIL;
+        pSurface->typeGL = GL_UNSIGNED_SHORT;
+        break;
+    case SVGA3D_Z_D24X8:
+        pSurface->internalFormatGL = GL_DEPTH_COMPONENT24;
+        pSurface->formatGL = GL_DEPTH_COMPONENT;
+        pSurface->typeGL = GL_UNSIGNED_INT;
+        break;
+
+    /* Advanced D3D9 depth formats. */
+    case SVGA3D_Z_DF16:
+        pSurface->internalFormatGL = GL_DEPTH_COMPONENT16;
+        pSurface->formatGL = GL_DEPTH_COMPONENT;
+        pSurface->typeGL = GL_FLOAT;
+        break;
+
+    case SVGA3D_Z_DF24:
+        pSurface->internalFormatGL = GL_DEPTH_COMPONENT24;
+        pSurface->formatGL = GL_DEPTH_COMPONENT;
+        pSurface->typeGL = GL_FLOAT;        /* ??? */
+        break;
+
+    case SVGA3D_Z_D24S8_INT:
+        pSurface->internalFormatGL = GL_DEPTH24_STENCIL8;
+        pSurface->formatGL = GL_DEPTH_STENCIL;
+        pSurface->typeGL = GL_INT;        /* ??? */
+        break;
+
+    case SVGA3D_DXT1:
+        pSurface->internalFormatGL = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
+        pSurface->formatGL = GL_RGBA_S3TC;          /* ??? */
+        pSurface->typeGL = GL_UNSIGNED_INT;         /* ??? */
+        break;
+
+    case SVGA3D_DXT3:
+        pSurface->internalFormatGL = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
+        pSurface->formatGL = GL_RGBA_S3TC;          /* ??? */
+        pSurface->typeGL = GL_UNSIGNED_INT;         /* ??? */
+        break;
+
+    case SVGA3D_DXT5:
+        pSurface->internalFormatGL = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
+        pSurface->formatGL = GL_RGBA_S3TC;
+        pSurface->typeGL = GL_UNSIGNED_INT;
+        break;
+
+    case SVGA3D_LUMINANCE8:
+        pSurface->internalFormatGL = GL_LUMINANCE8_EXT;
+        pSurface->formatGL = GL_LUMINANCE;
+        pSurface->typeGL = GL_UNSIGNED_BYTE;
+        break;
+
+    case SVGA3D_LUMINANCE16:
+        pSurface->internalFormatGL = GL_LUMINANCE16_EXT;
+        pSurface->formatGL = GL_LUMINANCE;
+        pSurface->typeGL = GL_UNSIGNED_SHORT;
+        break;
+
+    case SVGA3D_LUMINANCE4_ALPHA4:
+        pSurface->internalFormatGL = GL_LUMINANCE4_ALPHA4_EXT;
+        pSurface->formatGL = GL_LUMINANCE_ALPHA;
+        pSurface->typeGL = GL_UNSIGNED_BYTE;
+        break;
+
+    case SVGA3D_LUMINANCE8_ALPHA8:
+        pSurface->internalFormatGL = GL_LUMINANCE8_ALPHA8_EXT;
+        pSurface->formatGL = GL_LUMINANCE_ALPHA;
+        pSurface->typeGL = GL_UNSIGNED_BYTE;    /* unsigned_short causes issues even though this type should be 16-bit */
+        break;
+
+    case SVGA3D_ALPHA8:
+        pSurface->internalFormatGL = GL_ALPHA8_EXT;
+        pSurface->formatGL = GL_ALPHA;
+        pSurface->typeGL = GL_UNSIGNED_BYTE;
+        break;
+
+#if 0
+
+    /* Bump-map formats */
+    case SVGA3D_BUMPU8V8:
+        return D3DFMT_V8U8;
+    case SVGA3D_BUMPL6V5U5:
+        return D3DFMT_L6V5U5;
+    case SVGA3D_BUMPX8L8V8U8:
+        return D3DFMT_X8L8V8U8;
+    case SVGA3D_BUMPL8V8U8:
+        /* No corresponding D3D9 equivalent. */
+        AssertFailedReturn(D3DFMT_UNKNOWN);
+    /* signed bump-map formats */
+    case SVGA3D_V8U8:
+        return D3DFMT_V8U8;
+    case SVGA3D_Q8W8V8U8:
+        return D3DFMT_Q8W8V8U8;
+    case SVGA3D_CxV8U8:
+        return D3DFMT_CxV8U8;
+    /* mixed bump-map formats */
+    case SVGA3D_X8L8V8U8:
+        return D3DFMT_X8L8V8U8;
+    case SVGA3D_A2W10V10U10:
+        return D3DFMT_A2W10V10U10;
+#endif
+
+    case SVGA3D_ARGB_S10E5:   /* 16-bit floating-point ARGB */
+        pSurface->internalFormatGL = GL_RGBA16F;
+        pSurface->formatGL = GL_RGBA;
+        pSurface->typeGL = GL_FLOAT;
+        break;
+
+    case SVGA3D_ARGB_S23E8:   /* 32-bit floating-point ARGB */
+        pSurface->internalFormatGL = GL_RGBA32F;
+        pSurface->formatGL = GL_RGBA;
+        pSurface->typeGL = GL_FLOAT;    /* ?? */
+        break;
+
+    case SVGA3D_A2R10G10B10:
+        pSurface->internalFormatGL = GL_RGB10_A2; /* ?? */
+        pSurface->formatGL = GL_RGBA;
+        pSurface->typeGL = GL_UNSIGNED_INT;
+        break;
+
+
+    /* Single- and dual-component floating point formats */
+    case SVGA3D_R_S10E5:
+        pSurface->internalFormatGL = GL_R16F;
+        pSurface->formatGL = GL_RED;
+        pSurface->typeGL = GL_FLOAT;
+        break;
+    case SVGA3D_R_S23E8:
+        pSurface->internalFormatGL = GL_R32F;
+        pSurface->formatGL = GL_RG;
+        pSurface->typeGL = GL_FLOAT;
+        break;
+    case SVGA3D_RG_S10E5:
+        pSurface->internalFormatGL = GL_RG16F;
+        pSurface->formatGL = GL_RG;
+        pSurface->typeGL = GL_FLOAT;
+        break;
+    case SVGA3D_RG_S23E8:
+        pSurface->internalFormatGL = GL_RG32F;
+        pSurface->formatGL = GL_RG;
+        pSurface->typeGL = GL_FLOAT;
+        break;
+
+    /*
+     * Any surface can be used as a buffer object, but SVGA3D_BUFFER is
+     * the most efficient format to use when creating new surfaces
+     * expressly for index or vertex data.
+     */
+    case SVGA3D_BUFFER:
+        pSurface->internalFormatGL = -1;
+        pSurface->formatGL = -1;
+        pSurface->typeGL = -1;
+        break;
+
+#if 0
+        return D3DFMT_UNKNOWN;
+
+    case SVGA3D_V16U16:
+        return D3DFMT_V16U16;
+#endif
+
+    case SVGA3D_G16R16:
+        pSurface->internalFormatGL = GL_RG16;
+        pSurface->formatGL = GL_RG;
+        pSurface->typeGL = GL_UNSIGNED_INT;
+        break;
+
+    case SVGA3D_A16B16G16R16:
+        pSurface->internalFormatGL = GL_RGBA16;
+        pSurface->formatGL = GL_RG;
+        pSurface->typeGL = GL_UNSIGNED_INT;     /* ??? */
+        break;
+
+#if 0
+    /* Packed Video formats */
+    case SVGA3D_UYVY:
+        return D3DFMT_UYVY;
+    case SVGA3D_YUY2:
+        return D3DFMT_YUY2;
+
+    /* Planar video formats */
+    case SVGA3D_NV12:
+        return (D3DFORMAT)MAKEFOURCC('N', 'V', '1', '2');
+
+    /* Video format with alpha */
+    case SVGA3D_AYUV:
+        return (D3DFORMAT)MAKEFOURCC('A', 'Y', 'U', 'V');
+
+    case SVGA3D_BC4_UNORM:
+    case SVGA3D_BC5_UNORM:
+        /* Unknown; only in DX10 & 11 */
+        break;
+#endif
+    default:
+        AssertMsgFailed(("Unsupported format %d\n", format));
+        break;
+    }
+}
+
+
+#if 0
+/**
+ * Convert SVGA multi sample count value to its D3D equivalent
+ */
+D3DMULTISAMPLE_TYPE vmsvga3dMultipeSampleCount2D3D(uint32_t multisampleCount)
+{
+    AssertCompile(D3DMULTISAMPLE_2_SAMPLES == 2);
+    AssertCompile(D3DMULTISAMPLE_16_SAMPLES == 16);
+
+    if (multisampleCount > 16)
+        return D3DMULTISAMPLE_NONE;
+
+    /* @todo exact same mapping as d3d? */
+    return (D3DMULTISAMPLE_TYPE)multisampleCount;
+}
+#endif
+
+int vmsvga3dSurfaceDefine(PVGASTATE pThis, uint32_t sid, uint32_t surfaceFlags, SVGA3dSurfaceFormat format, SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES],
+                          uint32_t multisampleCount, SVGA3dTextureFilter autogenFilter, uint32_t cMipLevels, SVGA3dSize *pMipLevelSize)
+{
+    PVMSVGA3DSURFACE pSurface;
+    PVMSVGA3DSTATE   pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dSurfaceDefine: sid=%x surfaceFlags=%x format=%s (%x) multiSampleCount=%d autogenFilter=%d, cMipLevels=%d size=(%d,%d,%d)\n", 
+         sid, surfaceFlags, vmsvgaSurfaceType2String(format), format, multisampleCount, autogenFilter, cMipLevels, pMipLevelSize->width, pMipLevelSize->height, pMipLevelSize->depth));
+
+    AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(cMipLevels >= 1, VERR_INVALID_PARAMETER);
+    /* Assuming all faces have the same nr of mipmaps. */
+    AssertReturn(!(surfaceFlags & SVGA3D_SURFACE_CUBEMAP) || cMipLevels == face[0].numMipLevels * 6, VERR_INVALID_PARAMETER);
+    AssertReturn((surfaceFlags & SVGA3D_SURFACE_CUBEMAP) || cMipLevels == face[0].numMipLevels, VERR_INVALID_PARAMETER);
+
+    if (sid >= pState->cSurfaces)
+    {
+        pState->paSurface = (PVMSVGA3DSURFACE )RTMemRealloc(pState->paSurface, sizeof(VMSVGA3DSURFACE) * (sid + 1));
+        AssertReturn(pState->paSurface, VERR_NO_MEMORY);
+        memset(&pState->paSurface[pState->cSurfaces], 0, sizeof(VMSVGA3DSURFACE) * (sid + 1 - pState->cSurfaces));
+        for (uint32_t i = pState->cSurfaces; i < sid + 1; i++)
+            pState->paSurface[i].id = SVGA3D_INVALID_ID;
+
+        pState->cSurfaces = sid + 1;
+    }
+    /* If one already exists with this id, then destroy it now. */
+    if (pState->paSurface[sid].id != SVGA3D_INVALID_ID)
+        vmsvga3dSurfaceDestroy(pThis, sid);
+
+    pSurface = &pState->paSurface[sid];
+    memset(pSurface, 0, sizeof(*pSurface));
+    pSurface->id                    = sid;
+    pSurface->idAssociatedContext   = SVGA3D_INVALID_ID;
+    vmsvga3dSurfaceFormat2OGL(pSurface, format);
+
+    pSurface->oglId.buffer = OPENGL_INVALID_ID;
+
+    /* The surface type is sort of undefined now, even though the hints and format can help to clear that up. 
+     * In some case we'll have to wait until the surface is used to create the D3D object.
+     */
+    switch (format)
+    {
+    case SVGA3D_Z_D32:
+    case SVGA3D_Z_D16:
+    case SVGA3D_Z_D24S8:
+    case SVGA3D_Z_D15S1:
+    case SVGA3D_Z_D24X8:
+    case SVGA3D_Z_DF16:
+    case SVGA3D_Z_DF24:
+    case SVGA3D_Z_D24S8_INT:
+        surfaceFlags |= SVGA3D_SURFACE_HINT_DEPTHSTENCIL;
+        break;
+
+    /* Texture compression formats */
+    case SVGA3D_DXT1:
+    case SVGA3D_DXT2:
+    case SVGA3D_DXT3:
+    case SVGA3D_DXT4:
+    case SVGA3D_DXT5:
+    /* Bump-map formats */
+    case SVGA3D_BUMPU8V8:
+    case SVGA3D_BUMPL6V5U5:
+    case SVGA3D_BUMPX8L8V8U8:
+    case SVGA3D_BUMPL8V8U8:
+    case SVGA3D_V8U8:
+    case SVGA3D_Q8W8V8U8:
+    case SVGA3D_CxV8U8:
+    case SVGA3D_X8L8V8U8:
+    case SVGA3D_A2W10V10U10:
+    case SVGA3D_V16U16:
+    /* Typical render target formats; we should allow render target buffers to be used as textures. */
+    case SVGA3D_X8R8G8B8:
+    case SVGA3D_A8R8G8B8:
+    case SVGA3D_R5G6B5:
+    case SVGA3D_X1R5G5B5:
+    case SVGA3D_A1R5G5B5:
+    case SVGA3D_A4R4G4B4:
+        surfaceFlags |= SVGA3D_SURFACE_HINT_TEXTURE;
+        break;
+
+    case SVGA3D_LUMINANCE8:
+    case SVGA3D_LUMINANCE4_ALPHA4:
+    case SVGA3D_LUMINANCE16:
+    case SVGA3D_LUMINANCE8_ALPHA8:
+    case SVGA3D_ARGB_S10E5:   /* 16-bit floating-point ARGB */
+    case SVGA3D_ARGB_S23E8:   /* 32-bit floating-point ARGB */
+    case SVGA3D_A2R10G10B10:
+    case SVGA3D_ALPHA8:
+    case SVGA3D_R_S10E5:
+    case SVGA3D_R_S23E8:
+    case SVGA3D_RG_S10E5:
+    case SVGA3D_RG_S23E8:
+    case SVGA3D_G16R16:
+    case SVGA3D_A16B16G16R16:
+    case SVGA3D_UYVY:
+    case SVGA3D_YUY2:
+    case SVGA3D_NV12:
+    case SVGA3D_AYUV:
+    case SVGA3D_BC4_UNORM:
+    case SVGA3D_BC5_UNORM:
+        break;
+
+    /*
+     * Any surface can be used as a buffer object, but SVGA3D_BUFFER is
+     * the most efficient format to use when creating new surfaces
+     * expressly for index or vertex data.
+     */
+    case SVGA3D_BUFFER:
+        break;
+
+    default:
+        break;
+    }
+
+    pSurface->flags             = surfaceFlags;
+    pSurface->format            = format;
+    memcpy(pSurface->faces, face, sizeof(face));
+    pSurface->cFaces            = 1;        /* check for cube maps later */
+    pSurface->multiSampleCount  = multisampleCount;
+    pSurface->autogenFilter     = autogenFilter;
+    Assert(autogenFilter != SVGA3D_TEX_FILTER_FLATCUBIC);
+    Assert(autogenFilter != SVGA3D_TEX_FILTER_GAUSSIANCUBIC);
+    pSurface->pMipmapLevels     = (PVMSVGA3DMIPMAPLEVEL)RTMemAllocZ(cMipLevels * sizeof(VMSVGA3DMIPMAPLEVEL));
+    AssertReturn(pSurface->pMipmapLevels, VERR_NO_MEMORY);
+
+    for (uint32_t i=0; i < cMipLevels; i++)
+        pSurface->pMipmapLevels[i].size = pMipLevelSize[i];
+
+    pSurface->cbBlock = vmsvga3dSurfaceFormatSize(format);
+
+    switch (surfaceFlags & (SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET | SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_CUBEMAP))
+    {
+    case SVGA3D_SURFACE_CUBEMAP:
+        Log(("SVGA3D_SURFACE_CUBEMAP\n"));
+        pSurface->cFaces = 6;
+        break;
+
+    case SVGA3D_SURFACE_HINT_INDEXBUFFER:
+        Log(("SVGA3D_SURFACE_HINT_INDEXBUFFER\n"));
+        /* else type unknown at this time; postpone buffer creation */
+        break;
+
+    case SVGA3D_SURFACE_HINT_VERTEXBUFFER:
+        Log(("SVGA3D_SURFACE_HINT_VERTEXBUFFER\n"));
+        /* Type unknown at this time; postpone buffer creation */
+        break;
+
+    case SVGA3D_SURFACE_HINT_TEXTURE:
+        Log(("SVGA3D_SURFACE_HINT_TEXTURE\n"));
+        break;
+
+    case SVGA3D_SURFACE_HINT_RENDERTARGET:
+        Log(("SVGA3D_SURFACE_HINT_RENDERTARGET\n"));
+        break;
+
+    case SVGA3D_SURFACE_HINT_DEPTHSTENCIL:
+        Log(("SVGA3D_SURFACE_HINT_DEPTHSTENCIL\n"));
+        break;
+
+    default:
+        /* Unknown; decide later. */
+        break;
+    }
+   
+    /* Allocate buffer to hold the surface data until we can move it into a D3D object */
+    for (uint32_t iFace=0; iFace < pSurface->cFaces; iFace++)
+    {
+        for (uint32_t i=0; i < pSurface->faces[iFace].numMipLevels; i++)
+        {
+            uint32_t idx = i + iFace * pSurface->faces[0].numMipLevels;
+
+            Log(("vmsvga3dSurfaceDefine: face %d mip level %d (%d,%d,%d)\n", iFace, i, pSurface->pMipmapLevels[idx].size.width, pSurface->pMipmapLevels[idx].size.height, pSurface->pMipmapLevels[idx].size.depth));
+            Log(("vmsvga3dSurfaceDefine: cbPitch=%x cbBlock=%x \n", pSurface->cbBlock * pSurface->pMipmapLevels[idx].size.width, pSurface->cbBlock));
+
+            pSurface->pMipmapLevels[idx].cbSurfacePitch = pSurface->cbBlock * pSurface->pMipmapLevels[idx].size.width;
+            pSurface->pMipmapLevels[idx].cbSurface      = pSurface->pMipmapLevels[idx].cbSurfacePitch * pSurface->pMipmapLevels[idx].size.height * pSurface->pMipmapLevels[idx].size.depth;
+            pSurface->pMipmapLevels[idx].pSurfaceData   = RTMemAllocZ(pSurface->pMipmapLevels[idx].cbSurface);
+            AssertReturn(pSurface->pMipmapLevels[idx].pSurfaceData, VERR_NO_MEMORY);
+        }
+    }
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSurfaceDestroy(PVGASTATE pThis, uint32_t sid)
+{
+    PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    if (    sid < pState->cSurfaces
+        &&  pState->paSurface[sid].id == sid)
+    {
+        PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];
+        PVMSVGA3DCONTEXT pContext = NULL;
+
+        Log(("vmsvga3dSurfaceDestroy id %x\n", sid));
+
+        /* @todo stricter checks for associated context */
+        uint32_t cid = pSurface->idAssociatedContext;
+        if (    cid <= pState->cContexts
+            &&  pState->paContext[cid].id == cid)
+        {
+            pContext = &pState->paContext[cid];
+            VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+        }
+        else
+        {
+            /* Pick any active context; we need something here */
+            for (cid = 0; cid < pState->cContexts; cid++)
+            {
+                if (pState->paContext[cid].id == cid)
+                {
+                    pContext = &pState->paContext[cid];
+                    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+                    break;
+                }
+            }
+            AssertReturn(pContext, VERR_INTERNAL_ERROR);    /* otherwise crashes/fails */
+        }
+
+        switch (pSurface->flags & (SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET | SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_CUBEMAP))
+        {
+        case SVGA3D_SURFACE_CUBEMAP:
+            AssertFailed(); /* @todo */
+            break;
+
+        case SVGA3D_SURFACE_HINT_INDEXBUFFER:
+        case SVGA3D_SURFACE_HINT_VERTEXBUFFER:
+            if (pSurface->oglId.buffer != OPENGL_INVALID_ID)
+            {
+                pState->ext.glDeleteBuffers(1, &pSurface->oglId.buffer);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            }
+            break;
+
+        case SVGA3D_SURFACE_HINT_TEXTURE:
+        case SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET:
+            if (pSurface->oglId.texture != OPENGL_INVALID_ID)
+            {
+                glDeleteTextures(1, &pSurface->oglId.texture);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            }
+            break;
+
+        case SVGA3D_SURFACE_HINT_RENDERTARGET:
+        case SVGA3D_SURFACE_HINT_DEPTHSTENCIL:
+        case SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_HINT_TEXTURE:    /* @todo actual texture surface not supported */
+            if (pSurface->oglId.renderbuffer != OPENGL_INVALID_ID)
+            {
+                pState->ext.glDeleteRenderbuffers(1, &pSurface->oglId.renderbuffer);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            }
+            break;
+
+        default:
+            break;
+        }
+
+        if (pSurface->pMipmapLevels)
+        {
+            for (uint32_t face=0; face < pSurface->cFaces; face++)
+            {
+                for (uint32_t i=0; i < pSurface->faces[face].numMipLevels; i++)
+                {
+                    uint32_t idx = i + face * pSurface->faces[0].numMipLevels;
+                    if (pSurface->pMipmapLevels[idx].pSurfaceData)
+                        RTMemFree(pSurface->pMipmapLevels[idx].pSurfaceData);
+                }
+            }
+            RTMemFree(pSurface->pMipmapLevels);
+        }
+
+        memset(pSurface, 0, sizeof(*pSurface));
+        pSurface->id = SVGA3D_INVALID_ID;
+    }
+    else
+        AssertFailedReturn(VERR_INVALID_PARAMETER);
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSurfaceCopy(PVGASTATE pThis, SVGA3dSurfaceImageId dest, SVGA3dSurfaceImageId src, uint32_t cCopyBoxes, SVGA3dCopyBox *pBox)
+{
+    PVMSVGA3DSTATE      pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    uint32_t            sidSrc = src.sid;
+    uint32_t            sidDest = dest.sid;
+    int                 rc = VINF_SUCCESS;
+
+    AssertReturn(pState, VERR_NO_MEMORY);
+    AssertReturn(sidSrc < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(sidSrc < pState->cSurfaces && pState->paSurface[sidSrc].id == sidSrc, VERR_INVALID_PARAMETER);
+    AssertReturn(sidDest < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(sidDest < pState->cSurfaces && pState->paSurface[sidDest].id == sidDest, VERR_INVALID_PARAMETER);
+
+    for (uint32_t i = 0; i < cCopyBoxes; i++)
+    {
+        SVGA3dBox destBox, srcBox;
+
+        srcBox.x = pBox[i].srcx;
+        srcBox.y = pBox[i].srcy;
+        srcBox.z = pBox[i].srcz;
+        srcBox.w = pBox[i].w;
+        srcBox.h = pBox[i].h;
+        srcBox.d = pBox[i].z;
+
+        destBox.x = pBox[i].x;
+        destBox.y = pBox[i].y;
+        destBox.z = pBox[i].z;
+        destBox.w = pBox[i].w;
+        destBox.h = pBox[i].h;
+        destBox.z = pBox[i].z;
+
+        rc = vmsvga3dSurfaceStretchBlt(pThis, dest, destBox, src, srcBox, SVGA3D_STRETCH_BLT_LINEAR);
+        AssertRCReturn(rc, rc);
+    }
+    return VINF_SUCCESS;
+}
+
+/* Create D3D texture object for the specified surface. */
+static int vmsvga3dCreateTexture(PVMSVGA3DSTATE pState, PVMSVGA3DCONTEXT pContext, uint32_t idAssociatedContext, PVMSVGA3DSURFACE pSurface)
+{
+    GLint activeTexture = 0;
+
+    glGenTextures(1, &pSurface->oglId.texture);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+    /* @todo Set the mip map generation filter settings. */
+
+    glGetIntegerv(GL_TEXTURE_BINDING_2D, &activeTexture);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    /* Must bind texture to the current context in order to change it. */
+    glBindTexture(GL_TEXTURE_2D, pSurface->oglId.texture);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    if (pSurface->fDirty)
+    {
+        Log(("vmsvga3dCreateTexture: sync dirty texture\n"));
+        for (uint32_t i = 0; i < pSurface->faces[0].numMipLevels; i++)
+        {
+            if (pSurface->pMipmapLevels[i].fDirty)
+            {
+                Log(("vmsvga3dCreateTexture: sync dirty texture mipmap level %d (pitch %x)\n", i, pSurface->pMipmapLevels[i].cbSurfacePitch));
+
+                glTexImage2D(GL_TEXTURE_2D, 
+                             i, 
+                             pSurface->internalFormatGL, 
+                             pSurface->pMipmapLevels[i].size.width, 
+                             pSurface->pMipmapLevels[i].size.height, 
+                             0, 
+                             pSurface->formatGL, 
+                             pSurface->typeGL, 
+                             pSurface->pMipmapLevels[i].pSurfaceData);
+
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+                pSurface->pMipmapLevels[i].fDirty = false;
+            }
+        }
+        pSurface->fDirty = false;
+    }
+    else
+        /* Reserve texture memory. */
+        glTexImage2D(GL_TEXTURE_2D, 
+                     0, 
+                     pSurface->internalFormatGL, 
+                     pSurface->pMipmapLevels[0].size.width, 
+                     pSurface->pMipmapLevels[0].size.height, 
+                     0, 
+                     pSurface->formatGL,
+                     pSurface->typeGL, 
+                     NULL);
+
+    /* Restore the old active texture. */
+    glBindTexture(GL_TEXTURE_2D, activeTexture);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    pSurface->flags              |= SVGA3D_SURFACE_HINT_TEXTURE;
+    pSurface->idAssociatedContext = idAssociatedContext;
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSurfaceStretchBlt(PVGASTATE pThis, SVGA3dSurfaceImageId dest, SVGA3dBox destBox, SVGA3dSurfaceImageId src, SVGA3dBox srcBox, SVGA3dStretchBltMode mode)
+{
+    PVMSVGA3DSTATE      pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    PVMSVGA3DSURFACE    pSurfaceSrc;
+    uint32_t            sidSrc = src.sid;
+    PVMSVGA3DSURFACE    pSurfaceDest;
+    uint32_t            sidDest = dest.sid;
+    int                 rc = VINF_SUCCESS;
+    uint32_t            cid;
+    PVMSVGA3DCONTEXT    pContext;
+
+    AssertReturn(pState, VERR_NO_MEMORY);
+    AssertReturn(sidSrc < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(sidSrc < pState->cSurfaces && pState->paSurface[sidSrc].id == sidSrc, VERR_INVALID_PARAMETER);
+    AssertReturn(sidDest < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(sidDest < pState->cSurfaces && pState->paSurface[sidDest].id == sidDest, VERR_INVALID_PARAMETER);
+
+    pSurfaceSrc  = &pState->paSurface[sidSrc];
+    pSurfaceDest = &pState->paSurface[sidDest];
+    AssertReturn(pSurfaceSrc->faces[0].numMipLevels > src.mipmap, VERR_INVALID_PARAMETER);
+    AssertReturn(pSurfaceDest->faces[0].numMipLevels > dest.mipmap, VERR_INVALID_PARAMETER);
+
+    Log(("vmsvga3dSurfaceStretchBlt: src sid=%x (%d,%d)(%d,%d) dest sid=%x (%d,%d)(%d,%d) mode=%x\n", src.sid, srcBox.x, srcBox.y, srcBox.x + srcBox.w, srcBox.y + srcBox.h, dest.sid, destBox.x, destBox.y, destBox.x + destBox.w, destBox.y + destBox.h, mode));
+
+    /* @todo stricter checks for associated context */
+    cid = pSurfaceDest->idAssociatedContext;
+    if (cid == SVGA3D_INVALID_ID)
+        cid = pSurfaceSrc->idAssociatedContext;
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSurfaceStretchBlt invalid context id!\n"));
+        AssertFailedReturn(VERR_INVALID_PARAMETER);
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    if (pSurfaceSrc->oglId.texture == OPENGL_INVALID_ID)
+    {
+        /* Unknown surface type; turn it into a texture, which can be used for other purposes too. */
+        Log(("vmsvga3dSurfaceStretchBlt: unknown src surface id=%x type=%d format=%d -> create texture\n", sidSrc, pSurfaceSrc->flags, pSurfaceSrc->format));
+        rc = vmsvga3dCreateTexture(pState, pContext, cid, pSurfaceSrc);
+        AssertRCReturn(rc, rc);
+    }
+
+    if (pSurfaceDest->oglId.texture == OPENGL_INVALID_ID)
+    {
+        /* Unknown surface type; turn it into a texture, which can be used for other purposes too. */
+        Log(("vmsvga3dSurfaceStretchBlt: unknown dest surface id=%x type=%d format=%d -> create texture\n", sidDest, pSurfaceDest->flags, pSurfaceDest->format));
+        rc = vmsvga3dCreateTexture(pState, pContext, cid, pSurfaceDest);
+        AssertRCReturn(rc, rc);
+    }
+
+    /* Activate the read and draw framebuffer objects. */
+    pState->ext.glBindFramebuffer(GL_READ_FRAMEBUFFER, pContext->idReadFramebuffer);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+    pState->ext.glBindFramebuffer(GL_DRAW_FRAMEBUFFER, pContext->idDrawFramebuffer);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    /* Bind the source and destination objects to the right place. */
+    pState->ext.glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pSurfaceSrc->oglId.texture, src.mipmap);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+    pState->ext.glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pSurfaceDest->oglId.texture, dest.mipmap);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    Log(("src conv. (%d,%d)(%d,%d); dest conv (%d,%d)(%d,%d)\n", srcBox.x, D3D_TO_OGL_Y_COORD(pSurfaceSrc, srcBox.y + srcBox.h),     
+         srcBox.x + srcBox.w, D3D_TO_OGL_Y_COORD(pSurfaceSrc, srcBox.y), destBox.x, D3D_TO_OGL_Y_COORD(pSurfaceDest, destBox.y + destBox.h),  
+         destBox.x + destBox.w, D3D_TO_OGL_Y_COORD(pSurfaceDest, destBox.y)));
+
+    pState->ext.glBlitFramebuffer(srcBox.x,
+#ifdef MANUAL_FLIP_SURFACE_DATA
+                                  D3D_TO_OGL_Y_COORD(pSurfaceSrc, srcBox.y + srcBox.h),     /* inclusive */
+#else
+                                  srcBox.y,
+#endif
+                                  srcBox.x + srcBox.w,                                      /* exclusive. */
+#ifdef MANUAL_FLIP_SURFACE_DATA
+                                  D3D_TO_OGL_Y_COORD(pSurfaceSrc, srcBox.y),                /* exclusive */
+#else
+                                  srcBox.y + srcBox.h,
+#endif
+                                  destBox.x,
+#ifdef MANUAL_FLIP_SURFACE_DATA
+                                  D3D_TO_OGL_Y_COORD(pSurfaceDest, destBox.y + destBox.h),  /* inclusive. */
+#else
+                                  destBox.y,
+#endif
+                                  destBox.x + destBox.w,                                    /* exclusive. */
+#ifdef MANUAL_FLIP_SURFACE_DATA
+                                  D3D_TO_OGL_Y_COORD(pSurfaceDest, destBox.y),              /* exclusive */                         
+#else
+                                  destBox.y + destBox.h,
+#endif
+                                  GL_COLOR_BUFFER_BIT,
+                                  (mode == SVGA3D_STRETCH_BLT_POINT) ? GL_NEAREST : GL_LINEAR);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    /* Reset the frame buffer association */
+    pState->ext.glBindFramebuffer(GL_FRAMEBUFFER, pContext->idFramebuffer);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSurfaceDMA(PVGASTATE pThis, SVGA3dGuestImage guest, SVGA3dSurfaceImageId host, SVGA3dTransferType transfer, uint32_t cCopyBoxes, SVGA3dCopyBox *pBoxes)
+{
+    PVMSVGA3DSTATE          pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    PVMSVGA3DSURFACE        pSurface;
+    PVMSVGA3DMIPMAPLEVEL    pMipLevel;
+    uint32_t                sid = host.sid;
+    int                     rc = VINF_SUCCESS;
+
+    AssertReturn(pState, VERR_NO_MEMORY);
+    AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(sid < pState->cSurfaces && pState->paSurface[sid].id == sid, VERR_INVALID_PARAMETER);
+
+    pSurface = &pState->paSurface[sid];
+    AssertReturn(pSurface->faces[0].numMipLevels > host.mipmap, VERR_INVALID_PARAMETER);
+    pMipLevel = &pSurface->pMipmapLevels[host.mipmap];
+
+    if (pSurface->flags & SVGA3D_SURFACE_HINT_TEXTURE)
+        Log(("vmsvga3dSurfaceDMA TEXTURE guestptr gmr=%x offset=%x pitch=%x host sid=%x face=%d mipmap=%d transfer=%x cCopyBoxes=%d\n", guest.ptr.gmrId, guest.ptr.offset, guest.pitch, host.sid, host.face, host.mipmap, transfer, cCopyBoxes));
+    else
+        Log(("vmsvga3dSurfaceDMA guestptr gmr=%x offset=%x pitch=%x host sid=%x face=%d mipmap=%d transfer=%x cCopyBoxes=%d\n", guest.ptr.gmrId, guest.ptr.offset, guest.pitch, host.sid, host.face, host.mipmap, transfer, cCopyBoxes));
+
+    if (pSurface->oglId.texture == OPENGL_INVALID_ID)
+    {
+        AssertReturn(pSurface->pMipmapLevels[host.mipmap].pSurfaceData, VERR_INTERNAL_ERROR);
+
+        for (unsigned i = 0; i < cCopyBoxes; i++)
+        {
+            unsigned uDestOffset;
+            unsigned cbSrcPitch;
+            uint8_t *pBufferStart;
+
+            Log(("Copy box %d (%d,%d,%d)(%d,%d,%d) dest (%d,%d)\n", i, pBoxes[i].srcx, pBoxes[i].srcy, pBoxes[i].srcz, pBoxes[i].w, pBoxes[i].h, pBoxes[i].d, pBoxes[i].x, pBoxes[i].y));
+            /* Apparently we're supposed to clip it (gmr test sample) */
+            if (pBoxes[i].x + pBoxes[i].w > pMipLevel->size.width)
+                pBoxes[i].w = pMipLevel->size.width - pBoxes[i].x;
+            if (pBoxes[i].y + pBoxes[i].h > pMipLevel->size.height)
+                pBoxes[i].h = pMipLevel->size.height - pBoxes[i].y;
+            if (pBoxes[i].z + pBoxes[i].d > pMipLevel->size.depth)
+                pBoxes[i].d = pMipLevel->size.depth - pBoxes[i].z;
+
+            if (    !pBoxes[i].w
+                ||  !pBoxes[i].h
+                ||  !pBoxes[i].d
+                ||   pBoxes[i].x > pMipLevel->size.width
+                ||   pBoxes[i].y > pMipLevel->size.height
+                ||   pBoxes[i].z > pMipLevel->size.depth)
+            {
+                Log(("Empty box; skip\n"));
+                continue;
+            }
+
+            uDestOffset = pBoxes[i].x * pSurface->cbBlock + pBoxes[i].y * pMipLevel->cbSurfacePitch + pBoxes[i].z * pMipLevel->size.height * pMipLevel->cbSurfacePitch;
+            AssertReturn(uDestOffset + pBoxes[i].w * pSurface->cbBlock * pBoxes[i].h * pBoxes[i].d <= pMipLevel->cbSurface, VERR_INTERNAL_ERROR);
+
+            cbSrcPitch = (guest.pitch == 0) ? pBoxes[i].w * pSurface->cbBlock : guest.pitch;
+#ifdef MANUAL_FLIP_SURFACE_DATA
+            pBufferStart =    (uint8_t *)pMipLevel->pSurfaceData
+                            + pBoxes[i].x * pSurface->cbBlock 
+                            + pMipLevel->cbSurface - pBoxes[i].y * pMipLevel->cbSurfacePitch
+                            - pMipLevel->cbSurfacePitch;      /* flip image during copy */
+#else
+            pBufferStart = (uint8_t *)pMipLevel->pSurfaceData + uDestOffset;
+#endif
+            rc = vmsvgaGMRTransfer(pThis, 
+                                    transfer,
+                                    pBufferStart,
+#ifdef MANUAL_FLIP_SURFACE_DATA
+                                    -(int32_t)pMipLevel->cbSurfacePitch, 
+#else
+                                    (int32_t)pMipLevel->cbSurfacePitch, 
+#endif
+                                    guest.ptr,
+                                    pBoxes[i].srcx * pSurface->cbBlock + (pBoxes[i].srcy + pBoxes[i].srcz * pBoxes[i].h) * cbSrcPitch,
+                                    cbSrcPitch,
+                                    pBoxes[i].w * pSurface->cbBlock,
+                                    pBoxes[i].d * pBoxes[i].h);
+
+            LogFlow(("first line:\n%.*Rhxd\n", pMipLevel->cbSurface, pMipLevel->pSurfaceData));
+
+            AssertRC(rc);
+        }
+        pSurface->pMipmapLevels[host.mipmap].fDirty = true;
+        pSurface->fDirty = true;
+    }
+    else
+    {
+        /* @todo stricter checks for associated context */
+        uint32_t cid = pSurface->idAssociatedContext;
+        if (    cid >= pState->cContexts
+            ||  pState->paContext[cid].id != cid)
+        {
+            Log(("vmsvga3dSurfaceDMA invalid context id (%x - %x)!\n", cid, (cid >= pState->cContexts) ? -1 : pState->paContext[cid].id));
+            AssertFailedReturn(VERR_INVALID_PARAMETER);
+        }
+        PVMSVGA3DCONTEXT pContext = &pState->paContext[cid];
+        VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+        for (unsigned i = 0; i < cCopyBoxes; i++)
+        {
+            bool fVertex = false;
+            unsigned cbSrcPitch;
+
+            /* Apparently we're supposed to clip it (gmr test sample) */
+            if (pBoxes[i].x + pBoxes[i].w > pMipLevel->size.width)
+                pBoxes[i].w = pMipLevel->size.width - pBoxes[i].x;
+            if (pBoxes[i].y + pBoxes[i].h > pMipLevel->size.height)
+                pBoxes[i].h = pMipLevel->size.height - pBoxes[i].y;
+            if (pBoxes[i].z + pBoxes[i].d > pMipLevel->size.depth)
+                pBoxes[i].d = pMipLevel->size.depth - pBoxes[i].z;
+
+            Assert((pBoxes[i].d == 1 || pBoxes[i].d == 0) && pBoxes[i].z == 0);
+
+            if (    !pBoxes[i].w
+                ||  !pBoxes[i].h
+                ||   pBoxes[i].x > pMipLevel->size.width
+                ||   pBoxes[i].y > pMipLevel->size.height)
+            {
+                Log(("Empty box; skip\n"));
+                continue;
+            }
+
+            Log(("Copy box %d (%d,%d,%d)(%d,%d,%d) dest (%d,%d)\n", i, pBoxes[i].srcx, pBoxes[i].srcy, pBoxes[i].srcz, pBoxes[i].w, pBoxes[i].h, pBoxes[i].d, pBoxes[i].x, pBoxes[i].y));
+
+            cbSrcPitch = (guest.pitch == 0) ? pBoxes[i].w * pSurface->cbBlock : guest.pitch;
+
+            switch (pSurface->flags & (SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET | SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_CUBEMAP))
+            {
+            case SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET:
+            case SVGA3D_SURFACE_HINT_TEXTURE:
+            case SVGA3D_SURFACE_HINT_RENDERTARGET:
+            {
+                uint32_t cbSurfacePitch;
+                uint8_t *pDoubleBuffer, *pBufferStart;
+                unsigned uDestOffset = 0;
+
+                pDoubleBuffer = (uint8_t *)RTMemAlloc(pMipLevel->cbSurface);
+                AssertReturn(pDoubleBuffer, VERR_NO_MEMORY);
+
+                if (transfer == SVGA3D_READ_HOST_VRAM)
+                {
+                    GLint activeTexture;
+
+                    glGetIntegerv(GL_TEXTURE_BINDING_2D, &activeTexture);
+                    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+                    glBindTexture(GL_TEXTURE_2D, pSurface->oglId.texture);
+                    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+                    glGetTexImage(GL_TEXTURE_2D,
+                                  host.mipmap,
+                                  pSurface->formatGL, 
+                                  pSurface->typeGL, 
+                                  pDoubleBuffer);
+                    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+                    /* Restore the old active texture. */
+                    glBindTexture(GL_TEXTURE_2D, activeTexture);
+                    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+                    uDestOffset = pBoxes[i].x * pSurface->cbBlock + pBoxes[i].y * pMipLevel->cbSurfacePitch;
+                    AssertReturn(uDestOffset + pBoxes[i].w * pSurface->cbBlock + (pBoxes[i].h - 1) * pMipLevel->cbSurfacePitch <= pMipLevel->cbSurface, VERR_INTERNAL_ERROR);
+
+                    cbSurfacePitch = pMipLevel->cbSurfacePitch;
+
+#ifdef MANUAL_FLIP_SURFACE_DATA
+                    pBufferStart =   pDoubleBuffer 
+                                   + pBoxes[i].x * pSurface->cbBlock 
+                                   + pMipLevel->cbSurface - pBoxes[i].y * cbSurfacePitch 
+                                   - cbSurfacePitch;      /* flip image during copy */
+#else
+                    pBufferStart = pDoubleBuffer + uDestOffset;
+#endif
+                }
+                else
+                {
+                    cbSurfacePitch = pBoxes[i].w * pSurface->cbBlock;
+#ifdef MANUAL_FLIP_SURFACE_DATA
+                    pBufferStart = pDoubleBuffer + cbSurfacePitch * pBoxes[i].h - cbSurfacePitch;      /* flip image during copy */
+#else
+                    pBufferStart = pDoubleBuffer;
+#endif
+                }
+
+                rc = vmsvgaGMRTransfer(pThis, 
+                                       transfer,
+                                       pBufferStart,
+#ifdef MANUAL_FLIP_SURFACE_DATA
+                                       -(int32_t)cbSurfacePitch,
+#else
+                                       (int32_t)cbSurfacePitch,
+#endif
+                                       guest.ptr,
+                                       pBoxes[i].srcx * pSurface->cbBlock + pBoxes[i].srcy * cbSrcPitch,
+                                       cbSrcPitch,
+                                       pBoxes[i].w * pSurface->cbBlock,
+                                       pBoxes[i].h);
+                AssertRC(rc);
+
+                /* Update the opengl surface data. */
+                if (transfer == SVGA3D_WRITE_HOST_VRAM)
+                {
+                    GLint activeTexture = 0;
+                    GLint alignment;
+
+                    glGetIntegerv(GL_TEXTURE_BINDING_2D, &activeTexture);
+                    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+                    /* Must bind texture to the current context in order to change it. */
+                    glBindTexture(GL_TEXTURE_2D, pSurface->oglId.texture);
+                    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+                    Log(("vmsvga3dSurfaceDMA: copy texture mipmap level %d (pitch %x)\n", host.mipmap, pMipLevel->cbSurfacePitch));
+
+                    /* Set row length and alignment of the input data. */
+                    glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
+                    glPixelStorei(GL_UNPACK_ROW_LENGTH, pBoxes[i].w);
+                    glPixelStorei(GL_UNPACK_ALIGNMENT, pSurface->cbBlock);
+
+                    glTexSubImage2D(GL_TEXTURE_2D,
+                                    host.mipmap,
+                                    pBoxes[i].x,
+                                    pBoxes[i].y,
+                                    pBoxes[i].w,
+                                    pBoxes[i].h,
+                                    pSurface->formatGL, 
+                                    pSurface->typeGL, 
+                                    pDoubleBuffer);
+
+                    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+                    /* Restore old values. */
+                    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+                    glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
+
+                    /* Restore the old active texture. */
+                    glBindTexture(GL_TEXTURE_2D, activeTexture);
+                    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+                }
+                /* Free the double buffer. */
+                RTMemFree(pDoubleBuffer);
+
+                LogFlow(("first line:\n%.*Rhxd\n", pBoxes[i].w * pSurface->cbBlock, pDoubleBuffer));
+                break;
+            }
+
+            case SVGA3D_SURFACE_HINT_DEPTHSTENCIL:
+                AssertFailed(); /* @todo */
+                break;
+
+            case SVGA3D_SURFACE_HINT_VERTEXBUFFER:
+            case SVGA3D_SURFACE_HINT_INDEXBUFFER:
+            {
+                uint8_t *pData;
+                unsigned uDestOffset;
+
+                Assert(pBoxes[i].h == 1);
+
+                pState->ext.glBindBuffer(GL_ARRAY_BUFFER, pSurface->oglId.buffer);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+                pData = (uint8_t *)pState->ext.glMapBuffer(GL_ARRAY_BUFFER, (transfer == SVGA3D_READ_HOST_VRAM) ? GL_READ_ONLY : GL_WRITE_ONLY);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                Assert(pData);
+
+                uDestOffset = pBoxes[i].x * pSurface->cbBlock + pBoxes[i].y * pMipLevel->cbSurfacePitch;
+                AssertReturn(uDestOffset + pBoxes[i].w * pSurface->cbBlock + (pBoxes[i].h - 1) * pMipLevel->cbSurfacePitch <= pMipLevel->cbSurface, VERR_INTERNAL_ERROR);
+
+                Log(("Lock %s memory for rectangle (%d,%d)(%d,%d)\n", (fVertex) ? "vertex" : "index", pBoxes[i].x, pBoxes[i].y, pBoxes[i].x + pBoxes[i].w, pBoxes[i].y + pBoxes[i].h));
+
+                rc = vmsvgaGMRTransfer(pThis, 
+                                       transfer,
+                                       pData + uDestOffset, 
+                                       pMipLevel->cbSurfacePitch, 
+                                       guest.ptr,
+                                       pBoxes[i].srcx * pSurface->cbBlock + pBoxes[i].srcy * cbSrcPitch,
+                                       cbSrcPitch,
+                                       pBoxes[i].w * pSurface->cbBlock,
+                                       pBoxes[i].h);
+                AssertRC(rc);
+
+                LogFlow(("first line:\n%.*Rhxd\n", cbSrcPitch, pData));
+
+                pState->ext.glUnmapBuffer(GL_ARRAY_BUFFER);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+                pState->ext.glBindBuffer(GL_ARRAY_BUFFER, 0);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                break;
+            }
+
+            default:
+                AssertFailed();
+                break;
+            }
+        }
+    }
+    return rc;
+}
+
+int vmsvga3dSurfaceBlitToScreen(PVGASTATE pThis, uint32_t dest, SVGASignedRect destRect, SVGA3dSurfaceImageId src, SVGASignedRect srcRect, uint32_t cRects, SVGASignedRect *pRect)
+{
+    /* Requires SVGA_FIFO_CAP_SCREEN_OBJECT support */
+    Log(("vmsvga3dSurfaceBlitToScreen: dest=%d (%d,%d)(%d,%d) surface=%x (face=%d, mipmap=%d) (%d,%d)(%d,%d) cRects=%d\n", dest, destRect.left, destRect.top, destRect.right, destRect.bottom, src.sid, src.face, src.mipmap, srcRect.left, srcRect.top, srcRect.right, srcRect.bottom, cRects));
+    for (uint32_t i = 0; i < cRects; i++)
+    {
+        Log(("vmsvga3dSurfaceBlitToScreen: clipping rect %d (%d,%d)(%d,%d)\n", i, pRect[i].left, pRect[i].top, pRect[i].right, pRect[i].bottom));
+    }
+
+    /* @todo Only screen 0 for now. */
+    AssertReturn(dest == 0, VERR_INTERNAL_ERROR);
+    AssertReturn(src.mipmap == 0 && src.face == 0, VERR_INVALID_PARAMETER);
+    /* @todo scaling */
+    AssertReturn(destRect.right - destRect.left == srcRect.right - srcRect.left && destRect.bottom - destRect.top == srcRect.bottom - srcRect.top, VERR_INVALID_PARAMETER);
+
+    if (cRects == 0)
+    {
+        /* easy case; no clipping */
+        SVGA3dCopyBox        box;
+        SVGA3dGuestImage     dst;
+       
+        box.x       = destRect.left;
+        box.y       = destRect.top;
+        box.z       = 0;
+        box.w       = destRect.right - destRect.left;
+        box.h       = destRect.bottom - destRect.top;
+        box.d       = 1;
+        box.srcx    = srcRect.left;
+        box.srcy    = srcRect.top;
+        box.srcz    = 0;
+
+        dst.ptr.gmrId  = SVGA_GMR_FRAMEBUFFER;
+        dst.ptr.offset = 0;
+        dst.pitch      = pThis->svga.cbScanline;
+
+        int rc = vmsvga3dSurfaceDMA(pThis, dst, src, SVGA3D_READ_HOST_VRAM, 1, &box);
+        AssertRCReturn(rc, rc);
+
+        vgaR3UpdateDisplay(pThis, box.x, box.y, box.w, box.h);
+        return VINF_SUCCESS;
+    }
+    else
+    {
+        SVGA3dGuestImage dst;
+        SVGA3dCopyBox    box;
+
+        box.srcz    = 0;
+        box.z       = 0;
+        box.d       = 1;
+
+        dst.ptr.gmrId  = SVGA_GMR_FRAMEBUFFER;
+        dst.ptr.offset = 0;
+        dst.pitch      = pThis->svga.cbScanline;
+
+        /* @todo merge into one SurfaceDMA call */
+        for (uint32_t i = 0; i < cRects; i++)
+        {   
+            /* The clipping rectangle is relative to the top-left corner of srcRect & destRect. Adjust here. */
+            box.srcx = srcRect.left + pRect[i].left;
+            box.srcy = srcRect.top  + pRect[i].top;
+
+            box.x    = pRect[i].left + destRect.left;
+            box.y    = pRect[i].top  + destRect.top;
+            box.z    = 0;
+            box.w    = pRect[i].right - pRect[i].left;
+            box.h    = pRect[i].bottom - pRect[i].top;
+
+            int rc = vmsvga3dSurfaceDMA(pThis, dst, src, SVGA3D_READ_HOST_VRAM, 1, &box);
+            AssertRCReturn(rc, rc);
+
+            vgaR3UpdateDisplay(pThis, box.x, box.y, box.w, box.h);
+        }
+
+        return VINF_SUCCESS;
+    }
+}
+
+int vmsvga3dGenerateMipmaps(PVGASTATE pThis, uint32_t sid, SVGA3dTextureFilter filter)
+{
+    PVMSVGA3DSTATE      pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    PVMSVGA3DSURFACE    pSurface;
+    int                 rc = VINF_SUCCESS;
+    PVMSVGA3DCONTEXT    pContext;
+    uint32_t            cid;
+    GLint               activeTexture = 0;
+
+    AssertReturn(pState, VERR_NO_MEMORY);
+    AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(sid < pState->cSurfaces && pState->paSurface[sid].id == sid, VERR_INVALID_PARAMETER);
+
+    pSurface = &pState->paSurface[sid];
+    AssertReturn(pSurface->idAssociatedContext != SVGA3D_INVALID_ID, VERR_INTERNAL_ERROR);
+
+    Assert(filter != SVGA3D_TEX_FILTER_FLATCUBIC);
+    Assert(filter != SVGA3D_TEX_FILTER_GAUSSIANCUBIC);
+    pSurface->autogenFilter = filter;
+
+    Log(("vmsvga3dGenerateMipmaps: sid=%x filter=%d\n", sid, filter));
+
+    /* @todo stricter checks for associated context */
+    cid = pSurface->idAssociatedContext;
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dGenerateMipmaps invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    if (pSurface->oglId.texture == OPENGL_INVALID_ID)
+    {
+        /* Unknown surface type; turn it into a texture. */
+        Log(("vmsvga3dGenerateMipmaps: unknown src surface id=%x type=%d format=%d -> create texture\n", sid, pSurface->flags, pSurface->format));
+        rc = vmsvga3dCreateTexture(pState, pContext, cid, pSurface);
+        AssertRCReturn(rc, rc);
+    }
+    else
+    {
+        /* @todo new filter */
+        AssertFailed();
+    }
+
+    glGetIntegerv(GL_TEXTURE_BINDING_2D, &activeTexture);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    /* Must bind texture to the current context in order to change it. */
+    glBindTexture(GL_TEXTURE_2D, pSurface->oglId.texture);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    /* Generate the mip maps. */
+    pState->ext.glGenerateMipmap(GL_TEXTURE_2D);    
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    /* Restore the old texture. */
+    glBindTexture(GL_TEXTURE_2D, activeTexture);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dCommandPresent(PVGASTATE pThis, uint32_t sid, uint32_t cRects, SVGA3dCopyRect *pRect)
+{
+    PVMSVGA3DSTATE      pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    PVMSVGA3DSURFACE    pSurface;
+    int                 rc = VINF_SUCCESS;
+    PVMSVGA3DCONTEXT    pContext;
+    uint32_t            cid;
+    struct 
+    {
+        uint32_t        x;
+        uint32_t        y;
+        uint32_t        cx;
+        uint32_t        cy;
+    } srcViewPort;
+
+    AssertReturn(pState, VERR_NO_MEMORY);
+    AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(sid < pState->cSurfaces && pState->paSurface[sid].id == sid, VERR_INVALID_PARAMETER);
+
+    pSurface = &pState->paSurface[sid];
+    AssertReturn(pSurface->idAssociatedContext != SVGA3D_INVALID_ID, VERR_INTERNAL_ERROR);
+
+    /* @todo stricter checks for associated context */
+    cid = pSurface->idAssociatedContext;
+    Log(("vmsvga3dCommandPresent: sid=%x cRects=%d cid=%x\n", sid, cRects, cid));
+    for (uint32_t i=0; i < cRects; i++)
+    {
+        Log(("vmsvga3dCommandPresent: rectangle %d src=(%d,%d) (%d,%d)(%d,%d)\n", i, pRect[i].srcx, pRect[i].srcy, pRect[i].x, pRect[i].y, pRect[i].x + pRect[i].w, pRect[i].y + pRect[i].h));
+    }
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dCommandPresent invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    /* Source surface different size? */
+    if (pSurface->pMipmapLevels[0].size.width  != pThis->svga.uWidth ||
+        pSurface->pMipmapLevels[0].size.height != pThis->svga.uHeight)
+    {
+        float xMultiplier = (float)pSurface->pMipmapLevels[0].size.width / (float)pThis->svga.uWidth;
+        float yMultiplier = (float)pSurface->pMipmapLevels[0].size.height / (float)pThis->svga.uHeight;
+
+        LogFlow(("size (%d vs %d) (%d vs %d) multiplier %d\n", pSurface->pMipmapLevels[0].size.width, pThis->svga.uWidth, pSurface->pMipmapLevels[0].size.height, pThis->svga.uHeight, (int)(xMultiplier * 100.0), (int)(yMultiplier * 100.0)));
+
+        srcViewPort.x  = (uint32_t)((float)pThis->svga.viewport.x  * xMultiplier);
+        srcViewPort.y  = (uint32_t)((float)pThis->svga.viewport.y  * yMultiplier);
+        srcViewPort.cx = (uint32_t)((float)pThis->svga.viewport.cx * xMultiplier);
+        srcViewPort.cy = (uint32_t)((float)pThis->svga.viewport.cy * yMultiplier);
+    }
+    else
+    {
+        srcViewPort.x  = pThis->svga.viewport.x;
+        srcViewPort.y  = pThis->svga.viewport.y;
+        srcViewPort.cx = pThis->svga.viewport.cx;
+        srcViewPort.cy = pThis->svga.viewport.cy;
+    }
+
+#if 1
+    /* @note this path is slightly faster than the glBlitFrameBuffer path below. */
+    SVGA3dCopyRect rect;
+    uint32_t oldVShader, oldPShader;
+    GLint oldTextureId;
+
+    if (cRects == 0)
+    {
+        rect.x = rect.y = rect.srcx = rect.srcy = 0;
+        rect.w = pSurface->pMipmapLevels[0].size.width;
+        rect.h = pSurface->pMipmapLevels[0].size.height;
+        pRect  = &rect;
+        cRects = 1;
+    }
+
+    //glPushAttrib(GL_ENABLE_BIT | GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_VIEWPORT_BIT);
+
+#if 0
+    glDisable(GL_CULL_FACE);
+    glDisable(GL_BLEND);
+    glDisable(GL_ALPHA_TEST);
+    glDisable(GL_SCISSOR_TEST);
+    glDisable(GL_STENCIL_TEST);
+    glEnable(GL_DEPTH_TEST);
+    glDepthFunc(GL_ALWAYS);
+    glDepthMask(GL_TRUE);
+    glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
+    glViewport(0, 0, pSurface->pMipmapLevels[0].size.width, pSurface->pMipmapLevels[0].size.height);
+#endif
+
+    glGetIntegerv(GL_TEXTURE_BINDING_2D, &oldTextureId);
+
+    oldVShader = pContext->state.shidVertex;
+    oldPShader = pContext->state.shidPixel;
+    vmsvga3dShaderSet(pThis, cid, SVGA3D_SHADERTYPE_VS, SVGA_ID_INVALID);
+    vmsvga3dShaderSet(pThis, cid, SVGA3D_SHADERTYPE_PS, SVGA_ID_INVALID);
+
+    /* Flush shader changes. */
+    if (pContext->pShaderContext)
+        ShaderUpdateState(pContext->pShaderContext, 0);
+
+    /* Activate the read and draw framebuffer objects. */
+    pState->ext.glBindFramebuffer(GL_READ_FRAMEBUFFER, pContext->idReadFramebuffer);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+    pState->ext.glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0 /* back buffer */);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    pState->ext.glActiveTexture(GL_TEXTURE0);
+    glEnable(GL_TEXTURE_2D);
+    glBindTexture(GL_TEXTURE_2D, pSurface->oglId.texture);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+
+//    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
+//    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+
+    /* Reset the transformation matrices. */
+    glMatrixMode(GL_MODELVIEW);
+    glPushMatrix();
+    glLoadIdentity();
+    glMatrixMode(GL_PROJECTION);
+    glPushMatrix();
+    glLoadIdentity();
+    glScalef(1.0f, -1.0f, 1.0f);
+    glOrtho(0, pThis->svga.uWidth, pThis->svga.uHeight, 0, 0.0, -1.0);
+
+    for (uint32_t i = 0; i < cRects; i++)
+    {
+        float left, right, top, bottom; /* Texture coordinates */
+        int   vertexLeft, vertexRight, vertexTop, vertexBottom;
+
+        pRect[i].srcx = RT_MAX(pRect[i].srcx, srcViewPort.x);
+        pRect[i].srcy = RT_MAX(pRect[i].srcy, srcViewPort.y);
+        pRect[i].x    = RT_MAX(pRect[i].x, pThis->svga.viewport.x) - pThis->svga.viewport.x;
+        pRect[i].y    = RT_MAX(pRect[i].y, pThis->svga.viewport.y) - pThis->svga.viewport.y;
+        pRect[i].w    = pThis->svga.viewport.cx;
+        pRect[i].h    = pThis->svga.viewport.cy;
+
+        if (    pRect[i].x + pRect[i].w <= pThis->svga.viewport.x
+            ||  pThis->svga.viewport.x + pThis->svga.viewport.cx <= pRect[i].x
+            ||  pRect[i].y + pRect[i].h <= pThis->svga.viewport.y
+            ||  pThis->svga.viewport.y + pThis->svga.viewport.cy <= pRect[i].y)
+        {
+            /* Intersection is empty; skip */
+            continue;
+        }
+
+        left   = pRect[i].srcx;
+        right  = pRect[i].srcx + pRect[i].w;
+        top    = pRect[i].srcy + pRect[i].h;
+        bottom = pRect[i].srcy;
+
+        left   /= pSurface->pMipmapLevels[0].size.width;
+        right  /= pSurface->pMipmapLevels[0].size.width;
+        top    /= pSurface->pMipmapLevels[0].size.height;
+        bottom /= pSurface->pMipmapLevels[0].size.height;
+
+        vertexLeft   = pRect[i].x;
+        vertexRight  = pRect[i].x + pRect[i].w;
+        vertexTop    = ((uint32_t)pThis->svga.uHeight >= pRect[i].y + pRect[i].h) ? pThis->svga.uHeight - pRect[i].y - pRect[i].h : 0;
+        vertexBottom = pThis->svga.uHeight - pRect[i].y;
+
+        Log(("view port (%d,%d)(%d,%d)\n", srcViewPort.x, srcViewPort.y, srcViewPort.cx, srcViewPort.cy));
+        Log(("vertex (%d,%d) (%d,%d) (%d,%d) (%d,%d)\n", vertexLeft, vertexBottom, vertexLeft, vertexTop, vertexRight, vertexTop, vertexRight, vertexBottom));
+        Log(("texture (%d,%d) (%d,%d) (%d,%d) (%d,%d)\n", pRect[i].srcx, pSurface->pMipmapLevels[0].size.height - (pRect[i].srcy + pRect[i].h), pRect[i].srcx, pSurface->pMipmapLevels[0].size.height - pRect[i].srcy, pRect[i].srcx + pRect[i].w, pSurface->pMipmapLevels[0].size.height - pRect[i].srcy, pRect[i].srcx + pRect[i].w, pSurface->pMipmapLevels[0].size.height - (pRect[i].srcy + pRect[i].h)));
+
+        glBegin(GL_QUADS);
+        /* bottom left */
+        glTexCoord2f(left, bottom);
+        glVertex2i(vertexLeft, vertexBottom);
+
+        /* top left */
+        glTexCoord2f(left, top);
+        glVertex2i(vertexLeft, vertexTop);
+
+        /* top right */
+        glTexCoord2f(right, top);
+        glVertex2i(vertexRight, vertexTop);
+
+        /* bottom right */
+        glTexCoord2f(right, bottom);
+        glVertex2i(vertexRight, vertexBottom);
+
+        glEnd();
+        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+    }
+
+    /* Restore old settings. */
+    glMatrixMode(GL_PROJECTION);
+    glPopMatrix();
+    glMatrixMode(GL_MODELVIEW);
+    glPopMatrix();
+
+    //glPopAttrib();
+
+    glBindTexture(GL_TEXTURE_2D, oldTextureId);
+    vmsvga3dShaderSet(pThis, cid, SVGA3D_SHADERTYPE_VS, oldVShader);
+    vmsvga3dShaderSet(pThis, cid, SVGA3D_SHADERTYPE_PS, oldPShader);
+
+    /* Reset the frame buffer association */
+    pState->ext.glBindFramebuffer(GL_FRAMEBUFFER, pContext->idFramebuffer);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+#else
+    /* Activate the read and draw framebuffer objects. */
+    pState->ext.glBindFramebuffer(GL_READ_FRAMEBUFFER, pContext->idReadFramebuffer);
+    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+    pState->ext.glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0 /* back buffer */);
+    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+    /* Bind the source objects to the right place. */
+    pState->ext.glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pSurface->oglId.texture, 0 /* level 0 */);
+    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+    /* Blit the surface rectangle(s) to the back buffer. */
+    if (cRects == 0)
+    {
+        Log(("view port (%d,%d)(%d,%d)\n", srcViewPort.x, srcViewPort.y, srcViewPort.cx, srcViewPort.cy));
+        pState->ext.glBlitFramebuffer(srcViewPort.x,
+                                      srcViewPort.y,
+                                      srcViewPort.x + srcViewPort.cx,   /* exclusive. */
+                                      srcViewPort.y + srcViewPort.cy,   /* exclusive. (reverse to flip the image) */
+                                      0,
+                                      pThis->svga.viewport.cy, /* exclusive. */
+                                      pThis->svga.viewport.cx, /* exclusive. */
+                                      0,
+                                      GL_COLOR_BUFFER_BIT,
+                                      GL_LINEAR);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+    }
+    else
+    {
+        for (uint32_t i = 0; i < cRects; i++)
+        {
+            if (    pRect[i].x + pRect[i].w <= pThis->svga.viewport.x
+                ||  pThis->svga.viewport.x + pThis->svga.viewport.cx <= pRect[i].x
+                ||  pRect[i].y + pRect[i].h <= pThis->svga.viewport.y
+                ||  pThis->svga.viewport.y + pThis->svga.viewport.cy <= pRect[i].y)
+            {
+                /* Intersection is empty; skip */
+                continue;
+            }
+
+            pState->ext.glBlitFramebuffer(RT_MAX(pRect[i].srcx, srcViewPort.x),
+                                          pSurface->pMipmapLevels[0].size.width - RT_MAX(pRect[i].srcy, srcViewPort.y),   /* exclusive. (reverse to flip the image) */
+                                          RT_MIN(pRect[i].srcx + pRect[i].w, srcViewPort.x + srcViewPort.cx),  /* exclusive. */
+                                          pSurface->pMipmapLevels[0].size.width - RT_MIN(pRect[i].srcy + pRect[i].h, srcViewPort.y + srcViewPort.cy),
+                                          RT_MAX(pRect[i].x, pThis->svga.viewport.x) - pThis->svga.viewport.x,
+                                          pThis->svga.uHeight - (RT_MIN(pRect[i].y + pRect[i].h, pThis->svga.viewport.y + pThis->svga.viewport.cy) - pThis->svga.viewport.y),  /* exclusive. */
+                                          RT_MIN(pRect[i].x + pRect[i].w, pThis->svga.viewport.x + pThis->svga.viewport.cx) - pThis->svga.viewport.x,  /* exclusive. */
+                                          pThis->svga.uHeight - (RT_MAX(pRect[i].y, pThis->svga.viewport.y) - pThis->svga.viewport.y),
+                                          GL_COLOR_BUFFER_BIT,
+                                          GL_LINEAR);
+        }
+    }
+    /* Reset the frame buffer association */
+    pState->ext.glBindFramebuffer(GL_FRAMEBUFFER, pContext->idFramebuffer);
+    VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+#endif
+
+    /* Flip the front and back buffers. */
+#ifdef RT_OS_WINDOWS
+    BOOL ret = SwapBuffers(pContext->hdc);
+    AssertMsg(ret, ("SwapBuffers failed with %d\n", GetLastError()));
+#elif RT_OS_DARWIN
+    vmsvga3dCocoaSwapBuffers(pContext->cocoaContext);
+#else
+    /* show the window if not already done */
+    if (!pContext->fMapped)
+    {
+        XMapWindow(pState->display, pContext->window);
+        pContext->fMapped = true;
+    }
+    /* now swap the buffers, i.e. display the rendering result */
+    glXSwapBuffers(pState->display, pContext->window);
+#endif
+    return VINF_SUCCESS;
+}
+
+#ifdef RT_OS_LINUX
+/**
+ * X11 event handling thread
+ * @param ThreadSelf thread handle
+ * @param pvUser pointer to pState structure
+ * @returns VBox status code
+ */
+DECLCALLBACK(int) vmsvga3dXEventThread(RTTHREAD ThreadSelf, void *pvUser)
+{
+    PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pvUser;
+    while (!pState->bTerminate)
+    {
+        while (XPending(pState->display) > 0)
+        {
+            XEvent event;
+            XNextEvent(pState->display, &event);
+
+            switch (event.type)
+            {
+                default:
+                    break;
+            }
+        }
+        /* sleep for 16ms to not burn too many cycles */
+        RTThreadSleep(16);
+    }
+    return VINF_SUCCESS;
+}
+#endif // RT_OS_LINUX
+
+
+/**
+ * Create a new 3d context
+ *
+ * @returns VBox status code.
+ * @param   pThis           VGA device instance data.
+ * @param   cid             Context id
+ */
+int vmsvga3dContextDefine(PVGASTATE pThis, uint32_t cid)
+{
+    int                     rc;
+    PVMSVGA3DCONTEXT        pContext;
+    PVMSVGA3DSTATE          pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+
+    AssertReturn(pState, VERR_NO_MEMORY);
+    AssertReturn(cid < SVGA3D_MAX_CONTEXT_IDS, VERR_INVALID_PARAMETER);
+
+    Log(("vmsvga3dContextDefine id %x\n", cid));
+#ifdef DEBUG_DEBUG_GFX_WINDOW_TEST_CONTEXT
+    if (pState->idTestContext == SVGA_ID_INVALID)
+    {
+        pState->idTestContext = 207;
+        rc = vmsvga3dContextDefine(pThis, pState->idTestContext);
+        AssertRCReturn(rc, rc);
+    }
+#endif
+
+    if (cid >= pState->cContexts)
+    {
+        pState->paContext = (PVMSVGA3DCONTEXT)RTMemRealloc(pState->paContext, sizeof(VMSVGA3DCONTEXT) * (cid + 1));
+        AssertReturn(pState->paContext, VERR_NO_MEMORY);
+        memset(&pState->paContext[pState->cContexts], 0, sizeof(VMSVGA3DCONTEXT) * (cid + 1 - pState->cContexts));
+        for (uint32_t i = pState->cContexts; i < cid + 1; i++)
+            pState->paContext[i].id = SVGA3D_INVALID_ID;
+
+        pState->cContexts = cid + 1;
+    }
+    /* If one already exists with this id, then destroy it now. */
+    if (pState->paContext[cid].id != SVGA3D_INVALID_ID)
+        vmsvga3dContextDestroy(pThis, cid);
+
+    pContext = &pState->paContext[cid];
+    memset(pContext, 0, sizeof(*pContext));
+    pContext->id                = cid;
+    for (uint32_t i = 0; i < RT_ELEMENTS(pContext->aSidActiveTexture); i++)
+        pContext->aSidActiveTexture[i] = SVGA3D_INVALID_ID;
+
+    pContext->sidRenderTarget   = SVGA3D_INVALID_ID;
+    pContext->state.shidVertex  = SVGA3D_INVALID_ID;
+    pContext->state.shidPixel   = SVGA3D_INVALID_ID;
+    pContext->idFramebuffer     = OPENGL_INVALID_ID;
+    pContext->idReadFramebuffer = OPENGL_INVALID_ID;
+    pContext->idDrawFramebuffer = OPENGL_INVALID_ID;
+
+    rc = ShaderContextCreate(&pContext->pShaderContext);
+    AssertRCReturn(rc, rc);
+
+    for (uint32_t i = 0; i < RT_ELEMENTS(pContext->state.aRenderTargets); i++)
+        pContext->state.aRenderTargets[i] = SVGA3D_INVALID_ID;
+
+    AssertReturn(pThis->svga.u64HostWindowId, VERR_INTERNAL_ERROR);
+
+#ifdef RT_OS_WINDOWS
+    /* Create a context window. */
+    CREATESTRUCT cs;
+    cs.lpCreateParams   = NULL;
+    cs.dwExStyle        = WS_EX_NOACTIVATE | WS_EX_NOPARENTNOTIFY | WS_EX_TRANSPARENT;
+# ifdef DEBUG_GFX_WINDOW
+    cs.lpszName         = (char *)RTMemAllocZ(256);
+    RTStrPrintf((char *)cs.lpszName, 256, "Context %d OpenGL Window", cid);
+# else
+    cs.lpszName         = NULL;
+# endif
+    cs.lpszClass        = 0;
+# ifdef DEBUG_GFX_WINDOW
+    cs.style            = WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE | WS_CAPTION;
+# else
+    cs.style            = WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_DISABLED | WS_CHILD | WS_VISIBLE;
+# endif
+    cs.x                = 0;
+    cs.y                = 0;
+    cs.cx               = pThis->svga.uWidth;
+    cs.cy               = pThis->svga.uHeight;
+    cs.hwndParent       = (HWND)pThis->svga.u64HostWindowId;
+    cs.hMenu            = NULL;
+    cs.hInstance        = pState->hInstance;
+
+    rc = vmsvga3dSendThreadMessage(pState->pWindowThread, pState->WndRequestSem, WM_VMSVGA3D_CREATEWINDOW, (WPARAM)&pContext->hwnd, (LPARAM)&cs);
+    AssertRCReturn(rc, rc);
+
+    pContext->hdc   = GetDC(pContext->hwnd);
+    AssertMsgReturn(pContext->hdc, ("GetDC %x failed with %d\n", pContext->hwnd, GetLastError()), VERR_INTERNAL_ERROR);
+    
+    PIXELFORMATDESCRIPTOR pfd = { 
+        sizeof(PIXELFORMATDESCRIPTOR),  /*  size of this pfd */
+        1,                              /* version number */
+        PFD_DRAW_TO_WINDOW |            /* support window */
+        PFD_DOUBLEBUFFER   |            /* support double buffering */
+        PFD_SUPPORT_OPENGL,             /* support OpenGL */
+        PFD_TYPE_RGBA,                  /* RGBA type */
+        24,                             /* 24-bit color depth */
+        0, 0, 0, 0, 0, 0,               /* color bits ignored */
+        8,                              /* alpha buffer */
+        0,                              /* shift bit ignored */
+        0,                              /* no accumulation buffer */
+        0, 0, 0, 0,                     /* accum bits ignored */
+        16,                             /* set depth buffer  */
+        16,                             /* set stencil buffer */
+        0,                              /* no auxiliary buffer */
+        PFD_MAIN_PLANE,                 /* main layer */
+        0,                              /* reserved */
+        0, 0, 0                         /* layer masks ignored */
+    }; 
+    int     pixelFormat;
+    BOOL    ret;
+
+    pixelFormat = ChoosePixelFormat(pContext->hdc, &pfd);
+    /* @todo is this really necessary?? */
+    pixelFormat = ChoosePixelFormat(pContext->hdc, &pfd);
+    AssertMsgReturn(pixelFormat != 0, ("ChoosePixelFormat failed with %d\n", GetLastError()), VERR_INTERNAL_ERROR);
+
+    ret = SetPixelFormat(pContext->hdc, pixelFormat, &pfd);
+    AssertMsgReturn(ret == TRUE, ("SetPixelFormat failed with %d\n", GetLastError()), VERR_INTERNAL_ERROR);
+
+    pContext->hglrc = wglCreateContext(pContext->hdc);
+    AssertMsgReturn(pContext->hglrc, ("wglCreateContext %x failed with %d\n", pContext->hdc, GetLastError()), VERR_INTERNAL_ERROR);    
+
+    // TODO isn't this default on Linux since OpenGL 1.1?
+    /* Find the first active context to share the display list with (necessary for sharing e.g. textures between contexts). */
+    for (uint32_t i = 0; i < pState->cContexts; i++)
+    {
+        if (    pState->paContext[i].id != SVGA3D_INVALID_ID
+            &&  i != pContext->id)
+        {
+            Log(("Sharing display lists between cid=%d and cid=%d\n", pContext->id, i));
+            ret = wglShareLists(pState->paContext[i].hglrc, pContext->hglrc);
+            Assert(ret == TRUE);
+            break;
+        }
+    }
+
+#elif RT_OS_DARWIN
+    /* Find the first active context to share the display list with (necessary for sharing e.g. textures between contexts). */
+    NativeNSOpenGLContextRef shareContext = NULL;
+    for (uint32_t i = 0; i < pState->cContexts; i++)
+    {
+        if (    pState->paContext[i].id != SVGA3D_INVALID_ID
+            &&  i != pContext->id)
+        {
+            Log(("Sharing display lists between cid=%d and cid=%d\n", pContext->id, i));
+            shareContext = pState->paContext[i].cocoaContext;
+            break;
+        }
+    }
+    vmsvga3dCocoaCreateContext(&pContext->cocoaContext, shareContext);
+    NativeNSViewRef pHostView = (NativeNSViewRef*)pThis->svga.u64HostWindowId;
+    vmsvga3dCocoaCreateView(&pContext->cocoaView, pHostView);
+#else
+    Window hostWindow = (Window)pThis->svga.u64HostWindowId;
+
+    if (pState->display == NULL)
+    { 
+        /* get an X display and make sure we have glX 1.3 */
+        pState->display = XOpenDisplay(0);
+        Assert(pState->display);
+        int glxMajor, glxMinor;
+        Bool ret = glXQueryVersion(pState->display, &glxMajor, &glxMinor);
+        AssertMsgReturn(ret && glxMajor == 1 && glxMinor >= 3, ("glX >=1.3 not present"), VERR_INTERNAL_ERROR);
+        /* start our X event handling thread */
+        rc = RTThreadCreate(&pState->pWindowThread, vmsvga3dXEventThread, pState, 0, RTTHREADTYPE_GUI, RTTHREADFLAGS_WAITABLE, "VMSVGA3DXEVENT");
+           if (RT_FAILURE(rc))
+        {
+            AssertMsgFailed(("%s: Async IO Thread creation for 3d window handling failed rc=%d\n", __FUNCTION__, rc));
+            return rc;
+        }
+    }
+    int attrib[] =
+    {
+        GLX_RGBA,
+        GLX_RED_SIZE, 1,
+        GLX_GREEN_SIZE, 1,
+        GLX_BLUE_SIZE, 1,
+        //GLX_ALPHA_SIZE, 1, this flips the bbos screen
+        GLX_DOUBLEBUFFER,
+        None
+    };
+    XVisualInfo *vi = glXChooseVisual(pState->display, DefaultScreen(pState->display), attrib);
+    XSetWindowAttributes swa;
+    swa.colormap = XCreateColormap(pState->display, XDefaultRootWindow(pState->display), vi->visual, AllocNone);
+    swa.border_pixel = 0;
+    swa.background_pixel = 0;
+    swa.event_mask = StructureNotifyMask | ExposureMask;
+    unsigned long flags = CWBorderPixel | CWBackPixel | CWColormap | CWEventMask;
+    pContext->window = XCreateWindow(pState->display, hostWindow,//XDefaultRootWindow(pState->display),//hostWindow,
+                                     0, 0, pThis->svga.uWidth, pThis->svga.uHeight,
+                                     0, vi->depth, InputOutput,
+                                     vi->visual, flags, &swa);
+    AssertMsgReturn(pContext->window, ("XCreateWindow failed"), VERR_INTERNAL_ERROR);
+    uint32_t cardinal_alpha = (uint32_t) (0.5 * (uint32_t)-1) ;
+
+    /* the window is hidden by default and only mapped when CommandPresent is executed on it */
+
+    /* Find the first active context to share the display list with (necessary for sharing e.g. textures between contexts). */
+    GLXContext shareContext = NULL;
+    for (uint32_t i = 0; i < pState->cContexts; i++)
+    {
+        if (    pState->paContext[i].id != SVGA3D_INVALID_ID
+            &&  i != pContext->id)
+        {
+            Log(("Sharing display lists between cid=%d and cid=%d\n", pContext->id, i));
+            shareContext = pState->paContext[i].glxContext;
+            break;
+        }
+    }
+
+    pContext->glxContext = glXCreateContext(pState->display, vi, shareContext, GL_TRUE);
+    AssertMsgReturn(pContext->glxContext, ("glXCreateContext failed"), VERR_INTERNAL_ERROR);
+#endif
+
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    /* NULL during the first PowerOn call. */
+    if (pState->ext.glGenFramebuffers)
+    {
+        /* Create a framebuffer object for this context. */
+        pState->ext.glGenFramebuffers(1, &pContext->idFramebuffer);
+        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+        /* Bind the object to the framebuffer target. */
+        pState->ext.glBindFramebuffer(GL_FRAMEBUFFER, pContext->idFramebuffer);
+        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+        /* Create read and draw framebuffer objects for this context. */
+        pState->ext.glGenFramebuffers(1, &pContext->idReadFramebuffer);
+        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+        pState->ext.glGenFramebuffers(1, &pContext->idDrawFramebuffer);
+        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    }
+#if 0
+    /* @todo move to shader lib!!! */
+    /* Clear the screen */
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    glClearColor(1.0f, 0.0f, 0.0f, 0.0f);
+    glClearIndex(0);
+    glClearDepth(1);
+    glClearStencil(0xffff);
+    glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);
+    glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
+    glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);
+    if (pState->ext.glProvokingVertex)
+        pState->ext.glProvokingVertex(GL_FIRST_VERTEX_CONVENTION);
+    /* @todo move to shader lib!!! */
+#endif
+    return VINF_SUCCESS;
+}
+
+/**
+ * Destroy an existing 3d context
+ *
+ * @returns VBox status code.
+ * @param   pThis           VGA device instance data.
+ * @param   cid             Context id
+ */
+int vmsvga3dContextDestroy(PVGASTATE pThis, uint32_t cid)
+{
+    PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    AssertReturn(cid < SVGA3D_MAX_CONTEXT_IDS, VERR_INVALID_PARAMETER);
+
+    if (    cid < pState->cContexts
+        &&  pState->paContext[cid].id == cid)
+    {
+        PVMSVGA3DCONTEXT pContext = &pState->paContext[cid];
+
+        Log(("vmsvga3dContextDestroy id %x\n", cid));
+
+        VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+        /* Destroy all leftover pixel shaders. */
+        for (uint32_t i = 0; i < pContext->cPixelShaders; i++)
+        {
+            if (pContext->paPixelShader[i].id != SVGA3D_INVALID_ID)
+                vmsvga3dShaderDestroy(pThis, pContext->paPixelShader[i].cid, pContext->paPixelShader[i].id, pContext->paPixelShader[i].type);
+        }
+        if (pContext->paPixelShader)
+            RTMemFree(pContext->paPixelShader);
+
+        /* Destroy all leftover vertex shaders. */
+        for (uint32_t i = 0; i < pContext->cVertexShaders; i++)
+        {
+            if (pContext->paVertexShader[i].id != SVGA3D_INVALID_ID)
+                vmsvga3dShaderDestroy(pThis, pContext->paVertexShader[i].cid, pContext->paVertexShader[i].id, pContext->paVertexShader[i].type);
+        }
+        if (pContext->paVertexShader)
+            RTMemFree(pContext->paVertexShader);
+
+        if (pContext->state.paVertexShaderConst)
+            RTMemFree(pContext->state.paVertexShaderConst);
+        if (pContext->state.paPixelShaderConst)
+            RTMemFree(pContext->state.paPixelShaderConst);
+
+        if (pContext->pShaderContext)
+        {
+            int rc = ShaderContextDestroy(pContext->pShaderContext);
+            AssertRC(rc);
+        }
+
+        if (pContext->idFramebuffer != OPENGL_INVALID_ID)
+        {
+            /* Unbind the object from the framebuffer target. */
+            pState->ext.glBindFramebuffer(GL_FRAMEBUFFER, 0 /* back buffer */);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            pState->ext.glDeleteFramebuffers(1, &pContext->idFramebuffer);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+            if (pContext->idReadFramebuffer != OPENGL_INVALID_ID)
+            {
+                pState->ext.glDeleteFramebuffers(1, &pContext->idReadFramebuffer);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            }
+            if (pContext->idDrawFramebuffer != OPENGL_INVALID_ID)
+            {
+                pState->ext.glDeleteFramebuffers(1, &pContext->idDrawFramebuffer);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            }
+        }
+#ifdef RT_OS_WINDOWS
+        wglMakeCurrent(NULL, NULL);
+        wglDeleteContext(pContext->hglrc);
+        ReleaseDC(pContext->hwnd, pContext->hdc);
+
+        /* Destroy the window we've created. */
+        int rc = vmsvga3dSendThreadMessage(pState->pWindowThread, pState->WndRequestSem, WM_VMSVGA3D_DESTROYWINDOW, (WPARAM)pContext->hwnd, 0);
+        AssertRC(rc);
+#elif RT_OS_DARWIN
+        vmsvga3dCocoaDestroyView(pContext->cocoaView);
+        vmsvga3dCocoaDestroyContext(pContext->cocoaContext);
+#elif RT_OS_LINUX
+        glXMakeCurrent(pState->display, None, NULL);
+        glXDestroyContext(pState->display, pContext->glxContext);
+        XDestroyWindow(pState->display, pContext->window);
+#endif
+
+        memset(pContext, 0, sizeof(*pContext));
+        pContext->id = SVGA3D_INVALID_ID;
+
+        VMSVGA3D_CLEAR_CURRENT_CONTEXT(pState);
+    }
+    else
+        AssertFailed();
+
+    return VINF_SUCCESS;
+}
+
+/* Handle resize */
+int vmsvga3dChangeMode(PVGASTATE pThis)
+{
+    PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    /* Resize all active contexts. */
+    for (uint32_t i = 0; i < pState->cContexts; i++)
+    {
+        PVMSVGA3DCONTEXT pContext = &pState->paContext[i];
+        uint32_t cid = pContext->id;
+
+        if (cid != SVGA3D_INVALID_ID)
+        {
+#ifdef RT_OS_WINDOWS
+            CREATESTRUCT          cs;
+
+            memset(&cs, 0, sizeof(cs));            
+            cs.cx = pThis->svga.uWidth;
+            cs.cy = pThis->svga.uHeight;
+
+            /* Resize the window. */
+            int rc = vmsvga3dSendThreadMessage(pState->pWindowThread, pState->WndRequestSem, WM_VMSVGA3D_RESIZEWINDOW, (WPARAM)pContext->hwnd, (LPARAM)&cs);
+            AssertRC(rc);
+#elif RT_OS_DARWIN
+            vmsvga3dCocoaViewSetSize(pContext->cocoaView, pThis->svga.uWidth, pThis->svga.uHeight);
+#elif RT_OS_LINUX
+            XWindowChanges wc;
+            wc.width = pThis->svga.uWidth;
+            wc.height = pThis->svga.uHeight;
+            XConfigureWindow(pState->display, pContext->window, CWWidth | CWHeight, &wc);
+#endif
+        }
+    }
+    return VINF_SUCCESS;
+}
+
+
+int vmsvga3dSetTransform(PVGASTATE pThis, uint32_t cid, SVGA3dTransformType type, float matrix[16])
+{
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+    bool                  fModelViewChanged = false;
+
+    Log(("vmsvga3dSetTransform cid=%x %s\n", cid, vmsvgaTransformToString(type)));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetTransform invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    /* Save this matrix for vm state save/restore. */
+    pContext->state.aTransformState[type].fValid = true;
+    memcpy(pContext->state.aTransformState[type].matrix, matrix, sizeof(pContext->state.aTransformState[type].matrix));
+    pContext->state.u32UpdateFlags |= VMSVGA3D_UPDATE_TRANSFORM;
+
+    Log(("Matrix [%d %d %d %d]\n", (int)(matrix[0] * 10.0), (int)(matrix[1] * 10.0), (int)(matrix[2] * 10.0), (int)(matrix[3] * 10.0)));
+    Log(("       [%d %d %d %d]\n", (int)(matrix[4] * 10.0), (int)(matrix[5] * 10.0), (int)(matrix[6] * 10.0), (int)(matrix[7] * 10.0)));
+    Log(("       [%d %d %d %d]\n", (int)(matrix[8] * 10.0), (int)(matrix[9] * 10.0), (int)(matrix[10] * 10.0), (int)(matrix[11] * 10.0)));
+    Log(("       [%d %d %d %d]\n", (int)(matrix[12] * 10.0), (int)(matrix[13] * 10.0), (int)(matrix[14] * 10.0), (int)(matrix[15] * 10.0)));
+
+    switch (type)
+    {
+    case SVGA3D_TRANSFORM_VIEW:
+        /* View * World = Model View */
+        glMatrixMode(GL_MODELVIEW);
+        glLoadMatrixf(matrix);
+        if (pContext->state.aTransformState[SVGA3D_TRANSFORM_WORLD].fValid)
+            glMultMatrixf(pContext->state.aTransformState[SVGA3D_TRANSFORM_WORLD].matrix);
+        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+        fModelViewChanged = true;
+        break;
+
+    case SVGA3D_TRANSFORM_PROJECTION:
+    {
+        int rc = ShaderTransformProjection(pContext->state.RectViewPort.w, pContext->state.RectViewPort.h, matrix);
+        AssertRCReturn(rc, rc);
+        break;
+    }
+
+    case SVGA3D_TRANSFORM_TEXTURE0:
+        glMatrixMode(GL_TEXTURE);
+        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+        glLoadMatrixf(matrix);
+        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+        break;
+
+    case SVGA3D_TRANSFORM_TEXTURE1:
+    case SVGA3D_TRANSFORM_TEXTURE2:
+    case SVGA3D_TRANSFORM_TEXTURE3:
+    case SVGA3D_TRANSFORM_TEXTURE4:
+    case SVGA3D_TRANSFORM_TEXTURE5:
+    case SVGA3D_TRANSFORM_TEXTURE6:
+    case SVGA3D_TRANSFORM_TEXTURE7:
+        Log(("vmsvga3dSetTransform: unsupported SVGA3D_TRANSFORM_TEXTUREx transform!!\n"));
+        return VERR_INVALID_PARAMETER;
+
+    case SVGA3D_TRANSFORM_WORLD:
+        /* View * World = Model View */
+        glMatrixMode(GL_MODELVIEW);
+        if (pContext->state.aTransformState[SVGA3D_TRANSFORM_VIEW].fValid)
+            glLoadMatrixf(pContext->state.aTransformState[SVGA3D_TRANSFORM_VIEW].matrix);
+        else
+            glLoadIdentity();
+        glMultMatrixf(matrix);
+        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+        fModelViewChanged = true;
+        break;
+
+    case SVGA3D_TRANSFORM_WORLD1:
+    case SVGA3D_TRANSFORM_WORLD2:
+    case SVGA3D_TRANSFORM_WORLD3:
+        Log(("vmsvga3dSetTransform: unsupported SVGA3D_TRANSFORM_WORLDx transform!!\n"));
+        return VERR_INVALID_PARAMETER;
+
+    default:
+        Log(("vmsvga3dSetTransform: unknown type!!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+
+    /* Apparently we need to reset the light and clip data after modifying the modelview matrix. */
+    if (fModelViewChanged)
+    {
+        /* Reprogram the clip planes. */
+        for (uint32_t j = 0; j < RT_ELEMENTS(pContext->state.aClipPlane); j++)
+        {
+            if (pContext->state.aClipPlane[j].fValid == true)
+                vmsvga3dSetClipPlane(pThis, cid, j, pContext->state.aClipPlane[j].plane);
+        }
+
+        /* Reprogram the light data. */
+        for (uint32_t j = 0; j < RT_ELEMENTS(pContext->state.aLightData); j++)
+        {
+            if (pContext->state.aLightData[j].fValidData == true)
+                vmsvga3dSetLightData(pThis, cid, j, &pContext->state.aLightData[j].data);
+        }
+    }
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSetZRange(PVGASTATE pThis, uint32_t cid, SVGA3dZRange zRange)
+{
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dSetZRange cid=%x min=%d max=%d\n", cid, (uint32_t)(zRange.min * 100.0), (uint32_t)(zRange.max * 100.0)));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetZRange invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    pContext->state.zRange = zRange;
+    pContext->state.u32UpdateFlags |= VMSVGA3D_UPDATE_ZRANGE;
+
+    if (zRange.min < -1.0)
+        zRange.min = -1.0;
+    if (zRange.max > 1.0)
+        zRange.max = 1.0;
+
+    glDepthRange((GLdouble)zRange.min, (GLdouble)zRange.max);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+    return VINF_SUCCESS;
+}
+
+/**
+ * Convert SVGA blend op value to its OpenGL equivalent
+ */
+static GLenum vmsvga3dBlendOp2GL(uint32_t blendOp)
+{
+    switch (blendOp)
+    {
+    case SVGA3D_BLENDOP_ZERO:
+        return GL_ZERO;
+    case SVGA3D_BLENDOP_ONE:
+        return GL_ONE;
+    case SVGA3D_BLENDOP_SRCCOLOR:
+        return GL_SRC_COLOR;
+    case SVGA3D_BLENDOP_INVSRCCOLOR:
+        return GL_ONE_MINUS_SRC_COLOR;
+    case SVGA3D_BLENDOP_SRCALPHA:
+        return GL_SRC_ALPHA;
+    case SVGA3D_BLENDOP_INVSRCALPHA:
+        return GL_ONE_MINUS_SRC_ALPHA;
+    case SVGA3D_BLENDOP_DESTALPHA:
+        return GL_DST_ALPHA;
+    case SVGA3D_BLENDOP_INVDESTALPHA:
+        return GL_ONE_MINUS_DST_ALPHA;
+    case SVGA3D_BLENDOP_DESTCOLOR:
+        return GL_DST_COLOR;
+    case SVGA3D_BLENDOP_INVDESTCOLOR:
+        return GL_ONE_MINUS_DST_COLOR;
+    case SVGA3D_BLENDOP_SRCALPHASAT:
+        return GL_SRC_ALPHA_SATURATE;
+    case SVGA3D_BLENDOP_BLENDFACTOR:
+        return GL_CONSTANT_ALPHA;       /* @todo correct?? */
+    case SVGA3D_BLENDOP_INVBLENDFACTOR:
+        return GL_ONE_MINUS_CONSTANT_ALPHA;       /* @todo correct?? */
+    default:
+        AssertFailed();
+        return GL_ONE;
+    }
+}
+
+static GLenum vmsvga3dBlendEquation2GL(uint32_t blendEq)
+{
+    switch (blendEq)
+    {
+    case SVGA3D_BLENDEQ_ADD:
+        return GL_FUNC_ADD;
+    case SVGA3D_BLENDEQ_SUBTRACT:
+        return GL_FUNC_SUBTRACT;
+    case SVGA3D_BLENDEQ_REVSUBTRACT:
+        return GL_FUNC_REVERSE_SUBTRACT;
+    case SVGA3D_BLENDEQ_MINIMUM:
+        return GL_MIN;
+    case SVGA3D_BLENDEQ_MAXIMUM:
+        return GL_MAX;
+    default:
+        AssertFailed();
+        return GL_FUNC_ADD;
+    }
+}
+
+static GLenum vmsvgaCmpFunc2GL(uint32_t cmpFunc)
+{
+    switch (cmpFunc)
+    {
+    case SVGA3D_CMP_NEVER:
+        return GL_NEVER;
+    case SVGA3D_CMP_LESS:
+        return GL_LESS;
+    case SVGA3D_CMP_EQUAL:
+        return GL_EQUAL;
+    case SVGA3D_CMP_LESSEQUAL:
+        return GL_LEQUAL;
+    case SVGA3D_CMP_GREATER:
+        return GL_GREATER;
+    case SVGA3D_CMP_NOTEQUAL:
+        return GL_NOTEQUAL;
+    case SVGA3D_CMP_GREATEREQUAL:
+        return GL_GEQUAL;
+    case SVGA3D_CMP_ALWAYS:
+        return GL_ALWAYS;
+    default: 
+        AssertFailed();
+        return GL_LESS;
+    }
+}
+
+static GLenum vmsvgaStencipOp2GL(uint32_t stencilOp)
+{
+    switch (stencilOp)
+    {
+    case SVGA3D_STENCILOP_KEEP:
+        return GL_KEEP;
+    case SVGA3D_STENCILOP_ZERO:
+        return GL_ZERO;
+    case SVGA3D_STENCILOP_REPLACE:
+        return GL_REPLACE;
+    case SVGA3D_STENCILOP_INCRSAT:
+        return GL_INCR_WRAP;
+    case SVGA3D_STENCILOP_DECRSAT:
+        return GL_DECR_WRAP;
+    case SVGA3D_STENCILOP_INVERT:
+        return GL_INVERT;
+    case SVGA3D_STENCILOP_INCR:
+        return GL_INCR;
+    case SVGA3D_STENCILOP_DECR:
+        return GL_DECR;
+    default:
+        AssertFailed();
+        return GL_KEEP;
+    }
+}
+
+int vmsvga3dSetRenderState(PVGASTATE pThis, uint32_t cid, uint32_t cRenderStates, SVGA3dRenderState *pRenderState)
+{
+    uint32_t                    val;
+    PVMSVGA3DCONTEXT            pContext;
+    PVMSVGA3DSTATE              pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dSetRenderState cid=%x cRenderStates=%d\n", cid, cRenderStates));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetRenderState invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    for (unsigned i = 0; i < cRenderStates; i++)
+    {
+        GLenum enableCap = ~0U;
+        Log(("vmsvga3dSetRenderState: cid=%d state=%s (%d) val=%x\n", cid, vmsvga3dGetRenderStateName(pRenderState[i].state), pRenderState[i].state, pRenderState[i].uintValue));        
+        /* Save the render state for vm state saving. */
+        if (pRenderState[i].state < SVGA3D_RS_MAX)
+            pContext->state.aRenderState[pRenderState[i].state] = pRenderState[i];
+
+        switch (pRenderState[i].state)
+        {
+        case SVGA3D_RS_ZENABLE:                /* SVGA3dBool */    
+            enableCap = GL_DEPTH_TEST;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_ZWRITEENABLE:           /* SVGA3dBool */
+            glDepthMask(!!pRenderState[i].uintValue);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+
+        case SVGA3D_RS_ALPHATESTENABLE:        /* SVGA3dBool */
+            enableCap = GL_ALPHA_TEST;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_DITHERENABLE:           /* SVGA3dBool */
+            enableCap = GL_DITHER;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_FOGENABLE:              /* SVGA3dBool */
+            enableCap = GL_FOG;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_SPECULARENABLE:         /* SVGA3dBool */
+            Log(("vmsvga3dSetRenderState: WARNING: not applicable.\n"));
+            break;
+
+        case SVGA3D_RS_LIGHTINGENABLE:         /* SVGA3dBool */
+            enableCap = GL_LIGHTING;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_NORMALIZENORMALS:       /* SVGA3dBool */
+            /* not applicable */
+            Log(("vmsvga3dSetRenderState: WARNING: not applicable.\n"));
+            break;
+
+        case SVGA3D_RS_POINTSPRITEENABLE:      /* SVGA3dBool */
+            enableCap = GL_POINT_SPRITE_ARB;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_POINTSIZE:              /* float */
+            /* @todo we need to apply scaling for point sizes below the min or above the max; see Wine) */
+            if (pRenderState[i].floatValue < pState->caps.flPointSize[0])
+                pRenderState[i].floatValue = pState->caps.flPointSize[0];
+            if (pRenderState[i].floatValue > pState->caps.flPointSize[1])
+                pRenderState[i].floatValue = pState->caps.flPointSize[1];
+
+            glPointSize(pRenderState[i].floatValue);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            Log(("SVGA3D_RS_POINTSIZE: %d\n", (uint32_t) (pRenderState[i].floatValue * 100.0)));
+            break;
+
+        case SVGA3D_RS_POINTSIZEMIN:           /* float */
+            pState->ext.glPointParameterf(GL_POINT_SIZE_MIN, pRenderState[i].floatValue);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            Log(("SVGA3D_RS_POINTSIZEMIN: %d\n", (uint32_t) (pRenderState[i].floatValue * 100.0)));
+            break;
+
+        case SVGA3D_RS_POINTSIZEMAX:           /* float */
+            pState->ext.glPointParameterf(GL_POINT_SIZE_MAX, pRenderState[i].floatValue);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            Log(("SVGA3D_RS_POINTSIZEMAX: %d\n", (uint32_t) (pRenderState[i].floatValue * 100.0)));
+            break;
+
+        case SVGA3D_RS_POINTSCALEENABLE:       /* SVGA3dBool */
+        case SVGA3D_RS_POINTSCALE_A:           /* float */
+        case SVGA3D_RS_POINTSCALE_B:           /* float */
+        case SVGA3D_RS_POINTSCALE_C:           /* float */
+            Log(("vmsvga3dSetRenderState: WARNING: not applicable.\n"));
+            break;
+
+        case SVGA3D_RS_AMBIENT:                /* SVGA3dColor */
+        {
+            GLfloat color[4]; /* red, green, blue, alpha */
+
+            vmsvgaColor2GLFloatArray(pRenderState[i].uintValue, &color[0], &color[1], &color[2], &color[3]);
+
+            glLightModelfv(GL_LIGHT_MODEL_AMBIENT, color);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+        }
+
+        case SVGA3D_RS_CLIPPLANEENABLE:        /* SVGA3dClipPlanes */
+        {
+            AssertCompile(SVGA3D_CLIPPLANE_MAX == (1 << 5));
+            for (uint32_t j = 0; j <= 5; j++)
+            {
+                if (pRenderState[i].uintValue & RT_BIT(j))
+                    glEnable(GL_CLIP_PLANE0 + j);
+                else
+                    glDisable(GL_CLIP_PLANE0 + j);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            }
+            break;
+        }
+
+        case SVGA3D_RS_FOGCOLOR:               /* SVGA3dColor */
+        {
+            GLfloat color[4]; /* red, green, blue, alpha */
+
+            vmsvgaColor2GLFloatArray(pRenderState[i].uintValue, &color[0], &color[1], &color[2], &color[3]);
+
+            glFogfv(GL_FOG_COLOR, color);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+        }
+
+        case SVGA3D_RS_FOGSTART:               /* float */
+            glFogf(GL_FOG_START, pRenderState[i].floatValue);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+
+        case SVGA3D_RS_FOGEND:                 /* float */
+            glFogf(GL_FOG_END, pRenderState[i].floatValue);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+
+        case SVGA3D_RS_FOGDENSITY:             /* float */
+            glFogf(GL_FOG_DENSITY, pRenderState[i].floatValue);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+
+        case SVGA3D_RS_RANGEFOGENABLE:         /* SVGA3dBool */
+            glFogi(GL_FOG_COORD_SRC, (pRenderState[i].uintValue) ? GL_FOG_COORD : GL_FRAGMENT_DEPTH);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+
+        case SVGA3D_RS_FOGMODE:                /* SVGA3dFogMode */
+        {
+            SVGA3dFogMode mode;
+            mode.uintValue = pRenderState[i].uintValue;
+
+            enableCap = GL_FOG_MODE;
+            switch (mode.s.function)
+            {
+            case SVGA3D_FOGFUNC_EXP:
+                val = GL_EXP;
+                break;
+            case SVGA3D_FOGFUNC_EXP2:
+                val = GL_EXP2;
+                break;
+            case SVGA3D_FOGFUNC_LINEAR:
+                val = GL_LINEAR;
+                break;
+            default:
+                AssertMsgFailedReturn(("Unexpected fog function %d\n", mode.s.function), VERR_INTERNAL_ERROR);
+                break;
+            }
+
+            /* @todo how to switch between vertex and pixel fog modes??? */
+            Assert(mode.s.type == SVGA3D_FOGTYPE_PIXEL);
+#if 0
+            /* The fog type determines the render state. */
+            switch (mode.s.type)
+            {
+            case SVGA3D_FOGTYPE_VERTEX:
+                renderState = D3DRS_FOGVERTEXMODE;
+                break;
+            case SVGA3D_FOGTYPE_PIXEL:
+                renderState = D3DRS_FOGTABLEMODE;
+                break;
+            default:
+                AssertMsgFailedReturn(("Unexpected fog type %d\n", mode.s.type), VERR_INTERNAL_ERROR);
+                break;
+            }
+#endif
+
+            /* Set the fog base to depth or range. */
+            switch (mode.s.base)
+            {
+            case SVGA3D_FOGBASE_DEPTHBASED:
+                glFogi(GL_FOG_COORD_SRC, GL_FRAGMENT_DEPTH);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                break;
+            case SVGA3D_FOGBASE_RANGEBASED:
+                glFogi(GL_FOG_COORD_SRC, GL_FOG_COORD);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                break;
+            default:
+                /* ignore */
+                AssertMsgFailed(("Unexpected fog base %d\n", mode.s.base));
+                break;
+            }
+            break;
+        }
+
+        case SVGA3D_RS_FILLMODE:               /* SVGA3dFillMode */
+        {
+            SVGA3dFillMode mode;
+
+            mode.uintValue = pRenderState[i].uintValue;
+
+            switch (mode.s.mode)
+            {
+            case SVGA3D_FILLMODE_POINT:
+                val = GL_POINT;
+                break;
+            case SVGA3D_FILLMODE_LINE:
+                val = GL_LINE;
+                break;
+            case SVGA3D_FILLMODE_FILL:
+                val = GL_FILL;
+                break;
+            default:
+                AssertMsgFailedReturn(("Unexpected fill mode %d\n", mode.s.mode), VERR_INTERNAL_ERROR);
+                break;
+            }
+            /* @note only front and back faces */
+            Assert(mode.s.face == SVGA3D_FACE_FRONT_BACK);
+            glPolygonMode(GL_FRONT_AND_BACK, val);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+        }
+
+        case SVGA3D_RS_SHADEMODE:              /* SVGA3dShadeMode */
+            switch (pRenderState[i].uintValue)
+            {
+            case SVGA3D_SHADEMODE_FLAT:
+                val = GL_FLAT;
+                break;
+
+            case SVGA3D_SHADEMODE_SMOOTH:
+                val = GL_SMOOTH;
+                break;
+
+            default:
+                AssertMsgFailedReturn(("Unexpected shade mode %d\n", pRenderState[i].uintValue), VERR_INTERNAL_ERROR);
+                break;
+            }
+
+            glShadeModel(val);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+
+        case SVGA3D_RS_LINEPATTERN:            /* SVGA3dLinePattern */
+            /* No longer supported by d3d; mesagl comments suggest not all backends support it */
+            /* @todo */
+            Log(("WARNING: SVGA3D_RS_LINEPATTERN %x not supported!!\n", pRenderState[i].uintValue));
+            /*
+            renderState = D3DRS_LINEPATTERN;
+            val = pRenderState[i].uintValue;
+            */
+            break;
+
+        case SVGA3D_RS_LINEAA:                 /* SVGA3dBool */
+            enableCap = GL_LINE_SMOOTH;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_LINEWIDTH:              /* float */
+            glLineWidth(pRenderState[i].floatValue);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+
+        case SVGA3D_RS_SEPARATEALPHABLENDENABLE: /* SVGA3dBool */
+        {
+            /* Refresh the blending state based on the new enable setting. */
+            SVGA3dRenderState renderstate[2];
+
+            renderstate[0].state     = SVGA3D_RS_SRCBLEND;
+            renderstate[0].uintValue = pContext->state.aRenderState[SVGA3D_RS_SRCBLEND].uintValue;
+            renderstate[1].state     = SVGA3D_RS_BLENDEQUATION;
+            renderstate[1].uintValue = pContext->state.aRenderState[SVGA3D_RS_BLENDEQUATION].uintValue;
+
+            int rc = vmsvga3dSetRenderState(pThis, cid, 2, renderstate);
+            AssertRCReturn(rc, rc);
+
+            if (pContext->state.aRenderState[SVGA3D_RS_BLENDENABLE].uintValue != 0)
+                continue;   /* ignore if blend is already enabled */
+            /* no break */
+        }
+
+        case SVGA3D_RS_BLENDENABLE:            /* SVGA3dBool */
+            enableCap = GL_BLEND;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_SRCBLENDALPHA:          /* SVGA3dBlendOp */
+        case SVGA3D_RS_DSTBLENDALPHA:          /* SVGA3dBlendOp */
+        case SVGA3D_RS_SRCBLEND:               /* SVGA3dBlendOp */
+        case SVGA3D_RS_DSTBLEND:               /* SVGA3dBlendOp */
+        {
+            GLint srcRGB, srcAlpha, dstRGB, dstAlpha;
+            GLint blendop = vmsvga3dBlendOp2GL(pRenderState[i].uintValue);
+
+            glGetIntegerv(GL_BLEND_SRC_RGB, &srcRGB);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            glGetIntegerv(GL_BLEND_DST_RGB, &dstRGB);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            glGetIntegerv(GL_BLEND_DST_ALPHA, &dstAlpha);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            glGetIntegerv(GL_BLEND_SRC_ALPHA, &srcAlpha);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+            switch (pRenderState[i].state)
+            {
+            case SVGA3D_RS_SRCBLEND:
+                srcRGB = blendop;
+                break;
+            case SVGA3D_RS_DSTBLEND:
+                dstRGB = blendop;
+                break;
+            case SVGA3D_RS_SRCBLENDALPHA:
+                srcAlpha = blendop;
+                break;
+            case SVGA3D_RS_DSTBLENDALPHA:
+                dstAlpha = blendop;
+                break;
+            default:
+                /* not possible; shut up gcc */
+                AssertFailed();
+                break;
+            }
+
+            if (pContext->state.aRenderState[SVGA3D_RS_SEPARATEALPHABLENDENABLE].uintValue != 0)
+                pState->ext.glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
+            else
+                glBlendFunc(srcRGB, dstRGB);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+        }
+
+        case SVGA3D_RS_BLENDEQUATIONALPHA:     /* SVGA3dBlendEquation */
+        case SVGA3D_RS_BLENDEQUATION:          /* SVGA3dBlendEquation */
+            if (pContext->state.aRenderState[SVGA3D_RS_SEPARATEALPHABLENDENABLE].uintValue != 0)
+                pState->ext.glBlendEquationSeparate(vmsvga3dBlendEquation2GL(pContext->state.aRenderState[SVGA3D_RS_BLENDEQUATION].uintValue), 
+                                                    vmsvga3dBlendEquation2GL(pContext->state.aRenderState[SVGA3D_RS_BLENDEQUATIONALPHA].uintValue));
+            else
+                pState->ext.glBlendEquation(vmsvga3dBlendEquation2GL(pRenderState[i].uintValue));
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+
+        case SVGA3D_RS_BLENDCOLOR:             /* SVGA3dColor */
+        {
+            GLfloat red, green, blue, alpha;
+
+            vmsvgaColor2GLFloatArray(pRenderState[i].uintValue, &red, &green, &blue, &alpha);
+
+            pState->ext.glBlendColor(red, green, blue, alpha);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+        }
+
+        case SVGA3D_RS_CULLMODE:               /* SVGA3dFace */
+        {
+            GLenum mode = GL_BACK;  /* default for OpenGL */
+
+            switch (pRenderState[i].uintValue)
+            {
+            case SVGA3D_FACE_NONE:
+                break;
+            case SVGA3D_FACE_FRONT:
+                mode = GL_FRONT;
+                break;
+            case SVGA3D_FACE_BACK:
+                mode = GL_BACK;
+                break;
+            case SVGA3D_FACE_FRONT_BACK:
+                mode = GL_FRONT_AND_BACK;
+                break;
+            default:
+                AssertMsgFailedReturn(("Unexpected cull mode %d\n", pRenderState[i].uintValue), VERR_INTERNAL_ERROR);
+                break;
+            }
+            enableCap = GL_CULL_FACE;
+            if (pRenderState[i].uintValue != SVGA3D_FACE_NONE)
+            {
+                glCullFace(mode);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                val = 1;
+            }
+            else
+                val = 0;
+            break;
+        }
+
+        case SVGA3D_RS_ZFUNC:                  /* SVGA3dCmpFunc */
+            glDepthFunc(vmsvgaCmpFunc2GL(pRenderState[i].uintValue));
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+
+        case SVGA3D_RS_ALPHAFUNC:              /* SVGA3dCmpFunc */
+        {
+            GLclampf ref;
+
+            glGetFloatv(GL_ALPHA_TEST_REF, &ref);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            glAlphaFunc(vmsvgaCmpFunc2GL(pRenderState[i].uintValue), ref);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+        }
+
+        case SVGA3D_RS_ALPHAREF:               /* float (0.0 .. 1.0) */
+        {
+            GLint func;
+
+            glGetIntegerv(GL_ALPHA_TEST_FUNC, &func);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            glAlphaFunc(func, pRenderState[i].floatValue);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+        }
+
+        case SVGA3D_RS_STENCILENABLE:          /* SVGA3dBool */
+            enableCap = GL_STENCIL_TEST;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_STENCILFUNC:            /* SVGA3dCmpFunc */
+        case SVGA3D_RS_STENCILREF:             /* uint32_t */
+        case SVGA3D_RS_STENCILMASK:            /* uint32_t */
+        {
+            GLint func, ref;
+            GLuint mask;
+
+            glGetIntegerv(GL_STENCIL_FUNC, &func);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            glGetIntegerv(GL_STENCIL_VALUE_MASK, (GLint *)&mask);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            glGetIntegerv(GL_STENCIL_REF, &ref);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+            switch (pRenderState[i].state)
+            {
+            case SVGA3D_RS_STENCILFUNC:            /* SVGA3dCmpFunc */
+                func = vmsvgaCmpFunc2GL(pRenderState[i].uintValue);
+                break;
+
+            case SVGA3D_RS_STENCILREF:             /* uint32_t */
+                ref = pRenderState[i].uintValue;
+                break;
+
+            case SVGA3D_RS_STENCILMASK:            /* uint32_t */
+                mask = pRenderState[i].uintValue;
+                break;
+
+            default:
+                /* not possible; shut up gcc */
+                AssertFailed();
+                break;
+            }
+
+            glStencilFunc(func, ref, mask);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+        }
+
+        case SVGA3D_RS_STENCILWRITEMASK:       /* uint32_t */
+            glStencilMask(pRenderState[i].uintValue);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+
+        case SVGA3D_RS_STENCILFAIL:            /* SVGA3dStencilOp */
+        case SVGA3D_RS_STENCILZFAIL:           /* SVGA3dStencilOp */
+        case SVGA3D_RS_STENCILPASS:            /* SVGA3dStencilOp */
+        {
+            GLint sfail, dpfail, dppass;
+            GLenum stencilop = vmsvgaStencipOp2GL(pRenderState[i].uintValue);
+
+            glGetIntegerv(GL_STENCIL_FAIL, &sfail);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL, &dpfail);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS, &dppass);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+            switch (pRenderState[i].state)
+            {
+            case SVGA3D_RS_STENCILFAIL:            /* SVGA3dStencilOp */
+                sfail = stencilop;
+                break;
+            case SVGA3D_RS_STENCILZFAIL:           /* SVGA3dStencilOp */
+                dpfail = stencilop;
+                break;
+            case SVGA3D_RS_STENCILPASS:            /* SVGA3dStencilOp */
+                dppass = stencilop;
+                break;
+            default:
+                /* not possible; shut up gcc */
+                AssertFailed();
+                break;
+            }
+            glStencilOp(sfail, dpfail, dppass);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+        }
+
+        case SVGA3D_RS_STENCILENABLE2SIDED:    /* SVGA3dBool */
+            /* @note GL_EXT_stencil_two_side required! */
+            if (pState->ext.fEXT_stencil_two_side)
+            {
+                enableCap = GL_STENCIL_TEST_TWO_SIDE_EXT;
+                val = pRenderState[i].uintValue;
+            }
+            else
+                Log(("vmsvga3dSetRenderState: WARNING unsupported SVGA3D_RS_STENCILENABLE2SIDED\n"));
+            break;
+
+        case SVGA3D_RS_CCWSTENCILFUNC:         /* SVGA3dCmpFunc */
+        {
+            /* @todo SVGA3D_RS_STENCILFAIL/ZFAIL/PASS for front & back faces
+             *       SVGA3D_RS_CCWSTENCILFAIL/ZFAIL/PASS for back faces ??
+             */
+            GLint ref;
+            GLuint mask;
+
+            glGetIntegerv(GL_STENCIL_BACK_VALUE_MASK, (GLint *)&mask);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            glGetIntegerv(GL_STENCIL_BACK_REF, &ref);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+            pState->ext.glStencilFuncSeparate(GL_BACK, vmsvgaCmpFunc2GL(pRenderState[i].uintValue), ref, mask);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+        }
+
+        case SVGA3D_RS_CCWSTENCILFAIL:         /* SVGA3dStencilOp */
+        case SVGA3D_RS_CCWSTENCILZFAIL:        /* SVGA3dStencilOp */
+        case SVGA3D_RS_CCWSTENCILPASS:         /* SVGA3dStencilOp */
+        {
+            /* @todo SVGA3D_RS_STENCILFAIL/ZFAIL/PASS for front & back faces
+             *       SVGA3D_RS_CCWSTENCILFAIL/ZFAIL/PASS for back faces ??
+             */
+            GLint sfail, dpfail, dppass;
+            GLenum stencilop = vmsvgaStencipOp2GL(pRenderState[i].uintValue);
+
+            glGetIntegerv(GL_STENCIL_BACK_FAIL, &sfail);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            glGetIntegerv(GL_STENCIL_BACK_PASS_DEPTH_FAIL, &dpfail);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            glGetIntegerv(GL_STENCIL_BACK_PASS_DEPTH_PASS, &dppass);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+            switch (pRenderState[i].state)
+            {
+            case SVGA3D_RS_CCWSTENCILFAIL:         /* SVGA3dStencilOp */
+                sfail = stencilop;
+                break;
+            case SVGA3D_RS_CCWSTENCILZFAIL:        /* SVGA3dStencilOp */
+                dpfail = stencilop;
+                break;
+            case SVGA3D_RS_CCWSTENCILPASS:         /* SVGA3dStencilOp */
+                dppass = stencilop;
+                break;
+            default:
+                /* not possible; shut up gcc */
+                AssertFailed();
+                break;
+            }
+            pState->ext.glStencilOpSeparate(GL_BACK, sfail, dpfail, dppass);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+        }
+
+        case SVGA3D_RS_ZBIAS:                  /* float */
+            /* @todo unknown meaning; depth bias is not identical
+            renderState = D3DRS_DEPTHBIAS;
+            val = pRenderState[i].uintValue;
+            */
+            Log(("vmsvga3dSetRenderState: WARNING unsupported SVGA3D_RS_ZBIAS\n"));
+            break;
+
+        case SVGA3D_RS_DEPTHBIAS:              /* float */
+        {
+            GLfloat factor;
+
+            /* @todo not sure if the d3d & ogl definitions are identical. */
+
+            /* Do not change the factor part. */
+            glGetFloatv(GL_POLYGON_OFFSET_FACTOR, &factor);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+            glPolygonOffset(factor, pRenderState[i].floatValue);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+        }
+
+        case SVGA3D_RS_SLOPESCALEDEPTHBIAS:    /* float */
+        {
+            GLfloat units;
+
+            /* @todo not sure if the d3d & ogl definitions are identical. */
+
+            /* Do not change the factor part. */
+            glGetFloatv(GL_POLYGON_OFFSET_UNITS, &units);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+            glPolygonOffset(pRenderState[i].floatValue, units);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+        }
+
+        case SVGA3D_RS_COLORWRITEENABLE:       /* SVGA3dColorMask */
+        {
+            GLboolean red, green, blue, alpha;
+            SVGA3dColorMask mask;
+
+            mask.uintValue = pRenderState[i].uintValue;
+
+            red     = mask.s.red;
+            green   = mask.s.green;
+            blue    = mask.s.blue;
+            alpha   = mask.s.alpha;
+
+            glColorMask(red, green, blue, alpha);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+        }
+
+        case SVGA3D_RS_COLORWRITEENABLE1:      /* SVGA3dColorMask to D3DCOLORWRITEENABLE_* */
+        case SVGA3D_RS_COLORWRITEENABLE2:      /* SVGA3dColorMask to D3DCOLORWRITEENABLE_* */
+        case SVGA3D_RS_COLORWRITEENABLE3:      /* SVGA3dColorMask to D3DCOLORWRITEENABLE_* */
+            Log(("vmsvga3dSetRenderState: WARNING SVGA3D_RS_COLORWRITEENABLEx not supported!!\n"));
+            break;
+
+        case SVGA3D_RS_SCISSORTESTENABLE:      /* SVGA3dBool */
+            enableCap = GL_SCISSOR_TEST;
+            val = pRenderState[i].uintValue;
+            break;
+
+#if 0
+        case SVGA3D_RS_DIFFUSEMATERIALSOURCE:  /* SVGA3dVertexMaterial */
+            AssertCompile(D3DMCS_COLOR2 == SVGA3D_VERTEXMATERIAL_SPECULAR);
+            renderState = D3DRS_DIFFUSEMATERIALSOURCE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_SPECULARMATERIALSOURCE: /* SVGA3dVertexMaterial */
+            renderState = D3DRS_SPECULARMATERIALSOURCE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_AMBIENTMATERIALSOURCE:  /* SVGA3dVertexMaterial */
+            renderState = D3DRS_AMBIENTMATERIALSOURCE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_EMISSIVEMATERIALSOURCE: /* SVGA3dVertexMaterial */
+            renderState = D3DRS_EMISSIVEMATERIALSOURCE;
+            val = pRenderState[i].uintValue;
+            break;
+#endif
+
+        case SVGA3D_RS_WRAP3:                  /* SVGA3dWrapFlags */
+        case SVGA3D_RS_WRAP4:                  /* SVGA3dWrapFlags */
+        case SVGA3D_RS_WRAP5:                  /* SVGA3dWrapFlags */
+        case SVGA3D_RS_WRAP6:                  /* SVGA3dWrapFlags */
+        case SVGA3D_RS_WRAP7:                  /* SVGA3dWrapFlags */
+        case SVGA3D_RS_WRAP8:                  /* SVGA3dWrapFlags */
+        case SVGA3D_RS_WRAP9:                  /* SVGA3dWrapFlags */
+        case SVGA3D_RS_WRAP10:                 /* SVGA3dWrapFlags */
+        case SVGA3D_RS_WRAP11:                 /* SVGA3dWrapFlags */
+        case SVGA3D_RS_WRAP12:                 /* SVGA3dWrapFlags */
+        case SVGA3D_RS_WRAP13:                 /* SVGA3dWrapFlags */
+        case SVGA3D_RS_WRAP14:                 /* SVGA3dWrapFlags */
+        case SVGA3D_RS_WRAP15:                 /* SVGA3dWrapFlags */
+            Log(("vmsvga3dSetRenderState: WARNING unsupported SVGA3D_WRAPx (x >= 3)\n"));
+            break;
+
+        case SVGA3D_RS_LASTPIXEL:              /* SVGA3dBool */
+        case SVGA3D_RS_TWEENFACTOR:            /* float */
+        case SVGA3D_RS_INDEXEDVERTEXBLENDENABLE: /* SVGA3dBool */
+        case SVGA3D_RS_VERTEXBLEND:            /* SVGA3dVertexBlendFlags */
+            Log(("vmsvga3dSetRenderState: WARNING not applicable!!\n"));
+            break;
+
+        case SVGA3D_RS_MULTISAMPLEANTIALIAS:   /* SVGA3dBool */
+            enableCap = GL_MULTISAMPLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_MULTISAMPLEMASK:        /* uint32_t */
+        case SVGA3D_RS_ANTIALIASEDLINEENABLE:  /* SVGA3dBool */
+            Log(("vmsvga3dSetRenderState: WARNING not applicable??!!\n"));
+            break;
+
+        case SVGA3D_RS_COORDINATETYPE:         /* SVGA3dCoordinateType */
+            Assert(pRenderState[i].uintValue == SVGA3D_COORDINATE_LEFTHANDED);
+            /* @todo setup a view matrix to scale the world space by -1 in the z-direction for right handed coordinates. */
+            /*
+            renderState = D3DRS_COORDINATETYPE;
+            val = pRenderState[i].uintValue;
+            */
+            break;
+
+        case SVGA3D_RS_FRONTWINDING:           /* SVGA3dFrontWinding */
+            Assert(pRenderState[i].uintValue == SVGA3D_FRONTWINDING_CW);
+            /* Invert the selected mode because of y-inversion (?) */
+            glFrontFace((pRenderState[i].uintValue != SVGA3D_FRONTWINDING_CW) ? GL_CW : GL_CCW);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+
+        case SVGA3D_RS_OUTPUTGAMMA:            /* float */
+            //AssertFailed();
+            /*
+            D3DRS_SRGBWRITEENABLE ??
+            renderState = D3DRS_OUTPUTGAMMA;
+            val = pRenderState[i].uintValue;
+            */
+            break;
+
+#if 0
+
+        case SVGA3D_RS_VERTEXMATERIALENABLE:   /* SVGA3dBool */
+            //AssertFailed();
+            renderState = D3DRS_INDEXEDVERTEXBLENDENABLE;       /* correct?? */
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_TEXTUREFACTOR:          /* SVGA3dColor */
+            renderState = D3DRS_TEXTUREFACTOR;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_LOCALVIEWER:            /* SVGA3dBool */
+            renderState = D3DRS_LOCALVIEWER;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_ZVISIBLE:               /* SVGA3dBool */
+            AssertFailed();
+            /*
+            renderState = D3DRS_ZVISIBLE;
+            val = pRenderState[i].uintValue;
+            */
+            break;
+
+        case SVGA3D_RS_CLIPPING:               /* SVGA3dBool */
+            renderState = D3DRS_CLIPPING;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP0:                  /* SVGA3dWrapFlags */
+            glTexParameter GL_TEXTURE_WRAP_S
+            Assert(SVGA3D_WRAPCOORD_3 == D3DWRAPCOORD_3);
+            renderState = D3DRS_WRAP0;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP1:                  /* SVGA3dWrapFlags */
+            glTexParameter GL_TEXTURE_WRAP_T
+            renderState = D3DRS_WRAP1;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP2:                  /* SVGA3dWrapFlags */
+            glTexParameter GL_TEXTURE_WRAP_R
+            renderState = D3DRS_WRAP2;
+            val = pRenderState[i].uintValue;
+            break;
+
+
+        case SVGA3D_RS_SEPARATEALPHABLENDENABLE: /* SVGA3dBool */
+            renderState = D3DRS_SEPARATEALPHABLENDENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+
+        case SVGA3D_RS_BLENDEQUATIONALPHA:     /* SVGA3dBlendEquation */
+            renderState = D3DRS_BLENDOPALPHA;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_TRANSPARENCYANTIALIAS:  /* SVGA3dTransparencyAntialiasType */
+            AssertFailed();
+            /*
+            renderState = D3DRS_TRANSPARENCYANTIALIAS;
+            val = pRenderState[i].uintValue;
+            */
+            break;
+
+#endif
+        default:
+            AssertFailed();
+            break;
+        }
+
+        if (enableCap != ~0U)
+        {
+            if (val)
+                glEnable(enableCap);
+            else
+                glDisable(enableCap);
+        }
+    }
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSetRenderTarget(PVGASTATE pThis, uint32_t cid, SVGA3dRenderTargetType type, SVGA3dSurfaceImageId target)
+{
+    PVMSVGA3DCONTEXT            pContext;
+    PVMSVGA3DSTATE              pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    PVMSVGA3DSURFACE            pRenderTarget;
+
+    AssertReturn(pState, VERR_NO_MEMORY);
+    AssertReturn(type < SVGA3D_RT_MAX, VERR_INVALID_PARAMETER);
+    AssertReturn(target.face == 0, VERR_INVALID_PARAMETER);
+    AssertReturn(target.mipmap == 0, VERR_INVALID_PARAMETER);
+
+    Log(("vmsvga3dSetRenderTarget cid=%x type=%x surface id=%x\n", cid, type, target.sid));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetRenderTarget invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    /* Save for vm state save/restore. */
+    pContext->state.aRenderTargets[type] = target.sid;
+
+    if (target.sid == SVGA3D_INVALID_ID)
+    {
+        /* Disable render target. */
+        switch (type)
+        {
+        case SVGA3D_RT_DEPTH:
+        case SVGA3D_RT_STENCIL:
+            pState->ext.glFramebufferRenderbuffer(GL_FRAMEBUFFER, (type == SVGA3D_RT_DEPTH) ? GL_DEPTH_ATTACHMENT : GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+
+        case SVGA3D_RT_COLOR0:
+        case SVGA3D_RT_COLOR1:
+        case SVGA3D_RT_COLOR2:
+        case SVGA3D_RT_COLOR3:
+        case SVGA3D_RT_COLOR4:
+        case SVGA3D_RT_COLOR5:
+        case SVGA3D_RT_COLOR6:
+        case SVGA3D_RT_COLOR7:
+            pContext->sidRenderTarget = SVGA3D_INVALID_ID;
+            pState->ext.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + type - SVGA3D_RT_COLOR0, 0, 0, 0);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+
+        default:
+            AssertFailedReturn(VERR_INVALID_PARAMETER);
+        }
+        return VINF_SUCCESS;
+    }
+
+    AssertReturn(target.sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(target.sid < pState->cSurfaces && pState->paSurface[target.sid].id == target.sid, VERR_INVALID_PARAMETER);
+    pRenderTarget = &pState->paSurface[target.sid];
+
+    switch (type)
+    {
+    case SVGA3D_RT_DEPTH:
+    case SVGA3D_RT_STENCIL:
+        if (pRenderTarget->oglId.texture == OPENGL_INVALID_ID)
+        {
+            Log(("vmsvga3dSetRenderTarget: create renderbuffer to be used as render target; surface id=%x type=%d format=%d\n", target.sid, pRenderTarget->flags, pRenderTarget->internalFormatGL));
+            pState->ext.glGenRenderbuffers(1, &pRenderTarget->oglId.renderbuffer);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+            pState->ext.glBindRenderbuffer(GL_RENDERBUFFER, pRenderTarget->oglId.renderbuffer);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+            pState->ext.glRenderbufferStorage(GL_RENDERBUFFER, 
+                                              pRenderTarget->internalFormatGL, 
+                                              pRenderTarget->pMipmapLevels[0].size.width, 
+                                              pRenderTarget->pMipmapLevels[0].size.height);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+            pRenderTarget->idAssociatedContext = cid;
+        }
+        else
+        {
+            pState->ext.glBindRenderbuffer(GL_RENDERBUFFER, pRenderTarget->oglId.renderbuffer);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+        }
+        Assert(pRenderTarget->idAssociatedContext == cid);
+        Assert(!pRenderTarget->fDirty);
+        AssertReturn(pRenderTarget->oglId.texture != OPENGL_INVALID_ID, VERR_INVALID_PARAMETER);
+
+        pRenderTarget->flags |= SVGA3D_SURFACE_HINT_DEPTHSTENCIL;
+
+        pState->ext.glFramebufferRenderbuffer(GL_FRAMEBUFFER, (type == SVGA3D_RT_DEPTH) ? GL_DEPTH_ATTACHMENT : GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, pRenderTarget->oglId.renderbuffer);
+        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+        break;
+
+    case SVGA3D_RT_COLOR0:
+    case SVGA3D_RT_COLOR1:
+    case SVGA3D_RT_COLOR2:
+    case SVGA3D_RT_COLOR3:
+    case SVGA3D_RT_COLOR4:
+    case SVGA3D_RT_COLOR5:
+    case SVGA3D_RT_COLOR6:
+    case SVGA3D_RT_COLOR7:
+    {
+        /* A texture surface can be used as a render target to fill it and later on used as a texture. */
+        if (pRenderTarget->oglId.texture == OPENGL_INVALID_ID)
+        {
+            Log(("vmsvga3dSetRenderTarget: create texture to be used as render target; surface id=%x type=%d format=%d -> create texture\n", target.sid, pRenderTarget->flags, pRenderTarget->format));
+            int rc = vmsvga3dCreateTexture(pState, pContext, cid, pRenderTarget);
+            AssertRCReturn(rc, rc);
+        }
+
+        AssertReturn(pRenderTarget->oglId.texture != OPENGL_INVALID_ID, VERR_INVALID_PARAMETER);
+        Assert(!pRenderTarget->fDirty);
+
+        pRenderTarget->flags |= SVGA3D_SURFACE_HINT_RENDERTARGET;
+
+        pState->ext.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + type - SVGA3D_RT_COLOR0, GL_TEXTURE_2D, pRenderTarget->oglId.texture, target.mipmap);
+        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+        pContext->sidRenderTarget = target.sid;
+
+#ifdef DEBUG
+        GLenum status = pState->ext.glCheckFramebufferStatus(GL_FRAMEBUFFER);
+        if (status != GL_FRAMEBUFFER_COMPLETE)
+            Log(("vmsvga3dSetRenderTarget: WARNING: glCheckFramebufferStatus returned %x\n", status));
+#endif
+        /* @todo use glDrawBuffers too? */
+        break;
+    }
+
+    default:
+        AssertFailedReturn(VERR_INVALID_PARAMETER);
+    }
+
+    return VINF_SUCCESS;
+}
+
+#if 0
+/**
+ * Convert SVGA texture combiner value to its D3D equivalent
+ */
+static DWORD vmsvga3dTextureCombiner2D3D(uint32_t value)
+{
+    switch (value)
+    {
+    case SVGA3D_TC_DISABLE:
+        return D3DTOP_DISABLE;
+    case SVGA3D_TC_SELECTARG1:
+        return D3DTOP_SELECTARG1;
+    case SVGA3D_TC_SELECTARG2:
+        return D3DTOP_SELECTARG2;
+    case SVGA3D_TC_MODULATE:
+        return D3DTOP_MODULATE;
+    case SVGA3D_TC_ADD:
+        return D3DTOP_ADD;
+    case SVGA3D_TC_ADDSIGNED:
+        return D3DTOP_ADDSIGNED;
+    case SVGA3D_TC_SUBTRACT:
+        return D3DTOP_SUBTRACT;
+    case SVGA3D_TC_BLENDTEXTUREALPHA:
+        return D3DTOP_BLENDTEXTUREALPHA;
+    case SVGA3D_TC_BLENDDIFFUSEALPHA:
+        return D3DTOP_BLENDDIFFUSEALPHA;
+    case SVGA3D_TC_BLENDCURRENTALPHA:
+        return D3DTOP_BLENDCURRENTALPHA;
+    case SVGA3D_TC_BLENDFACTORALPHA:
+        return D3DTOP_BLENDFACTORALPHA;
+    case SVGA3D_TC_MODULATE2X:
+        return D3DTOP_MODULATE2X;
+    case SVGA3D_TC_MODULATE4X:
+        return D3DTOP_MODULATE4X;
+    case SVGA3D_TC_DSDT:
+        AssertFailed(); /* @todo ??? */
+        return D3DTOP_DISABLE;
+    case SVGA3D_TC_DOTPRODUCT3:
+        return D3DTOP_DOTPRODUCT3;
+    case SVGA3D_TC_BLENDTEXTUREALPHAPM:
+        return D3DTOP_BLENDTEXTUREALPHAPM;
+    case SVGA3D_TC_ADDSIGNED2X:
+        return D3DTOP_ADDSIGNED2X;
+    case SVGA3D_TC_ADDSMOOTH:
+        return D3DTOP_ADDSMOOTH;
+    case SVGA3D_TC_PREMODULATE:
+        return D3DTOP_PREMODULATE;
+    case SVGA3D_TC_MODULATEALPHA_ADDCOLOR:
+        return D3DTOP_MODULATEALPHA_ADDCOLOR;
+    case SVGA3D_TC_MODULATECOLOR_ADDALPHA:
+        return D3DTOP_MODULATECOLOR_ADDALPHA;
+    case SVGA3D_TC_MODULATEINVALPHA_ADDCOLOR:
+        return D3DTOP_MODULATEINVALPHA_ADDCOLOR;
+    case SVGA3D_TC_MODULATEINVCOLOR_ADDALPHA:
+        return D3DTOP_MODULATEINVCOLOR_ADDALPHA;
+    case SVGA3D_TC_BUMPENVMAPLUMINANCE:
+        return D3DTOP_BUMPENVMAPLUMINANCE;
+    case SVGA3D_TC_MULTIPLYADD:
+        return D3DTOP_MULTIPLYADD;
+    case SVGA3D_TC_LERP:
+        return D3DTOP_LERP;
+    default:
+        AssertFailed();
+        return D3DTOP_DISABLE;
+    }
+}
+
+/**
+ * Convert SVGA texture arg data value to its D3D equivalent
+ */
+static DWORD vmsvga3dTextureArgData2D3D(uint32_t value)
+{
+    switch (value)
+    {
+    case SVGA3D_TA_CONSTANT:
+        return D3DTA_CONSTANT;
+    case SVGA3D_TA_PREVIOUS:
+        return D3DTA_CURRENT;   /* current = previous */
+    case SVGA3D_TA_DIFFUSE:
+        return D3DTA_DIFFUSE;
+    case SVGA3D_TA_TEXTURE:
+        return D3DTA_TEXTURE;
+    case SVGA3D_TA_SPECULAR:
+        return D3DTA_SPECULAR;
+    default:
+        AssertFailed();
+        return 0;
+    }
+}
+
+/**
+ * Convert SVGA texture transform flag value to its D3D equivalent
+ */
+static DWORD vmsvga3dTextTransformFlags2D3D(uint32_t value)
+{
+    switch (value)
+    {
+    case SVGA3D_TEX_TRANSFORM_OFF:
+        return D3DTTFF_DISABLE;
+    case SVGA3D_TEX_TRANSFORM_S:
+        return D3DTTFF_COUNT1;      /* @todo correct? */
+    case SVGA3D_TEX_TRANSFORM_T:
+        return D3DTTFF_COUNT2;      /* @todo correct? */
+    case SVGA3D_TEX_TRANSFORM_R:
+        return D3DTTFF_COUNT3;      /* @todo correct? */
+    case SVGA3D_TEX_TRANSFORM_Q:
+        return D3DTTFF_COUNT4;      /* @todo correct? */
+    case SVGA3D_TEX_PROJECTED:
+        return D3DTTFF_PROJECTED;
+    default:
+        AssertFailed();
+        return 0;
+    }
+}
+#endif
+
+static GLenum vmsvga3dTextureAddress2OGL(SVGA3dTextureAddress value)
+{
+    switch (value)
+    {
+    case SVGA3D_TEX_ADDRESS_WRAP:
+        return GL_REPEAT;
+    case SVGA3D_TEX_ADDRESS_MIRROR:
+        return GL_MIRRORED_REPEAT;
+    case SVGA3D_TEX_ADDRESS_CLAMP:
+        return GL_CLAMP_TO_EDGE;
+    case SVGA3D_TEX_ADDRESS_BORDER:
+        return GL_CLAMP_TO_BORDER;
+    case SVGA3D_TEX_ADDRESS_MIRRORONCE:
+        AssertFailed();
+        return GL_CLAMP_TO_EDGE_SGIS; /* @todo correct? */
+
+    case SVGA3D_TEX_ADDRESS_EDGE:        
+    case SVGA3D_TEX_ADDRESS_INVALID:
+    default:
+        AssertFailed();
+        return GL_REPEAT;   /* default */
+    }
+}
+
+static GLenum vmsvga3dTextureFilter2OGL(SVGA3dTextureFilter value)
+{
+    switch (value)
+    {
+    case SVGA3D_TEX_FILTER_NONE:
+    case SVGA3D_TEX_FILTER_LINEAR:
+        return GL_LINEAR;
+    case SVGA3D_TEX_FILTER_NEAREST:
+        return GL_NEAREST;
+    case SVGA3D_TEX_FILTER_ANISOTROPIC:
+        /* @todo */
+    case SVGA3D_TEX_FILTER_FLATCUBIC:       // Deprecated, not implemented
+    case SVGA3D_TEX_FILTER_GAUSSIANCUBIC:   // Deprecated, not implemented
+    case SVGA3D_TEX_FILTER_PYRAMIDALQUAD:   // Not currently implemented
+    case SVGA3D_TEX_FILTER_GAUSSIANQUAD:    // Not currently implemented
+    default:
+        AssertFailed();
+        return GL_LINEAR;   /* default */
+    }
+}
+
+uint32_t vmsvga3dSVGA3dColor2RGBA(SVGA3dColor value)
+{
+    /* flip the red and blue bytes */
+    uint8_t blue = value & 0xff;
+    uint8_t red  = (value >> 16) & 0xff;
+    return (value & 0xff00ff00) | red | (blue << 16);
+}
+
+int vmsvga3dSetTextureState(PVGASTATE pThis, uint32_t cid, uint32_t cTextureStates, SVGA3dTextureState *pTextureState)
+{
+    GLenum                      val;
+    GLenum                      currentStage = ~0L;
+    PVMSVGA3DCONTEXT            pContext;
+    PVMSVGA3DSTATE              pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dSetTextureState %x cTextureState=%d\n", cid, cTextureStates));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetTextureState invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    for (unsigned i = 0; i < cTextureStates; i++)
+    {
+        GLenum textureType = ~0U;
+        GLenum samplerType = ~0U;
+
+        Log(("vmsvga3dSetTextureState: cid=%x stage=%d type=%s (%x) val=%x\n", cid, pTextureState[i].stage, vmsvga3dTextureStateToString(pTextureState[i].name), pTextureState[i].name, pTextureState[i].value));
+        /* Record the texture state for vm state saving. */
+        if (    pTextureState[i].stage < SVGA3D_MAX_TEXTURE_STAGE
+            &&  pTextureState[i].name < SVGA3D_TS_MAX)
+        {
+            pContext->state.aTextureState[pTextureState[i].stage][pTextureState[i].name] = pTextureState[i];
+        }
+
+        /* Active the right texture unit for subsequent texture state changes. */
+        if (pTextureState[i].stage != currentStage)
+        {
+            pState->ext.glActiveTexture(GL_TEXTURE0 + pTextureState[i].stage);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            currentStage = pTextureState[i].stage;
+        }
+
+        switch (pTextureState[i].name)
+        {
+        case SVGA3D_TS_BUMPENVMAT00:                /* float */
+        case SVGA3D_TS_BUMPENVMAT01:                /* float */
+        case SVGA3D_TS_BUMPENVMAT10:                /* float */
+        case SVGA3D_TS_BUMPENVMAT11:                /* float */
+        case SVGA3D_TS_BUMPENVLSCALE:               /* float */
+        case SVGA3D_TS_BUMPENVLOFFSET:              /* float */
+            Log(("vmsvga3dSetTextureState: bump mapping texture options not supported!!\n"));
+            break;
+
+        case SVGA3D_TS_COLOROP:                     /* SVGA3dTextureCombiner */
+        case SVGA3D_TS_COLORARG0:                   /* SVGA3dTextureArgData */
+        case SVGA3D_TS_COLORARG1:                   /* SVGA3dTextureArgData */
+        case SVGA3D_TS_COLORARG2:                   /* SVGA3dTextureArgData */
+        case SVGA3D_TS_ALPHAOP:                     /* SVGA3dTextureCombiner */
+        case SVGA3D_TS_ALPHAARG0:                   /* SVGA3dTextureArgData */
+        case SVGA3D_TS_ALPHAARG1:                   /* SVGA3dTextureArgData */
+        case SVGA3D_TS_ALPHAARG2:                   /* SVGA3dTextureArgData */
+            /* @todo; not used by MesaGL */
+            Log(("vmsvga3dSetTextureState: colorop/alphaop not yet supported!!\n"));
+            break;
+#if 0
+
+        case SVGA3D_TS_TEXCOORDINDEX:               /* uint32_t */
+            textureType = D3DTSS_TEXCOORDINDEX;
+            val = pTextureState[i].value;
+            break;
+
+        case SVGA3D_TS_TEXTURETRANSFORMFLAGS:       /* SVGA3dTexTransformFlags */
+            textureType = D3DTSS_TEXTURETRANSFORMFLAGS;
+            val = vmsvga3dTextTransformFlags2D3D(pTextureState[i].value);
+            break;
+#endif
+
+        case SVGA3D_TS_BIND_TEXTURE:                /* SVGA3dSurfaceId */
+            if (pTextureState[i].value == SVGA3D_INVALID_ID)
+            {
+                Log(("SVGA3D_TS_BIND_TEXTURE: stage %d, texture surface id=%x\n", pTextureState[i].stage, pTextureState[i].value));
+
+                pContext->aSidActiveTexture[currentStage] = SVGA3D_INVALID_ID;
+                /* Unselect the currently associated texture. */
+                glBindTexture(GL_TEXTURE_2D, 0);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                /* Necessary for the fixed pipeline. */
+                glDisable(GL_TEXTURE_2D);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            }
+            else
+            {
+                uint32_t sid = pTextureState[i].value;
+
+                AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+                AssertReturn(sid < pState->cSurfaces && pState->paSurface[sid].id == sid, VERR_INVALID_PARAMETER);
+
+                PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];
+
+                Log(("SVGA3D_TS_BIND_TEXTURE: stage %d, texture surface id=%x (%d,%d)\n", pTextureState[i].stage, pTextureState[i].value, pSurface->pMipmapLevels[0].size.width, pSurface->pMipmapLevels[0].size.height));
+
+                if (pSurface->oglId.texture == OPENGL_INVALID_ID)
+                {
+                    Assert(pSurface->idAssociatedContext == SVGA3D_INVALID_ID);
+                    Log(("CreateTexture (%d,%d) level=%d\n", pSurface->pMipmapLevels[0].size.width, pSurface->pMipmapLevels[0].size.height, pSurface->faces[0].numMipLevels));
+                    int rc = vmsvga3dCreateTexture(pState, pContext, cid, pSurface);
+                    AssertRCReturn(rc, rc);
+                }
+
+                glBindTexture(GL_TEXTURE_2D, pSurface->oglId.texture);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+                /* Necessary for the fixed pipeline. */
+                glEnable(GL_TEXTURE_2D);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+                if (pContext->aSidActiveTexture[currentStage] != sid)
+                {
+                    /* Recreate the texture state as glBindTexture resets them all (sigh). */
+                    for (uint32_t iStage = 0; iStage < SVGA3D_MAX_TEXTURE_STAGE; iStage++)
+                    {
+                        for (uint32_t j = 0; j < SVGA3D_TS_MAX; j++)
+                        {
+                            SVGA3dTextureState *pTextureStateIter = &pContext->state.aTextureState[iStage][j];
+
+                            if (    pTextureStateIter->name != SVGA3D_TS_INVALID
+                                &&  pTextureStateIter->name != SVGA3D_TS_BIND_TEXTURE)
+                                vmsvga3dSetTextureState(pThis, pContext->id, 1, pTextureStateIter);
+                        }
+                    }
+                }
+                pContext->aSidActiveTexture[currentStage] = sid;
+            }
+            /* Finished; continue with the next one. */
+            continue;
+
+        case SVGA3D_TS_ADDRESSW:                    /* SVGA3dTextureAddress */
+            textureType = GL_TEXTURE_WRAP_R;    /* R = W */
+            val = vmsvga3dTextureAddress2OGL((SVGA3dTextureAddress)pTextureState[i].value);
+            break;
+
+        case SVGA3D_TS_ADDRESSU:                    /* SVGA3dTextureAddress */
+            textureType = GL_TEXTURE_WRAP_S;    /* S = U */
+            val = vmsvga3dTextureAddress2OGL((SVGA3dTextureAddress)pTextureState[i].value);
+            break;
+
+        case SVGA3D_TS_ADDRESSV:                    /* SVGA3dTextureAddress */
+            textureType = GL_TEXTURE_WRAP_T;    /* T = V */
+            val = vmsvga3dTextureAddress2OGL((SVGA3dTextureAddress)pTextureState[i].value);
+            break;
+
+        case SVGA3D_TS_MIPFILTER:                   /* SVGA3dTextureFilter */
+            //AssertFailed(); /* @todo */
+            //samplerType = D3DSAMP_MIPFILTER;
+            val = vmsvga3dTextureFilter2OGL((SVGA3dTextureFilter)pTextureState[i].value);
+            break;
+
+        case SVGA3D_TS_MAGFILTER:                   /* SVGA3dTextureFilter */
+            textureType = GL_TEXTURE_MAG_FILTER;
+            val = vmsvga3dTextureFilter2OGL((SVGA3dTextureFilter)pTextureState[i].value);
+            Assert(val == GL_NEAREST || val == GL_LINEAR);
+            break;
+
+        case SVGA3D_TS_MINFILTER:                   /* SVGA3dTextureFilter */
+            textureType = GL_TEXTURE_MIN_FILTER;
+            val = vmsvga3dTextureFilter2OGL((SVGA3dTextureFilter)pTextureState[i].value);
+            break;
+
+        case SVGA3D_TS_BORDERCOLOR:                 /* SVGA3dColor */
+        {
+            GLfloat color[4]; /* red, green, blue, alpha */
+
+            vmsvgaColor2GLFloatArray(pTextureState[i].value, &color[0], &color[1], &color[2], &color[3]);
+
+            glTexParameterfv(GL_TEXTURE_2D /* @todo flexible type */, GL_TEXTURE_BORDER_COLOR, color);   /* Identical; default 0.0 identical too */
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+        }
+
+        case SVGA3D_TS_TEXTURE_LOD_BIAS:            /* float */
+            glTexParameterf(GL_TEXTURE_2D /* @todo flexible type */, GL_TEXTURE_LOD_BIAS, pTextureState[i].value);   /* Identical; default 0.0 identical too */
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            break;
+            
+        case SVGA3D_TS_TEXTURE_MIPMAP_LEVEL:        /* uint32_t */
+            textureType = GL_TEXTURE_MAX_LEVEL;
+            val = pTextureState[i].value;   /* Identical?? */
+            break;
+
+#if 0      
+        case SVGA3D_TS_TEXTURE_ANISOTROPIC_LEVEL:   /* uint32_t */
+            samplerType = D3DSAMP_MAXANISOTROPY;
+            val = pTextureState[i].value;   /* Identical?? */
+            break;
+            
+        case SVGA3D_TS_GAMMA:                       /* float */
+            samplerType = D3DSAMP_SRGBTEXTURE;
+            /* Boolean in D3D */
+            if (pTextureState[i].floatValue == 1.0f)
+                val = FALSE;
+            else
+                val = TRUE;
+            break;           
+#endif
+        /* Internal commands, that don't map directly to the SetTextureStageState API. */
+        case SVGA3D_TS_TEXCOORDGEN:                 /* SVGA3dTextureCoordGen */
+            AssertFailed();
+            break;
+
+        default:
+            //AssertFailed();
+            break;
+        }
+
+        if (textureType != ~0U)
+        {
+            glTexParameteri(GL_TEXTURE_2D /* @todo flexible type */, textureType, val);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+        }
+    }
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSetMaterial(PVGASTATE pThis, uint32_t cid, SVGA3dFace face, SVGA3dMaterial *pMaterial)
+{
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+    GLenum                oglFace;
+
+    Log(("vmsvga3dSetMaterial cid=%x face %d\n", cid, face));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetMaterial invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    switch (face)
+    {
+    case SVGA3D_FACE_NONE:
+    case SVGA3D_FACE_FRONT:
+        oglFace = GL_FRONT;
+        break;
+
+    case SVGA3D_FACE_BACK:
+        oglFace = GL_BACK;
+        break;
+
+    case SVGA3D_FACE_FRONT_BACK:
+        oglFace = GL_FRONT_AND_BACK;
+        break;
+
+    default:
+        AssertFailedReturn(VERR_INVALID_PARAMETER);
+    }
+
+    /* Save for vm state save/restore. */
+    pContext->state.aMaterial[face].fValid = true;
+    pContext->state.aMaterial[face].material = *pMaterial;
+    pContext->state.u32UpdateFlags |= VMSVGA3D_UPDATE_MATERIAL;
+
+    glMaterialfv(oglFace, GL_DIFFUSE, pMaterial->diffuse);
+    glMaterialfv(oglFace, GL_AMBIENT, pMaterial->ambient);
+    glMaterialfv(oglFace, GL_SPECULAR, pMaterial->specular);
+    glMaterialfv(oglFace, GL_EMISSION, pMaterial->emissive);
+    glMaterialfv(oglFace, GL_SHININESS, &pMaterial->shininess);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    return VINF_SUCCESS;
+}
+
+/* @todo Move into separate library as we are using logic from Wine here. */
+int vmsvga3dSetLightData(PVGASTATE pThis, uint32_t cid, uint32_t index, SVGA3dLightData *pData)
+{
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+    float                 QuadAttenuation;
+
+    Log(("vmsvga3dSetLightData cid=%x index=%d type=%d\n", cid, index, pData->type));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetLightData invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    /* Store for vm state save/restore */
+    if (index < SVGA3D_MAX_LIGHTS)
+    {
+        pContext->state.aLightData[index].fValidData = true;
+        pContext->state.aLightData[index].data = *pData;
+    }
+    else
+        AssertFailed();
+
+    if (    pData->attenuation0 < 0.0f 
+        ||  pData->attenuation1 < 0.0f 
+        ||  pData->attenuation2 < 0.0f)
+    {
+        Log(("vmsvga3dSetLightData: invalid negative attenuation values!!\n"));
+        return VINF_SUCCESS;    /* ignore; could crash the GL driver */
+    }
+
+    /* Light settings are affected by the model view in OpenGL, the View transform in direct3d */
+    glMatrixMode(GL_MODELVIEW);
+    glPushMatrix();
+    glLoadMatrixf(pContext->state.aTransformState[SVGA3D_TRANSFORM_VIEW].matrix);
+
+    glLightfv(GL_LIGHT0 + index, GL_DIFFUSE, pData->diffuse);
+    glLightfv(GL_LIGHT0 + index, GL_SPECULAR, pData->specular);
+    glLightfv(GL_LIGHT0 + index, GL_AMBIENT, pData->ambient);
+
+    if (pData->range * pData->range >= FLT_MIN)
+        QuadAttenuation = 1.4f / (pData->range * pData->range);
+    else 
+        QuadAttenuation = 0.0f;
+
+    switch (pData->type)
+    {
+    case SVGA3D_LIGHTTYPE_POINT:
+    {
+        GLfloat position[4];
+
+        position[0] = pData->position[0];
+        position[1] = pData->position[1];
+        position[2] = pData->position[2];
+        position[3] = 1.0f;
+
+        glLightfv(GL_LIGHT0 + index, GL_POSITION, position);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+        
+        glLightf(GL_LIGHT0 + index, GL_SPOT_CUTOFF, 180.0f);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+        
+        /* Attenuation - Are these right? guessing... */
+        glLightf(GL_LIGHT0 + index, GL_CONSTANT_ATTENUATION, pData->attenuation0);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+        
+        glLightf(GL_LIGHT0 + index, GL_LINEAR_ATTENUATION, pData->attenuation1);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+        glLightf(GL_LIGHT0 + index, GL_QUADRATIC_ATTENUATION, (QuadAttenuation < pData->attenuation2) ? pData->attenuation2 : QuadAttenuation);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+        /* @todo range */
+        break;
+    }
+
+    case SVGA3D_LIGHTTYPE_SPOT1:
+    {
+        GLfloat exponent;
+        GLfloat position[4];
+        const GLfloat pi = 4.0f * atanf(1.0f);
+
+        position[0] = pData->position[0];
+        position[1] = pData->position[1];
+        position[2] = pData->position[2];
+        position[3] = 1.0f;
+
+        glLightfv(GL_LIGHT0 + index, GL_POSITION, position);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+        position[0] = pData->direction[0];
+        position[1] = pData->direction[1];
+        position[2] = pData->direction[2];
+        position[3] = 1.0f;
+
+        glLightfv(GL_LIGHT0 + index, GL_SPOT_DIRECTION, position);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+        /*
+         * opengl-ish and d3d-ish spot lights use too different models for the
+         * light "intensity" as a function of the angle towards the main light direction,
+         * so we only can approximate very roughly.
+         * however spot lights are rather rarely used in games (if ever used at all).
+         * furthermore if still used, probably nobody pays attention to such details.
+         */
+        if (pData->falloff == 0)
+        {
+            /* Falloff = 0 is easy, because d3d's and opengl's spot light equations have the
+             * falloff resp. exponent parameter as an exponent, so the spot light lighting
+             * will always be 1.0 for both of them, and we don't have to care for the
+             * rest of the rather complex calculation
+             */
+            exponent = 0.0f;
+        } 
+        else 
+        {
+            float rho = pData->theta + (pData->phi - pData->theta) / (2 * pData->falloff);
+            if (rho < 0.0001f) 
+                rho = 0.0001f;
+            exponent = -0.3f/log(cos(rho/2));
+        }
+        if (exponent > 128.0f)
+            exponent = 128.0f;
+
+        glLightf(GL_LIGHT0 + index, GL_SPOT_EXPONENT, exponent);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+        glLightf(GL_LIGHT0 + index, GL_SPOT_CUTOFF, pData->phi * 90.0 / pi);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+        /* Attenuation - Are these right? guessing... */
+        glLightf(GL_LIGHT0 + index, GL_CONSTANT_ATTENUATION, pData->attenuation0);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+        
+        glLightf(GL_LIGHT0 + index, GL_LINEAR_ATTENUATION, pData->attenuation1);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+        glLightf(GL_LIGHT0 + index, GL_QUADRATIC_ATTENUATION, (QuadAttenuation < pData->attenuation2) ? pData->attenuation2 : QuadAttenuation);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+        /* @todo range */
+        break;
+    }
+
+    case SVGA3D_LIGHTTYPE_DIRECTIONAL:
+    {
+        GLfloat position[4];
+
+        position[0] = -pData->direction[0];
+        position[1] = -pData->direction[1];
+        position[2] = -pData->direction[2];
+        position[3] = 0.0f;
+
+        glLightfv(GL_LIGHT0 + index, GL_POSITION, position); /* Note gl uses w position of 0 for direction! */
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+        glLightf(GL_LIGHT0 + index, GL_SPOT_CUTOFF, 180.0f);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+        glLightf(GL_LIGHT0 + index, GL_SPOT_EXPONENT, 0.0f);
+        VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+        break;
+    }
+
+    case SVGA3D_LIGHTTYPE_SPOT2:
+    default:
+        Log(("Unsupported light type!!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+
+    /* Restore the modelview matrix */
+    glPopMatrix();
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSetLightEnabled(PVGASTATE pThis, uint32_t cid, uint32_t index, uint32_t enabled)
+{    
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dSetLightEnabled cid=%x %d -> %d\n", cid, index, enabled));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetLightEnabled invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    /* Store for vm state save/restore */
+    if (index < SVGA3D_MAX_LIGHTS)
+        pContext->state.aLightData[index].fEnabled = !!enabled;
+    else
+        AssertFailed();
+
+    if (enabled)
+    {
+        /* Load the default settings if none have been set yet. */
+        if (!pContext->state.aLightData[index].fValidData)
+            vmsvga3dSetLightData(pThis, cid, index, (SVGA3dLightData *)&vmsvga3d_default_light);
+        glEnable(GL_LIGHT0 + index);
+    }
+    else
+        glDisable(GL_LIGHT0 + index);
+
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSetViewPort(PVGASTATE pThis, uint32_t cid, SVGA3dRect *pRect)
+{
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dSetViewPort cid=%x (%d,%d)(%d,%d)\n", cid, pRect->x, pRect->y, pRect->w, pRect->h));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetViewPort invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    /* Save for vm state save/restore. */
+    pContext->state.RectViewPort = *pRect;
+    pContext->state.u32UpdateFlags |= VMSVGA3D_UPDATE_VIEWPORT;
+
+    /* @todo y-inversion for partial viewport coordinates? */
+    glViewport(pRect->x, pRect->y, pRect->w, pRect->h);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    /* Reset the projection matrix as that relies on the viewport setting. */
+    if (pContext->state.aTransformState[SVGA3D_TRANSFORM_PROJECTION].fValid == true)
+    {
+        vmsvga3dSetTransform(pThis, cid, SVGA3D_TRANSFORM_PROJECTION, pContext->state.aTransformState[SVGA3D_TRANSFORM_PROJECTION].matrix);
+    }
+    else
+    {
+        float matrix[16];
+
+        /* identity matrix if no matrix set. */
+        memset(matrix, 0, sizeof(matrix));
+        matrix[0]  = 1.0;
+        matrix[5]  = 1.0;
+        matrix[10] = 1.0;
+        matrix[15] = 1.0;
+        vmsvga3dSetTransform(pThis, cid, SVGA3D_TRANSFORM_PROJECTION, matrix);
+    }
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSetClipPlane(PVGASTATE pThis, uint32_t cid,  uint32_t index, float plane[4])
+{
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+    double                oglPlane[4];
+
+    Log(("vmsvga3dSetClipPlane cid=%x %d (%d,%d)(%d,%d)\n", cid, index, (unsigned)(plane[0] * 100.0), (unsigned)(plane[1] * 100.0), (unsigned)(plane[2] * 100.0), (unsigned)(plane[3] * 100.0)));
+    AssertReturn(index <= SVGA3D_CLIPPLANE_MAX, VERR_INVALID_PARAMETER);
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetClipPlane invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    /* Store for vm state save/restore. */
+    pContext->state.aClipPlane[index].fValid = true;
+    memcpy(pContext->state.aClipPlane[index].plane, plane, sizeof(plane));
+
+    /* @todo clip plane affected by model view in OpenGL & view in D3D + vertex shader -> not transformed (see Wine; state.c clipplane) */
+    oglPlane[0] = (double)plane[0];
+    oglPlane[1] = (double)plane[1];
+    oglPlane[2] = (double)plane[2];
+    oglPlane[3] = (double)plane[3];
+
+    glClipPlane(GL_CLIP_PLANE0 + index, oglPlane);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSetScissorRect(PVGASTATE pThis, uint32_t cid, SVGA3dRect *pRect)
+{
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dSetScissorRect cid=%x (%d,%d)(%d,%d)\n", cid, pRect->x, pRect->y, pRect->w, pRect->h));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetScissorRect invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    /* Store for vm state save/restore. */
+    pContext->state.u32UpdateFlags |= VMSVGA3D_UPDATE_SCISSORRECT;
+    pContext->state.RectScissor = *pRect;
+
+    glScissor(pRect->x, pRect->y, pRect->w, pRect->h);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+    return VINF_SUCCESS;
+}
+
+static void vmsvgaColor2GLFloatArray(uint32_t color, GLfloat *pRed, GLfloat *pGreen, GLfloat *pBlue, GLfloat *pAlpha)
+{
+    /* Convert byte color components to float (0-1.0) */
+    *pAlpha = (GLfloat)(color >> 24) / 255.0;
+    *pRed   = (GLfloat)((color >> 16) & 0xff) / 255.0;
+    *pGreen = (GLfloat)((color >> 8) & 0xff) / 255.0;
+    *pBlue  = (GLfloat)(color & 0xff) / 255.0;
+}
+
+int vmsvga3dCommandClear(PVGASTATE pThis, uint32_t cid, SVGA3dClearFlag clearFlag, uint32_t color, float depth, uint32_t stencil, uint32_t cRects, SVGA3dRect *pRect)
+{
+    GLbitfield            mask = 0;
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+    GLboolean             fDepthWriteEnabled = GL_FALSE;
+
+    Log(("vmsvga3dCommandClear cid=%x clearFlag=%x color=%x depth=%d stencil=%x cRects=%d\n", cid, clearFlag, color, (uint32_t)(depth * 100.0), stencil, cRects));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dCommandClear invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    if (clearFlag & SVGA3D_CLEAR_COLOR)
+    {
+        GLfloat red, green, blue, alpha;
+
+        vmsvgaColor2GLFloatArray(color, &red, &green, &blue, &alpha);
+
+        /* Set the color clear value. */
+        glClearColor(red, green, blue, alpha);
+
+        mask |= GL_COLOR_BUFFER_BIT;
+    }
+    if (clearFlag & SVGA3D_CLEAR_STENCIL)
+    {
+        /* @todo possibly the same problem as with glDepthMask */
+        glClearStencil(stencil);
+        mask |= GL_STENCIL_BUFFER_BIT;
+    }
+    if (clearFlag & SVGA3D_CLEAR_DEPTH)
+    {
+        glClearDepth((GLdouble)depth);
+        mask |= GL_DEPTH_BUFFER_BIT;
+
+        /* glClear will not clear the depth buffer if writing is disabled. */
+        glGetBooleanv(GL_DEPTH_WRITEMASK, &fDepthWriteEnabled);
+        if (fDepthWriteEnabled == GL_FALSE)
+            glDepthMask(GL_TRUE);
+    }
+
+    if (cRects)
+    {
+        /* Save the current scissor test bit and scissor box. */
+        glPushAttrib(GL_SCISSOR_BIT);
+        glEnable(GL_SCISSOR_TEST);
+        for (unsigned i=0; i < cRects; i++)
+        {
+            Log(("vmsvga3dCommandClear: rect %d (%d,%d)(%d,%d)\n", i, pRect[i].x, pRect[i].y, pRect[i].x + pRect[i].w, pRect[i].y + pRect[i].h));
+            glScissor(pRect[i].x, pRect[i].y, pRect[i].w, pRect[i].h);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            glClear(mask);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+        }
+        /* Restore the old scissor test bit and box */
+        glPopAttrib();
+    }
+    else
+    {
+        glClear(mask);
+        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+    }
+
+    /* Restore depth write state. */
+    if (    (clearFlag & SVGA3D_CLEAR_DEPTH)
+        && fDepthWriteEnabled == GL_FALSE)
+        glDepthMask(GL_FALSE);
+
+    return VINF_SUCCESS;
+}
+
+/* Convert VMWare vertex declaration to its OpenGL equivalent. */
+int vmsvga3dVertexDecl2OGL(SVGA3dVertexArrayIdentity &identity, GLint &size, GLenum &type, GLboolean &normalized)
+{
+    normalized = GL_FALSE;
+    switch (identity.type)
+    {
+    case SVGA3D_DECLTYPE_FLOAT1:
+        size = 1;
+        type = GL_FLOAT;
+        break;
+    case SVGA3D_DECLTYPE_FLOAT2:
+        size = 2;
+        type = GL_FLOAT;
+        break;
+    case SVGA3D_DECLTYPE_FLOAT3:
+        size = 3;
+        type = GL_FLOAT;
+        break;
+    case SVGA3D_DECLTYPE_FLOAT4:
+        size = 4;
+        type = GL_FLOAT;
+        break;
+
+    case SVGA3D_DECLTYPE_D3DCOLOR:
+        size = GL_BGRA;                 /* @note requires GL_ARB_vertex_array_bgra */
+        type = GL_UNSIGNED_BYTE;
+        normalized = GL_TRUE;   /* glVertexAttribPointer fails otherwise */
+        break;
+
+    case SVGA3D_DECLTYPE_UBYTE4N:
+        normalized = GL_TRUE;
+        /* no break */
+    case SVGA3D_DECLTYPE_UBYTE4:
+        size = 4;
+        type = GL_UNSIGNED_BYTE;
+        break;
+
+    case SVGA3D_DECLTYPE_SHORT2N:
+        normalized = GL_TRUE;
+        /* no break */
+    case SVGA3D_DECLTYPE_SHORT2:
+        size = 2;
+        type = GL_SHORT;
+        break;
+
+    case SVGA3D_DECLTYPE_SHORT4N:
+        normalized = GL_TRUE;
+        /* no break */
+    case SVGA3D_DECLTYPE_SHORT4:
+        size = 4;
+        type = GL_SHORT;
+        break;
+
+    case SVGA3D_DECLTYPE_USHORT4N:
+        normalized = GL_TRUE;
+        size = 4;
+        type = GL_UNSIGNED_SHORT;
+        break;
+
+    case SVGA3D_DECLTYPE_USHORT2N:
+        normalized = GL_TRUE;
+        size = 2;
+        type = GL_UNSIGNED_SHORT;
+        break;
+
+    case SVGA3D_DECLTYPE_UDEC3:
+        size = 3;
+        type = GL_UNSIGNED_INT_2_10_10_10_REV;    /* @todo correct? */
+        break;
+
+    case SVGA3D_DECLTYPE_DEC3N:
+        normalized = true;
+        size = 3;
+        type = GL_INT_2_10_10_10_REV;    /* @todo correct? */
+        break;
+
+    case SVGA3D_DECLTYPE_FLOAT16_2:
+        size = 2;
+        type = GL_HALF_FLOAT;
+        break;
+    case SVGA3D_DECLTYPE_FLOAT16_4:
+        size = 4;
+        type = GL_HALF_FLOAT;
+        break;
+    default:
+        AssertFailedReturn(VERR_INVALID_PARAMETER);
+    }
+
+    //pVertexElement->Method      = identity.method;
+    //pVertexElement->Usage       = identity.usage;
+
+    return VINF_SUCCESS;
+}
+
+/* Convert VMWare primitive type to its OpenGL equivalent. */
+/* Calculate the vertex count based on the primitive type and nr of primitives. */
+int vmsvga3dPrimitiveType2OGL(SVGA3dPrimitiveType PrimitiveType, GLenum *pMode, uint32_t cPrimitiveCount, uint32_t *pcVertices)
+{
+    switch (PrimitiveType)
+    {
+    case SVGA3D_PRIMITIVE_TRIANGLELIST:
+        *pMode      = GL_TRIANGLES;
+        *pcVertices = cPrimitiveCount * 3;
+        break;
+    case SVGA3D_PRIMITIVE_POINTLIST:
+        *pMode = GL_POINTS;
+        *pcVertices = cPrimitiveCount;
+        break;
+    case SVGA3D_PRIMITIVE_LINELIST:
+        *pMode = GL_LINES;
+        *pcVertices = cPrimitiveCount * 2;
+        break;
+    case SVGA3D_PRIMITIVE_LINESTRIP:
+        *pMode = GL_LINE_STRIP;
+        *pcVertices = cPrimitiveCount + 1;
+        break;
+    case SVGA3D_PRIMITIVE_TRIANGLESTRIP:
+        *pMode = GL_TRIANGLE_STRIP;
+        *pcVertices = cPrimitiveCount + 2;
+        break;
+    case SVGA3D_PRIMITIVE_TRIANGLEFAN:
+        *pMode = GL_TRIANGLE_FAN;
+        *pcVertices = cPrimitiveCount + 2;
+        break;
+    default:
+        return VERR_INVALID_PARAMETER;
+    }
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dDrawPrimitivesProcessVertexDecls(PVMSVGA3DSTATE pState, PVMSVGA3DCONTEXT pContext, uint32_t iVertexDeclBase, uint32_t numVertexDecls, SVGA3dVertexDecl *pVertexDecl)
+{
+    unsigned            sidVertex = pVertexDecl[0].array.surfaceId;
+    PVMSVGA3DSURFACE    pVertexSurface;
+
+    AssertReturn(sidVertex < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(sidVertex < pState->cSurfaces && pState->paSurface[sidVertex].id == sidVertex, VERR_INVALID_PARAMETER);
+
+    pVertexSurface = &pState->paSurface[sidVertex];
+    Log(("vmsvga3dDrawPrimitives: vertex surface %x\n", sidVertex));
+
+    /* Create and/or bind the vertex buffer. */
+    if (pVertexSurface->oglId.buffer == OPENGL_INVALID_ID)
+    {
+        Log(("vmsvga3dDrawPrimitives: create vertex buffer fDirty=%d size=%x bytes\n", pVertexSurface->fDirty, pVertexSurface->pMipmapLevels[0].cbSurface));
+        pState->ext.glGenBuffers(1, &pVertexSurface->oglId.buffer);
+        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+        pState->ext.glBindBuffer(GL_ARRAY_BUFFER, pVertexSurface->oglId.buffer);
+        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+        Assert(pVertexSurface->fDirty);
+        /* @todo rethink usage dynamic/static */
+        pState->ext.glBufferData(GL_ARRAY_BUFFER, pVertexSurface->pMipmapLevels[0].cbSurface, pVertexSurface->pMipmapLevels[0].pSurfaceData, GL_DYNAMIC_DRAW);
+        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+        pVertexSurface->pMipmapLevels[0].fDirty = false;
+        pVertexSurface->fDirty = false;
+
+        pVertexSurface->flags |= SVGA3D_SURFACE_HINT_VERTEXBUFFER;
+    }
+    else
+    {
+        Assert(pVertexSurface->fDirty == false);
+        pState->ext.glBindBuffer(GL_ARRAY_BUFFER, pVertexSurface->oglId.buffer);
+        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+    }
+    pVertexSurface->idAssociatedContext = pContext->id;
+
+    /* Setup the vertex declarations. */
+    for (unsigned iVertex = 0; iVertex < numVertexDecls; iVertex++)
+    {
+        GLint size;
+        GLenum type;
+        GLboolean normalized;
+        GLuint index = iVertexDeclBase + iVertex;
+
+        Log(("vmsvga3dDrawPrimitives: array index %d type=%s (%d) method=%s (%d) usage=%s (%d) usageIndex=%d stride=%d offset=%d\n", index, vmsvgaDeclType2String(pVertexDecl[iVertex].identity.type), pVertexDecl[iVertex].identity.type, vmsvgaDeclMethod2String(pVertexDecl[iVertex].identity.method), pVertexDecl[iVertex].identity.method, vmsvgaDeclUsage2String(pVertexDecl[iVertex].identity.usage), pVertexDecl[iVertex].identity.usage, pVertexDecl[iVertex].identity.usageIndex, pVertexDecl[iVertex].array.stride, pVertexDecl[iVertex].array.offset));
+
+        int rc = vmsvga3dVertexDecl2OGL(pVertexDecl[iVertex].identity, size, type, normalized);
+        AssertRCReturn(rc, rc);
+
+        if (pContext->state.shidVertex != SVGA_ID_INVALID)
+        {
+            /* Use numbered vertex arrays when shaders are active. */
+            pState->ext.glEnableVertexAttribArray(index);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            pState->ext.glVertexAttribPointer(index, size, type, normalized, pVertexDecl[iVertex].array.stride, (const GLvoid *)pVertexDecl[iVertex].array.offset);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            /* case SVGA3D_DECLUSAGE_COLOR:    @todo color component order not identical!! test GL_BGRA!!  */
+        }
+        else
+        {
+            /* Use the predefined selection of vertex streams for the fixed pipeline. */
+            switch (pVertexDecl[iVertex].identity.usage)
+            {
+            case SVGA3D_DECLUSAGE_POSITION:
+                glEnableClientState(GL_VERTEX_ARRAY);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                glVertexPointer(size, type, pVertexDecl[iVertex].array.stride, (const GLvoid *)pVertexDecl[iVertex].array.offset);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                break;
+            case SVGA3D_DECLUSAGE_BLENDWEIGHT:
+                AssertFailed();
+                break;
+            case SVGA3D_DECLUSAGE_BLENDINDICES:
+                AssertFailed();
+                break;
+            case SVGA3D_DECLUSAGE_NORMAL:
+                glEnableClientState(GL_NORMAL_ARRAY);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                glNormalPointer(type, pVertexDecl[iVertex].array.stride, (const GLvoid *)pVertexDecl[iVertex].array.offset);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                break;
+            case SVGA3D_DECLUSAGE_PSIZE:
+                AssertFailed();
+                break;
+            case SVGA3D_DECLUSAGE_TEXCOORD:
+                /* Specify the affected texture unit. */
+                pState->ext.glClientActiveTexture(GL_TEXTURE0 + pVertexDecl[iVertex].identity.usageIndex);
+                glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                glTexCoordPointer(size, type, pVertexDecl[iVertex].array.stride, (const GLvoid *)pVertexDecl[iVertex].array.offset);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                break;
+            case SVGA3D_DECLUSAGE_TANGENT:
+                AssertFailed();
+                break;
+            case SVGA3D_DECLUSAGE_BINORMAL:
+                AssertFailed();
+                break;
+            case SVGA3D_DECLUSAGE_TESSFACTOR:
+                AssertFailed();
+                break;
+            case SVGA3D_DECLUSAGE_POSITIONT:
+                AssertFailed(); /* see position_transformed in Wine */
+                break;
+            case SVGA3D_DECLUSAGE_COLOR:    /* @todo color component order not identical!! test GL_BGRA!! */
+                glEnableClientState(GL_COLOR_ARRAY);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                glColorPointer(size, type, pVertexDecl[iVertex].array.stride, (const GLvoid *)pVertexDecl[iVertex].array.offset);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                break;
+            case SVGA3D_DECLUSAGE_FOG:
+                glEnableClientState(GL_FOG_COORD_ARRAY);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                pState->ext.glFogCoordPointer(type, pVertexDecl[iVertex].array.stride, (const GLvoid *)pVertexDecl[iVertex].array.offset);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                break;
+            case SVGA3D_DECLUSAGE_DEPTH:
+                AssertFailed();
+                break;
+            case SVGA3D_DECLUSAGE_SAMPLE:
+                AssertFailed();
+                break;
+            }
+        }
+       
+#ifdef LOG_ENABLED
+        if (pVertexDecl[iVertex].array.stride == 0)
+            Log(("vmsvga3dDrawPrimitives: stride == 0! Can be valid\n"));
+#endif
+    }
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dDrawPrimitivesCleanupVertexDecls(PVMSVGA3DSTATE pState, PVMSVGA3DCONTEXT pContext, uint32_t iVertexDeclBase, uint32_t numVertexDecls, SVGA3dVertexDecl *pVertexDecl)
+{
+    /* Setup the vertex declarations. */
+    for (unsigned iVertex = 0; iVertex < numVertexDecls; iVertex++)
+    {
+        if (pContext->state.shidVertex != SVGA_ID_INVALID)
+        {
+            /* Use numbered vertex arrays when shaders are active. */
+            pState->ext.glDisableVertexAttribArray(iVertexDeclBase + iVertex);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+        }
+        else
+        {
+            /* Use the predefined selection of vertex streams for the fixed pipeline. */
+            switch (pVertexDecl[iVertex].identity.usage)
+            {
+            case SVGA3D_DECLUSAGE_POSITION:
+                glDisableClientState(GL_VERTEX_ARRAY);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                break;
+            case SVGA3D_DECLUSAGE_BLENDWEIGHT:
+                break;
+            case SVGA3D_DECLUSAGE_BLENDINDICES:
+                break;
+            case SVGA3D_DECLUSAGE_NORMAL:
+                glDisableClientState(GL_NORMAL_ARRAY);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                break;
+            case SVGA3D_DECLUSAGE_PSIZE:
+                break;
+            case SVGA3D_DECLUSAGE_TEXCOORD:
+                /* Specify the affected texture unit. */
+                pState->ext.glClientActiveTexture(GL_TEXTURE0 + pVertexDecl[iVertex].identity.usageIndex);
+                glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                break;
+            case SVGA3D_DECLUSAGE_TANGENT:
+                break;
+            case SVGA3D_DECLUSAGE_BINORMAL:
+                break;
+            case SVGA3D_DECLUSAGE_TESSFACTOR:
+                break;
+            case SVGA3D_DECLUSAGE_POSITIONT:
+                break;
+            case SVGA3D_DECLUSAGE_COLOR:    /* @todo color component order not identical!! */
+                glDisableClientState(GL_COLOR_ARRAY);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                break;
+            case SVGA3D_DECLUSAGE_FOG:
+                glDisableClientState(GL_FOG_COORD_ARRAY);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                break;
+            case SVGA3D_DECLUSAGE_DEPTH:
+                break;
+            case SVGA3D_DECLUSAGE_SAMPLE:
+                break;
+            }
+        }
+    }
+    /* Unbind the vertex buffer after usage. */
+    pState->ext.glBindBuffer(GL_ARRAY_BUFFER, 0);
+    VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dDrawPrimitives(PVGASTATE pThis, uint32_t cid, uint32_t numVertexDecls, SVGA3dVertexDecl *pVertexDecl, uint32_t numRanges, SVGA3dPrimitiveRange *pRange, uint32_t cVertexDivisor, SVGA3dVertexDivisor *pVertexDivisor)
+{
+    PVMSVGA3DCONTEXT             pContext;
+    PVMSVGA3DSTATE               pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_INTERNAL_ERROR);
+    int                          rc = VERR_NOT_IMPLEMENTED;
+    uint32_t                     iCurrentVertex;
+
+    Log(("vmsvga3dDrawPrimitives cid=%x numVertexDecls=%d numRanges=%d, cVertexDivisor=%d\n", cid, numVertexDecls, numRanges, cVertexDivisor));
+
+    AssertReturn(numVertexDecls && numVertexDecls <= SVGA3D_MAX_VERTEX_ARRAYS, VERR_INVALID_PARAMETER);
+    AssertReturn(numRanges && numRanges <= SVGA3D_MAX_DRAW_PRIMITIVE_RANGES, VERR_INVALID_PARAMETER);
+    AssertReturn(!cVertexDivisor || cVertexDivisor == numVertexDecls, VERR_INVALID_PARAMETER);
+    /* @todo */
+    Assert(!cVertexDivisor);
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dDrawPrimitives invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    /* Flush any shader changes. */
+    if (pContext->pShaderContext)
+    {
+        uint32_t rtHeight = 0;
+
+        if (pContext->sidRenderTarget != SVGA_ID_INVALID)
+        {
+            PVMSVGA3DSURFACE pRenderTarget = &pState->paSurface[pContext->sidRenderTarget];
+            rtHeight = pRenderTarget->pMipmapLevels[0].size.height;
+        }
+
+        ShaderUpdateState(pContext->pShaderContext, rtHeight);
+    }
+
+    /* Process all vertex declarations. Each vertex buffer is represented by one stream. */
+    iCurrentVertex   = 0;
+    while (iCurrentVertex < numVertexDecls)
+    {
+        uint32_t sidVertex = SVGA_ID_INVALID;
+        uint32_t iVertex;
+
+        for (iVertex = iCurrentVertex; iVertex < numVertexDecls; iVertex++)
+        {
+            if (    sidVertex != SVGA_ID_INVALID
+                &&  pVertexDecl[iVertex].array.surfaceId != sidVertex
+               )
+                break;
+            sidVertex = pVertexDecl[iVertex].array.surfaceId;
+        }
+
+        rc = vmsvga3dDrawPrimitivesProcessVertexDecls(pState, pContext, iCurrentVertex, iVertex - iCurrentVertex, &pVertexDecl[iCurrentVertex]);
+        AssertRCReturn(rc, rc);
+
+        iCurrentVertex = iVertex;
+    }
+
+    /* Now draw the primitives. */
+    for (unsigned iPrimitive = 0; iPrimitive < numRanges; iPrimitive++)
+    {
+        GLenum           modeDraw;
+        unsigned         sidIndex  = pRange[iPrimitive].indexArray.surfaceId;
+        PVMSVGA3DSURFACE pIndexSurface = NULL;
+        unsigned         cVertices;
+
+        Log(("Primitive %d: type %s\n", iPrimitive, vmsvga3dPrimitiveType2String(pRange[iPrimitive].primType)));
+        rc = vmsvga3dPrimitiveType2OGL(pRange[iPrimitive].primType, &modeDraw, pRange[iPrimitive].primitiveCount, &cVertices);
+        if (RT_FAILURE(rc))
+        {
+            AssertRC(rc);
+            goto internal_error;
+        }
+
+        if (sidIndex != SVGA3D_INVALID_ID)
+        {
+            AssertMsg(pRange[iPrimitive].indexWidth == sizeof(uint32_t) || pRange[iPrimitive].indexWidth == sizeof(uint16_t), ("Unsupported primitive width %d\n", pRange[iPrimitive].indexWidth));
+
+            if (    sidIndex >= SVGA3D_MAX_SURFACE_IDS
+                ||  sidIndex >= pState->cSurfaces 
+                ||  pState->paSurface[sidIndex].id != sidIndex)
+            {
+                Assert(sidIndex < SVGA3D_MAX_SURFACE_IDS);
+                Assert(sidIndex < pState->cSurfaces && pState->paSurface[sidIndex].id == sidIndex);
+                rc = VERR_INVALID_PARAMETER;
+                goto internal_error;
+            }
+            pIndexSurface = &pState->paSurface[sidIndex];
+            Log(("vmsvga3dDrawPrimitives: index surface %x\n", sidIndex));
+
+            if (pIndexSurface->oglId.buffer == OPENGL_INVALID_ID)
+            {
+                Log(("vmsvga3dDrawPrimitives: create index buffer fDirty=%d size=%x bytes\n", pIndexSurface->fDirty, pIndexSurface->pMipmapLevels[0].cbSurface));
+
+                pState->ext.glGenBuffers(1, &pIndexSurface->oglId.buffer);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+                pState->ext.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, pIndexSurface->oglId.buffer);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+                Assert(pIndexSurface->fDirty);
+
+                /* @todo rethink usage dynamic/static */
+                pState->ext.glBufferData(GL_ELEMENT_ARRAY_BUFFER, pIndexSurface->pMipmapLevels[0].cbSurface, pIndexSurface->pMipmapLevels[0].pSurfaceData, GL_DYNAMIC_DRAW);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+                pIndexSurface->pMipmapLevels[0].fDirty = false;
+                pIndexSurface->fDirty = false;
+
+                pIndexSurface->flags |= SVGA3D_SURFACE_HINT_INDEXBUFFER;
+            }
+            else
+            {
+                Assert(pIndexSurface->fDirty == false);
+
+                pState->ext.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, pIndexSurface->oglId.buffer);
+                VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+            }
+            pIndexSurface->idAssociatedContext = pContext->id;
+        }
+
+        if (!pIndexSurface)
+        {
+            /* Render without an index buffer */
+            Log(("DrawPrimitive %x cPrimitives=%d cVertices=%d index index bias=%d\n", modeDraw, pRange[iPrimitive].primitiveCount, cVertices, pRange[iPrimitive].indexBias));
+            glDrawArrays(modeDraw, pRange[iPrimitive].indexBias, cVertices);
+        }
+        else
+        {
+            Assert(pRange[iPrimitive].indexBias >= 0);  /* @todo */
+            Assert(pRange[iPrimitive].indexWidth == pRange[iPrimitive].indexArray.stride);
+           
+            /* Render with an index buffer */
+            Log(("DrawIndexedPrimitive %x cPrimitives=%d cVertices=%d hint.first=%d hint.last=%d index offset=%d primitivecount=%d index width=%d index bias=%d\n", modeDraw, pRange[iPrimitive].primitiveCount, cVertices, pVertexDecl[0].rangeHint.first,  pVertexDecl[0].rangeHint.last,  pRange[iPrimitive].indexArray.offset, pRange[iPrimitive].primitiveCount,  pRange[iPrimitive].indexWidth, pRange[iPrimitive].indexBias));
+            if (pRange[iPrimitive].indexBias == 0)
+            {
+                glDrawElements(modeDraw, 
+                               cVertices,
+                               (pRange[iPrimitive].indexWidth == sizeof(uint16_t)) ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, 
+                               (GLvoid *)(pRange[iPrimitive].indexArray.offset));   /* byte offset in indices buffer */
+            }
+            else
+                pState->ext.glDrawElementsBaseVertex(modeDraw, 
+                                                     cVertices, 
+                                                     (pRange[iPrimitive].indexWidth == sizeof(uint16_t)) ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, 
+                                                     (GLvoid *)(pRange[iPrimitive].indexArray.offset),   /* byte offset in indices buffer */
+                                                     pRange[iPrimitive].indexBias);        /* basevertex */
+
+            /* Unbind the index buffer after usage. */
+            pState->ext.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
+            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+        }
+        VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+    }
+
+internal_error:
+
+    /* Deactivate the vertex declarations. */
+    iCurrentVertex   = 0;
+    while (iCurrentVertex < numVertexDecls)
+    {
+        uint32_t sidVertex = SVGA_ID_INVALID;
+        uint32_t iVertex;
+
+        for (iVertex = iCurrentVertex; iVertex < numVertexDecls; iVertex++)
+        {
+            if (    sidVertex != SVGA_ID_INVALID
+                &&  pVertexDecl[iVertex].array.surfaceId != sidVertex
+               )
+                break;
+            sidVertex = pVertexDecl[iVertex].array.surfaceId;
+        }
+
+        rc = vmsvga3dDrawPrimitivesCleanupVertexDecls(pState, pContext, iCurrentVertex, iVertex - iCurrentVertex, &pVertexDecl[iCurrentVertex]);
+        AssertRCReturn(rc, rc);
+
+        iCurrentVertex = iVertex;
+    }
+#ifdef DEBUG
+    for (uint32_t i = 0; i < RT_ELEMENTS(pContext->aSidActiveTexture); i++)
+    {
+        if (pContext->aSidActiveTexture[i] != SVGA3D_INVALID_ID)
+        {
+            GLint activeTexture = 0;
+            GLint activeTextureUnit = 0;
+
+            glGetIntegerv(GL_ACTIVE_TEXTURE, &activeTextureUnit);
+            pState->ext.glActiveTexture(GL_TEXTURE0 + i);
+
+            glGetIntegerv(GL_TEXTURE_BINDING_2D, &activeTexture);
+            pState->ext.glActiveTexture(activeTextureUnit);
+
+            if (pContext->aSidActiveTexture[activeTextureUnit - GL_TEXTURE0] != SVGA3D_INVALID_ID)
+            {
+                PVMSVGA3DSURFACE pTexture;
+                pTexture = &pState->paSurface[pContext->aSidActiveTexture[activeTextureUnit - GL_TEXTURE0]];
+
+                AssertMsg(pTexture->oglId.texture == activeTexture, ("%x vs %x unit %d - %d\n", pTexture->oglId.texture, activeTexture, i, activeTextureUnit - GL_TEXTURE0));
+            }
+        }
+    }
+#endif
+
+#ifdef DEBUG_GFX_WINDOW
+    if (pContext->aSidActiveTexture[0])
+    {
+        SVGA3dCopyRect rect;
+
+        rect.srcx = rect.srcy = rect.x = rect.y = 0;
+        rect.w = 800;
+        rect.h = 600;
+        vmsvga3dCommandPresent(pThis, pContext->sidRenderTarget, 0, NULL);
+    }
+#endif
+    return rc;
+}
+
+
+int vmsvga3dShaderDefine(PVGASTATE pThis, uint32_t cid, uint32_t shid, SVGA3dShaderType type, uint32_t cbData, uint32_t *pShaderData)
+{
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSHADER       pShader;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+    int                   rc;
+
+    Log(("vmsvga3dShaderDefine cid=%x shid=%x type=%s cbData=%x\n", cid, shid, (type == SVGA3D_SHADERTYPE_VS) ? "VERTEX" : "PIXEL", cbData));
+    LogFlow(("shader code:\n%.*Rhxd\n", cbData, pShaderData));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dShaderDefine invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    AssertReturn(shid < SVGA3D_MAX_SHADER_IDS, VERR_INVALID_PARAMETER);
+    if (type == SVGA3D_SHADERTYPE_VS)
+    {
+        if (shid >= pContext->cVertexShaders)
+        {
+            pContext->paVertexShader = (PVMSVGA3DSHADER)RTMemRealloc(pContext->paVertexShader, sizeof(VMSVGA3DSHADER) * (shid + 1));
+            AssertReturn(pContext->paVertexShader, VERR_NO_MEMORY);
+            memset(&pContext->paVertexShader[pContext->cVertexShaders], 0, sizeof(VMSVGA3DSHADER) * (shid + 1 - pContext->cVertexShaders));
+            for (uint32_t i = pContext->cVertexShaders; i < shid + 1; i++)
+                pContext->paVertexShader[i].id = SVGA3D_INVALID_ID;
+            pContext->cVertexShaders = shid + 1;
+        }
+        /* If one already exists with this id, then destroy it now. */
+        if (pContext->paVertexShader[shid].id != SVGA3D_INVALID_ID)
+            vmsvga3dShaderDestroy(pThis, cid, shid, pContext->paVertexShader[shid].type);
+
+        pShader = &pContext->paVertexShader[shid];
+    }
+    else
+    {
+        Assert(type == SVGA3D_SHADERTYPE_PS);
+        if (shid >= pContext->cPixelShaders)
+        {
+            pContext->paPixelShader = (PVMSVGA3DSHADER)RTMemRealloc(pContext->paPixelShader, sizeof(VMSVGA3DSHADER) * (shid + 1));
+            AssertReturn(pContext->paPixelShader, VERR_NO_MEMORY);
+            memset(&pContext->paPixelShader[pContext->cPixelShaders], 0, sizeof(VMSVGA3DSHADER) * (shid + 1 - pContext->cPixelShaders));
+            for (uint32_t i = pContext->cPixelShaders; i < shid + 1; i++)
+                pContext->paPixelShader[i].id = SVGA3D_INVALID_ID;
+            pContext->cPixelShaders = shid + 1;
+        }
+        /* If one already exists with this id, then destroy it now. */
+        if (pContext->paPixelShader[shid].id != SVGA3D_INVALID_ID)
+            vmsvga3dShaderDestroy(pThis, cid, shid, pContext->paPixelShader[shid].type);
+
+        pShader = &pContext->paPixelShader[shid];
+    }
+
+    memset(pShader, 0, sizeof(*pShader));
+    pShader->id     = shid;
+    pShader->cid    = cid;
+    pShader->type   = type;
+    pShader->cbData = cbData;
+    pShader->pShaderProgram = RTMemAllocZ(cbData);
+    AssertReturn(pShader->pShaderProgram, VERR_NO_MEMORY);
+    memcpy(pShader->pShaderProgram, pShaderData, cbData);
+
+    switch (type)
+    {
+    case SVGA3D_SHADERTYPE_VS:
+        rc = ShaderCreateVertexShader(pContext->pShaderContext, (const uint32_t *)pShaderData, &pShader->u.pVertexShader);
+        break;
+
+    case SVGA3D_SHADERTYPE_PS:
+        rc = ShaderCreatePixelShader(pContext->pShaderContext, (const uint32_t *)pShaderData, &pShader->u.pPixelShader);
+        break;
+
+    default:
+        AssertFailedReturn(VERR_INVALID_PARAMETER);
+    }
+
+    return rc;
+}
+
+int vmsvga3dShaderDestroy(PVGASTATE pThis, uint32_t cid, uint32_t shid, SVGA3dShaderType type)
+{
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+    PVMSVGA3DSHADER       pShader = NULL;
+    int                   rc;
+
+    Log(("vmsvga3dShaderDestroy cid=%x shid=%x type=%s\n", cid, shid, (type == SVGA3D_SHADERTYPE_VS) ? "VERTEX" : "PIXEL"));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dShaderDestroy invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    if (type == SVGA3D_SHADERTYPE_VS)
+    {
+        if (    shid < pContext->cVertexShaders
+            &&  pContext->paVertexShader[shid].id == shid)
+        {
+            pShader = &pContext->paVertexShader[shid];
+            rc = ShaderDestroyVertexShader(pContext->pShaderContext, pShader->u.pVertexShader);
+            AssertRC(rc);
+        }
+    }
+    else
+    {
+        Assert(type == SVGA3D_SHADERTYPE_PS);
+        if (    shid < pContext->cPixelShaders
+            &&  pContext->paPixelShader[shid].id == shid)
+        {
+            pShader = &pContext->paPixelShader[shid];
+            rc = ShaderDestroyPixelShader(pContext->pShaderContext, pShader->u.pPixelShader);
+            AssertRC(rc);
+        }
+    }
+
+    if (pShader)
+    {
+        if (pShader->pShaderProgram)
+            RTMemFree(pShader->pShaderProgram);
+        memset(pShader, 0, sizeof(*pShader));
+        pShader->id = SVGA3D_INVALID_ID;
+    }
+    else
+        AssertFailedReturn(VERR_INVALID_PARAMETER);
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dShaderSet(PVGASTATE pThis, uint32_t cid, SVGA3dShaderType type, uint32_t shid)
+{
+    PVMSVGA3DCONTEXT    pContext;
+    PVMSVGA3DSTATE      pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+    int                 rc;
+
+    Log(("vmsvga3dShaderSet cid=%x type=%s shid=%d\n", cid, (type == SVGA3D_SHADERTYPE_VS) ? "VERTEX" : "PIXEL", shid));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dShaderSet invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    if (type == SVGA3D_SHADERTYPE_VS)
+    {
+        /* Save for vm state save/restore. */
+        pContext->state.shidVertex = shid;
+        pContext->state.u32UpdateFlags |= VMSVGA3D_UPDATE_VERTEXSHADER;
+
+        if (    shid < pContext->cVertexShaders
+            &&  pContext->paVertexShader[shid].id == shid)
+        {
+            PVMSVGA3DSHADER pShader = &pContext->paVertexShader[shid];
+            Assert(type == pShader->type);
+
+            rc = ShaderSetVertexShader(pContext->pShaderContext, pShader->u.pVertexShader);
+            AssertRCReturn(rc, rc);
+        }
+        else
+        if (shid == SVGA_ID_INVALID)
+        {
+            /* Unselect shader. */
+            rc = ShaderSetVertexShader(pContext->pShaderContext, NULL);
+            AssertRCReturn(rc, rc);
+        }
+        else
+            AssertFailedReturn(VERR_INVALID_PARAMETER);
+    }
+    else
+    {
+        /* Save for vm state save/restore. */
+        pContext->state.shidPixel = shid;
+        pContext->state.u32UpdateFlags |= VMSVGA3D_UPDATE_PIXELSHADER;
+
+        Assert(type == SVGA3D_SHADERTYPE_PS);
+        if (    shid < pContext->cPixelShaders
+            &&  pContext->paPixelShader[shid].id == shid)
+        {
+            PVMSVGA3DSHADER pShader = &pContext->paPixelShader[shid];
+            Assert(type == pShader->type);
+
+            rc = ShaderSetPixelShader(pContext->pShaderContext, pShader->u.pPixelShader);
+            AssertRCReturn(rc, rc);
+        }
+        else
+        if (shid == SVGA_ID_INVALID)
+        {
+            /* Unselect shader. */
+            rc = ShaderSetPixelShader(pContext->pShaderContext, NULL);
+            AssertRCReturn(rc, rc);
+        }
+        else
+            AssertFailedReturn(VERR_INVALID_PARAMETER);
+    }
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dShaderSetConst(PVGASTATE pThis, uint32_t cid, uint32_t reg, SVGA3dShaderType type, SVGA3dShaderConstType ctype, uint32_t cRegisters, uint32_t *pValues)
+{
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+    int                   rc;
+
+    Log(("vmsvga3dShaderSetConst cid=%x reg=%x type=%s cregs=%d ctype=%x\n", cid, reg, (type == SVGA3D_SHADERTYPE_VS) ? "VERTEX" : "PIXEL", cRegisters, ctype));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dShaderSetConst invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+    for (uint32_t i = 0; i < cRegisters; i++)
+    {
+#ifdef LOG_ENABLED
+        switch (ctype)
+        {
+            case SVGA3D_CONST_TYPE_FLOAT:
+            {
+                float *pValuesF = (float *)pValues;
+                Log(("Constant %d: value=%d-%d-%d-%d\n", reg + i, (int)(pValuesF[i*4 + 0] * 100.0), (int)(pValuesF[i*4 + 1] * 100.0), (int)(pValuesF[i*4 + 2] * 100.0), (int)(pValuesF[i*4 + 3] * 100.0)));
+                break;
+            }
+
+            case SVGA3D_CONST_TYPE_INT:
+                Log(("Constant %d: value=%x-%x-%x-%x\n", reg + i, pValues[i*4 + 0], pValues[i*4 + 1], pValues[i*4 + 2], pValues[i*4 + 3]));
+                break;
+
+            case SVGA3D_CONST_TYPE_BOOL:
+                Log(("Constant %d: value=%x-%x-%x-%x\n", reg + i, pValues[i*4 + 0], pValues[i*4 + 1], pValues[i*4 + 2], pValues[i*4 + 3]));
+                break;
+        }
+#endif
+        vmsvga3dSaveShaderConst(pContext, reg + i, type, ctype, pValues[i*4 + 0], pValues[i*4 + 1], pValues[i*4 + 2], pValues[i*4 + 3]);
+    }
+
+    switch (type)
+    {
+    case SVGA3D_SHADERTYPE_VS:
+        switch (ctype)
+        {
+        case SVGA3D_CONST_TYPE_FLOAT:
+            rc = ShaderSetVertexShaderConstantF(pContext->pShaderContext, reg, (const float *)pValues, cRegisters);
+            break;
+
+        case SVGA3D_CONST_TYPE_INT:
+            rc = ShaderSetVertexShaderConstantI(pContext->pShaderContext, reg, (const int32_t *)pValues, cRegisters);
+            break;
+
+        case SVGA3D_CONST_TYPE_BOOL:
+            rc = ShaderSetVertexShaderConstantB(pContext->pShaderContext, reg, (const uint8_t *)pValues, cRegisters);
+            break;
+
+        default:
+            AssertFailedReturn(VERR_INVALID_PARAMETER);
+        }
+        AssertRCReturn(rc, rc);
+        break;
+
+    case SVGA3D_SHADERTYPE_PS:
+        switch (ctype)
+        {
+        case SVGA3D_CONST_TYPE_FLOAT:
+            rc = ShaderSetPixelShaderConstantF(pContext->pShaderContext, reg, (const float *)pValues, cRegisters);
+            break;
+
+        case SVGA3D_CONST_TYPE_INT:
+            rc = ShaderSetPixelShaderConstantI(pContext->pShaderContext, reg, (const int32_t *)pValues, cRegisters);
+            break;
+
+        case SVGA3D_CONST_TYPE_BOOL:
+            rc = ShaderSetPixelShaderConstantB(pContext->pShaderContext, reg, (const uint8_t *)pValues, cRegisters);
+            break;
+
+        default:
+            AssertFailedReturn(VERR_INVALID_PARAMETER);
+        }
+        AssertRCReturn(rc, rc);
+        break;
+
+    default:
+        AssertFailedReturn(VERR_INVALID_PARAMETER);
+    }
+
+    return VINF_SUCCESS;
+}
+
+
+int vmsvga3dQueryBegin(PVGASTATE pThis, uint32_t cid, SVGA3dQueryType type)
+{
+    AssertFailed();
+    return VERR_NOT_IMPLEMENTED;
+}
+
+int vmsvga3dQueryEnd(PVGASTATE pThis, uint32_t cid, SVGA3dQueryType type, SVGAGuestPtr guestResult)
+{
+    AssertFailed();
+    return VERR_NOT_IMPLEMENTED;
+}
+
+int vmsvga3dQueryWait(PVGASTATE pThis, uint32_t cid, SVGA3dQueryType type, SVGAGuestPtr guestResult)
+{
+    AssertFailed();
+    return VERR_NOT_IMPLEMENTED;
+}
+
+
+
+
Index: trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-shared.cpp
===================================================================
--- trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-shared.cpp	(revision 53206)
+++ trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-shared.cpp	(revision 53206)
@@ -0,0 +1,1120 @@
+/** @file
+ * DevVMWare - VMWare SVGA device
+ */
+
+/*
+ * Copyright (C) 2013 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#define LOG_GROUP LOG_GROUP_DEV_VMSVGA
+#include <VBox/vmm/pdmdev.h>
+#include <VBox/version.h>
+#include <VBox/err.h>
+#include <VBox/log.h>
+#include <VBox/vmm/pgm.h>
+
+#include <iprt/assert.h>
+#include <iprt/semaphore.h>
+#include <iprt/uuid.h>
+#include <iprt/mem.h>
+#include <iprt/avl.h>
+
+#include <VBox/VMMDev.h>
+#include <VBox/VBoxVideo.h>
+#include <VBox/bioslogo.h>
+
+/* should go BEFORE any other DevVGA include to make all DevVGA.h config defines be visible */
+#include "DevVGA.h"
+
+#include "DevVGA-SVGA.h"
+#include "DevVGA-SVGA3d.h"
+#include "vmsvga/svga_reg.h"
+#include "vmsvga/svga3d_reg.h"
+#include "vmsvga/svga3d_shaderdefs.h"
+
+
+#ifdef RT_OS_WINDOWS
+/*******************************************************************************
+*   Structures and Typedefs                                                    *
+*******************************************************************************/
+#define     VMSVGA3D_WNDCLASSNAME       "VMSVGA3DWNDCLS"
+
+static LONG WINAPI vmsvga3dWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+#endif
+
+#ifdef RT_OS_WINDOWS
+/**
+ * Send a message to the async window thread and wait for a reply
+ *
+ * @returns VBox status code.
+ * @param   pWindowThread   Thread handle
+ * @param   WndRequestSem   Semaphore handle for waiting
+ * @param   msg             Message id
+ * @param   wParam          First parameter
+ * @param   lParam          Second parameter
+ */
+int vmsvga3dSendThreadMessage(RTTHREAD pWindowThread, RTSEMEVENT WndRequestSem, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+    int  rc;
+    BOOL ret;
+
+    ret = PostThreadMessage(RTThreadGetNative(pWindowThread), msg, wParam, lParam);
+    AssertMsgReturn(ret, ("PostThreadMessage %x failed with %d\n", RTThreadGetNative(pWindowThread), GetLastError()), VERR_INTERNAL_ERROR);
+
+    rc = RTSemEventWait(WndRequestSem, RT_INDEFINITE_WAIT);
+    Assert(RT_SUCCESS(rc));
+
+    return rc;
+}
+
+/**
+ * The async window handling thread
+ *
+ * @returns VBox status code.
+ * @param   pDevIns     The VGA device instance.
+ * @param   pThread     The send thread.
+ */
+DECLCALLBACK(int) vmsvga3dWindowThread(RTTHREAD ThreadSelf, void *pvUser)
+{
+    RTSEMEVENT      WndRequestSem = (RTSEMEVENT)pvUser;
+    WNDCLASSEX      wc;
+
+    /* Register our own window class. */
+    wc.cbSize           = sizeof(wc);
+    wc.style            = CS_OWNDC;
+    wc.lpfnWndProc      = (WNDPROC) vmsvga3dWndProc;
+    wc.cbClsExtra       = 0;
+    wc.cbWndExtra       = 0;
+    wc.hInstance        = GetModuleHandle("VBoxDD.dll");    /* @todo hardcoded name.. */
+    wc.hIcon            = LoadIcon(NULL, IDI_APPLICATION);
+    wc.hCursor          = LoadCursor(NULL, IDC_ARROW);
+    wc.hbrBackground    = NULL;
+    wc.lpszMenuName     = NULL;
+    wc.lpszClassName    = VMSVGA3D_WNDCLASSNAME;
+    wc.hIconSm          = NULL;
+
+    if (!RegisterClassEx(&wc))
+    {
+        Log(("RegisterClass failed with %x\n", GetLastError()));
+        return VERR_INTERNAL_ERROR;
+    }
+
+    LogFlow(("vmsvga3dWindowThread: started loop\n"));
+    while (true)
+    {
+        MSG msg;
+
+        if (GetMessage(&msg, 0, 0, 0))
+        {
+            if (msg.message == WM_VMSVGA3D_EXIT)
+            {
+                /* Signal to the caller that we're done. */
+                RTSemEventSignal(WndRequestSem);
+                break;
+            }
+
+            if (msg.message == WM_VMSVGA3D_WAKEUP)
+            {
+                continue;
+            }
+            if (msg.message == WM_VMSVGA3D_CREATEWINDOW)
+            {
+                HWND          *pHwnd = (HWND *)msg.wParam;
+                LPCREATESTRUCT pCS = (LPCREATESTRUCT) msg.lParam;
+
+#ifdef DEBUG_GFX_WINDOW
+                RECT rectClient;
+
+                rectClient.left     = 0;
+                rectClient.top      = 0;
+                rectClient.right    = pCS->cx;
+                rectClient.bottom   = pCS->cy;
+                AdjustWindowRectEx(&rectClient, WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE | WS_CAPTION, FALSE, WS_EX_NOACTIVATE | WS_EX_NOPARENTNOTIFY | WS_EX_TRANSPARENT);
+                pCS->cx = rectClient.right - rectClient.left;
+                pCS->cy = rectClient.bottom - rectClient.top;
+#endif
+                *pHwnd = CreateWindowEx(pCS->dwExStyle, 
+                                        VMSVGA3D_WNDCLASSNAME, 
+                                        pCS->lpszName, 
+                                        pCS->style,
+#ifdef DEBUG_GFX_WINDOW
+                                        0,
+                                        0,
+#else
+                                        pCS->x, 
+                                        pCS->y, 
+#endif
+                                        pCS->cx, 
+                                        pCS->cy,
+#ifdef DEBUG_GFX_WINDOW
+                                        0,
+#else
+                                        pCS->hwndParent, 
+#endif
+                                        pCS->hMenu, 
+                                        pCS->hInstance, 
+                                        NULL);
+                AssertMsg(*pHwnd, ("CreateWindowEx %x %s %s %x (%d,%d)(%d,%d), %x %x %x error=%x\n", pCS->dwExStyle, pCS->lpszName, VMSVGA3D_WNDCLASSNAME, pCS->style, pCS->x, 
+                                    pCS->y, pCS->cx, pCS->cy,pCS->hwndParent, pCS->hMenu, pCS->hInstance, GetLastError()));
+
+                /* Signal to the caller that we're done. */
+                RTSemEventSignal(WndRequestSem);
+                continue;
+            }
+            else
+            if (msg.message == WM_VMSVGA3D_DESTROYWINDOW)
+            {
+                BOOL ret = DestroyWindow((HWND)msg.wParam);
+                Assert(ret);
+                /* Signal to the caller that we're done. */
+                RTSemEventSignal(WndRequestSem);
+                continue;
+            }
+            else
+            if (msg.message == WM_VMSVGA3D_RESIZEWINDOW)
+            {
+                HWND hwnd = (HWND)msg.wParam;
+                LPCREATESTRUCT pCS = (LPCREATESTRUCT) msg.lParam;
+
+#ifdef DEBUG_GFX_WINDOW
+                RECT rectClient;
+
+                rectClient.left     = 0;
+                rectClient.top      = 0;
+                rectClient.right    = pCS->cx;
+                rectClient.bottom   = pCS->cy;
+                AdjustWindowRectEx(&rectClient, WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE | WS_CAPTION, FALSE, WS_EX_NOACTIVATE | WS_EX_NOPARENTNOTIFY | WS_EX_TRANSPARENT);
+                pCS->cx = rectClient.right - rectClient.left;
+                pCS->cy = rectClient.bottom - rectClient.top;
+#endif
+                BOOL ret = SetWindowPos(hwnd, 0, pCS->x, pCS->y, pCS->cx, pCS->cy, SWP_NOZORDER | SWP_NOMOVE);
+                Assert(ret);
+
+                /* Signal to the caller that we're done. */
+                RTSemEventSignal(WndRequestSem);
+                continue;
+            }
+
+            TranslateMessage(&msg);
+            DispatchMessage(&msg);
+        }
+        else
+        {
+            Log(("GetMessage failed with %x\n", GetLastError()));
+            break;
+        }
+    }
+
+    Log(("vmsvga3dWindowThread: end loop\n"));
+    return VINF_SUCCESS;
+}
+
+/* Window procedure for our top level window overlays. */
+static LONG WINAPI vmsvga3dWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+    switch (uMsg)
+    {
+        case WM_CLOSE:
+            break;
+
+        case WM_DESTROY:
+            break;
+
+        case WM_NCHITTEST:
+            return HTNOWHERE;
+    }
+    return DefWindowProc(hwnd, uMsg, wParam, lParam);
+}
+#endif /* RT_OS_WINDOWS */
+
+/**
+ * Calculate the size of one pixel
+ */
+uint32_t vmsvga3dSurfaceFormatSize(SVGA3dSurfaceFormat format)
+{
+    switch (format)
+    {
+    case SVGA3D_X8R8G8B8:
+    case SVGA3D_A8R8G8B8:
+        return 4;
+
+    case SVGA3D_R5G6B5:
+    case SVGA3D_X1R5G5B5:
+    case SVGA3D_A1R5G5B5:
+    case SVGA3D_A4R4G4B4:
+        return 2;
+
+    case SVGA3D_Z_D32:
+    case SVGA3D_Z_D24S8:
+    case SVGA3D_Z_D24X8:
+    case SVGA3D_Z_DF24:
+    case SVGA3D_Z_D24S8_INT:
+        return 4;
+
+    case SVGA3D_Z_D16:
+    case SVGA3D_Z_DF16:
+    case SVGA3D_Z_D15S1:
+        return 2;
+
+    case SVGA3D_LUMINANCE8:
+    case SVGA3D_LUMINANCE4_ALPHA4:
+        return 1;
+
+    case SVGA3D_LUMINANCE16:
+    case SVGA3D_LUMINANCE8_ALPHA8:
+        return 2;
+
+    case SVGA3D_DXT1:
+    case SVGA3D_DXT2:
+        return 8;
+
+    case SVGA3D_DXT3:
+    case SVGA3D_DXT4:
+    case SVGA3D_DXT5:
+        return 16;
+
+    case SVGA3D_BUMPU8V8:
+    case SVGA3D_BUMPL6V5U5:
+        return 2;
+
+    case SVGA3D_BUMPX8L8V8U8:
+    case SVGA3D_Q8W8V8U8:
+        return 4;
+
+    case SVGA3D_V8U8:
+    case SVGA3D_CxV8U8:
+        return 2;
+
+    case SVGA3D_X8L8V8U8:
+    case SVGA3D_A2W10V10U10:
+        return 4;
+
+    case SVGA3D_ARGB_S10E5:   /* 16-bit floating-point ARGB */
+        return 2;
+    case SVGA3D_ARGB_S23E8:   /* 32-bit floating-point ARGB */
+        return 4;
+
+    case SVGA3D_A2R10G10B10:
+        return 4;
+
+    case SVGA3D_ALPHA8:
+        return 1;
+
+    case SVGA3D_R_S10E5:
+        return 2;
+
+    case SVGA3D_R_S23E8:
+    case SVGA3D_RG_S10E5:
+        return 4;
+
+    case SVGA3D_RG_S23E8:
+        return 8;
+
+    /*
+     * Any surface can be used as a buffer object, but SVGA3D_BUFFER is
+     * the most efficient format to use when creating new surfaces
+     * expressly for index or vertex data.
+     */
+    case SVGA3D_BUFFER:
+        return 1;
+
+    case SVGA3D_V16U16:
+        return 4;
+
+    case SVGA3D_G16R16:
+        return 32;
+    case SVGA3D_A16B16G16R16:
+        return 8;
+    }
+    AssertFailedReturn(4);
+}
+
+#ifdef LOG_ENABLED
+const char *vmsvga3dGetCapString(uint32_t idxCap)
+{
+    switch (idxCap)
+    {
+    case SVGA3D_DEVCAP_3D:
+        return "SVGA3D_DEVCAP_3D";
+    case SVGA3D_DEVCAP_MAX_LIGHTS:
+        return "SVGA3D_DEVCAP_MAX_LIGHTS";
+    case SVGA3D_DEVCAP_MAX_TEXTURES:
+        return "SVGA3D_DEVCAP_MAX_TEXTURES";
+    case SVGA3D_DEVCAP_MAX_CLIP_PLANES:
+        return "SVGA3D_DEVCAP_MAX_CLIP_PLANES";
+    case SVGA3D_DEVCAP_VERTEX_SHADER_VERSION:
+        return "SVGA3D_DEVCAP_VERTEX_SHADER_VERSION";
+    case SVGA3D_DEVCAP_VERTEX_SHADER:
+        return "SVGA3D_DEVCAP_VERTEX_SHADER";
+    case SVGA3D_DEVCAP_FRAGMENT_SHADER_VERSION:
+        return "SVGA3D_DEVCAP_FRAGMENT_SHADER_VERSION";
+    case SVGA3D_DEVCAP_FRAGMENT_SHADER:
+        return "SVGA3D_DEVCAP_FRAGMENT_SHADER";
+    case SVGA3D_DEVCAP_MAX_RENDER_TARGETS:
+        return "SVGA3D_DEVCAP_MAX_RENDER_TARGETS";
+    case SVGA3D_DEVCAP_S23E8_TEXTURES:
+        return "SVGA3D_DEVCAP_S23E8_TEXTURES";
+    case SVGA3D_DEVCAP_S10E5_TEXTURES:
+        return "SVGA3D_DEVCAP_S10E5_TEXTURES";
+    case SVGA3D_DEVCAP_MAX_FIXED_VERTEXBLEND:
+        return "SVGA3D_DEVCAP_MAX_FIXED_VERTEXBLEND";
+    case SVGA3D_DEVCAP_D16_BUFFER_FORMAT:
+        return "SVGA3D_DEVCAP_D16_BUFFER_FORMAT";
+    case SVGA3D_DEVCAP_D24S8_BUFFER_FORMAT:
+        return "SVGA3D_DEVCAP_D24S8_BUFFER_FORMAT";
+    case SVGA3D_DEVCAP_D24X8_BUFFER_FORMAT:
+        return "SVGA3D_DEVCAP_D24X8_BUFFER_FORMAT";
+    case SVGA3D_DEVCAP_QUERY_TYPES:
+        return "SVGA3D_DEVCAP_QUERY_TYPES";
+    case SVGA3D_DEVCAP_TEXTURE_GRADIENT_SAMPLING:
+        return "SVGA3D_DEVCAP_TEXTURE_GRADIENT_SAMPLING";
+    case SVGA3D_DEVCAP_MAX_POINT_SIZE:
+        return "SVGA3D_DEVCAP_MAX_POINT_SIZE";
+    case SVGA3D_DEVCAP_MAX_SHADER_TEXTURES:
+        return "SVGA3D_DEVCAP_MAX_SHADER_TEXTURES";
+    case SVGA3D_DEVCAP_MAX_TEXTURE_WIDTH:
+        return "SVGA3D_DEVCAP_MAX_TEXTURE_WIDTH";
+    case SVGA3D_DEVCAP_MAX_TEXTURE_HEIGHT:
+        return "SVGA3D_DEVCAP_MAX_TEXTURE_HEIGHT";
+    case SVGA3D_DEVCAP_MAX_VOLUME_EXTENT:
+        return "SVGA3D_DEVCAP_MAX_VOLUME_EXTENT";
+    case SVGA3D_DEVCAP_MAX_TEXTURE_REPEAT:
+        return "SVGA3D_DEVCAP_MAX_TEXTURE_REPEAT";
+    case SVGA3D_DEVCAP_MAX_TEXTURE_ASPECT_RATIO:
+        return "SVGA3D_DEVCAP_MAX_TEXTURE_ASPECT_RATIO";
+    case SVGA3D_DEVCAP_MAX_TEXTURE_ANISOTROPY:
+        return "SVGA3D_DEVCAP_MAX_TEXTURE_ANISOTROPY";
+    case SVGA3D_DEVCAP_MAX_PRIMITIVE_COUNT:
+        return "SVGA3D_DEVCAP_MAX_PRIMITIVE_COUNT";
+    case SVGA3D_DEVCAP_MAX_VERTEX_INDEX:
+        return "SVGA3D_DEVCAP_MAX_VERTEX_INDEX";
+    case SVGA3D_DEVCAP_MAX_VERTEX_SHADER_INSTRUCTIONS:
+        return "SVGA3D_DEVCAP_MAX_VERTEX_SHADER_INSTRUCTIONS";
+    case SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_INSTRUCTIONS:
+        return "SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_INSTRUCTIONS";
+    case SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEMPS:
+        return "SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEMPS";
+    case SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_TEMPS:
+        return "SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_TEMPS";
+    case SVGA3D_DEVCAP_TEXTURE_OPS:
+        return "SVGA3D_DEVCAP_TEXTURE_OPS";
+    case SVGA3D_DEVCAP_MULTISAMPLE_NONMASKABLESAMPLES:
+        return "SVGA3D_DEVCAP_MULTISAMPLE_NONMASKABLESAMPLES";
+    case SVGA3D_DEVCAP_MULTISAMPLE_MASKABLESAMPLES:
+        return "SVGA3D_DEVCAP_MULTISAMPLE_MASKABLESAMPLES";
+    case SVGA3D_DEVCAP_ALPHATOCOVERAGE:
+        return "SVGA3D_DEVCAP_ALPHATOCOVERAGE";
+    case SVGA3D_DEVCAP_SUPERSAMPLE:
+        return "SVGA3D_DEVCAP_SUPERSAMPLE";
+    case SVGA3D_DEVCAP_AUTOGENMIPMAPS:
+        return "SVGA3D_DEVCAP_AUTOGENMIPMAPS";
+    case SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEXTURES:
+        return "SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEXTURES";
+    case SVGA3D_DEVCAP_MAX_SIMULTANEOUS_RENDER_TARGETS:
+        return "SVGA3D_DEVCAP_MAX_SIMULTANEOUS_RENDER_TARGETS";
+    case SVGA3D_DEVCAP_MAX_CONTEXT_IDS:
+        return "SVGA3D_DEVCAP_MAX_CONTEXT_IDS";
+    case SVGA3D_DEVCAP_MAX_SURFACE_IDS:
+        return "SVGA3D_DEVCAP_MAX_SURFACE_IDS";
+    case SVGA3D_DEVCAP_SURFACEFMT_X8R8G8B8:
+        return "SVGA3D_DEVCAP_SURFACEFMT_X8R8G8B8";
+    case SVGA3D_DEVCAP_SURFACEFMT_A8R8G8B8:
+        return "SVGA3D_DEVCAP_SURFACEFMT_A8R8G8B8";
+    case SVGA3D_DEVCAP_SURFACEFMT_A2R10G10B10:
+        return "SVGA3D_DEVCAP_SURFACEFMT_A2R10G10B10";
+    case SVGA3D_DEVCAP_SURFACEFMT_X1R5G5B5:
+        return "SVGA3D_DEVCAP_SURFACEFMT_X1R5G5B5";
+    case SVGA3D_DEVCAP_SURFACEFMT_A1R5G5B5:
+        return "SVGA3D_DEVCAP_SURFACEFMT_A1R5G5B5";
+    case SVGA3D_DEVCAP_SURFACEFMT_A4R4G4B4:
+        return "SVGA3D_DEVCAP_SURFACEFMT_A4R4G4B4";
+    case SVGA3D_DEVCAP_SURFACEFMT_R5G6B5:
+        return "SVGA3D_DEVCAP_SURFACEFMT_R5G6B5";
+    case SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE16:
+        return "SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE16";
+    case SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8_ALPHA8:
+        return "SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8_ALPHA8";
+    case SVGA3D_DEVCAP_SURFACEFMT_ALPHA8:
+        return "SVGA3D_DEVCAP_SURFACEFMT_ALPHA8";
+    case SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8:
+        return "SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8";
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_D16:
+        return "SVGA3D_DEVCAP_SURFACEFMT_Z_D16";
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8:
+        return "SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8";
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_D24X8:
+        return "SVGA3D_DEVCAP_SURFACEFMT_Z_D24X8";
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_DF16:
+        return "SVGA3D_DEVCAP_SURFACEFMT_Z_DF16";
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_DF24:
+        return "SVGA3D_DEVCAP_SURFACEFMT_Z_DF24";
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT:
+        return "SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT";
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT1:
+        return "SVGA3D_DEVCAP_SURFACEFMT_DXT1";
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT2:
+        return "SVGA3D_DEVCAP_SURFACEFMT_DXT2";
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT3:
+        return "SVGA3D_DEVCAP_SURFACEFMT_DXT3";
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT4:
+        return "SVGA3D_DEVCAP_SURFACEFMT_DXT4";
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT5:
+        return "SVGA3D_DEVCAP_SURFACEFMT_DXT5";
+    case SVGA3D_DEVCAP_SURFACEFMT_BUMPX8L8V8U8:
+        return "SVGA3D_DEVCAP_SURFACEFMT_BUMPX8L8V8U8";
+    case SVGA3D_DEVCAP_SURFACEFMT_A2W10V10U10:
+        return "SVGA3D_DEVCAP_SURFACEFMT_A2W10V10U10";
+    case SVGA3D_DEVCAP_SURFACEFMT_BUMPU8V8:
+        return "SVGA3D_DEVCAP_SURFACEFMT_BUMPU8V8";
+    case SVGA3D_DEVCAP_SURFACEFMT_Q8W8V8U8:
+        return "SVGA3D_DEVCAP_SURFACEFMT_Q8W8V8U8";
+    case SVGA3D_DEVCAP_SURFACEFMT_CxV8U8:
+        return "SVGA3D_DEVCAP_SURFACEFMT_CxV8U8";
+    case SVGA3D_DEVCAP_SURFACEFMT_R_S10E5:
+        return "SVGA3D_DEVCAP_SURFACEFMT_R_S10E5";
+    case SVGA3D_DEVCAP_SURFACEFMT_R_S23E8:
+        return "SVGA3D_DEVCAP_SURFACEFMT_R_S23E8";
+    case SVGA3D_DEVCAP_SURFACEFMT_RG_S10E5:
+        return "SVGA3D_DEVCAP_SURFACEFMT_RG_S10E5";
+    case SVGA3D_DEVCAP_SURFACEFMT_RG_S23E8:
+        return "SVGA3D_DEVCAP_SURFACEFMT_RG_S23E8";
+    case SVGA3D_DEVCAP_SURFACEFMT_ARGB_S10E5:
+        return "SVGA3D_DEVCAP_SURFACEFMT_ARGB_S10E5";
+    case SVGA3D_DEVCAP_SURFACEFMT_ARGB_S23E8:
+        return "SVGA3D_DEVCAP_SURFACEFMT_ARGB_S23E8";
+    case SVGA3D_DEVCAP_SURFACEFMT_V16U16:
+        return "SVGA3D_DEVCAP_SURFACEFMT_V16U16";
+    case SVGA3D_DEVCAP_SURFACEFMT_G16R16:
+        return "SVGA3D_DEVCAP_SURFACEFMT_G16R16";
+    case SVGA3D_DEVCAP_SURFACEFMT_A16B16G16R16:
+        return "SVGA3D_DEVCAP_SURFACEFMT_A16B16G16R16";
+    case SVGA3D_DEVCAP_SURFACEFMT_UYVY:
+        return "SVGA3D_DEVCAP_SURFACEFMT_UYVY";
+    case SVGA3D_DEVCAP_SURFACEFMT_YUY2:
+        return "SVGA3D_DEVCAP_SURFACEFMT_YUY2";
+    case SVGA3D_DEVCAP_SURFACEFMT_NV12:
+        return "SVGA3D_DEVCAP_SURFACEFMT_NV12";
+    case SVGA3D_DEVCAP_SURFACEFMT_AYUV:
+        return "SVGA3D_DEVCAP_SURFACEFMT_AYUV";
+    case SVGA3D_DEVCAP_SURFACEFMT_BC4_UNORM:
+        return "SVGA3D_DEVCAP_SURFACEFMT_BC4_UNORM";
+    case SVGA3D_DEVCAP_SURFACEFMT_BC5_UNORM:
+        return "SVGA3D_DEVCAP_SURFACEFMT_BC5_UNORM";
+    default:
+        return "UNEXPECTED";
+    }
+}
+
+const char *vmsvga3dGet3dFormatString(uint32_t format)
+{
+    static char szFormat[1024];
+
+    szFormat[0] = 0;
+
+    if (format & SVGA3DFORMAT_OP_TEXTURE)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_TEXTURE\n");
+    if (format & SVGA3DFORMAT_OP_VOLUMETEXTURE)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_VOLUMETEXTURE\n");
+    if (format & SVGA3DFORMAT_OP_CUBETEXTURE)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_CUBETEXTURE\n");
+    if (format & SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET\n");
+    if (format & SVGA3DFORMAT_OP_SAME_FORMAT_RENDERTARGET)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_SAME_FORMAT_RENDERTARGET\n");
+    if (format & SVGA3DFORMAT_OP_ZSTENCIL)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_ZSTENCIL\n");
+    if (format & SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH\n");
+    if (format & SVGA3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET\n");
+    if (format & SVGA3DFORMAT_OP_DISPLAYMODE)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_DISPLAYMODE\n");
+    if (format & SVGA3DFORMAT_OP_3DACCELERATION)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_3DACCELERATION\n");
+    if (format & SVGA3DFORMAT_OP_PIXELSIZE)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_PIXELSIZE\n");
+    if (format & SVGA3DFORMAT_OP_CONVERT_TO_ARGB)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_CONVERT_TO_ARGB\n");
+    if (format & SVGA3DFORMAT_OP_OFFSCREENPLAIN)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_OFFSCREENPLAIN\n");
+    if (format & SVGA3DFORMAT_OP_SRGBREAD)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_SRGBREAD\n");
+    if (format & SVGA3DFORMAT_OP_BUMPMAP)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_BUMPMAP\n");
+    if (format & SVGA3DFORMAT_OP_DMAP)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_DMAP\n");
+    if (format & SVGA3DFORMAT_OP_NOFILTER)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_NOFILTER\n");
+    if (format & SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB\n");
+    if (format & SVGA3DFORMAT_OP_SRGBWRITE)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_SRGBWRITE\n");
+    if (format & SVGA3DFORMAT_OP_NOALPHABLEND)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_NOALPHABLEND\n");
+    if (format & SVGA3DFORMAT_OP_AUTOGENMIPMAP)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_AUTOGENMIPMAP\n");
+    if (format & SVGA3DFORMAT_OP_VERTEXTEXTURE)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_VERTEXTEXTURE\n");
+    if (format & SVGA3DFORMAT_OP_NOTEXCOORDWRAPNORMIP)
+        strcat(szFormat, "   - SVGA3DFORMAT_OP_NOTEXCOORDWRAPNORMIP\n");
+   return szFormat;
+}
+
+const char *vmsvga3dGetRenderStateName(uint32_t state)
+{
+    switch (state)
+    {
+    case SVGA3D_RS_ZENABLE:                /* SVGA3dBool */            
+        return "SVGA3D_RS_ZENABLE";
+    case SVGA3D_RS_ZWRITEENABLE:           /* SVGA3dBool */
+        return "SVGA3D_RS_ZWRITEENABLE";
+    case SVGA3D_RS_ALPHATESTENABLE:        /* SVGA3dBool */
+        return "SVGA3D_RS_ALPHATESTENABLE";
+    case SVGA3D_RS_DITHERENABLE:           /* SVGA3dBool */
+        return "SVGA3D_RS_DITHERENABLE";
+    case SVGA3D_RS_BLENDENABLE:            /* SVGA3dBool */
+        return "SVGA3D_RS_BLENDENABLE";
+    case SVGA3D_RS_FOGENABLE:              /* SVGA3dBool */
+        return "SVGA3D_RS_FOGENABLE";
+    case SVGA3D_RS_SPECULARENABLE:         /* SVGA3dBool */
+        return "SVGA3D_RS_SPECULARENABLE";
+    case SVGA3D_RS_STENCILENABLE:          /* SVGA3dBool */
+        return "SVGA3D_RS_STENCILENABLE";
+    case SVGA3D_RS_LIGHTINGENABLE:         /* SVGA3dBool */
+        return "SVGA3D_RS_LIGHTINGENABLE";
+    case SVGA3D_RS_NORMALIZENORMALS:       /* SVGA3dBool */
+        return "SVGA3D_RS_NORMALIZENORMALS";
+    case SVGA3D_RS_POINTSPRITEENABLE:      /* SVGA3dBool */
+        return "SVGA3D_RS_POINTSPRITEENABLE";
+    case SVGA3D_RS_POINTSCALEENABLE:       /* SVGA3dBool */
+        return "SVGA3D_RS_POINTSCALEENABLE";
+    case SVGA3D_RS_STENCILREF:             /* uint32_t */
+        return "SVGA3D_RS_STENCILREF";
+    case SVGA3D_RS_STENCILMASK:            /* uint32_t */
+        return "SVGA3D_RS_STENCILMASK";
+    case SVGA3D_RS_STENCILWRITEMASK:       /* uint32_t */
+        return "SVGA3D_RS_STENCILWRITEMASK";
+    case SVGA3D_RS_POINTSIZE:              /* float */
+        return "SVGA3D_RS_POINTSIZE";
+    case SVGA3D_RS_POINTSIZEMIN:           /* float */
+        return "SVGA3D_RS_POINTSIZEMIN";
+    case SVGA3D_RS_POINTSIZEMAX:           /* float */
+        return "SVGA3D_RS_POINTSIZEMAX";
+    case SVGA3D_RS_POINTSCALE_A:           /* float */
+        return "SVGA3D_RS_POINTSCALE_A";
+    case SVGA3D_RS_POINTSCALE_B:           /* float */
+        return "SVGA3D_RS_POINTSCALE_B";
+    case SVGA3D_RS_POINTSCALE_C:           /* float */
+        return "SVGA3D_RS_POINTSCALE_C";
+    case SVGA3D_RS_AMBIENT:                /* SVGA3dColor - identical */
+        return "SVGA3D_RS_AMBIENT";
+    case SVGA3D_RS_CLIPPLANEENABLE:        /* SVGA3dClipPlanes - identical */
+        return "SVGA3D_RS_CLIPPLANEENABLE";
+    case SVGA3D_RS_FOGCOLOR:               /* SVGA3dColor - identical */
+        return "SVGA3D_RS_FOGCOLOR";
+    case SVGA3D_RS_FOGSTART:               /* float */
+        return "SVGA3D_RS_FOGSTART";
+    case SVGA3D_RS_FOGEND:                 /* float */
+        return "SVGA3D_RS_FOGEND";
+    case SVGA3D_RS_FOGDENSITY:             /* float */
+        return "SVGA3D_RS_FOGDENSITY";
+    case SVGA3D_RS_RANGEFOGENABLE:         /* SVGA3dBool */
+        return "SVGA3D_RS_RANGEFOGENABLE";
+    case SVGA3D_RS_FOGMODE:                /* SVGA3dFogMode */
+        return "SVGA3D_RS_FOGMODE";
+    case SVGA3D_RS_FILLMODE:               /* SVGA3dFillMode */
+        return "SVGA3D_RS_FILLMODE";
+    case SVGA3D_RS_SHADEMODE:              /* SVGA3dShadeMode */
+        return "SVGA3D_RS_SHADEMODE";
+    case SVGA3D_RS_LINEPATTERN:            /* SVGA3dLinePattern */
+        return "SVGA3D_RS_LINEPATTERN";
+    case SVGA3D_RS_SRCBLEND:               /* SVGA3dBlendOp */
+        return "SVGA3D_RS_SRCBLEND";
+    case SVGA3D_RS_DSTBLEND:               /* SVGA3dBlendOp */
+        return "SVGA3D_RS_DSTBLEND";
+    case SVGA3D_RS_BLENDEQUATION:          /* SVGA3dBlendEquation */
+        return "SVGA3D_RS_BLENDEQUATION";
+    case SVGA3D_RS_CULLMODE:               /* SVGA3dFace */
+        return "SVGA3D_RS_CULLMODE";
+    case SVGA3D_RS_ZFUNC:                  /* SVGA3dCmpFunc */
+        return "SVGA3D_RS_ZFUNC";
+    case SVGA3D_RS_ALPHAFUNC:              /* SVGA3dCmpFunc */
+        return "SVGA3D_RS_ALPHAFUNC";
+    case SVGA3D_RS_STENCILFUNC:            /* SVGA3dCmpFunc */
+        return "SVGA3D_RS_STENCILFUNC";
+    case SVGA3D_RS_STENCILFAIL:            /* SVGA3dStencilOp */
+        return "SVGA3D_RS_STENCILFAIL";
+    case SVGA3D_RS_STENCILZFAIL:           /* SVGA3dStencilOp */
+        return "SVGA3D_RS_STENCILZFAIL";
+    case SVGA3D_RS_STENCILPASS:            /* SVGA3dStencilOp */
+        return "SVGA3D_RS_STENCILPASS";
+    case SVGA3D_RS_ALPHAREF:               /* float (0.0 .. 1.0) */
+        return "SVGA3D_RS_ALPHAREF";
+    case SVGA3D_RS_FRONTWINDING:           /* SVGA3dFrontWinding */
+        return "SVGA3D_RS_FRONTWINDING";
+    case SVGA3D_RS_COORDINATETYPE:         /* SVGA3dCoordinateType */
+        return "SVGA3D_RS_COORDINATETYPE";
+    case SVGA3D_RS_ZBIAS:                  /* float */
+        return "SVGA3D_RS_ZBIAS";
+    case SVGA3D_RS_COLORWRITEENABLE:       /* SVGA3dColorMask */
+        return "SVGA3D_RS_COLORWRITEENABLE";
+    case SVGA3D_RS_VERTEXMATERIALENABLE:   /* SVGA3dBool */
+        return "SVGA3D_RS_VERTEXMATERIALENABLE";
+    case SVGA3D_RS_DIFFUSEMATERIALSOURCE:  /* SVGA3dVertexMaterial */
+        return "SVGA3D_RS_DIFFUSEMATERIALSOURCE";
+    case SVGA3D_RS_SPECULARMATERIALSOURCE: /* SVGA3dVertexMaterial */
+        return "SVGA3D_RS_SPECULARMATERIALSOURCE";
+    case SVGA3D_RS_AMBIENTMATERIALSOURCE:  /* SVGA3dVertexMaterial */
+        return "SVGA3D_RS_AMBIENTMATERIALSOURCE";
+    case SVGA3D_RS_EMISSIVEMATERIALSOURCE: /* SVGA3dVertexMaterial */
+        return "SVGA3D_RS_EMISSIVEMATERIALSOURCE";
+    case SVGA3D_RS_TEXTUREFACTOR:          /* SVGA3dColor */
+        return "SVGA3D_RS_TEXTUREFACTOR";
+    case SVGA3D_RS_LOCALVIEWER:            /* SVGA3dBool */
+        return "SVGA3D_RS_LOCALVIEWER";
+    case SVGA3D_RS_SCISSORTESTENABLE:      /* SVGA3dBool */
+        return "SVGA3D_RS_SCISSORTESTENABLE";
+    case SVGA3D_RS_BLENDCOLOR:             /* SVGA3dColor */
+        return "SVGA3D_RS_BLENDCOLOR";
+    case SVGA3D_RS_STENCILENABLE2SIDED:    /* SVGA3dBool */
+        return "SVGA3D_RS_STENCILENABLE2SIDED";
+    case SVGA3D_RS_CCWSTENCILFUNC:         /* SVGA3dCmpFunc */
+        return "SVGA3D_RS_CCWSTENCILFUNC";
+    case SVGA3D_RS_CCWSTENCILFAIL:         /* SVGA3dStencilOp */
+        return "SVGA3D_RS_CCWSTENCILFAIL";
+    case SVGA3D_RS_CCWSTENCILZFAIL:        /* SVGA3dStencilOp */
+        return "SVGA3D_RS_CCWSTENCILZFAIL";
+    case SVGA3D_RS_CCWSTENCILPASS:         /* SVGA3dStencilOp */
+        return "SVGA3D_RS_CCWSTENCILPASS";
+    case SVGA3D_RS_VERTEXBLEND:            /* SVGA3dVertexBlendFlags */
+        return "SVGA3D_RS_VERTEXBLEND";
+    case SVGA3D_RS_SLOPESCALEDEPTHBIAS:    /* float */
+        return "SVGA3D_RS_SLOPESCALEDEPTHBIAS";
+    case SVGA3D_RS_DEPTHBIAS:              /* float */
+        return "SVGA3D_RS_DEPTHBIAS";
+    case SVGA3D_RS_OUTPUTGAMMA:            /* float */
+        return "SVGA3D_RS_OUTPUTGAMMA";
+    case SVGA3D_RS_ZVISIBLE:               /* SVGA3dBool */
+        return "SVGA3D_RS_ZVISIBLE";
+    case SVGA3D_RS_LASTPIXEL:              /* SVGA3dBool */
+        return "SVGA3D_RS_LASTPIXEL";
+    case SVGA3D_RS_CLIPPING:               /* SVGA3dBool */
+        return "SVGA3D_RS_CLIPPING";
+    case SVGA3D_RS_WRAP0:                  /* SVGA3dWrapFlags */
+        return "SVGA3D_RS_WRAP0";
+    case SVGA3D_RS_WRAP1:                  /* SVGA3dWrapFlags */
+        return "SVGA3D_RS_WRAP1";
+    case SVGA3D_RS_WRAP2:                  /* SVGA3dWrapFlags */
+        return "SVGA3D_RS_WRAP2";
+    case SVGA3D_RS_WRAP3:                  /* SVGA3dWrapFlags */
+        return "SVGA3D_RS_WRAP3";
+    case SVGA3D_RS_WRAP4:                  /* SVGA3dWrapFlags */
+        return "SVGA3D_RS_WRAP4";
+    case SVGA3D_RS_WRAP5:                  /* SVGA3dWrapFlags */
+        return "SVGA3D_RS_WRAP5";
+    case SVGA3D_RS_WRAP6:                  /* SVGA3dWrapFlags */
+        return "SVGA3D_RS_WRAP6";
+    case SVGA3D_RS_WRAP7:                  /* SVGA3dWrapFlags */
+        return "SVGA3D_RS_WRAP7";
+    case SVGA3D_RS_WRAP8:                  /* SVGA3dWrapFlags */
+        return "SVGA3D_RS_WRAP8";
+    case SVGA3D_RS_WRAP9:                  /* SVGA3dWrapFlags */
+        return "SVGA3D_RS_WRAP9";
+    case SVGA3D_RS_WRAP10:                 /* SVGA3dWrapFlags */
+        return "SVGA3D_RS_WRAP10";
+    case SVGA3D_RS_WRAP11:                 /* SVGA3dWrapFlags */
+        return "SVGA3D_RS_WRAP11";
+    case SVGA3D_RS_WRAP12:                 /* SVGA3dWrapFlags */
+        return "SVGA3D_RS_WRAP12";
+    case SVGA3D_RS_WRAP13:                 /* SVGA3dWrapFlags */
+        return "SVGA3D_RS_WRAP13";
+    case SVGA3D_RS_WRAP14:                 /* SVGA3dWrapFlags */
+        return "SVGA3D_RS_WRAP14";
+    case SVGA3D_RS_WRAP15:                 /* SVGA3dWrapFlags */
+        return "SVGA3D_RS_WRAP15";
+    case SVGA3D_RS_MULTISAMPLEANTIALIAS:   /* SVGA3dBool */
+        return "SVGA3D_RS_MULTISAMPLEANTIALIAS";
+    case SVGA3D_RS_MULTISAMPLEMASK:        /* uint32_t */
+        return "SVGA3D_RS_MULTISAMPLEMASK";
+    case SVGA3D_RS_INDEXEDVERTEXBLENDENABLE: /* SVGA3dBool */
+        return "SVGA3D_RS_INDEXEDVERTEXBLENDENABLE";
+    case SVGA3D_RS_TWEENFACTOR:            /* float */
+        return "SVGA3D_RS_TWEENFACTOR";
+    case SVGA3D_RS_ANTIALIASEDLINEENABLE:  /* SVGA3dBool */
+        return "SVGA3D_RS_ANTIALIASEDLINEENABLE";
+    case SVGA3D_RS_COLORWRITEENABLE1:      /* SVGA3dColorMask */
+        return "SVGA3D_RS_COLORWRITEENABLE1";
+    case SVGA3D_RS_COLORWRITEENABLE2:      /* SVGA3dColorMask */
+        return "SVGA3D_RS_COLORWRITEENABLE2";
+    case SVGA3D_RS_COLORWRITEENABLE3:      /* SVGA3dColorMask */
+        return "SVGA3D_RS_COLORWRITEENABLE3";
+    case SVGA3D_RS_SEPARATEALPHABLENDENABLE: /* SVGA3dBool */
+        return "SVGA3D_RS_SEPARATEALPHABLENDENABLE";
+    case SVGA3D_RS_SRCBLENDALPHA:          /* SVGA3dBlendOp */
+        return "SVGA3D_RS_SRCBLENDALPHA";
+    case SVGA3D_RS_DSTBLENDALPHA:          /* SVGA3dBlendOp */
+        return "SVGA3D_RS_DSTBLENDALPHA";
+    case SVGA3D_RS_BLENDEQUATIONALPHA:     /* SVGA3dBlendEquation */
+        return "SVGA3D_RS_BLENDEQUATIONALPHA";
+    case SVGA3D_RS_TRANSPARENCYANTIALIAS:  /* SVGA3dTransparencyAntialiasType */
+        return "SVGA3D_RS_TRANSPARENCYANTIALIAS";
+    case SVGA3D_RS_LINEAA:                 /* SVGA3dBool */
+        return "SVGA3D_RS_LINEAA";
+    case SVGA3D_RS_LINEWIDTH:              /* float */
+        return "SVGA3D_RS_LINEWIDTH";
+    default:
+        return "UNKNOWN";
+    }
+}
+
+const char *vmsvga3dTextureStateToString(SVGA3dTextureStateName textureState)
+{
+    switch (textureState)
+    {
+    case SVGA3D_TS_BIND_TEXTURE:
+        return "SVGA3D_TS_BIND_TEXTURE";
+    case SVGA3D_TS_COLOROP:
+        return "SVGA3D_TS_COLOROP";
+    case SVGA3D_TS_COLORARG1:
+        return "SVGA3D_TS_COLORARG1";
+    case SVGA3D_TS_COLORARG2:
+        return "SVGA3D_TS_COLORARG2";
+    case SVGA3D_TS_ALPHAOP:
+        return "SVGA3D_TS_ALPHAOP";
+    case SVGA3D_TS_ALPHAARG1:
+        return "SVGA3D_TS_ALPHAARG1";
+    case SVGA3D_TS_ALPHAARG2:
+        return "SVGA3D_TS_ALPHAARG2";
+    case SVGA3D_TS_ADDRESSU:
+        return "SVGA3D_TS_ADDRESSU";
+    case SVGA3D_TS_ADDRESSV:
+        return "SVGA3D_TS_ADDRESSV";
+    case SVGA3D_TS_MIPFILTER:
+        return "SVGA3D_TS_MIPFILTER";
+    case SVGA3D_TS_MAGFILTER:
+        return "SVGA3D_TS_MAGFILTER";
+    case SVGA3D_TS_MINFILTER:
+        return "SVGA3D_TS_MINFILTER";
+    case SVGA3D_TS_BORDERCOLOR:
+        return "SVGA3D_TS_BORDERCOLOR";
+    case SVGA3D_TS_TEXCOORDINDEX:
+        return "SVGA3D_TS_TEXCOORDINDEX";
+    case SVGA3D_TS_TEXTURETRANSFORMFLAGS:
+        return "SVGA3D_TS_TEXTURETRANSFORMFLAGS";
+    case SVGA3D_TS_TEXCOORDGEN:
+        return "SVGA3D_TS_TEXCOORDGEN";
+    case SVGA3D_TS_BUMPENVMAT00:
+        return "SVGA3D_TS_BUMPENVMAT00";
+    case SVGA3D_TS_BUMPENVMAT01:
+        return "SVGA3D_TS_BUMPENVMAT01";
+    case SVGA3D_TS_BUMPENVMAT10:
+        return "SVGA3D_TS_BUMPENVMAT10";
+    case SVGA3D_TS_BUMPENVMAT11:
+        return "SVGA3D_TS_BUMPENVMAT11";
+    case SVGA3D_TS_TEXTURE_MIPMAP_LEVEL:
+        return "SVGA3D_TS_TEXTURE_MIPMAP_LEVEL";
+    case SVGA3D_TS_TEXTURE_LOD_BIAS:
+        return "SVGA3D_TS_TEXTURE_LOD_BIAS";
+    case SVGA3D_TS_TEXTURE_ANISOTROPIC_LEVEL:
+        return "SVGA3D_TS_TEXTURE_ANISOTROPIC_LEVEL";
+    case SVGA3D_TS_ADDRESSW:
+        return "SVGA3D_TS_ADDRESSW";
+    case SVGA3D_TS_GAMMA:
+        return "SVGA3D_TS_GAMMA";
+    case SVGA3D_TS_BUMPENVLSCALE:
+        return "SVGA3D_TS_BUMPENVLSCALE";
+    case SVGA3D_TS_BUMPENVLOFFSET:
+        return "SVGA3D_TS_BUMPENVLOFFSET";
+    case SVGA3D_TS_COLORARG0:
+        return "SVGA3D_TS_COLORARG0";
+    case SVGA3D_TS_ALPHAARG0:
+        return "SVGA3D_TS_ALPHAARG0";
+    default:
+        return "UNKNOWN";
+    }
+}
+
+const char *vmsvgaTransformToString(SVGA3dTransformType type)
+{
+    switch (type)
+    {
+    case SVGA3D_TRANSFORM_INVALID:
+        return "SVGA3D_TRANSFORM_INVALID";
+    case SVGA3D_TRANSFORM_WORLD:
+        return "SVGA3D_TRANSFORM_WORLD";
+    case SVGA3D_TRANSFORM_VIEW:
+        return "SVGA3D_TRANSFORM_VIEW";
+    case SVGA3D_TRANSFORM_PROJECTION:
+        return "SVGA3D_TRANSFORM_PROJECTION";
+    case SVGA3D_TRANSFORM_TEXTURE0:
+        return "SVGA3D_TRANSFORM_TEXTURE0";
+    case SVGA3D_TRANSFORM_TEXTURE1:
+        return "SVGA3D_TRANSFORM_TEXTURE1";
+    case SVGA3D_TRANSFORM_TEXTURE2:
+        return "SVGA3D_TRANSFORM_TEXTURE2";
+    case SVGA3D_TRANSFORM_TEXTURE3:
+        return "SVGA3D_TRANSFORM_TEXTURE3";
+    case SVGA3D_TRANSFORM_TEXTURE4:
+        return "SVGA3D_TRANSFORM_TEXTURE4";
+    case SVGA3D_TRANSFORM_TEXTURE5:
+        return "SVGA3D_TRANSFORM_TEXTURE5";
+    case SVGA3D_TRANSFORM_TEXTURE6:
+        return "SVGA3D_TRANSFORM_TEXTURE6";
+    case SVGA3D_TRANSFORM_TEXTURE7:
+        return "SVGA3D_TRANSFORM_TEXTURE7";
+    case SVGA3D_TRANSFORM_WORLD1:
+        return "SVGA3D_TRANSFORM_WORLD1";
+    case SVGA3D_TRANSFORM_WORLD2:
+        return "SVGA3D_TRANSFORM_WORLD2";
+    case SVGA3D_TRANSFORM_WORLD3:
+        return "SVGA3D_TRANSFORM_WORLD3";
+    default:
+        return "UNKNOWN";
+    }
+}
+
+const char *vmsvgaDeclUsage2String(SVGA3dDeclUsage usage)
+{
+    switch (usage)
+    {
+    case SVGA3D_DECLUSAGE_POSITION:
+        return "SVGA3D_DECLUSAGE_POSITION";
+    case SVGA3D_DECLUSAGE_BLENDWEIGHT:
+        return "SVGA3D_DECLUSAGE_BLENDWEIGHT";
+    case SVGA3D_DECLUSAGE_BLENDINDICES:
+        return "SVGA3D_DECLUSAGE_BLENDINDICES";
+    case SVGA3D_DECLUSAGE_NORMAL:
+        return "SVGA3D_DECLUSAGE_NORMAL";
+    case SVGA3D_DECLUSAGE_PSIZE:
+        return "SVGA3D_DECLUSAGE_PSIZE";
+    case SVGA3D_DECLUSAGE_TEXCOORD:
+        return "SVGA3D_DECLUSAGE_TEXCOORD";
+    case SVGA3D_DECLUSAGE_TANGENT:
+        return "SVGA3D_DECLUSAGE_TANGENT";
+    case SVGA3D_DECLUSAGE_BINORMAL:
+        return "SVGA3D_DECLUSAGE_BINORMAL";
+    case SVGA3D_DECLUSAGE_TESSFACTOR:
+        return "SVGA3D_DECLUSAGE_TESSFACTOR";
+    case SVGA3D_DECLUSAGE_POSITIONT:
+        return "SVGA3D_DECLUSAGE_POSITIONT";
+    case SVGA3D_DECLUSAGE_COLOR:
+        return "SVGA3D_DECLUSAGE_COLOR";
+    case SVGA3D_DECLUSAGE_FOG:
+        return "SVGA3D_DECLUSAGE_FOG";
+    case SVGA3D_DECLUSAGE_DEPTH:
+        return "SVGA3D_DECLUSAGE_DEPTH";
+    case SVGA3D_DECLUSAGE_SAMPLE:
+        return "SVGA3D_DECLUSAGE_SAMPLE";
+    default:
+        return "UNKNOWN!!";
+    }
+}
+
+const char *vmsvgaDeclMethod2String(SVGA3dDeclMethod method)
+{
+    switch (method)
+    {
+    case SVGA3D_DECLMETHOD_DEFAULT:
+        return "SVGA3D_DECLMETHOD_DEFAULT";
+    case SVGA3D_DECLMETHOD_PARTIALU:
+        return "SVGA3D_DECLMETHOD_PARTIALU";
+    case SVGA3D_DECLMETHOD_PARTIALV:
+        return "SVGA3D_DECLMETHOD_PARTIALV";
+    case SVGA3D_DECLMETHOD_CROSSUV:
+        return "SVGA3D_DECLMETHOD_CROSSUV";
+    case SVGA3D_DECLMETHOD_UV:
+        return "SVGA3D_DECLMETHOD_UV";
+    case SVGA3D_DECLMETHOD_LOOKUP:
+        return "SVGA3D_DECLMETHOD_LOOKUP";
+    case SVGA3D_DECLMETHOD_LOOKUPPRESAMPLED:
+        return "SVGA3D_DECLMETHOD_LOOKUPPRESAMPLED";
+    default:
+        return "UNKNOWN!!";
+    }
+}
+
+const char *vmsvgaDeclType2String(SVGA3dDeclType type)
+{
+    switch (type)
+    {
+    case SVGA3D_DECLTYPE_FLOAT1:
+        return "SVGA3D_DECLTYPE_FLOAT1";
+    case SVGA3D_DECLTYPE_FLOAT2:
+        return "SVGA3D_DECLTYPE_FLOAT2";
+    case SVGA3D_DECLTYPE_FLOAT3:
+        return "SVGA3D_DECLTYPE_FLOAT3";
+    case SVGA3D_DECLTYPE_FLOAT4:
+        return "SVGA3D_DECLTYPE_FLOAT4";
+    case SVGA3D_DECLTYPE_D3DCOLOR:
+        return "SVGA3D_DECLTYPE_D3DCOLOR";
+    case SVGA3D_DECLTYPE_UBYTE4:
+        return "SVGA3D_DECLTYPE_UBYTE4";
+    case SVGA3D_DECLTYPE_SHORT2:
+        return "SVGA3D_DECLTYPE_SHORT2";
+    case SVGA3D_DECLTYPE_SHORT4:
+        return "SVGA3D_DECLTYPE_SHORT4";
+    case SVGA3D_DECLTYPE_UBYTE4N:
+        return "SVGA3D_DECLTYPE_UBYTE4N";
+    case SVGA3D_DECLTYPE_SHORT2N:
+        return "SVGA3D_DECLTYPE_SHORT2N";
+    case SVGA3D_DECLTYPE_SHORT4N:
+        return "SVGA3D_DECLTYPE_SHORT4N";
+    case SVGA3D_DECLTYPE_USHORT2N:
+        return "SVGA3D_DECLTYPE_USHORT2N";
+    case SVGA3D_DECLTYPE_USHORT4N:
+        return "SVGA3D_DECLTYPE_USHORT4N";
+    case SVGA3D_DECLTYPE_UDEC3:
+        return "SVGA3D_DECLTYPE_UDEC3";
+    case SVGA3D_DECLTYPE_DEC3N:
+        return "SVGA3D_DECLTYPE_DEC3N";
+    case SVGA3D_DECLTYPE_FLOAT16_2:
+        return "SVGA3D_DECLTYPE_FLOAT16_2";
+    case SVGA3D_DECLTYPE_FLOAT16_4:
+        return "SVGA3D_DECLTYPE_FLOAT16_4";
+    default:
+        return "UNKNOWN!!";
+    }
+}
+
+const char *vmsvgaSurfaceType2String(SVGA3dSurfaceFormat format)
+{
+    switch (format)
+    {
+    case SVGA3D_X8R8G8B8:
+        return "SVGA3D_X8R8G8B8";
+    case SVGA3D_A8R8G8B8:
+        return "SVGA3D_A8R8G8B8";
+    case SVGA3D_R5G6B5:
+        return "SVGA3D_R5G6B5";
+    case SVGA3D_X1R5G5B5:
+        return "SVGA3D_X1R5G5B5";
+    case SVGA3D_A1R5G5B5:
+        return "SVGA3D_A1R5G5B5";
+    case SVGA3D_A4R4G4B4:
+        return "SVGA3D_A4R4G4B4";
+    case SVGA3D_Z_D32:
+        return "SVGA3D_Z_D32";
+    case SVGA3D_Z_D16:
+        return "SVGA3D_Z_D16";
+    case SVGA3D_Z_D24S8:
+        return "SVGA3D_Z_D24S8";
+    case SVGA3D_Z_D15S1:
+        return "SVGA3D_Z_D15S1";
+    case SVGA3D_Z_D24X8:
+        return "SVGA3D_Z_D24X8";
+    case SVGA3D_Z_DF16:
+        return "SVGA3D_Z_DF16";
+    case SVGA3D_Z_DF24:
+        return "SVGA3D_Z_DF24";
+    case SVGA3D_Z_D24S8_INT:
+        return "SVGA3D_Z_D24S8_INT";
+    case SVGA3D_LUMINANCE8:
+        return "SVGA3D_LUMINANCE8";
+    case SVGA3D_LUMINANCE4_ALPHA4:
+        return "SVGA3D_LUMINANCE4_ALPHA4";
+    case SVGA3D_LUMINANCE16:
+        return "SVGA3D_LUMINANCE16";
+    case SVGA3D_LUMINANCE8_ALPHA8:
+        return "SVGA3D_LUMINANCE8_ALPHA8";
+    case SVGA3D_DXT1:
+        return "SVGA3D_DXT1";
+    case SVGA3D_DXT2:
+        return "SVGA3D_DXT2";
+    case SVGA3D_DXT3:
+        return "SVGA3D_DXT3";
+    case SVGA3D_DXT4:
+        return "SVGA3D_DXT4";
+    case SVGA3D_DXT5:
+        return "SVGA3D_DXT5";
+    case SVGA3D_BUMPU8V8:
+        return "SVGA3D_BUMPU8V8";
+    case SVGA3D_BUMPL6V5U5:
+        return "SVGA3D_BUMPL6V5U5";
+    case SVGA3D_BUMPX8L8V8U8:
+        return "SVGA3D_BUMPX8L8V8U8";
+    case SVGA3D_BUMPL8V8U8:
+        return "SVGA3D_BUMPL8V8U8";
+    case SVGA3D_V8U8:
+        return "SVGA3D_V8U8";
+    case SVGA3D_Q8W8V8U8:
+        return "SVGA3D_Q8W8V8U8";
+    case SVGA3D_CxV8U8:
+        return "SVGA3D_CxV8U8";
+    case SVGA3D_X8L8V8U8:
+        return "SVGA3D_X8L8V8U8";
+    case SVGA3D_A2W10V10U10:
+        return "SVGA3D_A2W10V10U10";
+    case SVGA3D_ARGB_S10E5:
+        return "SVGA3D_ARGB_S10E5";
+    case SVGA3D_ARGB_S23E8:
+        return "SVGA3D_ARGB_S23E8";
+    case SVGA3D_A2R10G10B10:
+        return "SVGA3D_A2R10G10B10";
+    case SVGA3D_ALPHA8:
+        return "SVGA3D_ALPHA8";
+    case SVGA3D_R_S10E5:
+        return "SVGA3D_R_S10E5";
+    case SVGA3D_R_S23E8:
+        return "SVGA3D_R_S23E8";
+    case SVGA3D_RG_S10E5:
+        return "SVGA3D_RG_S10E5";
+    case SVGA3D_RG_S23E8:
+        return "SVGA3D_RG_S23E8";
+    case SVGA3D_BUFFER:
+        return "SVGA3D_BUFFER";
+    case SVGA3D_V16U16:
+        return "SVGA3D_V16U16";
+    case SVGA3D_G16R16:
+        return "SVGA3D_G16R16";
+    case SVGA3D_A16B16G16R16:
+        return "SVGA3D_A16B16G16R16";
+    case SVGA3D_UYVY:
+        return "SVGA3D_UYVY";
+    case SVGA3D_YUY2:
+        return "SVGA3D_YUY2";
+    case SVGA3D_NV12:
+        return "SVGA3D_NV12";
+    case SVGA3D_AYUV:
+        return "SVGA3D_AYUV";
+    case SVGA3D_BC4_UNORM:
+        return "SVGA3D_BC4_UNORM";
+    case SVGA3D_BC5_UNORM:
+        return "SVGA3D_BC5_UNORM";
+    }
+    return "UNKNOWN!!";
+}
+
+const char *vmsvga3dPrimitiveType2String(SVGA3dPrimitiveType PrimitiveType)
+{
+    switch (PrimitiveType)
+    {
+    case SVGA3D_PRIMITIVE_TRIANGLELIST:
+        return "SVGA3D_PRIMITIVE_TRIANGLELIST";
+    case SVGA3D_PRIMITIVE_POINTLIST:
+        return "SVGA3D_PRIMITIVE_POINTLIST";
+    case SVGA3D_PRIMITIVE_LINELIST:
+        return "SVGA3D_PRIMITIVE_LINELIST";
+    case SVGA3D_PRIMITIVE_LINESTRIP:
+        return "SVGA3D_PRIMITIVE_LINESTRIP";
+    case SVGA3D_PRIMITIVE_TRIANGLESTRIP:
+        return "SVGA3D_PRIMITIVE_TRIANGLESTRIP";
+    case SVGA3D_PRIMITIVE_TRIANGLEFAN:
+        return "SVGA3D_PRIMITIVE_TRIANGLEFAN";
+    default:
+        return "UNKNOWN";
+    }
+}
+
+#endif /* LOG_ENABLED */
Index: trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-shared.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-shared.h	(revision 53206)
+++ trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-shared.h	(revision 53206)
@@ -0,0 +1,800 @@
+/** @file
+ * VMware SVGA device -- 3D part
+ */
+/*
+ * Copyright (C) 2013 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+#ifndef __DEVVMWARE3D_STATE_H__
+#define __DEVVMWARE3D_STATE_H__
+
+int vmsvga3dLoadExec(PVGASTATE pThis, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
+{
+    PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+    int            rc;
+    uint32_t       cContexts, cSurfaces;
+
+    /* Must initialize now as the recreation calls below rely on an initialized 3d subsystem. */
+    vmsvga3dPowerOn(pThis);
+
+    /* Get the generic 3d state first. */
+    rc = SSMR3GetStructEx(pSSM, pState, sizeof(*pState), 0, g_aVMSVGA3DSTATEFields, NULL);
+    AssertRCReturn(rc, rc);
+
+    cContexts                           = pState->cContexts;
+    cSurfaces                           = pState->cSurfaces;
+    pState->cContexts                   = 0;
+    pState->cSurfaces                   = 0;
+
+    /* Fetch all active contexts. */
+    for (uint32_t i = 0; i < cContexts; i++)
+    {
+        PVMSVGA3DCONTEXT pContext;
+        uint32_t         cid;
+
+        /* Get the context id */
+        rc = SSMR3GetU32(pSSM, &cid);
+        AssertRCReturn(rc, rc);
+
+        if (cid != SVGA3D_INVALID_ID)
+        {
+            uint32_t cPixelShaderConst, cVertexShaderConst, cPixelShaders, cVertexShaders;
+
+            rc = vmsvga3dContextDefine(pThis, cid);
+            AssertRCReturn(rc, rc);
+
+            pContext = &pState->paContext[i];
+            AssertReturn(pContext->id == cid, VERR_INTERNAL_ERROR);
+
+            rc = SSMR3GetStructEx(pSSM, pContext, sizeof(*pContext), 0, g_aVMSVGA3DCONTEXTFields, NULL);
+            AssertRCReturn(rc, rc);
+
+            cPixelShaders                       = pContext->cPixelShaders;
+            cVertexShaders                      = pContext->cVertexShaders;
+            cPixelShaderConst                   = pContext->state.cPixelShaderConst;
+            cVertexShaderConst                  = pContext->state.cVertexShaderConst;
+            pContext->cPixelShaders             = 0;
+            pContext->cVertexShaders            = 0;
+            pContext->state.cPixelShaderConst   = 0;
+            pContext->state.cVertexShaderConst  = 0;
+
+            /* Fetch all pixel shaders. */
+            for (uint32_t j = 0; j < cPixelShaders; j++)
+            {
+                VMSVGA3DSHADER  shader;
+                uint32_t        shid;
+
+                /* Fetch the id first. */
+                rc = SSMR3GetU32(pSSM, &shid);
+                AssertRCReturn(rc, rc);
+
+                if (shid != SVGA3D_INVALID_ID)
+                {
+                    uint32_t *pData;
+
+                    /* Fetch a copy of the shader struct. */
+                    rc = SSMR3GetStructEx(pSSM, &shader, sizeof(shader), 0, g_aVMSVGA3DSHADERFields, NULL);
+                    AssertRCReturn(rc, rc);
+
+                    pData = (uint32_t *)RTMemAlloc(shader.cbData);
+                    AssertReturn(pData, VERR_NO_MEMORY);
+
+                    rc = SSMR3GetMem(pSSM, pData, shader.cbData);
+                    AssertRCReturn(rc, rc);
+
+                    rc = vmsvga3dShaderDefine(pThis, cid, shid, shader.type, shader.cbData, pData);
+                    AssertRCReturn(rc, rc);
+
+                    RTMemFree(pData);
+                }
+            }
+
+            /* Fetch all vertex shaders. */
+            for (uint32_t j = 0; j < cVertexShaders; j++)
+            {
+                VMSVGA3DSHADER  shader;
+                uint32_t        shid;
+
+                /* Fetch the id first. */
+                rc = SSMR3GetU32(pSSM, &shid);
+                AssertRCReturn(rc, rc);
+
+                if (shid != SVGA3D_INVALID_ID)
+                {
+                    uint32_t *pData;
+
+                    /* Fetch a copy of the shader struct. */
+                    rc = SSMR3GetStructEx(pSSM, &shader, sizeof(shader), 0, g_aVMSVGA3DSHADERFields, NULL);
+                    AssertRCReturn(rc, rc);
+
+                    pData = (uint32_t *)RTMemAlloc(shader.cbData);
+                    AssertReturn(pData, VERR_NO_MEMORY);
+
+                    rc = SSMR3GetMem(pSSM, pData, shader.cbData);
+                    AssertRCReturn(rc, rc);
+
+                    rc = vmsvga3dShaderDefine(pThis, cid, shid, shader.type, shader.cbData, pData);
+                    AssertRCReturn(rc, rc);
+
+                    RTMemFree(pData);
+                }
+            }
+
+            /* Fetch pixel shader constants. */
+            for (uint32_t j = 0; j < cPixelShaderConst; j++)
+            {
+                VMSVGASHADERCONST ShaderConst;
+
+                rc = SSMR3GetStructEx(pSSM, &ShaderConst, sizeof(ShaderConst), 0, g_aVMSVGASHADERCONSTFields, NULL);
+                AssertRCReturn(rc, rc);
+
+                if (ShaderConst.fValid)
+                {
+                    rc = vmsvga3dShaderSetConst(pThis, cid, j, SVGA3D_SHADERTYPE_PS, ShaderConst.ctype, 1, ShaderConst.value);
+                    AssertRCReturn(rc, rc);
+                }
+            }
+
+            /* Fetch vertex shader constants. */
+            for (uint32_t j = 0; j < cVertexShaderConst; j++)
+            {
+                VMSVGASHADERCONST ShaderConst;
+
+                rc = SSMR3GetStructEx(pSSM, &ShaderConst, sizeof(ShaderConst), 0, g_aVMSVGASHADERCONSTFields, NULL);
+                AssertRCReturn(rc, rc);
+
+                if (ShaderConst.fValid)
+                {
+                    rc = vmsvga3dShaderSetConst(pThis, cid, j, SVGA3D_SHADERTYPE_VS, ShaderConst.ctype, 1, ShaderConst.value);
+                    AssertRCReturn(rc, rc);
+                }
+            }
+
+        }
+    }
+
+    /* Fetch all surfaces. */
+    for (uint32_t i = 0; i < cSurfaces; i++)
+    {
+        uint32_t sid;
+
+        /* Fetch the id first. */
+        rc = SSMR3GetU32(pSSM, &sid);
+        AssertRCReturn(rc, rc);
+
+        if (sid != SVGA3D_INVALID_ID)
+        {
+            VMSVGA3DSURFACE  surface;
+
+            /* Fetch the surface structure first. */
+            rc = SSMR3GetStructEx(pSSM, &surface, sizeof(surface), 0, g_aVMSVGA3DSURFACEFields, NULL);
+            AssertRCReturn(rc, rc);
+
+            {
+                uint32_t             cMipLevels = surface.faces[0].numMipLevels * surface.cFaces;
+                PVMSVGA3DMIPMAPLEVEL pMipmapLevel = (PVMSVGA3DMIPMAPLEVEL)RTMemAlloc(cMipLevels * sizeof(VMSVGA3DMIPMAPLEVEL));
+                AssertReturn(pMipmapLevel, VERR_NO_MEMORY);
+                SVGA3dSize *pMipmapLevelSize = (SVGA3dSize *)RTMemAlloc(cMipLevels * sizeof(SVGA3dSize));
+                AssertReturn(pMipmapLevelSize, VERR_NO_MEMORY);
+
+                /* Load the mip map level info. */
+                for (uint32_t face=0; face < surface.cFaces; face++)
+                {
+                    for (uint32_t j = 0; j < surface.faces[0].numMipLevels; j++)
+                    {
+                        uint32_t idx = j + face * surface.faces[0].numMipLevels;
+                        /* Load the mip map level struct. */
+                        rc = SSMR3GetStructEx(pSSM, &pMipmapLevel[idx], sizeof(pMipmapLevel[idx]), 0, g_aVMSVGA3DMIPMAPLEVELFields, NULL);
+                        AssertRCReturn(rc, rc);
+
+                        pMipmapLevelSize[idx] = pMipmapLevel[idx].size;
+                    }
+                }
+
+                rc = vmsvga3dSurfaceDefine(pThis, sid, surface.flags, surface.format, surface.faces, surface.multiSampleCount, surface.autogenFilter, cMipLevels, pMipmapLevelSize);
+                AssertRCReturn(rc, rc);
+
+                RTMemFree(pMipmapLevelSize);
+                RTMemFree(pMipmapLevel);
+            }
+
+            PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];
+            Assert(pSurface->id == sid);
+
+            pSurface->fDirty = false;
+
+            /* Load the mip map level data. */
+            for (uint32_t j = 0; j < pSurface->faces[0].numMipLevels * pSurface->cFaces; j++)
+            {
+                PVMSVGA3DMIPMAPLEVEL pMipmapLevel = &pSurface->pMipmapLevels[j];
+                bool fDataPresent = false;
+
+                Assert(pMipmapLevel->cbSurface);
+                pMipmapLevel->pSurfaceData = RTMemAllocZ(pMipmapLevel->cbSurface);
+                AssertReturn(pMipmapLevel->pSurfaceData, VERR_NO_MEMORY);
+                
+                /* Fetch the data present boolean first. */
+                rc = SSMR3GetBool(pSSM, &fDataPresent);
+                AssertRCReturn(rc, rc);
+
+                Log(("Surface sid=%x: load mipmap level %d with %x bytes data (present=%d).\n", sid, j, pMipmapLevel->cbSurface, fDataPresent));
+
+                if (fDataPresent)
+                {
+                    rc = SSMR3GetMem(pSSM, pMipmapLevel->pSurfaceData, pMipmapLevel->cbSurface);
+                    AssertRCReturn(rc, rc);
+                    pMipmapLevel->fDirty = true;
+                    pSurface->fDirty     = true;
+                }
+                else
+                {
+                    pMipmapLevel->fDirty = false;
+                }
+            }
+        }
+    }
+
+    /* Reinitialize all active contexts. */
+    for (uint32_t i = 0; i < pState->cContexts; i++)
+    {
+        PVMSVGA3DCONTEXT pContext = &pState->paContext[i];
+        uint32_t cid = pContext->id;
+
+        if (cid != SVGA3D_INVALID_ID)
+        {
+            /* First set the render targets as they change the internal state (reset viewport etc) */
+            Log(("vmsvga3dLoadExec: Recreate render targets BEGIN\n"));
+            for (uint32_t j = 0; j < RT_ELEMENTS(pContext->state.aRenderTargets); j++)
+            {
+                if (pContext->state.aRenderTargets[j] != SVGA3D_INVALID_ID)
+                {
+                    SVGA3dSurfaceImageId target;
+
+                    target.sid      = pContext->state.aRenderTargets[j];
+                    target.face     = 0;
+                    target.mipmap   = 0;
+                    rc = vmsvga3dSetRenderTarget(pThis, cid, (SVGA3dRenderTargetType)j, target);
+                    AssertRCReturn(rc, rc);
+                }
+            }
+            Log(("vmsvga3dLoadExec: Recreate render targets END\n"));
+
+            /* Recreate the render state */
+            Log(("vmsvga3dLoadExec: Recreate render state BEGIN\n"));
+            for (uint32_t j = 0; j < RT_ELEMENTS(pContext->state.aRenderState); j++)
+            {
+                SVGA3dRenderState *pRenderState = &pContext->state.aRenderState[j];
+
+                if (pRenderState->state != SVGA3D_RS_INVALID)
+                    vmsvga3dSetRenderState(pThis, pContext->id, 1, pRenderState);
+            }
+            Log(("vmsvga3dLoadExec: Recreate render state END\n"));
+
+            /* Recreate the texture state */
+            Log(("vmsvga3dLoadExec: Recreate texture state BEGIN\n"));
+            for (uint32_t iStage = 0; iStage < SVGA3D_MAX_TEXTURE_STAGE; iStage++)
+            {
+                for (uint32_t j = 0; j < SVGA3D_TS_MAX; j++)
+                {
+                    SVGA3dTextureState *pTextureState = &pContext->state.aTextureState[iStage][j];
+
+                    if (pTextureState->name != SVGA3D_TS_INVALID)
+                        vmsvga3dSetTextureState(pThis, pContext->id, 1, pTextureState);
+                }
+            }
+            Log(("vmsvga3dLoadExec: Recreate texture state END\n"));
+
+            /* Reprogram the clip planes. */
+            for (uint32_t j = 0; j < RT_ELEMENTS(pContext->state.aClipPlane); j++)
+            {
+                if (pContext->state.aClipPlane[j].fValid == true)
+                    vmsvga3dSetClipPlane(pThis, cid, j, pContext->state.aClipPlane[j].plane);
+            }
+
+            /* Reprogram the light data. */
+            for (uint32_t j = 0; j < RT_ELEMENTS(pContext->state.aLightData); j++)
+            {
+                if (pContext->state.aLightData[j].fValidData == true)
+                    vmsvga3dSetLightData(pThis, cid, j, &pContext->state.aLightData[j].data);
+                if (pContext->state.aLightData[j].fEnabled)
+                    vmsvga3dSetLightEnabled(pThis, cid, j, true);
+            }
+
+            /* Recreate the transform state. */
+            if (pContext->state.u32UpdateFlags & VMSVGA3D_UPDATE_TRANSFORM)
+            {
+                for (uint32_t j = 0; j < RT_ELEMENTS(pContext->state.aTransformState); j++)
+                {
+                    if (pContext->state.aTransformState[j].fValid == true)
+                        vmsvga3dSetTransform(pThis, cid, (SVGA3dTransformType)j, pContext->state.aTransformState[j].matrix);
+                }
+            }
+
+            /* Reprogram the material data. */
+            if (pContext->state.u32UpdateFlags & VMSVGA3D_UPDATE_MATERIAL)
+            {
+                for (uint32_t j = 0; j < RT_ELEMENTS(pContext->state.aMaterial); j++)
+                {
+                    if (pContext->state.aMaterial[j].fValid == true)
+                        vmsvga3dSetMaterial(pThis, cid, (SVGA3dFace)j, &pContext->state.aMaterial[j].material);
+                }
+            }
+
+            if (pContext->state.u32UpdateFlags & VMSVGA3D_UPDATE_SCISSORRECT)
+                vmsvga3dSetScissorRect(pThis, cid, &pContext->state.RectScissor);
+            if (pContext->state.u32UpdateFlags & VMSVGA3D_UPDATE_ZRANGE)
+                vmsvga3dSetZRange(pThis, cid, pContext->state.zRange);
+            if (pContext->state.u32UpdateFlags & VMSVGA3D_UPDATE_VIEWPORT)
+                vmsvga3dSetViewPort(pThis, cid, &pContext->state.RectViewPort);
+            if (pContext->state.u32UpdateFlags & VMSVGA3D_UPDATE_VERTEXSHADER)
+                vmsvga3dShaderSet(pThis, cid, SVGA3D_SHADERTYPE_VS, pContext->state.shidVertex);
+            if (pContext->state.u32UpdateFlags & VMSVGA3D_UPDATE_PIXELSHADER)
+                vmsvga3dShaderSet(pThis, cid, SVGA3D_SHADERTYPE_PS, pContext->state.shidPixel);
+        }
+    }
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSaveExec(PVGASTATE pThis, PSSMHANDLE pSSM)
+{
+    PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+    int            rc;
+
+    /* Save a copy of the generic 3d state first. */
+    rc = SSMR3PutStructEx(pSSM, pState, sizeof(*pState), 0, g_aVMSVGA3DSTATEFields, NULL);
+    AssertRCReturn(rc, rc);
+
+    /* Save all active contexts. */
+    for (uint32_t i = 0; i < pState->cContexts; i++)
+    {
+        PVMSVGA3DCONTEXT pContext = &pState->paContext[i];
+        uint32_t cid = pContext->id;
+
+        /* Save the id first. */
+        rc = SSMR3PutU32(pSSM, cid);
+        AssertRCReturn(rc, rc);
+
+        if (cid != SVGA3D_INVALID_ID)
+        {
+            /* Save a copy of the context structure first. */
+            rc = SSMR3PutStructEx(pSSM, pContext, sizeof(*pContext), 0, g_aVMSVGA3DCONTEXTFields, NULL);
+            AssertRCReturn(rc, rc);
+
+            /* Save all pixel shaders. */
+            for (uint32_t j = 0; j < pContext->cPixelShaders; j++)
+            {
+                PVMSVGA3DSHADER pShader = &pContext->paPixelShader[j];
+
+                /* Save the id first. */
+                rc = SSMR3PutU32(pSSM, pShader->id);
+                AssertRCReturn(rc, rc);
+
+                if (pShader->id != SVGA3D_INVALID_ID)
+                {
+                    uint32_t cbData = pShader->cbData;
+
+                    /* Save a copy of the shader struct. */
+                    rc = SSMR3PutStructEx(pSSM, pShader, sizeof(*pShader), 0, g_aVMSVGA3DSHADERFields, NULL);
+                    AssertRCReturn(rc, rc);
+
+                    Log(("Save pixelshader shid=%d with %x bytes code.\n", pShader->id, cbData));
+                    rc = SSMR3PutMem(pSSM, pShader->pShaderProgram, cbData);
+                    AssertRCReturn(rc, rc);
+                }
+            }
+
+            /* Save all vertex shaders. */
+            for (uint32_t j = 0; j < pContext->cVertexShaders; j++)
+            {
+                PVMSVGA3DSHADER pShader = &pContext->paVertexShader[j];
+
+                /* Save the id first. */
+                rc = SSMR3PutU32(pSSM, pShader->id);
+                AssertRCReturn(rc, rc);
+
+                if (pShader->id != SVGA3D_INVALID_ID)
+                {
+                    uint32_t cbData = pShader->cbData;
+
+                    /* Save a copy of the shader struct. */
+                    rc = SSMR3PutStructEx(pSSM, pShader, sizeof(*pShader), 0, g_aVMSVGA3DSHADERFields, NULL);
+                    AssertRCReturn(rc, rc);
+
+                    Log(("Save vertex shader shid=%d with %x bytes code.\n", pShader->id, cbData));
+                    /* Fetch the shader code and save it. */
+                    rc = SSMR3PutMem(pSSM, pShader->pShaderProgram, cbData);
+                    AssertRCReturn(rc, rc);
+                }
+            }
+
+            /* Save pixel shader constants. */
+            for (uint32_t j = 0; j < pContext->state.cPixelShaderConst; j++)
+            {
+                rc = SSMR3PutStructEx(pSSM, &pContext->state.paPixelShaderConst[j], sizeof(pContext->state.paPixelShaderConst[j]), 0, g_aVMSVGASHADERCONSTFields, NULL);
+                AssertRCReturn(rc, rc);
+            }
+
+            /* Save vertex shader constants. */
+            for (uint32_t j = 0; j < pContext->state.cVertexShaderConst; j++)
+            {
+                rc = SSMR3PutStructEx(pSSM, &pContext->state.paVertexShaderConst[j], sizeof(pContext->state.paVertexShaderConst[j]), 0, g_aVMSVGASHADERCONSTFields, NULL);
+                AssertRCReturn(rc, rc);
+            }
+        }
+    }
+
+    /* Save all active surfaces. */
+    for (uint32_t sid = 0; sid < pState->cSurfaces; sid++)
+    {
+        PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];
+
+        /* Save the id first. */
+        rc = SSMR3PutU32(pSSM, pSurface->id);
+        AssertRCReturn(rc, rc);
+
+        if (pSurface->id != SVGA3D_INVALID_ID)
+        {
+            /* Save a copy of the surface structure first. */
+            rc = SSMR3PutStructEx(pSSM, pSurface, sizeof(*pSurface), 0, g_aVMSVGA3DSURFACEFields, NULL);
+            AssertRCReturn(rc, rc);
+
+            /* Save the mip map level info. */
+            for (uint32_t face=0; face < pSurface->cFaces; face++)
+            {
+                for (uint32_t i = 0; i < pSurface->faces[0].numMipLevels; i++)
+                {
+                    uint32_t idx = i + face * pSurface->faces[0].numMipLevels;
+                    PVMSVGA3DMIPMAPLEVEL pMipmapLevel = &pSurface->pMipmapLevels[idx];
+
+                    /* Save a copy of the mip map level struct. */
+                    rc = SSMR3PutStructEx(pSSM, pMipmapLevel, sizeof(*pMipmapLevel), 0, g_aVMSVGA3DMIPMAPLEVELFields, NULL);
+                    AssertRCReturn(rc, rc);
+                }
+            }
+
+            /* Save the mip map level data. */
+            for (uint32_t face=0; face < pSurface->cFaces; face++)
+            {
+                for (uint32_t i = 0; i < pSurface->faces[0].numMipLevels; i++)
+                {
+                    uint32_t idx = i + face * pSurface->faces[0].numMipLevels;
+                    PVMSVGA3DMIPMAPLEVEL pMipmapLevel = &pSurface->pMipmapLevels[idx];
+
+                    Log(("Surface sid=%d: save mipmap level %d with %x bytes data.\n", sid, i, pMipmapLevel->cbSurface));
+
+#ifdef VMSVGA3D_DIRECT3D
+                    if (!pSurface->u.pSurface)
+#else
+                    if (pSurface->oglId.texture == OPENGL_INVALID_ID)
+#endif
+                    {
+                        if (pMipmapLevel->fDirty)
+                        {
+                            /* Data follows */
+                            rc = SSMR3PutBool(pSSM, true);
+                            AssertRCReturn(rc, rc);
+
+                            Assert(pMipmapLevel->cbSurface);
+                            rc = SSMR3PutMem(pSSM, pMipmapLevel->pSurfaceData, pMipmapLevel->cbSurface);
+                            AssertRCReturn(rc, rc);
+                        }
+                        else
+                        {
+                            /* No data follows */
+                            rc = SSMR3PutBool(pSSM, false);
+                            AssertRCReturn(rc, rc);
+                        }
+                    }
+                    else
+                    {
+#ifdef VMSVGA3D_DIRECT3D
+                        void            *pData;
+                        bool             fRenderTargetTexture = false;
+                        bool             fTexture = false;
+                        bool             fVertex = false;
+                        bool             fSkipSave = false;
+                        HRESULT          hr;
+
+                        Assert(pMipmapLevel->cbSurface);
+                        pData = RTMemAllocZ(pMipmapLevel->cbSurface);
+                        AssertReturn(pData, VERR_NO_MEMORY);
+
+                        switch (pSurface->flags & (SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET | SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_CUBEMAP))
+                        {
+                        case SVGA3D_SURFACE_HINT_DEPTHSTENCIL:
+                        case SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_HINT_TEXTURE:
+                            /* @todo unable to easily fetch depth surface data in d3d 9 */
+                            fSkipSave = true;
+                            break;
+                        case SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET:
+                            fRenderTargetTexture = true;
+                            /* no break */
+                        case SVGA3D_SURFACE_HINT_TEXTURE:
+                            fTexture = true;
+                            /* no break */
+                        case SVGA3D_SURFACE_HINT_RENDERTARGET:
+                        {
+                            D3DLOCKED_RECT LockedRect;
+
+                            if (fTexture)
+                            {
+                                if (pSurface->bounce.pTexture)
+                                {
+                                    if (    !pSurface->fDirty
+                                        &&  fRenderTargetTexture
+                                        &&  i == 0 /* only the first time */)
+                                    {
+                                        IDirect3DSurface9 *pSrc, *pDest;
+
+                                        /* @todo stricter checks for associated context */
+                                        uint32_t cid = pSurface->idAssociatedContext;
+                                        if (    cid >= pState->cContexts
+                                            ||  pState->paContext[cid].id != cid)
+                                        {
+                                            Log(("vmsvga3dSaveExec invalid context id (%x - %x)!\n", cid, (cid >= pState->cContexts) ? -1 : pState->paContext[cid].id));
+                                            AssertFailedReturn(VERR_INVALID_PARAMETER);
+                                        }
+                                        PVMSVGA3DCONTEXT pContext = &pState->paContext[cid];
+
+                                        hr = pSurface->bounce.pTexture->GetSurfaceLevel(i, &pDest);
+                                        AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSaveExec: GetSurfaceLevel failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                                        hr = pSurface->u.pTexture->GetSurfaceLevel(i, &pSrc);
+                                        AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSaveExec: GetSurfaceLevel failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                                        hr = pContext->pDevice->GetRenderTargetData(pSrc, pDest);
+                                        AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSaveExec: GetRenderTargetData failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                                        pSrc->Release();
+                                        pDest->Release();
+                                    }
+
+                                    hr = pSurface->bounce.pTexture->LockRect(i, /* texture level */
+                                                                             &LockedRect,
+                                                                             NULL,
+                                                                             D3DLOCK_READONLY);
+                                }
+                                else
+                                    hr = pSurface->u.pTexture->LockRect(i, /* texture level */
+                                                                        &LockedRect,
+                                                                        NULL,
+                                                                        D3DLOCK_READONLY);
+                            }
+                            else
+                                hr = pSurface->u.pSurface->LockRect(&LockedRect,
+                                                                    NULL,
+                                                                    D3DLOCK_READONLY);
+                            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSaveExec: LockRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
+               
+                            /* Copy the data one line at a time in case the internal pitch is different. */
+                            for (uint32_t j = 0; j < pMipmapLevel->size.height; j++)
+                            {
+                                memcpy((uint8_t *)pData + j * pMipmapLevel->cbSurfacePitch, (uint8_t *)LockedRect.pBits + j * LockedRect.Pitch, pMipmapLevel->cbSurfacePitch);
+                            }
+
+                            if (fTexture)
+                            {
+                                if (pSurface->bounce.pTexture)
+                                {
+                                    hr = pSurface->bounce.pTexture->UnlockRect(i);
+                                    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSaveExec: UnlockRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
+                                }
+                                else
+                                    hr = pSurface->u.pTexture->UnlockRect(i);
+                            }
+                            else
+                                hr = pSurface->u.pSurface->UnlockRect();
+                            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSaveExec: UnlockRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
+                            break;
+                        }
+
+                        case SVGA3D_SURFACE_HINT_VERTEXBUFFER:
+                            fVertex = true;
+                            /* no break */
+
+                        case SVGA3D_SURFACE_HINT_INDEXBUFFER:
+                        {
+                            uint8_t *pD3DData;
+
+                            if (fVertex)
+                                hr = pSurface->u.pVertexBuffer->Lock(0, 0, (void **)&pD3DData, D3DLOCK_READONLY);
+                            else        
+                                hr = pSurface->u.pIndexBuffer->Lock(0, 0, (void **)&pD3DData, D3DLOCK_READONLY);
+                            AssertMsg(hr == D3D_OK, ("vmsvga3dSaveExec: Lock %s failed with %x\n", (fVertex) ? "vertex" : "index", hr));
+
+                            memcpy(pData, pD3DData, pMipmapLevel->cbSurface);
+
+                            if (fVertex)
+                                hr = pSurface->u.pVertexBuffer->Unlock();
+                            else
+                                hr = pSurface->u.pIndexBuffer->Unlock();
+                            AssertMsg(hr == D3D_OK, ("vmsvga3dSaveExec: Unlock %s failed with %x\n", (fVertex) ? "vertex" : "index", hr));
+                            break;
+                        }
+
+                        default:
+                            AssertFailed();
+                            break;
+                        }
+
+                        if (!fSkipSave)
+                        {
+                            /* Data follows */
+                            rc = SSMR3PutBool(pSSM, true);
+                            AssertRCReturn(rc, rc);
+
+                            /* And write the surface data. */
+                            rc = SSMR3PutMem(pSSM, pData, pMipmapLevel->cbSurface);
+                            AssertRCReturn(rc, rc);
+                        }
+                        else
+                        {
+                            /* No data follows */
+                            rc = SSMR3PutBool(pSSM, false);
+                            AssertRCReturn(rc, rc);
+                        }
+
+                        RTMemFree(pData);
+#elif defined(VMSVGA3D_OPENGL)
+                        void *pData = NULL;
+
+                        /* @todo stricter checks for associated context */
+                        uint32_t cid = pSurface->idAssociatedContext;
+                        if (    cid >= pState->cContexts
+                            ||  pState->paContext[cid].id != cid)
+                        {
+                            Log(("vmsvga3dSaveExec: invalid context id (%x - %x)!\n", cid, (cid >= pState->cContexts) ? -1 : pState->paContext[cid].id));
+                            AssertFailedReturn(VERR_INVALID_PARAMETER);
+                        }
+                        PVMSVGA3DCONTEXT pContext = &pState->paContext[cid];
+                        VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
+
+                        Assert(pMipmapLevel->cbSurface);
+
+                        switch (pSurface->flags & (SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET | SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_CUBEMAP))
+                        {
+                        default:
+                            AssertFailed();
+                            /* no break */
+                        case SVGA3D_SURFACE_HINT_DEPTHSTENCIL:
+                        case SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_HINT_TEXTURE:
+                            /* @todo fetch data from the renderbuffer */
+                            /* No data follows */
+                            rc = SSMR3PutBool(pSSM, false);
+                            AssertRCReturn(rc, rc);
+                            break;
+
+                        case SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET:
+                        case SVGA3D_SURFACE_HINT_TEXTURE:
+                        case SVGA3D_SURFACE_HINT_RENDERTARGET:
+                        {
+                            GLint activeTexture;
+
+                            pData = RTMemAllocZ(pMipmapLevel->cbSurface);
+                            AssertReturn(pData, VERR_NO_MEMORY);
+
+                            glGetIntegerv(GL_TEXTURE_BINDING_2D, &activeTexture);
+                            VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+                            glBindTexture(GL_TEXTURE_2D, pSurface->oglId.texture);
+                            VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+                            glGetTexImage(GL_TEXTURE_2D,
+                                          i,
+                                          pSurface->formatGL, 
+                                          pSurface->typeGL, 
+                                          pData);
+                            VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+
+                            /* Data follows */
+                            rc = SSMR3PutBool(pSSM, true);
+                            AssertRCReturn(rc, rc);
+
+                            /* And write the surface data. */
+                            rc = SSMR3PutMem(pSSM, pData, pMipmapLevel->cbSurface);
+                            AssertRCReturn(rc, rc);
+
+                            /* Restore the old active texture. */
+                            glBindTexture(GL_TEXTURE_2D, activeTexture);
+                            VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+                            break;
+                        }
+
+                        case SVGA3D_SURFACE_HINT_VERTEXBUFFER:
+                        case SVGA3D_SURFACE_HINT_INDEXBUFFER:
+                        {
+                            uint8_t *pBufferData;
+
+                            pState->ext.glBindBuffer(GL_ARRAY_BUFFER, pSurface->oglId.buffer);
+                            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+                            pBufferData = (uint8_t *)pState->ext.glMapBuffer(GL_ARRAY_BUFFER, GL_READ_ONLY);
+                            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+                            Assert(pBufferData);
+
+                            /* Data follows */
+                            rc = SSMR3PutBool(pSSM, true);
+                            AssertRCReturn(rc, rc);
+
+                            /* And write the surface data. */
+                            rc = SSMR3PutMem(pSSM, pBufferData, pMipmapLevel->cbSurface);
+                            AssertRCReturn(rc, rc);
+
+                            pState->ext.glUnmapBuffer(GL_ARRAY_BUFFER);
+                            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+                            pState->ext.glBindBuffer(GL_ARRAY_BUFFER, 0);
+                            VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
+
+                        }
+                        }
+                        if (pData)
+                            RTMemFree(pData);
+#else
+#error "Unexpected 3d backend"
+#endif
+                    }
+                }
+            }
+        }
+    }
+    return VINF_SUCCESS;
+}
+
+static uint32_t vmsvga3dSaveShaderConst(PVMSVGA3DCONTEXT pContext, uint32_t reg, SVGA3dShaderType type, SVGA3dShaderConstType ctype, uint32_t val1, uint32_t val2, uint32_t val3, uint32_t val4)
+{
+    /* Choose a sane upper limit. */
+    AssertReturn(reg < _32K, VERR_INVALID_PARAMETER);
+
+    if (type == SVGA3D_SHADERTYPE_VS)
+    {
+        if (pContext->state.cVertexShaderConst <= reg)
+        {
+            pContext->state.paVertexShaderConst = (PVMSVGASHADERCONST)RTMemRealloc(pContext->state.paVertexShaderConst, sizeof(VMSVGASHADERCONST) * (reg + 1));
+            AssertReturn(pContext->state.paVertexShaderConst, VERR_NO_MEMORY);
+            for (uint32_t i = pContext->state.cVertexShaderConst; i < reg + 1; i++)
+                pContext->state.paVertexShaderConst[i].fValid = false;
+            pContext->state.cVertexShaderConst = reg + 1;
+        }
+
+        pContext->state.paVertexShaderConst[reg].fValid   = true;
+        pContext->state.paVertexShaderConst[reg].ctype    = ctype;
+        pContext->state.paVertexShaderConst[reg].value[0] = val1;
+        pContext->state.paVertexShaderConst[reg].value[1] = val2;
+        pContext->state.paVertexShaderConst[reg].value[2] = val3;
+        pContext->state.paVertexShaderConst[reg].value[3] = val4;
+    }
+    else
+    {
+        Assert(type == SVGA3D_SHADERTYPE_PS);
+        if (pContext->state.cPixelShaderConst <= reg)
+        {
+            pContext->state.paPixelShaderConst = (PVMSVGASHADERCONST)RTMemRealloc(pContext->state.paPixelShaderConst, sizeof(VMSVGASHADERCONST) * (reg + 1));
+            AssertReturn(pContext->state.paPixelShaderConst, VERR_NO_MEMORY);
+            for (uint32_t i = pContext->state.cPixelShaderConst; i < reg + 1; i++)
+                pContext->state.paPixelShaderConst[i].fValid = false;
+            pContext->state.cPixelShaderConst = reg + 1;
+        }
+
+        pContext->state.paPixelShaderConst[reg].fValid   = true;
+        pContext->state.paPixelShaderConst[reg].ctype    = ctype;
+        pContext->state.paPixelShaderConst[reg].value[0] = val1;
+        pContext->state.paPixelShaderConst[reg].value[1] = val2;
+        pContext->state.paPixelShaderConst[reg].value[2] = val3;
+        pContext->state.paPixelShaderConst[reg].value[3] = val4;
+    }
+
+    return VINF_SUCCESS;
+}
+
+
+#endif  /* __DEVVMWARE3D_STATE_H__ */
Index: trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp
===================================================================
--- trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp	(revision 53206)
+++ trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp	(revision 53206)
@@ -0,0 +1,6285 @@
+/** @file
+ * DevVMWare - VMWare SVGA device
+ */
+
+/*
+ * Copyright (C) 2013 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#define LOG_GROUP LOG_GROUP_DEV_VMSVGA
+#include <VBox/vmm/pdmdev.h>
+#include <VBox/version.h>
+#include <VBox/err.h>
+#include <VBox/log.h>
+#include <VBox/vmm/pgm.h>
+
+#include <iprt/assert.h>
+#include <iprt/semaphore.h>
+#include <iprt/uuid.h>
+#include <iprt/mem.h>
+#include <iprt/avl.h>
+
+#include <VBox/VMMDev.h>
+#include <VBox/VBoxVideo.h>
+#include <VBox/bioslogo.h>
+
+/* should go BEFORE any other DevVGA include to make all DevVGA.h config defines be visible */
+#include "DevVGA.h"
+
+#include "DevVGA-SVGA.h"
+#include "DevVGA-SVGA3d.h"
+#include "vmsvga/svga_reg.h"
+#include "vmsvga/svga3d_reg.h"
+#include "vmsvga/svga3d_shaderdefs.h"
+
+#include <d3d9.h>
+
+/* Enable to disassemble defined shaders. */
+//#define DUMP_SHADER_DISASSEMBLY
+
+#ifdef DUMP_SHADER_DISASSEMBLY
+#include <d3dx9shader.h>
+#endif
+
+/* Enable to render the result of DrawPrimitive in a seperate window. */
+//#define DEBUG_GFX_WINDOW
+
+/* Enable to use Wine to convert D3D to opengl */
+//#define VBOX_VMSVGA3D_WITH_OPENGL
+
+#define FOURCC_INTZ     (D3DFORMAT)MAKEFOURCC('I', 'N', 'T', 'Z')
+#define FOURCC_NULL     (D3DFORMAT)MAKEFOURCC('N', 'U', 'L', 'L')
+
+/*******************************************************************************
+*   Structures and Typedefs                                                    *
+*******************************************************************************/
+
+typedef struct
+{
+    SVGA3dSize              size;
+    uint32_t                cbSurface;
+    uint32_t                cbSurfacePitch;
+    void                   *pSurfaceData;
+    bool                    fDirty;
+} VMSVGA3DMIPMAPLEVEL, *PVMSVGA3DMIPMAPLEVEL;
+
+/**
+ * SSM descriptor table for the VMSVGA3DMIPMAPLEVEL structure.
+ */
+static SSMFIELD const g_aVMSVGA3DMIPMAPLEVELFields[] =
+{
+    SSMFIELD_ENTRY(                 VMSVGA3DMIPMAPLEVEL, size),
+    SSMFIELD_ENTRY(                 VMSVGA3DMIPMAPLEVEL, cbSurface),
+    SSMFIELD_ENTRY(                 VMSVGA3DMIPMAPLEVEL, cbSurfacePitch),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DMIPMAPLEVEL, pSurfaceData),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DMIPMAPLEVEL, fDirty),
+    SSMFIELD_ENTRY_TERM()
+};
+
+typedef struct
+{
+    /* Key is context id. */
+    AVLU32NODECORE          Core;
+    union
+    {
+        IDirect3DSurface9          *pSurface;
+        IDirect3DTexture9          *pTexture;
+        IDirect3DCubeTexture9      *pCubeTexture;
+    } u;
+} VMSVGA3DSHAREDSURFACE, *PVMSVGA3DSHAREDSURFACE;
+
+typedef struct
+{
+    uint32_t                id;
+    uint32_t                idAssociatedContext;
+    uint32_t                flags;
+    SVGA3dSurfaceFormat     format; 
+    SVGA3dSurfaceFace       faces[SVGA3D_MAX_SURFACE_FACES];
+    uint32_t                cFaces;
+    PVMSVGA3DMIPMAPLEVEL    pMipmapLevels; 
+    uint32_t                multiSampleCount;
+    SVGA3dTextureFilter     autogenFilter;
+    D3DFORMAT               formatD3D;
+    DWORD                   fUsageD3D;
+    D3DMULTISAMPLE_TYPE     multiSampleTypeD3D;
+    uint32_t                cbBlock;        /* block/pixel size in bytes */
+    /* Dirty state; surface was manually updated. */
+    bool                    fDirty;
+    /* Handle for shared objects (currently only textures & render targets). */
+    HANDLE                  hSharedObject;
+    /** Event query inserted after each GPU operation that updates or uses this surface. */
+    IDirect3DQuery9        *pQuery;
+    union
+    {
+        IDirect3DSurface9          *pSurface;
+        IDirect3DCubeTexture9      *pCubeTexture;
+        IDirect3DIndexBuffer9      *pIndexBuffer;
+        IDirect3DTexture9          *pTexture;
+        IDirect3DVertexBuffer9     *pVertexBuffer;
+    } u;
+    union
+    {
+        IDirect3DTexture9          *pTexture;
+    } bounce;
+    AVLU32TREE              pSharedObjectTree;
+    bool                    fStencilAsTexture;
+} VMSVGA3DSURFACE, *PVMSVGA3DSURFACE;
+
+/**
+ * SSM descriptor table for the VMSVGA3DSURFACE structure.
+ */
+static SSMFIELD const g_aVMSVGA3DSURFACEFields[] =
+{
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, id),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, idAssociatedContext),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, flags),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, format),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, faces),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, cFaces),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSURFACE, pMipmapLevels),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, multiSampleCount),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, autogenFilter),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, format),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSURFACE, formatD3D),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSURFACE, fUsageD3D),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSURFACE, multiSampleTypeD3D),
+    SSMFIELD_ENTRY(                 VMSVGA3DSURFACE, cbBlock),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSURFACE, fDirty),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSURFACE, hSharedObject),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSURFACE, pQuery),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSURFACE, u.pSurface),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSURFACE, bounce.pTexture),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSURFACE, pSharedObjectTree),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSURFACE, fStencilAsTexture),
+    SSMFIELD_ENTRY_TERM()
+};
+
+typedef struct
+{
+    uint32_t                        id;
+    uint32_t                        cid;
+    SVGA3dShaderType                type;
+    uint32_t                        cbData;
+    void                           *pShaderProgram;
+    union
+    {
+        IDirect3DVertexShader9     *pVertexShader;
+        IDirect3DPixelShader9      *pPixelShader;
+    } u;
+} VMSVGA3DSHADER, *PVMSVGA3DSHADER;
+
+/**
+ * SSM descriptor table for the VMSVGA3DSHADER structure.
+ */
+static SSMFIELD const g_aVMSVGA3DSHADERFields[] =
+{
+    SSMFIELD_ENTRY(                 VMSVGA3DSHADER, id),
+    SSMFIELD_ENTRY(                 VMSVGA3DSHADER, cid),
+    SSMFIELD_ENTRY(                 VMSVGA3DSHADER, type),
+    SSMFIELD_ENTRY(                 VMSVGA3DSHADER, cbData),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSHADER, pShaderProgram),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSHADER, u.pVertexShader),
+    SSMFIELD_ENTRY_TERM()
+};
+
+typedef struct
+{
+    bool        fValid;
+    float       matrix[16];
+} VMSVGATRANSFORMSTATE, *PVMSVGATRANSFORMSTATE;
+
+typedef struct
+{
+    bool            fValid;
+    SVGA3dMaterial  material;
+} VMSVGAMATERIALSTATE, *PVMSVGAMATERIALSTATE;
+
+typedef struct
+{
+    bool            fValid;
+    float           plane[4];
+} VMSVGACLIPPLANESTATE, *PVMSVGACLIPPLANESTATE;
+
+typedef struct
+{
+    bool            fEnabled;
+    bool            fValidData;
+    SVGA3dLightData data;
+} VMSVGALIGHTSTATE, *PVMSVGALIGHTSTATE;
+
+typedef struct
+{
+    bool                    fValid;
+    SVGA3dShaderConstType   ctype;
+    uint32_t                value[4];
+} VMSVGASHADERCONST, *PVMSVGASHADERCONST;
+
+/**
+ * SSM descriptor table for the VMSVGASHADERCONST structure.
+ */
+static SSMFIELD const g_aVMSVGASHADERCONSTFields[] =
+{
+    SSMFIELD_ENTRY(                 VMSVGASHADERCONST, fValid),
+    SSMFIELD_ENTRY(                 VMSVGASHADERCONST, ctype),
+    SSMFIELD_ENTRY(                 VMSVGASHADERCONST, value),
+    SSMFIELD_ENTRY_TERM()
+};
+
+#define VMSVGA3D_UPDATE_SCISSORRECT     RT_BIT(0)
+#define VMSVGA3D_UPDATE_ZRANGE          RT_BIT(1)
+#define VMSVGA3D_UPDATE_VIEWPORT        RT_BIT(2)
+#define VMSVGA3D_UPDATE_VERTEXSHADER    RT_BIT(3)
+#define VMSVGA3D_UPDATE_PIXELSHADER     RT_BIT(4)
+#define VMSVGA3D_UPDATE_TRANSFORM       RT_BIT(5)
+#define VMSVGA3D_UPDATE_MATERIAL        RT_BIT(6)
+
+typedef struct
+{
+    uint32_t                id;
+#ifdef VBOX_VMSVGA3D_WITH_OPENGL
+    IDirect3DDevice9       *pDevice;
+#else
+    IDirect3DDevice9Ex     *pDevice;
+#endif
+    HWND                    hwnd;
+    /* Current active render target (if any) */
+    uint32_t                sidRenderTarget;
+    /* Current selected texture surfaces (if any) */
+    uint32_t                aSidActiveTexture[SVGA3D_MAX_TEXTURE_STAGE];
+    /* Per context pixel and vertex shaders. */
+    uint32_t                cPixelShaders;
+    PVMSVGA3DSHADER         paPixelShader;
+    uint32_t                cVertexShaders;
+    PVMSVGA3DSHADER         paVertexShader;
+    /* Keep track of the internal state to be able to recreate the context properly (save/restore, window resize). */
+    struct
+    {
+        uint32_t                u32UpdateFlags;
+
+        SVGA3dRenderState       aRenderState[SVGA3D_RS_MAX];
+        SVGA3dTextureState      aTextureState[SVGA3D_MAX_TEXTURE_STAGE][SVGA3D_TS_MAX];
+        VMSVGATRANSFORMSTATE    aTransformState[SVGA3D_TRANSFORM_MAX];
+        VMSVGAMATERIALSTATE     aMaterial[SVGA3D_FACE_MAX];
+        VMSVGACLIPPLANESTATE    aClipPlane[SVGA3D_CLIPPLANE_MAX];
+        VMSVGALIGHTSTATE        aLightData[SVGA3D_MAX_LIGHTS];
+
+        uint32_t                aRenderTargets[SVGA3D_RT_MAX];
+        SVGA3dRect              RectScissor;
+        SVGA3dRect              RectViewPort;
+        SVGA3dZRange            zRange;
+        uint32_t                shidPixel;
+        uint32_t                shidVertex;
+
+        uint32_t                cPixelShaderConst;
+        PVMSVGASHADERCONST      paPixelShaderConst;
+        uint32_t                cVertexShaderConst;
+        PVMSVGASHADERCONST      paVertexShaderConst;
+    } state;
+} VMSVGA3DCONTEXT, *PVMSVGA3DCONTEXT;
+
+/**
+ * SSM descriptor table for the VMSVGA3DCONTEXT structure.
+ */
+static SSMFIELD const g_aVMSVGA3DCONTEXTFields[] =
+{
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, id),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DCONTEXT, pDevice),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DCONTEXT, hwnd),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DCONTEXT, sidRenderTarget),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DCONTEXT, aSidActiveTexture),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, cPixelShaders),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DCONTEXT, paPixelShader),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, cVertexShaders),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DCONTEXT, paVertexShader),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.u32UpdateFlags),
+
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.aRenderState),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.aTextureState),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.aTransformState),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.aMaterial),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.aClipPlane),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.aLightData),
+
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.aRenderTargets),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.RectScissor),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.RectViewPort),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.zRange),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.shidPixel),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.shidVertex),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.cPixelShaderConst),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DCONTEXT, state.paPixelShaderConst),
+    SSMFIELD_ENTRY(                 VMSVGA3DCONTEXT, state.cVertexShaderConst),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DCONTEXT, state.paVertexShaderConst),
+    SSMFIELD_ENTRY_TERM()
+};
+
+typedef struct
+{
+#ifdef VBOX_VMSVGA3D_WITH_OPENGL
+    IDirect3D9             *pD3D9;
+#else
+    IDirect3D9Ex           *pD3D9;
+#endif
+    D3DCAPS9                caps; 
+
+    /** Window Thread. */
+    R3PTRTYPE(RTTHREAD)     pWindowThread;
+    HMODULE                 hInstance;
+    /** Window request semaphore. */
+    RTSEMEVENT              WndRequestSem;
+
+    uint32_t                cContexts;
+    uint32_t                cSurfaces;
+    PVMSVGA3DCONTEXT        paContext;
+    PVMSVGA3DSURFACE        paSurface;
+
+    bool                    fSupportedSurfaceINTZ;
+    bool                    fSupportedSurfaceNULL;
+} VMSVGA3DSTATE, *PVMSVGA3DSTATE;
+
+/**
+ * SSM descriptor table for the VMSVGA3DSTATE structure.
+ */
+static SSMFIELD const g_aVMSVGA3DSTATEFields[] =
+{
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSTATE, pD3D9),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSTATE, caps),
+
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSTATE, pWindowThread),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSTATE, hInstance),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSTATE, WndRequestSem),
+
+    SSMFIELD_ENTRY(                 VMSVGA3DSTATE, cContexts),
+    SSMFIELD_ENTRY(                 VMSVGA3DSTATE, cSurfaces),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSTATE, paContext),
+    SSMFIELD_ENTRY_IGN_HCPTR(       VMSVGA3DSTATE, paSurface),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSTATE, fSupportedSurfaceINTZ),
+    SSMFIELD_ENTRY_IGNORE(          VMSVGA3DSTATE, fSupportedSurfaceNULL),
+    SSMFIELD_ENTRY_TERM()
+};
+
+typedef struct
+{
+    DWORD                   Usage;
+    D3DRESOURCETYPE         ResourceType;
+    SVGA3dFormatOp          FormatOp;
+} VMSVGA3DFORMATSUPPORT;
+
+VMSVGA3DFORMATSUPPORT aFormatSupport[] = 
+{
+    {
+        0,
+        D3DRTYPE_SURFACE,
+        SVGA3DFORMAT_OP_OFFSCREENPLAIN,
+    },
+    {
+        D3DUSAGE_RENDERTARGET,
+        D3DRTYPE_SURFACE,
+        (SVGA3dFormatOp) (SVGA3DFORMAT_OP_OFFSCREEN_RENDERTARGET | SVGA3DFORMAT_OP_SAME_FORMAT_RENDERTARGET),
+    },
+    {
+        D3DUSAGE_AUTOGENMIPMAP,
+        D3DRTYPE_TEXTURE,
+        SVGA3DFORMAT_OP_AUTOGENMIPMAP,
+    },
+    {
+        D3DUSAGE_DMAP,
+        D3DRTYPE_TEXTURE,
+        SVGA3DFORMAT_OP_DMAP,
+    },
+    {
+        0,
+        D3DRTYPE_TEXTURE,
+        SVGA3DFORMAT_OP_TEXTURE,
+    },
+    {
+        0,
+        D3DRTYPE_CUBETEXTURE,
+        SVGA3DFORMAT_OP_CUBETEXTURE,
+    },
+    {
+        0,
+        D3DRTYPE_VOLUMETEXTURE,
+        SVGA3DFORMAT_OP_VOLUMETEXTURE,
+    },
+    {
+        D3DUSAGE_QUERY_VERTEXTEXTURE,
+        D3DRTYPE_TEXTURE,
+        SVGA3DFORMAT_OP_VERTEXTEXTURE,
+    },
+    {
+        D3DUSAGE_QUERY_LEGACYBUMPMAP,
+        D3DRTYPE_TEXTURE,
+        SVGA3DFORMAT_OP_BUMPMAP,
+    },
+    {
+        D3DUSAGE_QUERY_SRGBREAD,
+        D3DRTYPE_TEXTURE,
+        SVGA3DFORMAT_OP_SRGBREAD,
+    },
+    {
+        D3DUSAGE_QUERY_SRGBWRITE,
+        D3DRTYPE_TEXTURE,
+        SVGA3DFORMAT_OP_SRGBWRITE,
+    }
+};
+
+VMSVGA3DFORMATSUPPORT aFeatureReject[] = 
+{
+    {
+        D3DUSAGE_QUERY_WRAPANDMIP,
+        D3DRTYPE_TEXTURE,
+        SVGA3DFORMAT_OP_NOTEXCOORDWRAPNORMIP
+    },
+    {
+        D3DUSAGE_QUERY_FILTER,
+        D3DRTYPE_TEXTURE,
+        SVGA3DFORMAT_OP_NOFILTER
+    },
+    {
+        D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING,
+        D3DRTYPE_TEXTURE, /* ?? */
+        SVGA3DFORMAT_OP_NOALPHABLEND
+    },    
+};
+
+static void vmsvgaDumpD3DCaps(D3DCAPS9 *pCaps);
+static int vmsvga3dCreateTexture(PVMSVGA3DCONTEXT pContext, uint32_t idAssociatedContext, PVMSVGA3DSURFACE pSurface);
+
+RT_C_DECLS_BEGIN
+RT_C_DECLS_END
+
+int vmsvga3dInit(PVGASTATE pThis)
+{
+    PVMSVGA3DSTATE pState;
+    int rc;
+
+    pThis->svga.p3dState = RTMemAllocZ(sizeof(VMSVGA3DSTATE));
+    AssertReturn(pThis->svga.p3dState, VERR_NO_MEMORY);
+    pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+
+    /* Create event semaphore. */
+    rc = RTSemEventCreate(&pState->WndRequestSem);
+    if (RT_FAILURE(rc))
+    {
+        Log(("%s: Failed to create event semaphore for window handling.\n", __FUNCTION__));
+        return rc;
+    }
+
+    /* Create the async IO thread. */
+    rc = RTThreadCreate(&pState->pWindowThread, vmsvga3dWindowThread, pState->WndRequestSem, 0, RTTHREADTYPE_GUI, 0, "VMSVGA3DWND");
+    if (RT_FAILURE(rc))
+    {
+        AssertMsgFailed(("%s: Async IO Thread creation for 3d window handling failed rc=%d\n", __FUNCTION__, rc));
+        return rc;
+    }
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dPowerOn(PVGASTATE pThis)
+{
+    PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pThis->svga.p3dState, VERR_NO_MEMORY);
+    HRESULT hr;
+
+    if (pState->pD3D9)
+        return VINF_SUCCESS;    /* already initialized (load state) */
+
+#ifdef VBOX_VMSVGA3D_WITH_OPENGL
+    pState->pD3D9 = Direct3DCreate9(D3D_SDK_VERSION);
+    AssertReturn(pState->pD3D9, VERR_INTERNAL_ERROR);
+#else
+    hr = Direct3DCreate9Ex(D3D_SDK_VERSION, &pState->pD3D9);
+    AssertReturn(hr == D3D_OK, VERR_INTERNAL_ERROR);
+#endif
+    hr = pState->pD3D9->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &pState->caps);
+    AssertReturn(hr == D3D_OK, VERR_INTERNAL_ERROR);
+
+    vmsvgaDumpD3DCaps(&pState->caps);
+
+    /* Check if INTZ is supported. */
+    hr = pState->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT, 
+                                          D3DDEVTYPE_HAL,
+                                          D3DFMT_X8R8G8B8,    /* assume standard 32-bit display mode */
+                                          0,
+                                          D3DRTYPE_TEXTURE,
+                                          FOURCC_INTZ);
+    if (hr != D3D_OK)
+    {
+        /* INTZ support is essential to support depth surfaces used as textures. */
+        LogRel(("VMSVGA: texture format INTZ not supported!!!\n"));
+    }
+    else
+        pState->fSupportedSurfaceINTZ = true;
+
+    /* Check if NULL is supported. */
+    hr = pState->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT, 
+                                          D3DDEVTYPE_HAL,
+                                          D3DFMT_X8R8G8B8,    /* assume standard 32-bit display mode */
+                                          D3DUSAGE_RENDERTARGET,
+                                          D3DRTYPE_SURFACE,
+                                          FOURCC_NULL);
+    if (hr != D3D_OK)
+    {
+        /* NULL is a dummy surface which can be used as a render target to save memory. */
+        LogRel(("VMSVGA: surface format NULL not supported!!!\n"));
+    }
+    else
+        pState->fSupportedSurfaceNULL = true;
+
+
+    /*  Check if DX9 depth stencil textures are supported */
+    hr = pState->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT, 
+                                          D3DDEVTYPE_HAL,
+                                          D3DFMT_X8R8G8B8,    /* assume standard 32-bit display mode */
+                                          D3DUSAGE_DEPTHSTENCIL,
+                                          D3DRTYPE_TEXTURE,
+                                          D3DFMT_D16);
+    if (hr != D3D_OK)
+    {
+        LogRel(("VMSVGA: texture format D3DFMT_D16 not supported\n"));
+    }
+
+    hr = pState->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT, 
+                                          D3DDEVTYPE_HAL,
+                                          D3DFMT_X8R8G8B8,    /* assume standard 32-bit display mode */
+                                          D3DUSAGE_DEPTHSTENCIL,
+                                          D3DRTYPE_TEXTURE,
+                                          D3DFMT_D24X8);
+    if (hr != D3D_OK)
+    {
+        LogRel(("VMSVGA: texture format D3DFMT_D24X8 not supported\n"));
+    }
+    hr = pState->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT, 
+                                          D3DDEVTYPE_HAL,
+                                          D3DFMT_X8R8G8B8,    /* assume standard 32-bit display mode */
+                                          D3DUSAGE_DEPTHSTENCIL,
+                                          D3DRTYPE_TEXTURE,
+                                          D3DFMT_D24S8);
+    if (hr != D3D_OK)
+    {
+        LogRel(("VMSVGA: texture format D3DFMT_D24S8 not supported\n"));
+    }
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dReset(PVGASTATE pThis)
+{
+    PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pThis->svga.p3dState, VERR_NO_MEMORY);
+
+    /* Destroy all leftover surfaces. */
+    for (uint32_t i = 0; i < pState->cSurfaces; i++)
+    {
+        if (pState->paSurface[i].id != SVGA3D_INVALID_ID)
+            vmsvga3dSurfaceDestroy(pThis, pState->paSurface[i].id);
+    }
+
+    /* Destroy all leftover contexts. */
+    for (uint32_t i = 0; i < pState->cContexts; i++)
+    {
+        if (pState->paContext[i].id != SVGA3D_INVALID_ID)
+            vmsvga3dContextDestroy(pThis, pState->paContext[i].id);
+    }
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dTerminate(PVGASTATE pThis)
+{
+    PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pThis->svga.p3dState, VERR_NO_MEMORY);
+
+    int rc = vmsvga3dReset(pThis);
+    AssertRCReturn(rc, rc);
+
+    /* Terminate the window creation thread. */
+    rc = vmsvga3dSendThreadMessage(pState->pWindowThread, pState->WndRequestSem, WM_VMSVGA3D_EXIT, 0, 0);
+    AssertRCReturn(rc, rc);
+
+    RTSemEventDestroy(pState->WndRequestSem);
+
+    if (pState->pD3D9)
+        pState->pD3D9->Release();
+
+    return VINF_SUCCESS;
+}
+
+/* Shared functions that depend on private structure definitions. */
+#define VMSVGA3D_DIRECT3D
+#include "DevVGA-SVGA3d-shared.h"
+
+
+static uint32_t vmsvga3dGetSurfaceFormatSupport(PVMSVGA3DSTATE pState3D, uint32_t idx3dCaps, D3DFORMAT format)
+{
+    NOREF(idx3dCaps);
+    HRESULT  hr;
+    uint32_t result = 0;
+
+    /* Try if the format can be used for the primary display. */
+    hr = pState3D->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT, 
+                                            D3DDEVTYPE_HAL,
+                                            format,
+                                            0,
+                                            D3DRTYPE_SURFACE,
+                                            format);
+
+    for (unsigned i = 0; i < RT_ELEMENTS(aFormatSupport); i++)
+    {
+        hr = pState3D->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT, 
+                                                D3DDEVTYPE_HAL,
+                                                D3DFMT_X8R8G8B8,    /* assume standard 32-bit display mode */
+                                                aFormatSupport[i].Usage,
+                                                aFormatSupport[i].ResourceType,
+                                                format);
+        if (hr == D3D_OK)
+            result |= aFormatSupport[i].FormatOp;
+    }
+
+    /* Check for features only if the format is supported in any form. */
+    if (result)
+    {
+        for (unsigned i = 0; i < RT_ELEMENTS(aFeatureReject); i++)
+        {
+            hr = pState3D->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT, 
+                                                    D3DDEVTYPE_HAL,
+                                                    D3DFMT_X8R8G8B8,    /* assume standard 32-bit display mode */
+                                                    aFeatureReject[i].Usage,
+                                                    aFeatureReject[i].ResourceType,
+                                                    format);
+            if (hr != D3D_OK)
+                result |= aFeatureReject[i].FormatOp;
+        }
+    }
+
+    /* @todo missing:
+     * 
+     * SVGA3DFORMAT_OP_PIXELSIZE
+     */
+
+    switch (idx3dCaps)
+    {
+    case SVGA3D_DEVCAP_SURFACEFMT_X8R8G8B8:
+    case SVGA3D_DEVCAP_SURFACEFMT_X1R5G5B5:
+    case SVGA3D_DEVCAP_SURFACEFMT_R5G6B5:
+        result |= SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB 
+               |  SVGA3DFORMAT_OP_CONVERT_TO_ARGB
+               |  SVGA3DFORMAT_OP_DISPLAYMODE           /* Should not be set for alpha formats. */
+               |  SVGA3DFORMAT_OP_3DACCELERATION;       /* implies OP_DISPLAYMODE */
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_A8R8G8B8:
+    case SVGA3D_DEVCAP_SURFACEFMT_A2R10G10B10:
+    case SVGA3D_DEVCAP_SURFACEFMT_A1R5G5B5:
+    case SVGA3D_DEVCAP_SURFACEFMT_A4R4G4B4:
+        result |= SVGA3DFORMAT_OP_MEMBEROFGROUP_ARGB 
+               |  SVGA3DFORMAT_OP_CONVERT_TO_ARGB
+               |  SVGA3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET;
+        break;
+
+    }
+    Log(("CAPS: %s =\n%s\n", vmsvga3dGetCapString(idx3dCaps), vmsvga3dGet3dFormatString(result)));
+
+    return result;
+}
+
+static uint32_t vmsvga3dGetDepthFormatSupport(PVMSVGA3DSTATE pState3D, uint32_t idx3dCaps, D3DFORMAT format)
+{
+    HRESULT  hr;
+    uint32_t result = 0;
+        
+    hr = pState3D->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT, 
+                                            D3DDEVTYPE_HAL,
+                                            D3DFMT_X8R8G8B8,    /* assume standard 32-bit display mode */
+                                            D3DUSAGE_DEPTHSTENCIL,
+                                            D3DRTYPE_SURFACE,
+                                            format);
+    if (hr == D3D_OK)
+        result =  SVGA3DFORMAT_OP_ZSTENCIL 
+                | SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH
+                | SVGA3DFORMAT_OP_TEXTURE /* Necessary for Ubuntu Unity */;
+
+    Log(("CAPS: %s =\n%s\n", vmsvga3dGetCapString(idx3dCaps), vmsvga3dGet3dFormatString(result)));
+    return result;
+}
+
+
+int vmsvga3dQueryCaps(PVGASTATE pThis, uint32_t idx3dCaps, uint32_t *pu32Val)
+{
+    PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+    D3DCAPS9 *pCaps = &pState->caps;
+    int       rc = VINF_SUCCESS;
+
+    *pu32Val = 0;
+
+    switch (idx3dCaps)
+    {
+    case SVGA3D_DEVCAP_3D:
+        *pu32Val = 1; /* boolean? */
+        break;
+
+    case SVGA3D_DEVCAP_MAX_LIGHTS:
+        *pu32Val = pCaps->MaxActiveLights;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_TEXTURES:
+        *pu32Val = pCaps->MaxSimultaneousTextures;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_CLIP_PLANES:
+        *pu32Val = pCaps->MaxUserClipPlanes;
+        break;
+
+    case SVGA3D_DEVCAP_VERTEX_SHADER_VERSION:
+        switch (pCaps->VertexShaderVersion)
+        {
+        case D3DVS_VERSION(1,1):
+            *pu32Val = SVGA3DVSVERSION_11;
+            break;
+        case D3DVS_VERSION(2,0):
+            *pu32Val = SVGA3DVSVERSION_20;
+            break;
+        case D3DVS_VERSION(3,0):
+            *pu32Val = SVGA3DVSVERSION_30;
+            break;
+        case D3DVS_VERSION(4,0):
+            *pu32Val = SVGA3DVSVERSION_40;
+            break;
+        default:
+            LogRel(("VMSVGA: Unsupported vertex shader version %x\n", pCaps->VertexShaderVersion));
+            break;
+        }
+        break;
+
+    case SVGA3D_DEVCAP_VERTEX_SHADER:
+        /* boolean? */
+        *pu32Val = 1;
+        break;
+
+    case SVGA3D_DEVCAP_FRAGMENT_SHADER_VERSION:
+        switch (pCaps->PixelShaderVersion)
+        {
+        case D3DPS_VERSION(1,1):
+            *pu32Val = SVGA3DPSVERSION_11;
+            break;
+        case D3DPS_VERSION(1,2):
+            *pu32Val = SVGA3DPSVERSION_12;
+            break;
+        case D3DPS_VERSION(1,3):
+            *pu32Val = SVGA3DPSVERSION_13;
+            break;
+        case D3DPS_VERSION(1,4):
+            *pu32Val = SVGA3DPSVERSION_14;
+            break;
+        case D3DPS_VERSION(2,0):
+            *pu32Val = SVGA3DPSVERSION_20;
+            break;
+        case D3DPS_VERSION(3,0):
+            *pu32Val = SVGA3DPSVERSION_30;
+            break;
+        case D3DPS_VERSION(4,0):
+            *pu32Val = SVGA3DPSVERSION_40;
+            break;
+        default:
+            LogRel(("VMSVGA: Unsupported pixel shader version %x\n", pCaps->PixelShaderVersion));
+            break;
+        }
+        break;
+
+    case SVGA3D_DEVCAP_FRAGMENT_SHADER:
+        /* boolean? */
+        *pu32Val = 1;
+        break;
+
+    case SVGA3D_DEVCAP_S23E8_TEXTURES:
+    case SVGA3D_DEVCAP_S10E5_TEXTURES:
+        /* Must be obsolete by now; surface format caps specify the same thing. */
+        rc = VERR_INVALID_PARAMETER;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_FIXED_VERTEXBLEND:
+        break;
+
+    /*
+     *   2. The BUFFER_FORMAT capabilities are deprecated, and they always
+     *      return TRUE. Even on physical hardware that does not support
+     *      these formats natively, the SVGA3D device will provide an emulation
+     *      which should be invisible to the guest OS.
+     */
+    case SVGA3D_DEVCAP_D16_BUFFER_FORMAT:
+    case SVGA3D_DEVCAP_D24S8_BUFFER_FORMAT:
+    case SVGA3D_DEVCAP_D24X8_BUFFER_FORMAT:
+        *pu32Val = 1;
+        break;
+
+    case SVGA3D_DEVCAP_QUERY_TYPES:
+        break;
+
+    case SVGA3D_DEVCAP_TEXTURE_GRADIENT_SAMPLING:
+        break;
+
+    case SVGA3D_DEVCAP_MAX_POINT_SIZE:
+        AssertCompile(sizeof(uint32_t) == sizeof(float));
+        *(float *)pu32Val = pCaps->MaxPointSize;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_SHADER_TEXTURES:
+        /* @todo ?? */
+        rc = VERR_INVALID_PARAMETER;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_TEXTURE_WIDTH:
+        *pu32Val = pCaps->MaxTextureWidth;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_TEXTURE_HEIGHT:
+        *pu32Val = pCaps->MaxTextureHeight;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_VOLUME_EXTENT:
+        *pu32Val = pCaps->MaxVolumeExtent;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_TEXTURE_REPEAT:
+        *pu32Val = pCaps->MaxTextureRepeat;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_TEXTURE_ASPECT_RATIO:
+        *pu32Val = pCaps->MaxTextureAspectRatio;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_TEXTURE_ANISOTROPY:
+        *pu32Val = pCaps->MaxAnisotropy;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_PRIMITIVE_COUNT:
+        *pu32Val = pCaps->MaxPrimitiveCount;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_VERTEX_INDEX:
+        *pu32Val = pCaps->MaxVertexIndex;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_VERTEX_SHADER_INSTRUCTIONS:
+        *pu32Val = pCaps->MaxVertexShader30InstructionSlots;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_INSTRUCTIONS:
+        *pu32Val = pCaps->MaxPixelShader30InstructionSlots;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEMPS:
+        *pu32Val = pCaps->VS20Caps.NumTemps;
+        break;
+
+    case SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_TEMPS:
+        *pu32Val = pCaps->PS20Caps.NumTemps;
+        break;
+
+    case SVGA3D_DEVCAP_TEXTURE_OPS:
+        break;
+
+    case SVGA3D_DEVCAP_MULTISAMPLE_NONMASKABLESAMPLES:
+        break;
+
+    case SVGA3D_DEVCAP_MULTISAMPLE_MASKABLESAMPLES:
+        break;
+
+    case SVGA3D_DEVCAP_ALPHATOCOVERAGE:
+        break;
+
+    case SVGA3D_DEVCAP_SUPERSAMPLE:
+        break;
+
+    case SVGA3D_DEVCAP_AUTOGENMIPMAPS:
+        *pu32Val = !!(pCaps->Caps2 & D3DCAPS2_CANAUTOGENMIPMAP);
+        break;
+
+    case SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEXTURES:
+        break;
+
+    case SVGA3D_DEVCAP_MAX_RENDER_TARGETS:  /* @todo same thing? */
+    case SVGA3D_DEVCAP_MAX_SIMULTANEOUS_RENDER_TARGETS:
+        *pu32Val = pCaps->NumSimultaneousRTs;
+        break;
+
+    /*
+     * This is the maximum number of SVGA context IDs that the guest
+     * can define using SVGA_3D_CMD_CONTEXT_DEFINE.
+     */
+    case SVGA3D_DEVCAP_MAX_CONTEXT_IDS:
+        *pu32Val = SVGA3D_MAX_CONTEXT_IDS;
+        break;
+
+    /*
+     * This is the maximum number of SVGA surface IDs that the guest
+     * can define using SVGA_3D_CMD_SURFACE_DEFINE*.
+     */
+    case SVGA3D_DEVCAP_MAX_SURFACE_IDS:
+        *pu32Val = SVGA3D_MAX_SURFACE_IDS;
+        break;
+
+    /* Supported surface formats. */
+    case SVGA3D_DEVCAP_SURFACEFMT_X8R8G8B8:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_X8R8G8B8);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_A8R8G8B8:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A8R8G8B8);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_A2R10G10B10:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A2R10G10B10);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_X1R5G5B5:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_X1R5G5B5);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_A1R5G5B5:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A1R5G5B5);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_A4R4G4B4:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A4R4G4B4);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_R5G6B5:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A4R4G4B4);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE16:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_L16);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8_ALPHA8:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A8L8);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_ALPHA8:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A8);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_LUMINANCE8:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_L8);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_D16:
+        *pu32Val = vmsvga3dGetDepthFormatSupport(pState, idx3dCaps, D3DFMT_D16);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8:
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT: /* @todo not correct */
+        *pu32Val = vmsvga3dGetDepthFormatSupport(pState, idx3dCaps, D3DFMT_D24S8);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_D24X8:
+        *pu32Val = vmsvga3dGetDepthFormatSupport(pState, idx3dCaps, D3DFMT_D24X8);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_DF16:
+        /* @todo supposed to be floating-point, but unable to find a match for D3D9... */
+        *pu32Val = 0;
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_Z_DF24:
+        *pu32Val = vmsvga3dGetDepthFormatSupport(pState, idx3dCaps, D3DFMT_D24FS8);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT1:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_DXT1);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT2:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_DXT2);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT3:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_DXT3);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT4:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_DXT4);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_DXT5:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_DXT5);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_BUMPX8L8V8U8:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_X8L8V8U8);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_A2W10V10U10:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A2W10V10U10);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_BUMPU8V8:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_V8U8);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_Q8W8V8U8:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_Q8W8V8U8);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_CxV8U8:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_CxV8U8);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_R_S10E5:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_R16F);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_R_S23E8:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_R32F);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_RG_S10E5:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_G16R16F);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_RG_S23E8:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_G32R32F);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_ARGB_S10E5:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A16B16G16R16F);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_ARGB_S23E8:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A32B32G32R32F);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_V16U16:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_V16U16);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_G16R16:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_G16R16);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_A16B16G16R16:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A16B16G16R16);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_UYVY:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_UYVY);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_YUY2:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_YUY2);
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_NV12:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, (D3DFORMAT)MAKEFOURCC('N', 'V', '1', '2'));
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_AYUV:
+        *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, (D3DFORMAT)MAKEFOURCC('A', 'Y', 'U', 'V'));
+        break;
+
+    case SVGA3D_DEVCAP_SURFACEFMT_BC4_UNORM:
+    case SVGA3D_DEVCAP_SURFACEFMT_BC5_UNORM:
+        /* Unknown; only in DX10 & 11 */
+        Log(("CAPS: Unknown CAP %s\n", vmsvga3dGetCapString(idx3dCaps)));
+        rc = VERR_INVALID_PARAMETER;
+        *pu32Val = 0;
+        break;
+
+    default:
+        Log(("CAPS: Unexpected CAP %d\n", idx3dCaps));
+        rc = VERR_INVALID_PARAMETER;
+        break;
+    }
+#if 0
+    /* Dump of VMWare Player caps (from their log); for debugging purposes */
+    switch (idx3dCaps)
+    {
+    case 0: 
+        *pu32Val = 0x00000001;
+        break;
+    case 1:
+        *pu32Val = 0x0000000a;
+        break;
+    case 2: 
+        *pu32Val = 0x00000008;
+        break;
+    case 3: *pu32Val = 0x00000006; break;
+    case 4: *pu32Val = 0x00000007; break;
+    case 5: *pu32Val = 0x00000001; break;
+    case 6: *pu32Val = 0x0000000d; break;
+    case 7: *pu32Val = 0x00000001; break;
+    case 8: *pu32Val = 0x00000004; break;
+    case 9: *pu32Val = 0x00000001; break;
+    case 10: *pu32Val = 0x00000001; break;
+    case 11: *pu32Val = 0x00000004; break;
+    case 12: *pu32Val = 0x00000001; break;
+    case 13: *pu32Val = 0x00000001; break;
+    case 14: *pu32Val = 0x00000001; break;
+    case 15: *pu32Val = 0x00000001; break;
+    case 16: *pu32Val = 0x00000001; break;
+    case 17: *pu32Val = (uint32_t)256.000000; break;
+    case 18: *pu32Val = 0x00000014; break;
+    case 19: *pu32Val = 0x00001000; break;
+    case 20: *pu32Val = 0x00001000; break;
+    case 21: *pu32Val = 0x00000800; break;
+    case 22: *pu32Val = 0x00002000; break;
+    case 23: *pu32Val = 0x00000800; break;
+    case 24: *pu32Val = 0x00000010; break;
+    case 25: *pu32Val = 0x000fffff; break;
+    case 26: *pu32Val = 0x00ffffff; break;
+    case 27: *pu32Val = 0xffffffff; break;
+    case 28: *pu32Val = 0xffffffff; break;
+    case 29: *pu32Val = 0x00000020; break;
+    case 30: *pu32Val = 0x00000020; break;
+    case 31: *pu32Val = 0x03ffffff; break;
+    case 32: *pu32Val = 0x0098ec1f; break;
+    case 33: *pu32Val = 0x0098e11f; break;
+    case 34: *pu32Val = 0x0098e01f; break;
+    case 35: *pu32Val = 0x012c2000; break;
+    case 36: *pu32Val = 0x0098e11f; break;
+    case 37: *pu32Val = 0x0090c11f; break;
+    case 38: *pu32Val = 0x0098ec1f; break;
+    case 39: *pu32Val = 0x00804007; break;
+    case 40: *pu32Val = 0x0080c007; break;
+    case 41: *pu32Val = 0x00804007; break;
+    case 42: *pu32Val = 0x0080c007; break;
+    case 43: *pu32Val = 0x000000c1; break;
+    case 44: *pu32Val = 0x000000c1; break;
+    case 45: *pu32Val = 0x000000c1; break;
+    case 46: *pu32Val = 0x00808005; break;
+    case 47: *pu32Val = 0x00808005; break;
+    case 48: *pu32Val = 0x00808005; break;
+    case 49: *pu32Val = 0x00808005; break;
+    case 50: *pu32Val = 0x00808005; break;
+    case 51: *pu32Val = 0x01240000; break;
+    case 52: *pu32Val = 0x00814007; break;
+    case 53: *pu32Val = 0x00814007; break;
+    case 54: *pu32Val = 0x00814007; break;
+    case 55: *pu32Val = 0x01240000; break;
+    case 56: *pu32Val = 0x0080401f; break;
+    case 57: *pu32Val = 0x0080401f; break;
+    case 58: *pu32Val = 0x0080401f; break;
+    case 59: *pu32Val = 0x0080401f; break;
+    case 60: *pu32Val = 0x0080601f; break;
+    case 61: *pu32Val = 0x0080401f; break;
+    case 62: *pu32Val = 0x00000000; break;
+    case 63: *pu32Val = 0x00000004; break;
+    case 64: *pu32Val = 0x00000004; break;
+    case 65: *pu32Val = 0x00814005; break;
+    case 66: *pu32Val = 0x0080401f; break;
+    case 67: *pu32Val = 0x0080601f; break;
+    case 68: *pu32Val = 0x00006009; break;
+    case 69: *pu32Val = 0x00006001; break;
+    case 70: *pu32Val = 0x00000001; break;
+    case 71: *pu32Val = 0x0000000b; break;
+    case 72: *pu32Val = 0x00000001; break;
+    case 73: *pu32Val = 0x00000000; break;
+    case 74: *pu32Val = 0x00000000; break;
+    case 75: *pu32Val = 0x01246000; break;
+    case 76: *pu32Val = 0x00004009; break;
+    case 77: *pu32Val = 0x00000100; break;
+    case 78: *pu32Val = 0x00008000; break;
+    case 79: *pu32Val = 0x000000c1; break;
+    case 80: *pu32Val = 0x01240000; break;
+    case 81: *pu32Val = 0x000000c1; break;
+    case 82: *pu32Val = 0x00800005; break;
+    case 83: *pu32Val = 0x00800005; break;
+    case 84: *pu32Val = 0x00000000; break;
+    case 85: *pu32Val = 0x00000000; break;
+    case 86: *pu32Val = 0x00000000; break;
+    case 87: *pu32Val = 0x00000000; break;
+    case 88: *pu32Val = 0x00000000; break;
+    case 89: *pu32Val = (uint32_t) 0.000000; break;
+    case 90: *pu32Val = (uint32_t) 0.000000; break;
+    case 91: *pu32Val = 0x00006009; break;
+    default:
+//        Log(("CAPS: Unexpected CAP %d\n", idx3dCaps));
+//        rc = VERR_INVALID_PARAMETER;
+        break;
+    }
+#endif
+    Log(("CAPS: %d=%s - %x\n", idx3dCaps, vmsvga3dGetCapString(idx3dCaps), *pu32Val));
+    return rc;
+}
+
+/**
+ * Convert SVGA format value to its D3D equivalent
+ */
+static D3DFORMAT vmsvga3dSurfaceFormat2D3D(SVGA3dSurfaceFormat format)
+{
+    switch (format)
+    {
+    case SVGA3D_X8R8G8B8:
+        return D3DFMT_X8R8G8B8;
+    case SVGA3D_A8R8G8B8:
+        return D3DFMT_A8R8G8B8;
+    case SVGA3D_R5G6B5:
+        return D3DFMT_R5G6B5;
+    case SVGA3D_X1R5G5B5:
+        return D3DFMT_X1R5G5B5;
+    case SVGA3D_A1R5G5B5:
+        return D3DFMT_A1R5G5B5;
+    case SVGA3D_A4R4G4B4:
+        return D3DFMT_A4R4G4B4;
+
+    case SVGA3D_Z_D32:
+        return D3DFMT_D32;
+    case SVGA3D_Z_D16:
+        return D3DFMT_D16;
+    case SVGA3D_Z_D24S8_INT:    /* @todo not correct */
+    case SVGA3D_Z_D24S8:
+        return D3DFMT_D24S8;
+    case SVGA3D_Z_D15S1:
+        return D3DFMT_D15S1;
+    case SVGA3D_Z_D24X8:
+        return D3DFMT_D24X8;
+    /* Advanced D3D9 depth formats. */
+    case SVGA3D_Z_DF16:
+        /* @todo supposed to be floating-point, but unable to find a match for D3D9... */
+        AssertFailedReturn(D3DFMT_UNKNOWN);
+    case SVGA3D_Z_DF24:
+        return D3DFMT_D24FS8;
+
+    case SVGA3D_LUMINANCE8:
+        return D3DFMT_L8;
+    case SVGA3D_LUMINANCE4_ALPHA4:
+        return D3DFMT_A4L4;
+    case SVGA3D_LUMINANCE16:
+        return D3DFMT_L16;
+    case SVGA3D_LUMINANCE8_ALPHA8:
+        return D3DFMT_A8L8;
+
+    case SVGA3D_DXT1:
+        return D3DFMT_DXT1;
+    case SVGA3D_DXT2:
+        return D3DFMT_DXT2;
+    case SVGA3D_DXT3:
+        return D3DFMT_DXT3;
+    case SVGA3D_DXT4:
+        return D3DFMT_DXT4;
+    case SVGA3D_DXT5:
+        return D3DFMT_DXT5;
+
+    /* Bump-map formats */
+    case SVGA3D_BUMPU8V8:
+        return D3DFMT_V8U8;
+    case SVGA3D_BUMPL6V5U5:
+        return D3DFMT_L6V5U5;
+    case SVGA3D_BUMPX8L8V8U8:
+        return D3DFMT_X8L8V8U8;
+    case SVGA3D_BUMPL8V8U8:
+        /* No corresponding D3D9 equivalent. */
+        AssertFailedReturn(D3DFMT_UNKNOWN);
+    /* signed bump-map formats */
+    case SVGA3D_V8U8:
+        return D3DFMT_V8U8;
+    case SVGA3D_Q8W8V8U8:
+        return D3DFMT_Q8W8V8U8;
+    case SVGA3D_CxV8U8:
+        return D3DFMT_CxV8U8;
+    /* mixed bump-map formats */
+    case SVGA3D_X8L8V8U8:
+        return D3DFMT_X8L8V8U8;
+    case SVGA3D_A2W10V10U10:
+        return D3DFMT_A2W10V10U10;
+
+    case SVGA3D_ARGB_S10E5:   /* 16-bit floating-point ARGB */
+        return D3DFMT_A16B16G16R16F;
+    case SVGA3D_ARGB_S23E8:   /* 32-bit floating-point ARGB */
+        return D3DFMT_A32B32G32R32F;
+
+    case SVGA3D_A2R10G10B10:
+        return D3DFMT_A2R10G10B10;
+
+    case SVGA3D_ALPHA8:
+        return D3DFMT_A8;
+
+    /* Single- and dual-component floating point formats */
+    case SVGA3D_R_S10E5:
+        return D3DFMT_R16F;
+    case SVGA3D_R_S23E8:
+        return D3DFMT_R32F;
+    case SVGA3D_RG_S10E5:
+        return D3DFMT_G16R16F;
+    case SVGA3D_RG_S23E8:
+        return D3DFMT_G32R32F;
+
+    /*
+     * Any surface can be used as a buffer object, but SVGA3D_BUFFER is
+     * the most efficient format to use when creating new surfaces
+     * expressly for index or vertex data.
+     */
+    case SVGA3D_BUFFER:
+        return D3DFMT_UNKNOWN;
+
+    case SVGA3D_V16U16:
+        return D3DFMT_V16U16;
+
+    case SVGA3D_G16R16:
+        return D3DFMT_G16R16;
+    case SVGA3D_A16B16G16R16:
+        return D3DFMT_A16B16G16R16;
+
+    /* Packed Video formats */
+    case SVGA3D_UYVY:
+        return D3DFMT_UYVY;
+    case SVGA3D_YUY2:
+        return D3DFMT_YUY2;
+
+    /* Planar video formats */
+    case SVGA3D_NV12:
+        return (D3DFORMAT)MAKEFOURCC('N', 'V', '1', '2');
+
+    /* Video format with alpha */
+    case SVGA3D_AYUV:
+        return (D3DFORMAT)MAKEFOURCC('A', 'Y', 'U', 'V');
+
+    case SVGA3D_BC4_UNORM:
+    case SVGA3D_BC5_UNORM:
+        /* Unknown; only in DX10 & 11 */
+        break;
+    }
+    AssertFailedReturn(D3DFMT_UNKNOWN);
+}
+
+/**
+ * Convert SVGA multi sample count value to its D3D equivalent
+ */
+D3DMULTISAMPLE_TYPE vmsvga3dMultipeSampleCount2D3D(uint32_t multisampleCount)
+{
+    AssertCompile(D3DMULTISAMPLE_2_SAMPLES == 2);
+    AssertCompile(D3DMULTISAMPLE_16_SAMPLES == 16);
+
+    if (multisampleCount > 16)
+        return D3DMULTISAMPLE_NONE;
+
+    /* @todo exact same mapping as d3d? */
+    return (D3DMULTISAMPLE_TYPE)multisampleCount;
+}
+
+int vmsvga3dSurfaceDefine(PVGASTATE pThis, uint32_t sid, uint32_t surfaceFlags, SVGA3dSurfaceFormat format, SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES],
+                          uint32_t multisampleCount, SVGA3dTextureFilter autogenFilter, uint32_t cMipLevels, SVGA3dSize *pMipLevelSize)
+{
+    PVMSVGA3DSURFACE pSurface;
+    PVMSVGA3DSTATE   pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+   
+    Log(("vmsvga3dSurfaceDefine: sid=%x surfaceFlags=%x format=%s (%x) multiSampleCount=%d autogenFilter=%d, cMipLevels=%d size=(%d,%d,%d)\n", 
+         sid, surfaceFlags, vmsvgaSurfaceType2String(format), format, multisampleCount, autogenFilter, cMipLevels, pMipLevelSize->width, pMipLevelSize->height, pMipLevelSize->depth));
+
+    AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(cMipLevels >= 1, VERR_INVALID_PARAMETER);
+    /* Assuming all faces have the same nr of mipmaps. */
+    AssertReturn(!(surfaceFlags & SVGA3D_SURFACE_CUBEMAP) || cMipLevels == face[0].numMipLevels * 6, VERR_INVALID_PARAMETER);
+    AssertReturn((surfaceFlags & SVGA3D_SURFACE_CUBEMAP) || cMipLevels == face[0].numMipLevels, VERR_INVALID_PARAMETER);
+
+    if (sid >= pState->cSurfaces)
+    {
+        pState->paSurface = (PVMSVGA3DSURFACE )RTMemRealloc(pState->paSurface, sizeof(VMSVGA3DSURFACE) * (sid + 1));
+        AssertReturn(pState->paSurface, VERR_NO_MEMORY);
+        memset(&pState->paSurface[pState->cSurfaces], 0, sizeof(VMSVGA3DSURFACE) * (sid + 1 - pState->cSurfaces));
+        for (uint32_t i = pState->cSurfaces; i < sid + 1; i++)
+            pState->paSurface[i].id = SVGA3D_INVALID_ID;
+
+        pState->cSurfaces = sid + 1;
+    }
+    /* If one already exists with this id, then destroy it now. */
+    if (pState->paSurface[sid].id != SVGA3D_INVALID_ID)
+        vmsvga3dSurfaceDestroy(pThis, sid);
+
+    pSurface = &pState->paSurface[sid];
+    memset(pSurface, 0, sizeof(*pSurface));
+    pSurface->id                    = sid;
+    pSurface->idAssociatedContext   = SVGA3D_INVALID_ID;
+    pSurface->hSharedObject         = NULL;
+    pSurface->pSharedObjectTree     = NULL;
+
+    /* The surface type is sort of undefined now, even though the hints and format can help to clear that up. 
+     * In some case we'll have to wait until the surface is used to create the D3D object.
+     */
+    switch (format)
+    {
+    case SVGA3D_Z_D32:
+    case SVGA3D_Z_D16:
+    case SVGA3D_Z_D24S8:
+    case SVGA3D_Z_D15S1:
+    case SVGA3D_Z_D24X8:
+    case SVGA3D_Z_DF16:
+    case SVGA3D_Z_DF24:
+    case SVGA3D_Z_D24S8_INT:
+        surfaceFlags |= SVGA3D_SURFACE_HINT_DEPTHSTENCIL;
+        break;
+
+    /* Texture compression formats */
+    case SVGA3D_DXT1:
+    case SVGA3D_DXT2:
+    case SVGA3D_DXT3:
+    case SVGA3D_DXT4:
+    case SVGA3D_DXT5:
+    /* Bump-map formats */
+    case SVGA3D_BUMPU8V8:
+    case SVGA3D_BUMPL6V5U5:
+    case SVGA3D_BUMPX8L8V8U8:
+    case SVGA3D_BUMPL8V8U8:
+    case SVGA3D_V8U8:
+    case SVGA3D_Q8W8V8U8:
+    case SVGA3D_CxV8U8:
+    case SVGA3D_X8L8V8U8:
+    case SVGA3D_A2W10V10U10:
+    case SVGA3D_V16U16:
+    /* Typical render target formats; we should allow render target buffers to be used as textures. */
+    case SVGA3D_X8R8G8B8:
+    case SVGA3D_A8R8G8B8:
+    case SVGA3D_R5G6B5:
+    case SVGA3D_X1R5G5B5:
+    case SVGA3D_A1R5G5B5:
+    case SVGA3D_A4R4G4B4:
+        surfaceFlags |= SVGA3D_SURFACE_HINT_TEXTURE;
+        break;
+
+    case SVGA3D_LUMINANCE8:
+    case SVGA3D_LUMINANCE4_ALPHA4:
+    case SVGA3D_LUMINANCE16:
+    case SVGA3D_LUMINANCE8_ALPHA8:
+    case SVGA3D_ARGB_S10E5:   /* 16-bit floating-point ARGB */
+    case SVGA3D_ARGB_S23E8:   /* 32-bit floating-point ARGB */
+    case SVGA3D_A2R10G10B10:
+    case SVGA3D_ALPHA8:
+    case SVGA3D_R_S10E5:
+    case SVGA3D_R_S23E8:
+    case SVGA3D_RG_S10E5:
+    case SVGA3D_RG_S23E8:
+    case SVGA3D_G16R16:
+    case SVGA3D_A16B16G16R16:
+    case SVGA3D_UYVY:
+    case SVGA3D_YUY2:
+    case SVGA3D_NV12:
+    case SVGA3D_AYUV:
+    case SVGA3D_BC4_UNORM:
+    case SVGA3D_BC5_UNORM:
+        break;
+
+    /*
+     * Any surface can be used as a buffer object, but SVGA3D_BUFFER is
+     * the most efficient format to use when creating new surfaces
+     * expressly for index or vertex data.
+     */
+    case SVGA3D_BUFFER:
+        break;
+    }
+
+    pSurface->flags             = surfaceFlags;
+    pSurface->format            = format;
+    memcpy(pSurface->faces, face, sizeof(face));
+    pSurface->cFaces            = 1;    /* check for cube maps later */
+    pSurface->multiSampleCount  = multisampleCount;
+    pSurface->autogenFilter     = autogenFilter;
+    Assert(autogenFilter != SVGA3D_TEX_FILTER_FLATCUBIC);
+    Assert(autogenFilter != SVGA3D_TEX_FILTER_GAUSSIANCUBIC);
+    pSurface->pMipmapLevels     = (PVMSVGA3DMIPMAPLEVEL)RTMemAllocZ(cMipLevels * sizeof(VMSVGA3DMIPMAPLEVEL));
+    AssertReturn(pSurface->pMipmapLevels, VERR_NO_MEMORY);
+
+    for (uint32_t i=0; i < cMipLevels; i++)
+        pSurface->pMipmapLevels[i].size = pMipLevelSize[i];
+
+    /* Translate the format and usage flags to D3D. */
+    pSurface->formatD3D         = vmsvga3dSurfaceFormat2D3D(format);
+    pSurface->cbBlock           = vmsvga3dSurfaceFormatSize(format);
+    pSurface->multiSampleTypeD3D= vmsvga3dMultipeSampleCount2D3D(multisampleCount);
+    pSurface->fUsageD3D         = 0;
+    if (surfaceFlags & SVGA3D_SURFACE_HINT_DYNAMIC)
+        pSurface->fUsageD3D |= D3DUSAGE_DYNAMIC;
+    if (surfaceFlags & SVGA3D_SURFACE_HINT_RENDERTARGET)
+        pSurface->fUsageD3D |= D3DUSAGE_RENDERTARGET;
+    if (surfaceFlags & SVGA3D_SURFACE_HINT_DEPTHSTENCIL)
+        pSurface->fUsageD3D |= D3DUSAGE_DEPTHSTENCIL;
+    if (surfaceFlags & SVGA3D_SURFACE_HINT_WRITEONLY)
+        pSurface->fUsageD3D |= D3DUSAGE_WRITEONLY;
+    if (surfaceFlags & SVGA3D_SURFACE_AUTOGENMIPMAPS)
+        pSurface->fUsageD3D |= D3DUSAGE_AUTOGENMIPMAP;
+
+    switch (surfaceFlags & (SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET | SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_CUBEMAP))
+    {
+    case SVGA3D_SURFACE_CUBEMAP:
+        Log(("SVGA3D_SURFACE_CUBEMAP\n"));
+        pSurface->cFaces = 6;
+        break;
+
+    case SVGA3D_SURFACE_HINT_INDEXBUFFER:
+        Log(("SVGA3D_SURFACE_HINT_INDEXBUFFER\n"));
+        /* else type unknown at this time; postpone buffer creation */
+        break;
+
+    case SVGA3D_SURFACE_HINT_VERTEXBUFFER:
+        Log(("SVGA3D_SURFACE_HINT_VERTEXBUFFER\n"));
+        /* Type unknown at this time; postpone buffer creation */
+        break;
+
+    case SVGA3D_SURFACE_HINT_TEXTURE:
+        Log(("SVGA3D_SURFACE_HINT_TEXTURE\n"));
+        break;
+
+    case SVGA3D_SURFACE_HINT_RENDERTARGET:
+        Log(("SVGA3D_SURFACE_HINT_RENDERTARGET\n"));
+        break;
+
+    case SVGA3D_SURFACE_HINT_DEPTHSTENCIL:
+        Log(("SVGA3D_SURFACE_HINT_DEPTHSTENCIL\n"));
+        break;
+
+    default:
+        /* Unknown; decide later. */
+        break;
+    }
+   
+    Assert(!pSurface->u.pSurface);
+
+    /* Allocate buffer to hold the surface data until we can move it into a D3D object */
+    for (uint32_t iFace=0; iFace < pSurface->cFaces; iFace++)
+    {
+        for (uint32_t i=0; i < pSurface->faces[iFace].numMipLevels; i++)
+        {
+            uint32_t idx = i + iFace * pSurface->faces[0].numMipLevels;
+
+            Log(("vmsvga3dSurfaceDefine: face %d mip level %d (%d,%d,%d)\n", iFace, i, pSurface->pMipmapLevels[idx].size.width, pSurface->pMipmapLevels[idx].size.height, pSurface->pMipmapLevels[idx].size.depth));
+            Log(("vmsvga3dSurfaceDefine: cbPitch=%x cbBlock=%x \n", pSurface->cbBlock * pSurface->pMipmapLevels[idx].size.width, pSurface->cbBlock));
+
+            pSurface->pMipmapLevels[idx].cbSurfacePitch = pSurface->cbBlock * pSurface->pMipmapLevels[idx].size.width;
+            pSurface->pMipmapLevels[idx].cbSurface      = pSurface->pMipmapLevels[idx].cbSurfacePitch * pSurface->pMipmapLevels[idx].size.height * pSurface->pMipmapLevels[idx].size.depth;
+            pSurface->pMipmapLevels[idx].pSurfaceData   = RTMemAllocZ(pSurface->pMipmapLevels[idx].cbSurface);
+            AssertReturn(pSurface->pMipmapLevels[idx].pSurfaceData, VERR_NO_MEMORY);
+        }
+    }
+    return VINF_SUCCESS;
+}
+
+/*
+ * Release all shared surface objects. 
+ */
+static int vmsvga3dSharedSurfaceDestroyTree(PAVLU32NODECORE pNode, void *pParam)
+{
+    PVMSVGA3DSHAREDSURFACE pSharedSurface = (PVMSVGA3DSHAREDSURFACE)pNode;
+    PVMSVGA3DSURFACE       pSurface = (PVMSVGA3DSURFACE)pParam;
+
+    switch (pSurface->flags & (SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET | SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_CUBEMAP))
+    {
+    case SVGA3D_SURFACE_HINT_TEXTURE:
+    case SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET:
+        Log(("vmsvga3dSharedSurfaceDestroyTree: release shared object for context %d\n", pNode->Key));
+        Assert(pSharedSurface->u.pTexture);
+        if (pSharedSurface->u.pTexture)
+            pSharedSurface->u.pTexture->Release();
+        break;
+
+    default:
+        AssertFailed();
+        break;
+    }
+    RTMemFree(pNode);
+    return 0;
+}
+
+int vmsvga3dSurfaceDestroy(PVGASTATE pThis, uint32_t sid)
+{
+    PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    if (    sid < pState->cSurfaces
+        &&  pState->paSurface[sid].id == sid)
+    {
+        PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];
+
+        Log(("vmsvga3dSurfaceDestroy id %x\n", sid));
+
+        /* Check all contexts if this surface is used as a render target or active texture. */
+        for (uint32_t cid = 0; cid < pState->cContexts; cid++)
+        {
+            PVMSVGA3DCONTEXT pContext = &pState->paContext[cid];
+            if (pContext->id == cid)
+            {
+                for (uint32_t i = 0; i < RT_ELEMENTS(pContext->aSidActiveTexture); i++)
+                {
+                    if (pContext->aSidActiveTexture[i] == sid)
+                        pContext->aSidActiveTexture[i] = SVGA3D_INVALID_ID;
+                }
+                if (pContext->sidRenderTarget == sid)
+                    pContext->sidRenderTarget = SVGA3D_INVALID_ID;
+            }
+        }
+
+        RTAvlU32Destroy(&pSurface->pSharedObjectTree, vmsvga3dSharedSurfaceDestroyTree, pSurface);
+        Assert(pSurface->pSharedObjectTree == NULL);
+
+        switch (pSurface->flags & (SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET | SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_CUBEMAP))
+        {
+        case SVGA3D_SURFACE_CUBEMAP:
+            AssertFailed(); /* @todo */
+            break;
+
+        case SVGA3D_SURFACE_HINT_INDEXBUFFER:
+            if (pSurface->u.pIndexBuffer)
+                pSurface->u.pIndexBuffer->Release();
+            break;
+
+        case SVGA3D_SURFACE_HINT_VERTEXBUFFER:
+            if (pSurface->u.pVertexBuffer)
+                pSurface->u.pVertexBuffer->Release();
+            break;
+
+        case SVGA3D_SURFACE_HINT_TEXTURE:
+        case SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET:
+            if (pSurface->u.pTexture)
+                pSurface->u.pTexture->Release();
+            if (pSurface->bounce.pTexture)
+                pSurface->bounce.pTexture->Release();
+            break;
+
+        case SVGA3D_SURFACE_HINT_RENDERTARGET:
+        case SVGA3D_SURFACE_HINT_DEPTHSTENCIL:
+        case SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_HINT_TEXTURE:    /* @todo actual texture surface not supported */
+            if (pSurface->fStencilAsTexture)
+                pSurface->u.pTexture->Release();
+            else
+            if (pSurface->u.pSurface)
+                pSurface->u.pSurface->Release();
+            break;
+
+        default:
+            AssertMsg(!pSurface->u.pSurface, ("type=%x\n", (pSurface->flags & (SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET | SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_CUBEMAP))));
+            break;
+        }
+
+        if (pSurface->pMipmapLevels)
+        {
+            for (uint32_t face=0; face < pSurface->cFaces; face++)
+            {
+                for (uint32_t i=0; i < pSurface->faces[face].numMipLevels; i++)
+                {
+                    uint32_t idx = i + face * pSurface->faces[0].numMipLevels;
+                    if (pSurface->pMipmapLevels[idx].pSurfaceData)
+                        RTMemFree(pSurface->pMipmapLevels[idx].pSurfaceData);
+                }
+            }
+            RTMemFree(pSurface->pMipmapLevels);
+        }
+        if (pSurface->pQuery)
+            pSurface->pQuery->Release();
+
+        memset(pSurface, 0, sizeof(*pSurface));
+        pSurface->id = SVGA3D_INVALID_ID;
+    }
+    else
+        AssertFailedReturn(VERR_INVALID_PARAMETER);
+
+    return VINF_SUCCESS;
+}
+
+/* Get the shared surface copy or create a new one. */
+static PVMSVGA3DSHAREDSURFACE vmsvga3dSurfaceGetSharedCopy(PVGASTATE pThis, PVMSVGA3DCONTEXT pContext, PVMSVGA3DSURFACE pSurface)
+{
+    Assert(pSurface->hSharedObject);
+
+    PVMSVGA3DSHAREDSURFACE pSharedSurface = (PVMSVGA3DSHAREDSURFACE)RTAvlU32Get(&pSurface->pSharedObjectTree, pContext->id);
+    if (!pSharedSurface)
+    {
+        HRESULT hr;
+        bool    ret;
+
+        Log(("vmsvga3dSurfaceGetSharedCopy: Create shared texture copy d3d (%d,%d) cMip=%d usage %x format %x.\n", 
+              pSurface->pMipmapLevels[0].size.width, 
+              pSurface->pMipmapLevels[0].size.height, 
+              pSurface->faces[0], 
+              pSurface->fUsageD3D | D3DUSAGE_RENDERTARGET,
+              pSurface->formatD3D));
+            
+        pSharedSurface = (PVMSVGA3DSHAREDSURFACE)RTMemAllocZ(sizeof(*pSharedSurface));
+        AssertReturn(pSharedSurface, NULL);
+
+        pSharedSurface->Core.Key = pContext->id;
+        ret = RTAvlU32Insert(&pSurface->pSharedObjectTree, &pSharedSurface->Core);
+        AssertReturn(ret, NULL);
+
+        /* Create shadow copy of the original shared texture. Shared d3d resources require Vista+ and have some restrictions. */
+        hr = pContext->pDevice->CreateTexture(pSurface->pMipmapLevels[0].size.width, 
+                                              pSurface->pMipmapLevels[0].size.height, 
+                                              pSurface->faces[0].numMipLevels, 
+                                              pSurface->fUsageD3D | D3DUSAGE_RENDERTARGET /* required for use as a StretchRect destination */,
+                                              pSurface->formatD3D,
+                                              D3DPOOL_DEFAULT,
+                                              &pSharedSurface->u.pTexture,
+                                              &pSurface->hSharedObject);
+        AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceGetSharedCopy: CreateTexture failed with %x\n", hr), NULL);
+    }
+    return pSharedSurface;
+}
+
+#ifdef VBOX_VMSVGA3D_WITH_OPENGL
+#define vmsvga3dSurfaceTrackUsage(a, b, c)
+#define vmsvga3dSurfaceFlush(a, b)
+#else
+/* Inject a query event into the D3D pipeline so we can check when usage of this surface has finished. 
+ * (D3D does not synchronize shared surface usage)
+ */
+static int vmsvga3dSurfaceTrackUsage(PVGASTATE pThis, PVMSVGA3DCONTEXT pContext, uint32_t sid)
+{
+    PVMSVGA3DSTATE   pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    PVMSVGA3DSURFACE pSurface  = &pState->paSurface[sid];
+    HRESULT          hr;
+
+    AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(sid < pState->cSurfaces && pState->paSurface[sid].id == sid, VERR_INVALID_PARAMETER);
+
+    /* Nothing to do if this surface hasn't been shared. */
+    if (pSurface->pSharedObjectTree == NULL)
+        return VINF_SUCCESS;
+
+    Log(("vmsvga3dSurfaceTrackUsage: track usage of surface id=%x (cid=%x)\n", sid, pContext->id));
+
+    /* Release the previous query object. */
+    if (pSurface->pQuery)
+    {
+        Log(("vmsvga3dSurfaceTrackUsage: release old query object\n"));
+        pSurface->pQuery->Release();
+        pSurface->pQuery = NULL;
+    }
+    hr = pContext->pDevice->CreateQuery(D3DQUERYTYPE_EVENT, &pSurface->pQuery);
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceTrackUsage: CreateQuery failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    hr = pSurface->pQuery->Issue(D3DISSUE_END);
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceTrackUsage: Issue failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    return VINF_SUCCESS;
+}
+
+
+/* Wait for all drawing, that uses this surface, to finish. */
+static int vmsvga3dSurfaceFlush(PVGASTATE pThis, PVMSVGA3DSURFACE pSurface)
+{
+    HRESULT hr;
+
+    if (!pSurface->pQuery)
+    {
+        LogFlow(("vmsvga3dSurfaceFlush: no query object\n"));
+        return VINF_SUCCESS;    /* nothing to wait for */
+    }
+    Assert(pSurface->pSharedObjectTree);
+
+    Log(("vmsvga3dSurfaceFlush: wait for draw to finish (sid=%x)\n", pSurface->id));
+    while (true)
+    {
+        hr = pSurface->pQuery->GetData(NULL, 0, D3DGETDATA_FLUSH);
+        if (hr != S_FALSE) break;
+
+        RTThreadSleep(1);
+    }
+    AssertMsgReturn(hr == S_OK, ("vmsvga3dSurfaceFinishDrawing: GetData failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    pSurface->pQuery->Release();
+    pSurface->pQuery = NULL;
+
+    return VINF_SUCCESS;
+}
+#endif /* VBOX_VMSVGA3D_WITH_OPENGL */
+
+int vmsvga3dSurfaceCopy(PVGASTATE pThis, SVGA3dSurfaceImageId dest, SVGA3dSurfaceImageId src, uint32_t cCopyBoxes, SVGA3dCopyBox *pBox)
+{
+    PVMSVGA3DSTATE      pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    PVMSVGA3DSURFACE    pSurfaceSrc;
+    uint32_t            sidSrc = src.sid;
+    PVMSVGA3DSURFACE    pSurfaceDest;
+    uint32_t            sidDest = dest.sid;
+    int                 rc = VINF_SUCCESS;
+
+    AssertReturn(pState, VERR_NO_MEMORY);
+    AssertReturn(sidSrc < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(sidSrc < pState->cSurfaces && pState->paSurface[sidSrc].id == sidSrc, VERR_INVALID_PARAMETER);
+    AssertReturn(sidDest < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(sidDest < pState->cSurfaces && pState->paSurface[sidDest].id == sidDest, VERR_INVALID_PARAMETER);
+
+    pSurfaceSrc  = &pState->paSurface[sidSrc];
+    pSurfaceDest = &pState->paSurface[sidDest];
+
+    AssertReturn(pSurfaceSrc->faces[0].numMipLevels > src.mipmap, VERR_INVALID_PARAMETER);
+    AssertReturn(pSurfaceDest->faces[0].numMipLevels > dest.mipmap, VERR_INVALID_PARAMETER);
+
+   // AssertMsgReturn(pSurfaceSrc->format == pSurfaceDest->format, ("Format mismatch (%d vs %d)!!\n", pSurfaceSrc->format, pSurfaceDest->format), VERR_INVALID_PARAMETER);
+
+    bool fSrcTexture  = !!(pSurfaceSrc->flags & SVGA3D_SURFACE_HINT_TEXTURE);
+    bool fDestTexture = !!(pSurfaceDest->flags & SVGA3D_SURFACE_HINT_TEXTURE);
+
+    if (    fDestTexture
+        &&  !pSurfaceDest->u.pSurface
+        &&  pSurfaceSrc->u.pSurface)
+    {
+        uint32_t            cid;
+        PVMSVGA3DCONTEXT    pContext;
+
+        /* @todo stricter checks for associated context */
+        cid = pSurfaceSrc->idAssociatedContext;
+        if (    cid >= pState->cContexts
+            ||  pState->paContext[cid].id != cid)
+        {
+            Log(("vmsvga3dSurfaceCopy invalid context id!\n"));
+            return VERR_INVALID_PARAMETER;
+        }
+        pContext = &pState->paContext[cid];
+
+        Log(("vmsvga3dSurfaceCopy: create texture surface id=%x type=%d format=%d -> create texture\n", sidDest, pSurfaceDest->flags, pSurfaceDest->format));
+        rc = vmsvga3dCreateTexture(pContext, cid, pSurfaceDest);
+        AssertRCReturn(rc, rc);
+    }
+
+    if (    pSurfaceSrc->u.pSurface
+        &&  pSurfaceDest->u.pSurface)
+    {
+        uint32_t                cid;
+        PVMSVGA3DCONTEXT        pContext;
+        IDirect3DTexture9      *pSrcTexture = pSurfaceSrc->u.pTexture;
+
+        /* @todo stricter checks for associated context */
+        cid = pSurfaceDest->idAssociatedContext;
+        if (    cid >= pState->cContexts
+            ||  pState->paContext[cid].id != cid)   
+        {
+            Log(("vmsvga3dSurfaceCopy invalid context id!\n"));
+            return VERR_INVALID_PARAMETER;
+        }
+        pContext = &pState->paContext[cid];
+
+        /* Must flush the other context's 3d pipeline to make sure all drawing is complete for the surface we're about to use. */
+        vmsvga3dSurfaceFlush(pThis, pSurfaceSrc);
+        vmsvga3dSurfaceFlush(pThis, pSurfaceDest);
+
+#ifndef VBOX_VMSVGA3D_WITH_OPENGL
+        if (    fSrcTexture 
+            &&  pSurfaceSrc->idAssociatedContext != cid)
+        {
+            Log(("vmsvga3dSurfaceCopy; using texture %x created for another context (%d vs %d)\n", sidSrc, pSurfaceSrc->idAssociatedContext, cid));
+
+            PVMSVGA3DSHAREDSURFACE pSharedSurface = vmsvga3dSurfaceGetSharedCopy(pThis, pContext, pSurfaceSrc);
+            AssertReturn(pSharedSurface, VERR_INTERNAL_ERROR);
+
+            pSrcTexture = pSharedSurface->u.pTexture;
+        }
+#endif
+
+        for (uint32_t i = 0; i < cCopyBoxes; i++)
+        {
+            HRESULT     hr;
+            RECT        RectSrc;
+            RECT        RectDest;
+            IDirect3DSurface9 *pSrc;
+            IDirect3DSurface9 *pDest;
+
+            RectSrc.left    = pBox[i].srcx;
+            RectSrc.top     = pBox[i].srcy;
+            RectSrc.right   = pBox[i].srcx + pBox[i].w;   /* exclusive */
+            RectSrc.bottom  = pBox[i].srcy + pBox[i].h;   /* exclusive */
+            RectDest.left   = pBox[i].x;
+            RectDest.top    = pBox[i].y;
+            RectDest.right  = pBox[i].x + pBox[i].w;   /* exclusive */
+            RectDest.bottom = pBox[i].y + pBox[i].h;   /* exclusive */
+
+            Log(("vmsvga3dSurfaceCopy: (StretchRect) copy src sid=%x face=%d mipmap=%d (%d,%d)(%d,%d) to dest sid=%x face=%d mipmap=%d (%d,%d)\n", sidSrc, src.face, src.mipmap, RectSrc.left, RectSrc.top, RectSrc.right, RectSrc.bottom, sidDest, dest.face, dest.mipmap, pBox[i].x, pBox[i].y));
+
+            if (    sidSrc == sidDest
+                &&  pBox[i].srcx == pBox[i].x
+                &&  pBox[i].srcy == pBox[i].y)
+            {
+                Log(("vmsvga3dSurfaceCopy: redundant copy to the same surface at the same coordinates. Ignore. \n"));
+                continue;
+            }
+            Assert(sidSrc != sidDest);
+            Assert(!pBox[i].srcz && !pBox[i].z);
+
+            if (fSrcTexture)
+            {
+                hr = pSrcTexture->GetSurfaceLevel(src.mipmap /* Texture level */,
+                                                  &pSrc);
+                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceCopy: GetSurfaceLevel failed with %x\n", hr), VERR_INTERNAL_ERROR);
+            }
+            else
+                pSrc = pSurfaceSrc->u.pSurface;
+
+            if (fDestTexture)
+            {
+                hr = pSurfaceDest->u.pTexture->GetSurfaceLevel(dest.mipmap /* Texture level */,
+                                                              &pDest);
+                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceCopy: GetSurfaceLevel failed with %x\n", hr), VERR_INTERNAL_ERROR);
+            }
+            else
+                pDest = pSurfaceDest->u.pSurface;
+
+            /* UpdateSurface is too picky; use StretchRect instead */
+            hr = pContext->pDevice->StretchRect(pSrc, &RectSrc, pDest, &RectDest, D3DTEXF_NONE);
+
+            /* GetSurfaceLevel increases the reference count; release the objects again. */
+            if (fDestTexture)
+                pDest->Release();
+            if (fSrcTexture)
+                pSrc->Release();
+
+            /* Track the StretchRect operation. */
+            vmsvga3dSurfaceTrackUsage(pThis, pContext, sidSrc);
+            vmsvga3dSurfaceTrackUsage(pThis, pContext, sidDest);
+
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceCopy: UpdateSurface failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        }
+    }
+    else
+    for (uint32_t i = 0; i < cCopyBoxes; i++)
+    {
+        HRESULT        hr = D3D_OK;
+        D3DLOCKED_RECT LockedSrcRect;
+        D3DLOCKED_RECT LockedDestRect;
+        RECT           Rect;
+
+        Rect.left   = pBox[i].srcx;
+        Rect.top    = pBox[i].srcy;
+        Rect.right  = pBox[i].srcx + pBox[i].w;   /* exclusive */
+        Rect.bottom = pBox[i].srcy + pBox[i].h;   /* exclusive */
+
+        Log(("vmsvga3dSurfaceCopy: (manual) copy src=%x src=%x face=%d (%d,%d)(%d,%d) to dest=%x src=%x face=%d (%d,%d)\n", sidSrc, src.face, src.mipmap, Rect.left, Rect.top, Rect.right, Rect.bottom, sidDest, dest.face, dest.mipmap, pBox[i].x, pBox[i].y));
+            
+        Assert(!pBox[i].srcz && !pBox[i].z);
+
+        if (!pSurfaceSrc->u.pSurface)
+        {
+            LockedSrcRect.pBits = (void *)pSurfaceSrc->pMipmapLevels[src.mipmap].pSurfaceData;
+            LockedSrcRect.Pitch  = pSurfaceSrc->pMipmapLevels[src.mipmap].cbSurfacePitch;
+        }
+        else
+        {
+            /* Must flush the other context's 3d pipeline to make sure all drawing is complete for the surface we're about to use. */
+            vmsvga3dSurfaceFlush(pThis, pSurfaceSrc);
+
+            if (fSrcTexture)
+            {
+                Assert(!pSurfaceSrc->bounce.pTexture);
+                hr = pSurfaceSrc->u.pTexture->LockRect(src.mipmap, /* Texture level */
+                                                       &LockedSrcRect,
+                                                       &Rect,
+                                                       D3DLOCK_READONLY);
+            }
+            else
+                hr = pSurfaceSrc->u.pSurface->LockRect(&LockedSrcRect,
+                                                       &Rect,
+                                                       D3DLOCK_READONLY);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceCopy: LockRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        }
+
+        if (!pSurfaceDest->u.pSurface)
+        {
+            LockedDestRect.pBits = (void *)pSurfaceDest->pMipmapLevels[dest.mipmap].pSurfaceData;
+            LockedDestRect.Pitch  = pSurfaceDest->pMipmapLevels[dest.mipmap].cbSurfacePitch;
+        }
+        else
+        {
+            /* Must flush the other context's 3d pipeline to make sure all drawing is complete for the surface we're about to use. */
+            vmsvga3dSurfaceFlush(pThis, pSurfaceDest);
+
+            if (fDestTexture)
+            {
+                Assert(!pSurfaceDest->bounce.pTexture);
+                hr = pSurfaceDest->u.pTexture->LockRect(dest.mipmap, /* texture level */
+                                                        &LockedDestRect,
+                                                        &Rect,
+                                                        0);
+            }
+            else
+                hr = pSurfaceDest->u.pSurface->LockRect(&LockedDestRect,
+                                                        &Rect,
+                                                        0);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceCopy: LockRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        }
+
+        uint8_t *pDest = (uint8_t *)LockedDestRect.pBits + LockedDestRect.Pitch * pBox[i].y + pBox[i].x * pSurfaceDest->cbBlock;
+        uint8_t *pSrc  = (uint8_t *)LockedSrcRect.pBits + LockedSrcRect.Pitch * pBox[i].srcy + pBox[i].srcx * pSurfaceSrc->cbBlock;
+
+        for (int32_t j = Rect.top; j < Rect.bottom; j++)
+        {
+            memcpy(pDest, pSrc, pBox[i].w * pSurfaceSrc->cbBlock);
+
+            pDest += LockedDestRect.Pitch;
+            pSrc  += LockedSrcRect.Pitch;
+        }
+
+        if (pSurfaceDest->u.pSurface)
+        {
+            if (fDestTexture)
+                hr = pSurfaceDest->u.pTexture->UnlockRect(dest.mipmap /* Texture level */);
+            else
+                hr = pSurfaceDest->u.pSurface->UnlockRect();
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceCopy: Unlock failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        }
+
+        if (pSurfaceSrc->u.pSurface)
+        {
+            if (fSrcTexture)
+                hr = pSurfaceSrc->u.pTexture->UnlockRect(src.mipmap /* Texture level */);
+            else
+                hr = pSurfaceSrc->u.pSurface->UnlockRect();
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceCopy: Unlock failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        }
+    }
+
+    return VINF_SUCCESS;
+}
+
+/* Create D3D texture object for the specified surface. */
+static int vmsvga3dCreateTexture(PVMSVGA3DCONTEXT pContext, uint32_t idAssociatedContext, PVMSVGA3DSURFACE pSurface)
+{
+    HRESULT hr;
+    IDirect3DTexture9 *pTexture;
+
+    Assert(pSurface->hSharedObject == NULL);
+
+    if (    pSurface->formatD3D == D3DFMT_D24S8
+        ||  pSurface->formatD3D == D3DFMT_D24X8)
+    {
+        Assert(pSurface->faces[0].numMipLevels == 1);
+        /* Use the INTZ format for a depth/stencil surface that will be used as a texture */
+        hr = pContext->pDevice->CreateTexture(pSurface->pMipmapLevels[0].size.width, 
+                                              pSurface->pMipmapLevels[0].size.height, 
+                                              1,
+                                              D3DUSAGE_DEPTHSTENCIL,
+                                              FOURCC_INTZ,
+                                              D3DPOOL_DEFAULT,
+                                              &pSurface->u.pTexture,
+                                              &pSurface->hSharedObject /* might result in poor performance */);
+        AssertMsgReturn(hr == D3D_OK, ("vmsvga3dCreateTexture: CreateTexture INTZ failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        pTexture = pSurface->u.pTexture;
+
+        pSurface->fStencilAsTexture = true;
+    }
+    else
+    {
+        hr = pContext->pDevice->CreateTexture(pSurface->pMipmapLevels[0].size.width, 
+                                              pSurface->pMipmapLevels[0].size.height, 
+                                              pSurface->faces[0].numMipLevels, 
+                                              pSurface->fUsageD3D | D3DUSAGE_RENDERTARGET /* required for use as a StretchRect destination */,
+                                              pSurface->formatD3D,
+                                              D3DPOOL_DEFAULT,
+                                              &pSurface->u.pTexture,
+                                              &pSurface->hSharedObject);
+        if (hr == D3D_OK)
+        {
+            /* Create another texture object to serve as a bounce buffer as the above texture surface can't be locked. */ 
+            hr = pContext->pDevice->CreateTexture(pSurface->pMipmapLevels[0].size.width, 
+                                                  pSurface->pMipmapLevels[0].size.height, 
+                                                  pSurface->faces[0].numMipLevels, 
+                                                  (pSurface->fUsageD3D & ~D3DUSAGE_RENDERTARGET) | D3DUSAGE_DYNAMIC /* Lockable */,
+                                                  pSurface->formatD3D,
+                                                  D3DPOOL_SYSTEMMEM,
+                                                  &pSurface->bounce.pTexture,
+                                                  NULL);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dCreateTexture: CreateTexture (systemmem) failed with %x\n", hr), VERR_INTERNAL_ERROR);
+            pTexture = pSurface->bounce.pTexture;
+        }
+        else
+        {
+            Log(("Format not accepted -> try old method\n"));
+            /* The format was probably not accepted; fall back to our old mode. */
+            hr = pContext->pDevice->CreateTexture(pSurface->pMipmapLevels[0].size.width, 
+                                                  pSurface->pMipmapLevels[0].size.height, 
+                                                  pSurface->faces[0].numMipLevels, 
+                                                  (pSurface->fUsageD3D & ~D3DUSAGE_RENDERTARGET) |  D3DUSAGE_DYNAMIC /* Lockable */,
+                                                  pSurface->formatD3D,
+                                                  D3DPOOL_DEFAULT,
+                                                  &pSurface->u.pTexture,
+                                                  &pSurface->hSharedObject /* might result in poor performance */);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dCreateTexture: CreateTexture failed with %x\n", hr), VERR_INTERNAL_ERROR);
+            pTexture = pSurface->u.pTexture;
+        }
+    }
+
+    if (pSurface->autogenFilter != SVGA3D_TEX_FILTER_NONE)
+    {
+        /* Set the mip map generation filter settings. */
+        hr = pSurface->u.pTexture->SetAutoGenFilterType((D3DTEXTUREFILTERTYPE)pSurface->autogenFilter);
+        AssertMsg(hr == D3D_OK, ("vmsvga3dCreateTexture: SetAutoGenFilterType failed with %x\n", hr));
+    }
+
+    if (pSurface->fDirty)
+    {
+        Log(("vmsvga3dCreateTexture: sync dirty texture\n"));
+        for (uint32_t i = 0; i < pSurface->faces[0].numMipLevels; i++)
+        {
+            if (pSurface->pMipmapLevels[i].fDirty)
+            {
+                D3DLOCKED_RECT LockedRect;
+
+                hr = pTexture->LockRect(i, /* texture level */
+                                        &LockedRect,
+                                        NULL,   /* entire texture */
+                                        0);
+
+                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dCreateTexture: LockRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                Log(("vmsvga3dCreateTexture: sync dirty texture mipmap level %d (pitch %x vs %x)\n", i, LockedRect.Pitch, pSurface->pMipmapLevels[i].cbSurfacePitch));
+
+                uint8_t *pDest = (uint8_t *)LockedRect.pBits;
+                uint8_t *pSrc  = (uint8_t *)pSurface->pMipmapLevels[i].pSurfaceData;
+                for (uint32_t j = 0; j < pSurface->pMipmapLevels[i].size.height; j++)
+                {
+                    memcpy(pDest, pSrc, pSurface->pMipmapLevels[i].cbSurfacePitch);
+
+                    pDest += LockedRect.Pitch;
+                    pSrc  += pSurface->pMipmapLevels[i].cbSurfacePitch;
+                }
+
+                hr = pTexture->UnlockRect(i /* texture level */);
+                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dCreateTexture: UnlockRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                pSurface->pMipmapLevels[i].fDirty = false;
+            }
+        }
+        if (pSurface->bounce.pTexture)
+        {
+            Log(("vmsvga3dCreateTexture: sync dirty texture from bounce buffer\n"));
+
+            hr = pContext->pDevice->UpdateTexture(pSurface->bounce.pTexture, pSurface->u.pTexture);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dCreateTexture: UpdateTexture failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+            /* We will now use the bounce texture for all memory accesses, so free our surface memory buffer. */
+            for (uint32_t i = 0; i < pSurface->faces[0].numMipLevels; i++)
+            {
+                RTMemFree(pSurface->pMipmapLevels[i].pSurfaceData);
+                pSurface->pMipmapLevels[i].pSurfaceData = NULL;
+            }
+        }
+        pSurface->fDirty = false;
+    }
+    pSurface->flags              |= SVGA3D_SURFACE_HINT_TEXTURE;
+    pSurface->idAssociatedContext = idAssociatedContext;
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSurfaceStretchBlt(PVGASTATE pThis, SVGA3dSurfaceImageId dest, SVGA3dBox destBox, SVGA3dSurfaceImageId src, SVGA3dBox srcBox, SVGA3dStretchBltMode mode)
+{
+    PVMSVGA3DSTATE      pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    PVMSVGA3DSURFACE    pSurfaceSrc;
+    uint32_t            sidSrc = src.sid;
+    PVMSVGA3DSURFACE    pSurfaceDest;
+    uint32_t            sidDest = dest.sid;
+    int                 rc = VINF_SUCCESS;
+    uint32_t            cid;
+    PVMSVGA3DCONTEXT    pContext;
+
+    AssertReturn(pState, VERR_NO_MEMORY);
+    AssertReturn(sidSrc < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(sidSrc < pState->cSurfaces && pState->paSurface[sidSrc].id == sidSrc, VERR_INVALID_PARAMETER);
+    AssertReturn(sidDest < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(sidDest < pState->cSurfaces && pState->paSurface[sidDest].id == sidDest, VERR_INVALID_PARAMETER);
+
+    pSurfaceSrc  = &pState->paSurface[sidSrc];
+    pSurfaceDest = &pState->paSurface[sidDest];
+    AssertReturn(pSurfaceSrc->faces[0].numMipLevels > src.mipmap, VERR_INVALID_PARAMETER);
+    AssertReturn(pSurfaceDest->faces[0].numMipLevels > dest.mipmap, VERR_INVALID_PARAMETER);
+
+    Log(("vmsvga3dSurfaceStretchBlt: src sid=%x (%d,%d)(%d,%d) dest sid=%x (%d,%d)(%d,%d) mode=%x\n", src.sid, srcBox.x, srcBox.y, srcBox.x + srcBox.w, srcBox.y + srcBox.h, dest.sid, destBox.x, destBox.y, destBox.x + destBox.w, destBox.y + destBox.h, mode));
+
+    /* @todo stricter checks for associated context */
+    cid = pSurfaceDest->idAssociatedContext;
+    if (cid == SVGA3D_INVALID_ID)
+        cid = pSurfaceSrc->idAssociatedContext;
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSurfaceStretchBlt invalid context id!\n"));
+        AssertFailedReturn(VERR_INVALID_PARAMETER);
+    }
+    pContext = &pState->paContext[cid];
+
+    if (!pSurfaceSrc->u.pSurface)
+    {
+        /* Unknown surface type; turn it into a texture, which can be used for other purposes too. */
+        Log(("vmsvga3dSurfaceStretchBlt: unknown src surface id=%x type=%d format=%d -> create texture\n", sidSrc, pSurfaceSrc->flags, pSurfaceSrc->format));
+        rc = vmsvga3dCreateTexture(pContext, cid, pSurfaceSrc);
+        AssertRCReturn(rc, rc);
+    }
+
+    if (!pSurfaceDest->u.pSurface)
+    {
+        /* Unknown surface type; turn it into a texture, which can be used for other purposes too. */
+        Log(("vmsvga3dSurfaceStretchBlt: unknown dest surface id=%x type=%d format=%d -> create texture\n", sidDest, pSurfaceDest->flags, pSurfaceDest->format));
+        rc = vmsvga3dCreateTexture(pContext, cid, pSurfaceDest);
+        AssertRCReturn(rc, rc);
+    }
+
+    /* Flush the drawing pipeline for this surface as it could be used in a shared context. */
+    vmsvga3dSurfaceFlush(pThis, pSurfaceSrc);
+    vmsvga3dSurfaceFlush(pThis, pSurfaceDest);
+
+    bool fSrcTexture  = !!(pSurfaceSrc->flags & SVGA3D_SURFACE_HINT_TEXTURE);
+    bool fDestTexture = !!(pSurfaceDest->flags & SVGA3D_SURFACE_HINT_TEXTURE);
+
+    HRESULT                 hr;
+    RECT                    RectSrc;
+    RECT                    RectDest;
+    D3DTEXTUREFILTERTYPE    moded3d;
+    IDirect3DSurface9      *pSrc;
+    IDirect3DSurface9      *pDest;
+
+    RectSrc.left    = srcBox.x;
+    RectSrc.top     = srcBox.y;
+    RectSrc.right   = srcBox.x + srcBox.w;   /* exclusive */
+    RectSrc.bottom  = srcBox.y + srcBox.h;   /* exclusive */
+    RectDest.left   = destBox.x;
+    RectDest.top    = destBox.y;
+    RectDest.right  = destBox.x + destBox.w;   /* exclusive */
+    RectDest.bottom = destBox.y + destBox.h;   /* exclusive */
+
+    Assert(!destBox.z && !srcBox.z);
+
+    if (fSrcTexture)
+    {
+        hr = pSurfaceSrc->u.pTexture->GetSurfaceLevel(src.mipmap /* Texture level */,
+                                                      &pSrc);
+        AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceStretchBlt: GetSurfaceLevel failed with %x\n", hr), VERR_INTERNAL_ERROR);
+    }
+    else
+        pSrc = pSurfaceSrc->u.pSurface;
+
+    if (fDestTexture)
+    {
+        hr = pSurfaceDest->u.pTexture->GetSurfaceLevel(dest.mipmap /* Texture level */,
+                                                      &pDest);
+        AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceStretchBlt: GetSurfaceLevel failed with %x\n", hr), VERR_INTERNAL_ERROR);
+    }
+    else
+        pDest = pSurfaceDest->u.pSurface;
+
+    switch (mode)
+    {
+    case SVGA3D_STRETCH_BLT_POINT:
+        moded3d = D3DTEXF_POINT;
+        break;
+
+    case SVGA3D_STRETCH_BLT_LINEAR:
+        moded3d = D3DTEXF_LINEAR;
+        break;
+
+    default:
+        AssertFailed();
+        moded3d = D3DTEXF_NONE;
+        break;
+    }
+
+    hr = pContext->pDevice->StretchRect(pSrc, &RectSrc, pDest, &RectDest, moded3d);
+
+    /* GetSurfaceLevel increases the reference count; release the objects again. */
+    if (fDestTexture)
+        pDest->Release();
+    if (fSrcTexture)
+        pSrc->Release();
+
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceStretchBlt: StretchRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    /* Track the StretchRect operation. */
+    vmsvga3dSurfaceTrackUsage(pThis, pContext, sidSrc);
+    vmsvga3dSurfaceTrackUsage(pThis, pContext, sidDest);
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSurfaceDMA(PVGASTATE pThis, SVGA3dGuestImage guest, SVGA3dSurfaceImageId host, SVGA3dTransferType transfer, uint32_t cCopyBoxes, SVGA3dCopyBox *pBoxes)
+{
+    PVMSVGA3DSTATE          pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    PVMSVGA3DSURFACE        pSurface;
+    PVMSVGA3DMIPMAPLEVEL    pMipLevel;
+    uint32_t                sid = host.sid;
+    int                     rc = VINF_SUCCESS;
+
+    AssertReturn(pState, VERR_NO_MEMORY);
+    AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(sid < pState->cSurfaces && pState->paSurface[sid].id == sid, VERR_INVALID_PARAMETER);
+
+    pSurface = &pState->paSurface[sid];
+    AssertReturn(pSurface->faces[0].numMipLevels > host.mipmap, VERR_INVALID_PARAMETER);
+    pMipLevel = &pSurface->pMipmapLevels[host.mipmap];
+
+    if (pSurface->flags & SVGA3D_SURFACE_HINT_TEXTURE)
+        Log(("vmsvga3dSurfaceDMA TEXTURE guestptr gmr=%x offset=%x pitch=%x host sid=%x face=%d mipmap=%d transfer=%x cCopyBoxes=%d\n", guest.ptr.gmrId, guest.ptr.offset, guest.pitch, host.sid, host.face, host.mipmap, transfer, cCopyBoxes));
+    else
+        Log(("vmsvga3dSurfaceDMA guestptr gmr=%x offset=%x pitch=%x host sid=%x face=%d mipmap=%d transfer=%x cCopyBoxes=%d\n", guest.ptr.gmrId, guest.ptr.offset, guest.pitch, host.sid, host.face, host.mipmap, transfer, cCopyBoxes));
+
+    if (!pSurface->u.pSurface)
+    {
+        AssertReturn(pSurface->pMipmapLevels[host.mipmap].pSurfaceData, VERR_INTERNAL_ERROR);
+
+        for (unsigned i = 0; i < cCopyBoxes; i++)
+        {
+            unsigned uDestOffset;
+            unsigned cbSrcPitch;
+
+            Log(("Copy box %d (%d,%d,%d)(%d,%d,%d)\n", i, pBoxes[i].srcx, pBoxes[i].srcy, pBoxes[i].srcz, pBoxes[i].w, pBoxes[i].h, pBoxes[i].d));
+            /* Apparently we're supposed to clip it (gmr test sample) */
+            if (pBoxes[i].x + pBoxes[i].w > pMipLevel->size.width)
+                pBoxes[i].w = pMipLevel->size.width - pBoxes[i].x;
+            if (pBoxes[i].y + pBoxes[i].h > pMipLevel->size.height)
+                pBoxes[i].h = pMipLevel->size.height - pBoxes[i].y;
+            if (pBoxes[i].z + pBoxes[i].d > pMipLevel->size.depth)
+                pBoxes[i].d = pMipLevel->size.depth - pBoxes[i].z;
+
+            if (    !pBoxes[i].w
+                ||  !pBoxes[i].h
+                ||  !pBoxes[i].d
+                ||   pBoxes[i].x > pMipLevel->size.width
+                ||   pBoxes[i].y > pMipLevel->size.height
+                ||   pBoxes[i].z > pMipLevel->size.depth)
+            {
+                Log(("Empty box; skip\n"));
+                continue;
+            }
+
+            uDestOffset = pBoxes[i].x * pSurface->cbBlock + pBoxes[i].y * pMipLevel->cbSurfacePitch + pBoxes[i].z * pMipLevel->size.height * pMipLevel->cbSurfacePitch;
+            AssertReturn(uDestOffset + pBoxes[i].w * pSurface->cbBlock * pBoxes[i].h * pBoxes[i].d <= pMipLevel->cbSurface, VERR_INTERNAL_ERROR);
+
+            cbSrcPitch = (guest.pitch == 0) ? pBoxes[i].w * pSurface->cbBlock : guest.pitch;
+
+            rc = vmsvgaGMRTransfer(pThis, 
+                                    transfer,
+                                    (uint8_t *)pMipLevel->pSurfaceData + uDestOffset, 
+                                    pMipLevel->cbSurfacePitch, 
+                                    guest.ptr,
+                                    pBoxes[i].srcx * pSurface->cbBlock + (pBoxes[i].srcy + pBoxes[i].srcz * pBoxes[i].h) * cbSrcPitch,
+                                    cbSrcPitch,
+                                    pBoxes[i].w * pSurface->cbBlock,
+                                    pBoxes[i].d * pBoxes[i].h);
+
+            LogFlow(("first line:\n%.*Rhxd\n", pMipLevel->cbSurfacePitch, pMipLevel->pSurfaceData));
+
+            AssertRC(rc);
+        }
+        pSurface->pMipmapLevels[host.mipmap].fDirty = true;
+        pSurface->fDirty = true;
+    }
+    else
+    {
+        HRESULT hr = D3D_OK;
+        DWORD   dwFlags = 0;
+
+        /* Flush the drawing pipeline for this surface as it could be used in a shared context. */
+        vmsvga3dSurfaceFlush(pThis, pSurface);
+
+        if (transfer == SVGA3D_READ_HOST_VRAM)
+            dwFlags |= D3DLOCK_READONLY;
+
+        for (unsigned i = 0; i < cCopyBoxes; i++)
+        {
+            bool fTexture = false;
+            bool fVertex = false;
+            bool fRenderTargetTexture = false;
+            unsigned cbSrcPitch;
+
+            /* Apparently we're supposed to clip it (gmr test sample) */
+            if (pBoxes[i].x + pBoxes[i].w > pMipLevel->size.width)
+                pBoxes[i].w = pMipLevel->size.width - pBoxes[i].x;
+            if (pBoxes[i].y + pBoxes[i].h > pMipLevel->size.height)
+                pBoxes[i].h = pMipLevel->size.height - pBoxes[i].y;
+            if (pBoxes[i].z + pBoxes[i].d > pMipLevel->size.depth)
+                pBoxes[i].d = pMipLevel->size.depth - pBoxes[i].z;
+
+            Assert((pBoxes[i].d == 1 || pBoxes[i].d == 0) && pBoxes[i].z == 0);
+
+            if (    !pBoxes[i].w
+                ||  !pBoxes[i].h
+                ||   pBoxes[i].x > pMipLevel->size.width
+                ||   pBoxes[i].y > pMipLevel->size.height)
+            {
+                Log(("Empty box; skip\n"));
+                continue;
+            }
+
+            cbSrcPitch = (guest.pitch == 0) ? pBoxes[i].w * pSurface->cbBlock : guest.pitch;
+
+            switch (pSurface->flags & (SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET | SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_CUBEMAP))
+            {
+            case SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET:
+                fRenderTargetTexture = true;
+                /* no break */
+            case SVGA3D_SURFACE_HINT_TEXTURE:
+                fTexture = true;
+                /* no break */
+            case SVGA3D_SURFACE_HINT_DEPTHSTENCIL:
+                if (pSurface->fStencilAsTexture)
+                    fTexture = true;
+                /* no break */
+            case SVGA3D_SURFACE_HINT_RENDERTARGET:
+            {
+                D3DLOCKED_RECT LockedRect;
+                RECT Rect;
+
+                Rect.left   = pBoxes[i].x;
+                Rect.top    = pBoxes[i].y;
+                Rect.right  = pBoxes[i].x + pBoxes[i].w;   /* exclusive */
+                Rect.bottom = pBoxes[i].y + pBoxes[i].h;   /* exclusive */
+
+                /* @todo inefficient for VRAM buffers!! */
+                if (fTexture)
+                {
+                    if (pSurface->bounce.pTexture)
+                    {
+                        if (    transfer == SVGA3D_READ_HOST_VRAM
+                            &&  fRenderTargetTexture
+                            &&  i == 0 /* only the first time */)
+                        {
+                            IDirect3DSurface9 *pSrc, *pDest;
+
+                            /* @todo stricter checks for associated context */
+                            uint32_t cid = pSurface->idAssociatedContext;
+                            if (    cid >= pState->cContexts
+                                ||  pState->paContext[cid].id != cid)
+                            {
+                                Log(("vmsvga3dSurfaceDMA invalid context id (%x - %x)!\n", cid, (cid >= pState->cContexts) ? -1 : pState->paContext[cid].id));
+                                AssertFailedReturn(VERR_INVALID_PARAMETER);
+                            }
+                            PVMSVGA3DCONTEXT pContext = &pState->paContext[cid];
+
+                            /* @todo only sync when something was actually rendered (since the last sync) */
+                            Log(("vmsvga3dSurfaceDMA: sync bounce buffer\n"));
+                            hr = pSurface->bounce.pTexture->GetSurfaceLevel(host.mipmap, &pDest);
+                            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceDMA: GetSurfaceLevel failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                            hr = pSurface->u.pTexture->GetSurfaceLevel(host.mipmap, &pSrc);
+                            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceDMA: GetSurfaceLevel failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                            hr = pContext->pDevice->GetRenderTargetData(pSrc, pDest);
+                            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceDMA: GetRenderTargetData failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                            pSrc->Release();
+                            pDest->Release();
+                        }
+
+                        hr = pSurface->bounce.pTexture->LockRect(host.mipmap, /* texture level */
+                                                                 &LockedRect,
+                                                                 &Rect,
+                                                                 dwFlags);
+                    }
+                    else
+                        hr = pSurface->u.pTexture->LockRect(host.mipmap, /* texture level */
+                                                            &LockedRect,
+                                                            &Rect,
+                                                            dwFlags);
+                }
+                else
+                    hr = pSurface->u.pSurface->LockRect(&LockedRect,
+                                                        &Rect,
+                                                        dwFlags);
+                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceDMA: LockRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                if (fTexture)
+                    Log(("Lock TEXTURE (bounce=%d) memory for rectangle (%d,%d)(%d,%d)\n", !!(pSurface->bounce.pTexture), Rect.left, Rect.top, Rect.right, Rect.bottom));
+                else
+                    Log(("Lock %s memory for rectangle (%d,%d)(%d,%d)\n", (pSurface->flags & SVGA3D_SURFACE_HINT_DEPTHSTENCIL) ? "DEPTH-STENCIL" : "RENDERTARGET", Rect.left, Rect.top, Rect.right, Rect.bottom));
+                
+                rc = vmsvgaGMRTransfer(pThis, 
+                                       transfer,
+                                       (uint8_t *)LockedRect.pBits, 
+                                       LockedRect.Pitch, 
+                                       guest.ptr,
+                                       pBoxes[i].srcx * pSurface->cbBlock + pBoxes[i].srcy * cbSrcPitch,
+                                       cbSrcPitch,
+                                       pBoxes[i].w * pSurface->cbBlock,
+                                       pBoxes[i].h);
+                AssertRC(rc);
+
+                LogFlow(("first line:\n%.*Rhxd\n", pBoxes[i].w * pSurface->cbBlock, LockedRect.pBits));
+
+                if (fTexture)
+                {
+                    if (pSurface->bounce.pTexture)
+                    {
+                        hr = pSurface->bounce.pTexture->UnlockRect(host.mipmap);
+                        AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceDMA: UnlockRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                        if (transfer == SVGA3D_WRITE_HOST_VRAM)
+                        {
+                            /* @todo stricter checks for associated context */
+                            uint32_t cid = pSurface->idAssociatedContext;
+                            if (    cid >= pState->cContexts
+                                ||  pState->paContext[cid].id != cid)
+                            {
+                                Log(("vmsvga3dSurfaceDMA invalid context id!\n"));
+                                AssertFailedReturn(VERR_INVALID_PARAMETER);
+                            }
+                            PVMSVGA3DCONTEXT pContext = &pState->paContext[cid];
+
+                            Log(("vmsvga3dSurfaceDMA: sync texture from bounce buffer\n"));
+
+                            /* Copy the new contents to the actual texture object. */
+                            hr = pContext->pDevice->UpdateTexture(pSurface->bounce.pTexture, pSurface->u.pTexture);
+                            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceDMA: UpdateTexture failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                            /* Track the copy operation. */
+                            vmsvga3dSurfaceTrackUsage(pThis, pContext, pSurface->id);
+                        }
+                    }
+                    else
+                        hr = pSurface->u.pTexture->UnlockRect(host.mipmap);
+                }
+                else
+                    hr = pSurface->u.pSurface->UnlockRect();
+                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceDMA: UnlockRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
+                break;
+            }
+
+            case SVGA3D_SURFACE_HINT_VERTEXBUFFER:
+                fVertex = true;
+                /* no break */
+
+            case SVGA3D_SURFACE_HINT_INDEXBUFFER:
+            {
+                uint8_t *pData;
+                unsigned uDestOffset;
+
+                uDestOffset = pBoxes[i].x * pSurface->cbBlock + pBoxes[i].y * pSurface->pMipmapLevels[host.mipmap].cbSurfacePitch;
+                AssertReturn(uDestOffset + pBoxes[i].w * pSurface->cbBlock + (pBoxes[i].h - 1) * pSurface->pMipmapLevels[host.mipmap].cbSurfacePitch <= pSurface->pMipmapLevels[host.mipmap].cbSurface, VERR_INTERNAL_ERROR);
+
+                /* @todo lock only as much as we really need */
+                if (fVertex)
+                    hr = pSurface->u.pVertexBuffer->Lock(0, 0, (void **)&pData, dwFlags);
+                else        
+                    hr = pSurface->u.pIndexBuffer->Lock(0, 0, (void **)&pData, dwFlags);
+                AssertMsg(hr == D3D_OK, ("vmsvga3dSurfaceDMA: Lock %s failed with %x\n", (fVertex) ? "vertex" : "index", hr));
+
+                Log(("Lock %s memory for rectangle (%d,%d)(%d,%d)\n", (fVertex) ? "vertex" : "index", pBoxes[i].x, pBoxes[i].y, pBoxes[i].x + pBoxes[i].w, pBoxes[i].y + pBoxes[i].h));
+
+                rc = vmsvgaGMRTransfer(pThis, 
+                                       transfer,
+                                       pData + uDestOffset, 
+                                       pSurface->pMipmapLevels[host.mipmap].cbSurfacePitch, 
+                                       guest.ptr,
+                                       pBoxes[i].srcx * pSurface->cbBlock + pBoxes[i].srcy * cbSrcPitch,
+                                       cbSrcPitch,
+                                       pBoxes[i].w * pSurface->cbBlock,
+                                       pBoxes[i].h);
+                AssertRC(rc);
+
+                LogFlow(("first line:\n%.*Rhxd\n", cbSrcPitch, pData));
+
+                if (fVertex)
+                    hr = pSurface->u.pVertexBuffer->Unlock();
+                else
+                    hr = pSurface->u.pIndexBuffer->Unlock();
+                AssertMsg(hr == D3D_OK, ("vmsvga3dSurfaceDMA: Unlock %s failed with %x\n", (fVertex) ? "vertex" : "index", hr));
+                break;
+            }
+
+            default:
+                AssertFailed();
+                break;
+            }
+        }
+    }
+    return rc;
+}
+
+int vmsvga3dSurfaceBlitToScreen(PVGASTATE pThis, uint32_t dest, SVGASignedRect destRect, SVGA3dSurfaceImageId src, SVGASignedRect srcRect, uint32_t cRects, SVGASignedRect *pRect)
+{
+    /* Requires SVGA_FIFO_CAP_SCREEN_OBJECT support */
+    Log(("vmsvga3dSurfaceBlitToScreen: dest=%d (%d,%d)(%d,%d) surface=%x (face=%d, mipmap=%d) (%d,%d)(%d,%d) cRects=%d\n", dest, destRect.left, destRect.top, destRect.right, destRect.bottom, src.sid, src.face, src.mipmap, srcRect.left, srcRect.top, srcRect.right, srcRect.bottom, cRects));
+    for (uint32_t i = 0; i < cRects; i++)
+    {
+        Log(("vmsvga3dSurfaceBlitToScreen: clipping rect %d (%d,%d)(%d,%d)\n", i, pRect[i].left, pRect[i].top, pRect[i].right, pRect[i].bottom));
+    }
+
+    /* @todo Only screen 0 for now. */
+    AssertReturn(dest == 0, VERR_INTERNAL_ERROR);
+    AssertReturn(src.mipmap == 0 && src.face == 0, VERR_INVALID_PARAMETER);
+    /* @todo scaling */
+    AssertReturn(destRect.right - destRect.left == srcRect.right - srcRect.left && destRect.bottom - destRect.top == srcRect.bottom - srcRect.top, VERR_INVALID_PARAMETER);
+
+    if (cRects == 0)
+    {
+        /* easy case; no clipping */
+        SVGA3dCopyBox        box;
+        SVGA3dGuestImage     dest;
+       
+        box.x       = destRect.left;
+        box.y       = destRect.top;
+        box.z       = 0;
+        box.w       = destRect.right - destRect.left;
+        box.h       = destRect.bottom - destRect.top;
+        box.d       = 1;
+        box.srcx    = srcRect.left;
+        box.srcy    = srcRect.top;
+        box.srcz    = 0;
+
+        dest.ptr.gmrId  = SVGA_GMR_FRAMEBUFFER;
+        dest.ptr.offset = 0;
+        dest.pitch      = pThis->svga.cbScanline;
+
+        int rc = vmsvga3dSurfaceDMA(pThis, dest, src, SVGA3D_READ_HOST_VRAM, 1, &box);
+        AssertRCReturn(rc, rc);
+
+        vgaR3UpdateDisplay(pThis, box.x, box.y, box.w, box.h);
+        return VINF_SUCCESS;
+    }
+    else
+    {
+        SVGA3dGuestImage dest;
+        SVGA3dCopyBox    box;
+
+        box.srcz    = 0;
+        box.z       = 0;
+        box.d       = 1;
+
+        dest.ptr.gmrId  = SVGA_GMR_FRAMEBUFFER;
+        dest.ptr.offset = 0;
+        dest.pitch      = pThis->svga.cbScanline;
+
+        /* @todo merge into one SurfaceDMA call */
+        for (uint32_t i = 0; i < cRects; i++)
+        {   
+            /* The clipping rectangle is relative to the top-left corner of srcRect & destRect. Adjust here. */
+            box.srcx = srcRect.left + pRect[i].left;
+            box.srcy = srcRect.top  + pRect[i].top;
+
+            box.x    = pRect[i].left + destRect.left;
+            box.y    = pRect[i].top  + destRect.top;
+            box.z    = 0;
+            box.w    = pRect[i].right - pRect[i].left;
+            box.h    = pRect[i].bottom - pRect[i].top;
+
+            int rc = vmsvga3dSurfaceDMA(pThis, dest, src, SVGA3D_READ_HOST_VRAM, 1, &box);
+            AssertRCReturn(rc, rc);
+
+            vgaR3UpdateDisplay(pThis, box.x, box.y, box.w, box.h);
+        }
+
+#if 0
+        {
+            PVMSVGA3DSTATE      pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+            HRESULT hr;
+            PVMSVGA3DSURFACE    pSurface;
+            PVMSVGA3DCONTEXT    pContext;
+            uint32_t            sid = src.sid;
+            AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+            AssertReturn(sid < pState->cSurfaces && pState->paSurface[sid].id == sid, VERR_INVALID_PARAMETER);
+
+            pSurface = &pState->paSurface[sid];
+            uint32_t            cid;
+
+            /* @todo stricter checks for associated context */
+            cid = pSurface->idAssociatedContext;
+
+            if (    cid >= pState->cContexts
+                ||  pState->paContext[cid].id != cid)
+            {
+                Log(("vmsvga3dGenerateMipmaps invalid context id!\n"));
+                return VERR_INVALID_PARAMETER;
+            }
+            pContext = &pState->paContext[cid];
+
+            if (pSurface->id == 0x5e)
+            {
+                IDirect3DSurface9 *pSrc;
+
+                hr = pSurface->u.pTexture->GetSurfaceLevel(0/* Texture level */,
+                                                           &pSrc);
+                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceStretchBlt: GetSurfaceLevel failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                pContext->pDevice->ColorFill(pSrc, NULL, (D3DCOLOR)0x11122255);
+                pSrc->Release();
+            }
+        }
+#endif
+
+        return VINF_SUCCESS;
+    }
+}
+
+int vmsvga3dGenerateMipmaps(PVGASTATE pThis, uint32_t sid, SVGA3dTextureFilter filter)
+{
+    PVMSVGA3DSTATE      pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    PVMSVGA3DSURFACE    pSurface;
+    int                 rc = VINF_SUCCESS;
+    HRESULT             hr;
+
+    AssertReturn(pState, VERR_NO_MEMORY);
+    AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(sid < pState->cSurfaces && pState->paSurface[sid].id == sid, VERR_INVALID_PARAMETER);
+
+    pSurface = &pState->paSurface[sid];
+    AssertReturn(pSurface->idAssociatedContext != SVGA3D_INVALID_ID, VERR_INTERNAL_ERROR);
+
+    Assert(filter != SVGA3D_TEX_FILTER_FLATCUBIC);
+    Assert(filter != SVGA3D_TEX_FILTER_GAUSSIANCUBIC);
+    pSurface->autogenFilter = filter;
+
+    Log(("vmsvga3dGenerateMipmaps: sid=%x filter=%d\n", sid, filter));
+
+    if (!pSurface->u.pSurface)
+    {
+        PVMSVGA3DCONTEXT    pContext;
+        uint32_t            cid;
+
+        /* @todo stricter checks for associated context */
+        cid = pSurface->idAssociatedContext;
+
+        if (    cid >= pState->cContexts
+            ||  pState->paContext[cid].id != cid)
+        {
+            Log(("vmsvga3dGenerateMipmaps invalid context id!\n"));
+            return VERR_INVALID_PARAMETER;
+        }
+        pContext = &pState->paContext[cid];
+
+        /* Unknown surface type; turn it into a texture. */
+        Log(("vmsvga3dGenerateMipmaps: unknown src surface id=%x type=%d format=%d -> create texture\n", sid, pSurface->flags, pSurface->format));
+        rc = vmsvga3dCreateTexture(pContext, cid, pSurface);
+        AssertRCReturn(rc, rc);
+    }
+    else
+    {
+        hr = pSurface->u.pTexture->SetAutoGenFilterType((D3DTEXTUREFILTERTYPE)filter);
+        AssertMsg(hr == D3D_OK, ("vmsvga3dGenerateMipmaps: SetAutoGenFilterType failed with %x\n", hr));
+    }
+
+    /* Generate the mip maps. */
+    pSurface->u.pTexture->GenerateMipSubLevels();
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dCommandPresent(PVGASTATE pThis, uint32_t sid, uint32_t cRects, SVGA3dCopyRect *pRect)
+{
+    PVMSVGA3DSTATE      pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    PVMSVGA3DSURFACE    pSurface;
+    int                 rc = VINF_SUCCESS;
+    PVMSVGA3DCONTEXT    pContext;
+    uint32_t            cid;
+    HRESULT             hr;
+    IDirect3DSurface9  *pBackBuffer;
+    IDirect3DSurface9  *pSurfaceD3D;
+    struct 
+    {
+        uint32_t        x;
+        uint32_t        y;
+        uint32_t        cx;
+        uint32_t        cy;
+    } srcViewPort;
+
+    AssertReturn(pState, VERR_NO_MEMORY);
+    AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(sid < pState->cSurfaces && pState->paSurface[sid].id == sid, VERR_INVALID_PARAMETER);
+
+    pSurface = &pState->paSurface[sid];
+    AssertReturn(pSurface->idAssociatedContext != SVGA3D_INVALID_ID, VERR_INTERNAL_ERROR);
+
+    /* @todo stricter checks for associated context */
+    cid = pSurface->idAssociatedContext;
+    Log(("vmsvga3dCommandPresent: sid=%x cRects=%d cid=%x\n", sid, cRects, cid));
+    for (uint32_t i=0; i < cRects; i++)
+    {
+        Log(("vmsvga3dCommandPresent: rectangle %d src=(%d,%d) (%d,%d)(%d,%d)\n", i, pRect[i].srcx, pRect[i].srcy, pRect[i].x, pRect[i].y, pRect[i].x + pRect[i].w, pRect[i].y + pRect[i].h));
+    }
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dCommandPresent invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+
+    hr = pContext->pDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer);
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dCommandPresent: GetBackBuffer failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    if (pSurface->flags & SVGA3D_SURFACE_HINT_TEXTURE)
+    {
+        hr = pSurface->u.pTexture->GetSurfaceLevel(0, &pSurfaceD3D);
+        AssertMsgReturn(hr == D3D_OK, ("vmsvga3dCommandPresent: GetSurfaceLevel failed with %x\n", hr), VERR_INTERNAL_ERROR);        
+    }
+    else
+        pSurfaceD3D = pSurface->u.pSurface;
+
+    /* Source surface different size? */
+    if (pSurface->pMipmapLevels[0].size.width  != pThis->svga.uWidth ||
+        pSurface->pMipmapLevels[0].size.height != pThis->svga.uHeight)
+    {
+        float xMultiplier = (float)pSurface->pMipmapLevels[0].size.width / (float)pThis->svga.uWidth;
+        float yMultiplier = (float)pSurface->pMipmapLevels[0].size.height / (float)pThis->svga.uHeight;
+
+        srcViewPort.x  = (uint32_t)((float)pThis->svga.viewport.x  * xMultiplier);
+        srcViewPort.y  = (uint32_t)((float)pThis->svga.viewport.y  * yMultiplier);
+        srcViewPort.cx = (uint32_t)((float)pThis->svga.viewport.cx * xMultiplier);
+        srcViewPort.cy = (uint32_t)((float)pThis->svga.viewport.cy * yMultiplier);
+    }
+    else
+    {
+        srcViewPort.x  = pThis->svga.viewport.x;
+        srcViewPort.y  = pThis->svga.viewport.y;
+        srcViewPort.cx = pThis->svga.viewport.cx;
+        srcViewPort.cy = pThis->svga.viewport.cy;
+    }
+
+    /* @note the viewport doesn't affect blitting. */
+    if (cRects == 0)
+    {
+        RECT rectDest, rectSrc;
+
+        rectSrc.left    = srcViewPort.x;
+        rectSrc.top     = srcViewPort.y;
+        rectSrc.right   = rectSrc.left + srcViewPort.cx;
+        rectSrc.bottom  = rectSrc.top  + srcViewPort.cy;
+        rectDest.left   = 0;
+        rectDest.top    = 0;
+        rectDest.right  = pThis->svga.viewport.cx;
+        rectDest.bottom = pThis->svga.viewport.cy;
+        hr = pContext->pDevice->StretchRect(pSurfaceD3D, &rectSrc, pBackBuffer, &rectDest, D3DTEXF_NONE);
+    }
+    else
+    {
+        for (uint32_t i = 0; i < cRects; i++)
+        {
+            RECT rectSrc;
+            RECT rectDest;
+
+            if (    pRect[i].x + pRect[i].w <= pThis->svga.viewport.x
+                ||  pThis->svga.viewport.x + pThis->svga.viewport.cx <= pRect[i].x
+                ||  pRect[i].y + pRect[i].h <= pThis->svga.viewport.y
+                ||  pThis->svga.viewport.y + pThis->svga.viewport.cy <= pRect[i].y)
+            {
+                /* Intersection is empty; skip */
+                continue;
+            }
+
+            rectSrc.left    = RT_MAX(pRect[i].srcx, srcViewPort.x);
+            rectSrc.top     = RT_MAX(pRect[i].srcy, srcViewPort.y);
+            rectSrc.right   = RT_MIN(pRect[i].srcx + pRect[i].w, srcViewPort.x + srcViewPort.cx);
+            rectSrc.bottom  = RT_MIN(pRect[i].srcy + pRect[i].h, srcViewPort.y + srcViewPort.cy);
+            rectDest.left   = RT_MAX(pRect[i].x, pThis->svga.viewport.x) - pThis->svga.viewport.x;
+            rectDest.top    = RT_MAX(pRect[i].y, pThis->svga.viewport.y) - pThis->svga.viewport.y;
+            rectDest.right  = RT_MIN(pRect[i].x + pRect[i].w, pThis->svga.viewport.x + pThis->svga.viewport.cx) - pThis->svga.viewport.x;
+            rectDest.bottom = RT_MIN(pRect[i].y + pRect[i].h, pThis->svga.viewport.y + pThis->svga.viewport.cy) - pThis->svga.viewport.y;
+
+            hr = pContext->pDevice->StretchRect(pSurfaceD3D, &rectSrc, pBackBuffer, &rectDest, D3DTEXF_NONE);
+            AssertBreak(hr == D3D_OK);
+        }
+    }
+
+    if (pSurface->flags & SVGA3D_SURFACE_HINT_TEXTURE)
+        pSurfaceD3D->Release();
+
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dCommandPresent: StretchRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    hr = pContext->pDevice->Present(NULL, NULL, NULL, NULL);
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dCommandPresent: Present failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    pBackBuffer->Release();
+    return VINF_SUCCESS;
+}
+
+
+/**
+ * Create a new 3d context
+ *
+ * @returns VBox status code.
+ * @param   pThis           VGA device instance data.
+ * @param   cid             Context id
+ */
+int vmsvga3dContextDefine(PVGASTATE pThis, uint32_t cid)
+{
+    int                     rc;
+    PVMSVGA3DCONTEXT        pContext;
+    HRESULT                 hr;
+    D3DPRESENT_PARAMETERS   PresParam;
+    PVMSVGA3DSTATE          pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+
+    AssertReturn(pState, VERR_NO_MEMORY);
+    AssertReturn(cid < SVGA3D_MAX_CONTEXT_IDS, VERR_INVALID_PARAMETER);
+
+    Log(("vmsvga3dContextDefine id %x\n", cid));
+
+    if (cid >= pState->cContexts)
+    {
+        pState->paContext = (PVMSVGA3DCONTEXT)RTMemRealloc(pState->paContext, sizeof(VMSVGA3DCONTEXT) * (cid + 1));
+        AssertReturn(pState->paContext, VERR_NO_MEMORY);
+        memset(&pState->paContext[pState->cContexts], 0, sizeof(VMSVGA3DCONTEXT) * (cid + 1 - pState->cContexts));
+        for (uint32_t i = pState->cContexts; i < cid + 1; i++)
+            pState->paContext[i].id = SVGA3D_INVALID_ID;
+
+        pState->cContexts = cid + 1;
+    }
+    /* If one already exists with this id, then destroy it now. */
+    if (pState->paContext[cid].id != SVGA3D_INVALID_ID)
+        vmsvga3dContextDestroy(pThis, cid);
+
+    pContext = &pState->paContext[cid];
+    memset(pContext, 0, sizeof(*pContext));
+    pContext->id               = cid;
+    for (uint32_t i = 0; i< RT_ELEMENTS(pContext->aSidActiveTexture); i++)
+        pContext->aSidActiveTexture[i] = SVGA3D_INVALID_ID;
+    pContext->sidRenderTarget  = SVGA3D_INVALID_ID;
+    pContext->state.shidVertex = SVGA3D_INVALID_ID;
+    pContext->state.shidPixel  = SVGA3D_INVALID_ID;
+
+    for (uint32_t i = 0; i < RT_ELEMENTS(pContext->state.aRenderTargets); i++)
+        pContext->state.aRenderTargets[i] = SVGA3D_INVALID_ID;
+
+    /* Create a context window. */
+    CREATESTRUCT cs;
+
+    AssertReturn(pThis->svga.u64HostWindowId, VERR_INTERNAL_ERROR);
+
+    cs.lpCreateParams   = NULL;
+    cs.dwExStyle        = WS_EX_NOACTIVATE | WS_EX_NOPARENTNOTIFY | WS_EX_TRANSPARENT;
+#ifdef DEBUG_GFX_WINDOW
+    cs.lpszName         = (char *)RTMemAllocZ(256);
+    RTStrPrintf((char *)cs.lpszName, 256, "Context %d OpenGL Window", cid);
+#else
+    cs.lpszName         = NULL;
+#endif
+    cs.lpszClass        = NULL;
+#ifdef DEBUG_GFX_WINDOW
+    cs.style            = WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE | WS_CAPTION;
+#else
+    cs.style            = WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_DISABLED | WS_CHILD | WS_VISIBLE;
+#endif
+    cs.x                = 0;
+    cs.y                = 0;
+    cs.cx               = pThis->svga.uWidth;
+    cs.cy               = pThis->svga.uHeight;
+    cs.hwndParent       = (HWND)pThis->svga.u64HostWindowId;
+    cs.hMenu            = NULL;
+    cs.hInstance        = pState->hInstance;
+
+    rc = vmsvga3dSendThreadMessage(pState->pWindowThread, pState->WndRequestSem, WM_VMSVGA3D_CREATEWINDOW, (WPARAM)&pContext->hwnd, (LPARAM)&cs);
+    AssertRCReturn(rc, rc);
+
+    /* Changed when the function returns. */
+    PresParam.BackBufferWidth               = 0;
+    PresParam.BackBufferHeight              = 0;
+    PresParam.BackBufferFormat              = D3DFMT_UNKNOWN;
+    PresParam.BackBufferCount               = 0;
+
+    PresParam.MultiSampleType               = D3DMULTISAMPLE_NONE;
+    PresParam.MultiSampleQuality            = 0;
+    PresParam.SwapEffect                    = D3DSWAPEFFECT_FLIP;
+    PresParam.hDeviceWindow                 = pContext->hwnd;
+    PresParam.Windowed                      = TRUE;     /* @todo */
+    PresParam.EnableAutoDepthStencil        = FALSE;
+    PresParam.AutoDepthStencilFormat        = D3DFMT_UNKNOWN;   /* not relevant */
+    PresParam.Flags                         = 0;
+    PresParam.FullScreen_RefreshRateInHz    = 0;        /* windowed -> 0 */
+    /* @todo consider using D3DPRESENT_DONOTWAIT so we don't wait for the GPU during Present calls. */
+    PresParam.PresentationInterval          = D3DPRESENT_INTERVAL_IMMEDIATE;
+
+#ifdef VBOX_VMSVGA3D_WITH_OPENGL
+    hr = pState->pD3D9->CreateDevice(D3DADAPTER_DEFAULT,
+                                     D3DDEVTYPE_HAL,
+                                     pContext->hwnd,
+                                     D3DCREATE_MULTITHREADED | D3DCREATE_MIXED_VERTEXPROCESSING, //D3DCREATE_HARDWARE_VERTEXPROCESSING,
+                                     &PresParam,
+                                     &pContext->pDevice);
+#else
+    hr = pState->pD3D9->CreateDeviceEx(D3DADAPTER_DEFAULT,
+                                       D3DDEVTYPE_HAL,
+                                       pContext->hwnd,
+                                       D3DCREATE_MULTITHREADED | D3DCREATE_MIXED_VERTEXPROCESSING, //D3DCREATE_HARDWARE_VERTEXPROCESSING,
+                                       &PresParam,
+                                       NULL,
+                                       &pContext->pDevice);
+#endif
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dContextDefine: CreateDevice failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    Log(("vmsvga3dContextDefine: Backbuffer (%d,%d) count=%d format=%x\n", PresParam.BackBufferWidth, PresParam.BackBufferHeight, PresParam.BackBufferCount, PresParam.BackBufferFormat));
+    return VINF_SUCCESS;
+}
+
+/**
+ * Destroy an existing 3d context
+ *
+ * @returns VBox status code.
+ * @param   pThis           VGA device instance data.
+ * @param   cid             Context id
+ */
+int vmsvga3dContextDestroy(PVGASTATE pThis, uint32_t cid)
+{
+    PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    AssertReturn(cid < SVGA3D_MAX_CONTEXT_IDS, VERR_INVALID_PARAMETER);
+
+    if (    cid < pState->cContexts
+        &&  pState->paContext[cid].id == cid)
+    {
+        PVMSVGA3DCONTEXT pContext = &pState->paContext[cid];
+
+        Log(("vmsvga3dContextDestroy id %x\n", cid));
+
+        /* Check for all surfaces that are associated with this context to remove all dependencies */
+        for (uint32_t sid = 0; sid < pState->cSurfaces; sid++)
+        {
+            PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];
+            if (    pSurface->id == sid
+                &&  pSurface->idAssociatedContext == cid)
+            {
+                int rc;
+
+                Log(("vmsvga3dContextDestroy: remove all dependencies for surface %x\n", sid));
+
+                uint32_t            surfaceFlags = pSurface->flags;
+                SVGA3dSurfaceFormat format = pSurface->format;
+                SVGA3dSurfaceFace   face[SVGA3D_MAX_SURFACE_FACES];
+                uint32_t            multisampleCount = pSurface->multiSampleCount;
+                SVGA3dTextureFilter autogenFilter = pSurface->autogenFilter;
+                SVGA3dSize         *pMipLevelSize;
+                uint32_t            cFaces = pSurface->cFaces;
+
+                pMipLevelSize = (SVGA3dSize *)RTMemAllocZ(pSurface->faces[0].numMipLevels * pSurface->cFaces * sizeof(SVGA3dSize));
+                AssertReturn(pMipLevelSize, VERR_NO_MEMORY);
+
+                for (uint32_t face=0; face < pSurface->cFaces; face++)
+                {
+                    for (uint32_t i = 0; i < pSurface->faces[0].numMipLevels; i++)
+                    {
+                        uint32_t idx = i + face * pSurface->faces[0].numMipLevels;
+                        memcpy(&pMipLevelSize[idx], &pSurface->pMipmapLevels[idx].size, sizeof(SVGA3dSize));
+                    }
+                }
+                memcpy(face, pSurface->faces, sizeof(pSurface->faces));
+
+                /* Recreate the surface with the original settings; destroys the contents, but that seems fairly safe since the context is also destroyed. */
+                /** @todo not safe with shared objects */
+                Assert(pSurface->pSharedObjectTree == NULL);
+
+                rc = vmsvga3dSurfaceDestroy(pThis, sid);
+                AssertRC(rc);
+
+                rc = vmsvga3dSurfaceDefine(pThis, sid, surfaceFlags, format, face, multisampleCount, autogenFilter, face[0].numMipLevels * cFaces, pMipLevelSize);
+                AssertRC(rc);
+
+                Assert(!pSurface->u.pSurface);
+            }
+            else
+            {
+                /* Check for a shared surface object. */
+                PVMSVGA3DSHAREDSURFACE pSharedSurface = (PVMSVGA3DSHAREDSURFACE)RTAvlU32Get(&pSurface->pSharedObjectTree, cid);
+                if (pSharedSurface)
+                {
+                    Log(("vmsvga3dContextDestroy: remove shared dependency for surface %x\n", sid));
+
+                    switch (pSurface->flags & (SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET | SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_CUBEMAP))
+                    {
+                    case SVGA3D_SURFACE_HINT_TEXTURE:
+                    case SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET:
+                        Assert(pSharedSurface->u.pTexture);
+                        if (pSharedSurface->u.pTexture)
+                            pSharedSurface->u.pTexture->Release();
+                        break;
+
+                    default:
+                        AssertFailed();
+                        break;
+                    }
+                    RTAvlU32Remove(&pSurface->pSharedObjectTree, cid);
+                    RTMemFree(pSharedSurface);
+                }
+            }
+        }
+
+        /* Destroy all leftover pixel shaders. */
+        for (uint32_t i = 0; i < pContext->cPixelShaders; i++)
+        {
+            if (pContext->paPixelShader[i].id != SVGA3D_INVALID_ID)
+                vmsvga3dShaderDestroy(pThis, pContext->paPixelShader[i].cid, pContext->paPixelShader[i].id, pContext->paPixelShader[i].type);
+        }
+        if (pContext->paPixelShader)
+            RTMemFree(pContext->paPixelShader);
+
+        /* Destroy all leftover vertex shaders. */
+        for (uint32_t i = 0; i < pContext->cVertexShaders; i++)
+        {
+            if (pContext->paVertexShader[i].id != SVGA3D_INVALID_ID)
+                vmsvga3dShaderDestroy(pThis, pContext->paVertexShader[i].cid, pContext->paVertexShader[i].id, pContext->paVertexShader[i].type);
+        }
+        if (pContext->paVertexShader)
+            RTMemFree(pContext->paVertexShader);
+
+        if (pContext->state.paVertexShaderConst)
+            RTMemFree(pContext->state.paVertexShaderConst);
+        if (pContext->state.paPixelShaderConst)
+            RTMemFree(pContext->state.paPixelShaderConst);
+
+        /* Release the D3D device object */
+        pContext->pDevice->Release();
+
+        /* Destroy the window we've created. */
+        int rc = vmsvga3dSendThreadMessage(pState->pWindowThread, pState->WndRequestSem, WM_VMSVGA3D_DESTROYWINDOW, (WPARAM)pContext->hwnd, 0);
+        AssertRC(rc);
+
+        memset(pContext, 0, sizeof(*pContext));
+        pContext->id = SVGA3D_INVALID_ID;
+    }
+    else
+        AssertFailed();
+
+    return VINF_SUCCESS;
+}
+
+#ifdef VBOX_VMSVGA3D_WITH_OPENGL
+#define vmsvga3dContextTrackUsage(pThis, pContext)
+#else
+static int vmsvga3dContextTrackUsage(PVGASTATE pThis, PVMSVGA3DCONTEXT pContext)
+{
+    /* Inject fences to make sure we can track surface usage in case the client wants to reuse it in another context. */
+    for (uint32_t i = 0; i < RT_ELEMENTS(pContext->aSidActiveTexture); i++)
+    {
+        if (pContext->aSidActiveTexture[i] != SVGA3D_INVALID_ID)
+            vmsvga3dSurfaceTrackUsage(pThis, pContext, pContext->aSidActiveTexture[i]);
+    }
+    if (pContext->sidRenderTarget != SVGA3D_INVALID_ID)
+        vmsvga3dSurfaceTrackUsage(pThis, pContext, pContext->sidRenderTarget);
+    return VINF_SUCCESS;
+}
+#endif
+
+/* Handle resize */
+int vmsvga3dChangeMode(PVGASTATE pThis)
+{
+    PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    /* Resize all active contexts. */
+    for (uint32_t i = 0; i < pState->cContexts; i++)
+    {
+        PVMSVGA3DCONTEXT pContext = &pState->paContext[i];
+        uint32_t cid = pContext->id;
+
+        if (cid != SVGA3D_INVALID_ID)
+        {
+            CREATESTRUCT          cs;
+            D3DPRESENT_PARAMETERS PresParam;
+            D3DVIEWPORT9          viewportOrg;
+            HRESULT               hr;
+
+#ifdef VMSVGA3D_DIRECT3D9_RESET
+            /* Sync back all surface data as everything is lost after the Reset. */
+            for (uint32_t sid = 0; sid < pState->cSurfaces; sid++)
+            {
+                PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];
+                if (    pSurface->id == sid
+                    &&  pSurface->idAssociatedContext == cid
+                    &&  pSurface->u.pSurface)
+                {
+                    Log(("vmsvga3dChangeMode: sync back data of surface sid=%x (fDirty=%d)\n", sid, pSurface->fDirty));
+
+                    /* Reallocate our surface memory buffers. */
+                    for (uint32_t i = 0; i < pSurface->cMipLevels; i++)
+                    {
+                        PVMSVGA3DMIPMAPLEVEL pMipmapLevel = &pSurface->pMipmapLevels[i];
+
+                        pMipmapLevel->pSurfaceData   = RTMemAllocZ(pMipmapLevel->cbSurface);
+                        AssertReturn(pMipmapLevel->pSurfaceData, VERR_NO_MEMORY);
+
+                        if (!pSurface->fDirty)
+                        {
+                            D3DLOCKED_RECT LockedRect;
+
+                            if (pSurface->bounce.pTexture)
+                            {
+                                IDirect3DSurface9 *pSrc, *pDest;
+
+                                /* @todo only sync when something was actually rendered (since the last sync) */
+                                Log(("vmsvga3dChangeMode: sync bounce buffer (level %d)\n", i));
+                                hr = pSurface->bounce.pTexture->GetSurfaceLevel(i, &pDest);
+                                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dChangeMode: GetSurfaceLevel failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                                hr = pSurface->u.pTexture->GetSurfaceLevel(i, &pSrc);
+                                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dChangeMode: GetSurfaceLevel failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                                hr = pContext->pDevice->GetRenderTargetData(pSrc, pDest);
+                                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dChangeMode: GetRenderTargetData failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                                pSrc->Release();
+                                pDest->Release();
+
+                                hr = pSurface->bounce.pTexture->LockRect(i,
+                                                                         &LockedRect,
+                                                                         NULL,
+                                                                         D3DLOCK_READONLY);
+                            }
+                            else
+                                hr = pSurface->u.pTexture->LockRect(i,
+                                                                    &LockedRect,
+                                                                    NULL,
+                                                                    D3DLOCK_READONLY);
+                            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dChangeMode: LockRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                            /* Copy the data one line at a time in case the internal pitch is different. */
+                            for (uint32_t j = 0; j < pMipmapLevel->size.height; j++)
+                            {
+                                memcpy((uint8_t *)pMipmapLevel->pSurfaceData + j * pMipmapLevel->cbSurfacePitch, (uint8_t *)LockedRect.pBits + j * LockedRect.Pitch, pMipmapLevel->cbSurfacePitch);
+                            }
+
+                            if (pSurface->bounce.pTexture)
+                                hr = pSurface->bounce.pTexture->UnlockRect(i);
+                            else
+                                hr = pSurface->u.pTexture->UnlockRect(i);
+                            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dChangeMode: UnlockRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
+                        }
+                    }
+
+
+                    switch (pSurface->flags & (SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET | SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_CUBEMAP))
+                    {
+                    case SVGA3D_SURFACE_CUBEMAP:
+                        AssertFailed(); /* @todo */
+                        break;
+
+                    case SVGA3D_SURFACE_HINT_INDEXBUFFER:
+                        pSurface->u.pIndexBuffer->Release();
+                        break;
+
+                    case SVGA3D_SURFACE_HINT_VERTEXBUFFER:
+                        pSurface->u.pVertexBuffer->Release();
+                        pSurface->u.pVertexBuffer = NULL;
+                        break;
+
+                    case SVGA3D_SURFACE_HINT_TEXTURE:
+                    case SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET:
+                        pSurface->u.pTexture->Release();
+                        pSurface->u.pTexture = NULL;
+                        if (pSurface->bounce.pTexture)
+                        {
+                            pSurface->bounce.pTexture->Release();
+                            pSurface->bounce.pTexture = NULL;
+                        }
+                        break;
+
+                    case SVGA3D_SURFACE_HINT_RENDERTARGET:
+                    case SVGA3D_SURFACE_HINT_DEPTHSTENCIL:
+                        if (pSurface->fStencilAsTexture)
+                            pSurface->u.pTexture->Release();
+                        else
+                            pSurface->u.pSurface->Release();
+                        pSurface->u.pSurface = NULL;
+                        break;
+
+                    default:
+                        break;
+                    }
+                    RTAvlU32Destroy(&pSurface->pSharedObjectTree, vmsvga3dSharedSurfaceDestroyTree, pSurface);
+                    Assert(pSurface->pSharedObjectTree == NULL);
+
+                    pSurface->idAssociatedContext = SVGA3D_INVALID_ID;
+                    pSurface->hSharedObject       = 0;
+                }
+            }
+#endif /* #ifdef VMSVGA3D_DIRECT3D9_RESET */
+            memset(&cs, 0, sizeof(cs));            
+            cs.cx = pThis->svga.uWidth;
+            cs.cy = pThis->svga.uHeight;
+
+            Log(("vmsvga3dChangeMode: Resize window %x of context %d to (%d,%d)\n", pContext->hwnd, pContext->id, cs.cx, cs.cy));
+
+            hr = pContext->pDevice->GetViewport(&viewportOrg);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dChangeMode: GetViewport failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+            Log(("vmsvga3dChangeMode: old viewport settings (%d,%d)(%d,%d) z=%d/%d\n", viewportOrg.X, viewportOrg.Y, viewportOrg.Width, viewportOrg.Height, (uint32_t)(viewportOrg.MinZ * 100.0), (uint32_t)(viewportOrg.MaxZ * 100.0)));
+
+            /* Resize the window. */
+            int rc = vmsvga3dSendThreadMessage(pState->pWindowThread, pState->WndRequestSem, WM_VMSVGA3D_RESIZEWINDOW, (WPARAM)pContext->hwnd, (LPARAM)&cs);
+            AssertRC(rc);
+
+            /* Changed when the function returns. */
+            PresParam.BackBufferWidth               = 0;
+            PresParam.BackBufferHeight              = 0;
+            PresParam.BackBufferFormat              = D3DFMT_UNKNOWN;
+            PresParam.BackBufferCount               = 0;
+
+            PresParam.MultiSampleType               = D3DMULTISAMPLE_NONE;
+            PresParam.MultiSampleQuality            = 0;
+            PresParam.SwapEffect                    = D3DSWAPEFFECT_FLIP;
+            PresParam.hDeviceWindow                 = pContext->hwnd;
+            PresParam.Windowed                      = TRUE;     /* @todo */
+            PresParam.EnableAutoDepthStencil        = FALSE;
+            PresParam.AutoDepthStencilFormat        = D3DFMT_UNKNOWN;   /* not relevant */
+            PresParam.Flags                         = 0;
+            PresParam.FullScreen_RefreshRateInHz    = 0;        /* windowed -> 0 */
+            /* @todo consider using D3DPRESENT_DONOTWAIT so we don't wait for the GPU during Present calls. */
+            PresParam.PresentationInterval          = D3DPRESENT_INTERVAL_IMMEDIATE;;
+
+#ifdef VBOX_VMSVGA3D_WITH_OPENGL
+            hr = pContext->pDevice->Reset(&PresParam);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dChangeMode: Reset failed with %x\n", hr), VERR_INTERNAL_ERROR);
+#else
+            /* ResetEx does not trash the device state */
+            hr = pContext->pDevice->ResetEx(&PresParam, NULL);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dChangeMode: Reset failed with %x\n", hr), VERR_INTERNAL_ERROR);
+#endif
+            Log(("vmsvga3dChangeMode: Backbuffer (%d,%d) count=%d format=%x\n", PresParam.BackBufferWidth, PresParam.BackBufferHeight, PresParam.BackBufferCount, PresParam.BackBufferFormat));
+
+            /* ResetEx changes the viewport; restore it again. */
+            hr = pContext->pDevice->SetViewport(&viewportOrg);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dChangeMode: SetViewport failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+#ifdef LOG_ENABLED
+            {
+                D3DVIEWPORT9          viewport;
+                hr = pContext->pDevice->GetViewport(&viewport);
+                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dChangeMode: GetViewport failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                Log(("vmsvga3dChangeMode: changed viewport settings (%d,%d)(%d,%d) z=%d/%d\n", viewport.X, viewport.Y, viewport.Width, viewport.Height, (uint32_t)(viewport.MinZ * 100.0), (uint32_t)(viewport.MaxZ * 100.0)));
+            }
+#endif
+
+            /* First set the render targets as they change the internal state (reset viewport etc) */
+            Log(("vmsvga3dChangeMode: Recreate render targets BEGIN\n"));
+            for (uint32_t j = 0; j < RT_ELEMENTS(pContext->state.aRenderTargets); j++)
+            {
+                if (pContext->state.aRenderTargets[j] != SVGA3D_INVALID_ID)
+                {
+                    SVGA3dSurfaceImageId target;
+
+                    target.sid      = pContext->state.aRenderTargets[j];
+                    target.face     = 0;
+                    target.mipmap   = 0;
+                    rc = vmsvga3dSetRenderTarget(pThis, cid, (SVGA3dRenderTargetType)j, target);
+                    AssertRCReturn(rc, rc);
+                }
+            }
+
+#ifdef VMSVGA3D_DIRECT3D9_RESET
+            /* Recreate the render state */
+            Log(("vmsvga3dChangeMode: Recreate render state BEGIN\n"));
+            for (uint32_t i = 0; i < RT_ELEMENTS(pContext->state.aRenderState); i++)
+            {
+                SVGA3dRenderState *pRenderState = &pContext->state.aRenderState[i];
+
+                if (pRenderState->state != SVGA3D_RS_INVALID)
+                    vmsvga3dSetRenderState(pThis, pContext->id, 1, pRenderState);
+            }
+            Log(("vmsvga3dChangeMode: Recreate render state END\n"));
+
+            /* Recreate the texture state */
+            Log(("vmsvga3dChangeMode: Recreate texture state BEGIN\n"));
+            for (uint32_t iStage = 0; iStage < SVGA3D_MAX_TEXTURE_STAGE; iStage++)
+            {
+                for (uint32_t j = 0; j < SVGA3D_TS_MAX; j++)
+                {
+                    SVGA3dTextureState *pTextureState = &pContext->state.aTextureState[iStage][j];
+
+                    if (pTextureState->name != SVGA3D_RS_INVALID)
+                        vmsvga3dSetTextureState(pThis, pContext->id, 1, pTextureState);
+                }
+            }
+            Log(("vmsvga3dChangeMode: Recreate texture state END\n"));
+
+            if (pContext->state.u32UpdateFlags & VMSVGA3D_UPDATE_SCISSORRECT)
+                vmsvga3dSetScissorRect(pThis, cid, &pContext->state.RectScissor);
+            if (pContext->state.u32UpdateFlags & VMSVGA3D_UPDATE_ZRANGE)
+                vmsvga3dSetZRange(pThis, cid, pContext->state.zRange);
+            if (pContext->state.u32UpdateFlags & VMSVGA3D_UPDATE_VIEWPORT)
+                vmsvga3dSetViewPort(pThis, cid, &pContext->state.RectViewPort);
+            if (pContext->state.u32UpdateFlags & VMSVGA3D_UPDATE_VERTEXSHADER)
+                vmsvga3dShaderSet(pThis, cid, SVGA3D_SHADERTYPE_VS, pContext->state.shidVertex);
+            if (pContext->state.u32UpdateFlags & VMSVGA3D_UPDATE_PIXELSHADER)
+                vmsvga3dShaderSet(pThis, cid, SVGA3D_SHADERTYPE_PS, pContext->state.shidPixel);
+            /** @todo restore more state data */
+#endif /* #ifdef VMSVGA3D_DIRECT3D9_RESET */
+        }
+    }
+    return VINF_SUCCESS;
+}
+
+
+int vmsvga3dSetTransform(PVGASTATE pThis, uint32_t cid, SVGA3dTransformType type, float matrix[16])
+{
+    D3DTRANSFORMSTATETYPE d3dState;
+    HRESULT               hr;
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dSetTransform %x %s\n", cid, vmsvgaTransformToString(type)));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetTransform invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+
+    switch (type)
+    {
+    case SVGA3D_TRANSFORM_VIEW:
+        d3dState = D3DTS_VIEW;
+        break;
+    case SVGA3D_TRANSFORM_PROJECTION:
+        d3dState = D3DTS_PROJECTION;
+        break;
+    case SVGA3D_TRANSFORM_TEXTURE0:
+        d3dState = D3DTS_TEXTURE0;
+        break;
+    case SVGA3D_TRANSFORM_TEXTURE1:
+        d3dState = D3DTS_TEXTURE1;
+        break;
+    case SVGA3D_TRANSFORM_TEXTURE2:
+        d3dState = D3DTS_TEXTURE2;
+        break;
+    case SVGA3D_TRANSFORM_TEXTURE3:
+        d3dState = D3DTS_TEXTURE3;
+        break;
+    case SVGA3D_TRANSFORM_TEXTURE4:
+        d3dState = D3DTS_TEXTURE4;
+        break;
+    case SVGA3D_TRANSFORM_TEXTURE5:
+        d3dState = D3DTS_TEXTURE5;
+        break;
+    case SVGA3D_TRANSFORM_TEXTURE6:
+        d3dState = D3DTS_TEXTURE6;
+        break;
+    case SVGA3D_TRANSFORM_TEXTURE7:
+        d3dState = D3DTS_TEXTURE7;
+        break;
+    case SVGA3D_TRANSFORM_WORLD:
+        d3dState = D3DTS_WORLD;
+        break;
+    case SVGA3D_TRANSFORM_WORLD1:
+        d3dState = D3DTS_WORLD1;
+        break;
+    case SVGA3D_TRANSFORM_WORLD2:
+        d3dState = D3DTS_WORLD2;
+        break;
+    case SVGA3D_TRANSFORM_WORLD3:
+        d3dState = D3DTS_WORLD3;
+        break;
+
+    default:
+        Log(("vmsvga3dSetTransform: unknown type!!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+
+    /* Save this matrix for vm state save/restore. */
+    pContext->state.aTransformState[type].fValid = true;
+    memcpy(pContext->state.aTransformState[type].matrix, matrix, sizeof(pContext->state.aTransformState[type].matrix));
+    pContext->state.u32UpdateFlags |= VMSVGA3D_UPDATE_TRANSFORM;
+
+    Log(("Matrix [%d %d %d %d]\n", (int)(matrix[0] * 10.0), (int)(matrix[1] * 10.0), (int)(matrix[2] * 10.0), (int)(matrix[3] * 10.0)));
+    Log(("       [%d %d %d %d]\n", (int)(matrix[4] * 10.0), (int)(matrix[5] * 10.0), (int)(matrix[6] * 10.0), (int)(matrix[7] * 10.0)));
+    Log(("       [%d %d %d %d]\n", (int)(matrix[8] * 10.0), (int)(matrix[9] * 10.0), (int)(matrix[10] * 10.0), (int)(matrix[11] * 10.0)));
+    Log(("       [%d %d %d %d]\n", (int)(matrix[12] * 10.0), (int)(matrix[13] * 10.0), (int)(matrix[14] * 10.0), (int)(matrix[15] * 10.0)));
+    hr = pContext->pDevice->SetTransform(d3dState, (const D3DMATRIX *)matrix);
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetTransform: SetTransform failed with %x\n", hr), VERR_INTERNAL_ERROR);
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSetZRange(PVGASTATE pThis, uint32_t cid, SVGA3dZRange zRange)
+{
+    D3DVIEWPORT9          viewport;
+    HRESULT               hr;
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dSetZRange %x min=%d max=%d\n", cid, (uint32_t)(zRange.min * 100.0), (uint32_t)(zRange.max * 100.0)));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetZRange invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+    pContext->state.zRange = zRange;
+    pContext->state.u32UpdateFlags |= VMSVGA3D_UPDATE_ZRANGE;
+
+    hr = pContext->pDevice->GetViewport(&viewport);
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetZRange: GetViewport failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    Log(("vmsvga3dSetZRange: old viewport settings (%d,%d)(%d,%d) z=%d/%d\n", viewport.X, viewport.Y, viewport.Width, viewport.Height, (uint32_t)(viewport.MinZ * 100.0), (uint32_t)(viewport.MaxZ * 100.0)));
+    /* @todo convert the depth range from -1-1 to 0-1 although we shouldn't be getting such values in the first place... */
+    if (zRange.min < 0.0)
+        zRange.min = 0.0;
+    if (zRange.max > 1.0)
+        zRange.max = 1.0;
+
+    viewport.MinZ = zRange.min;
+    viewport.MaxZ = zRange.max;
+    hr = pContext->pDevice->SetViewport(&viewport);
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetZRange: SetViewport failed with %x\n", hr), VERR_INTERNAL_ERROR);
+    return VINF_SUCCESS;
+}
+
+/**
+ * Convert SVGA blend op value to its D3D equivalent
+ */
+static DWORD vmsvga3dBlendOp2D3D(uint32_t blendOp, DWORD defaultBlendOp)
+{
+    switch (blendOp)
+    {
+    case SVGA3D_BLENDOP_ZERO:
+        return D3DBLEND_ZERO;
+    case SVGA3D_BLENDOP_ONE:
+        return D3DBLEND_ONE;
+    case SVGA3D_BLENDOP_SRCCOLOR:
+        return D3DBLEND_SRCCOLOR;
+    case SVGA3D_BLENDOP_INVSRCCOLOR:
+        return D3DBLEND_INVSRCCOLOR;
+    case SVGA3D_BLENDOP_SRCALPHA:
+        return D3DBLEND_SRCALPHA;
+    case SVGA3D_BLENDOP_INVSRCALPHA:
+        return D3DBLEND_INVSRCALPHA;
+    case SVGA3D_BLENDOP_DESTALPHA:
+        return D3DBLEND_DESTALPHA;
+    case SVGA3D_BLENDOP_INVDESTALPHA:
+        return D3DBLEND_INVDESTALPHA;
+    case SVGA3D_BLENDOP_DESTCOLOR:
+        return D3DBLEND_DESTCOLOR;
+    case SVGA3D_BLENDOP_INVDESTCOLOR:
+        return D3DBLEND_INVDESTCOLOR;
+    case SVGA3D_BLENDOP_SRCALPHASAT:
+        return D3DBLEND_SRCALPHASAT;
+    case SVGA3D_BLENDOP_BLENDFACTOR:
+        return D3DBLEND_BLENDFACTOR;
+    case SVGA3D_BLENDOP_INVBLENDFACTOR:
+        return D3DBLEND_INVBLENDFACTOR;
+    default:
+        AssertFailed();
+        return defaultBlendOp;
+    }
+}
+
+int vmsvga3dSetRenderState(PVGASTATE pThis, uint32_t cid, uint32_t cRenderStates, SVGA3dRenderState *pRenderState)
+{
+    DWORD                       val;
+    HRESULT                     hr;
+    PVMSVGA3DCONTEXT            pContext;
+    PVMSVGA3DSTATE              pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dSetRenderState %x cRenderStates=%d\n", cid, cRenderStates));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetRenderState invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+
+    for (unsigned i = 0; i < cRenderStates; i++)
+    {
+        D3DRENDERSTATETYPE renderState = D3DRS_FORCE_DWORD;
+
+        Log(("vmsvga3dSetRenderState: state=%s (%d) val=%x\n", vmsvga3dGetRenderStateName(pRenderState[i].state), pRenderState[i].state, pRenderState[i].uintValue));
+        /* Save the render state for vm state saving. */
+        if (pRenderState[i].state < SVGA3D_RS_MAX)
+            pContext->state.aRenderState[pRenderState[i].state] = pRenderState[i];
+
+        switch (pRenderState[i].state)
+        {
+        case SVGA3D_RS_ZENABLE:                /* SVGA3dBool */            
+            renderState = D3DRS_ZENABLE;
+            val = pRenderState[i].uintValue;
+            Assert(val == D3DZB_FALSE || val == D3DZB_TRUE);
+            break;
+
+        case SVGA3D_RS_ZWRITEENABLE:           /* SVGA3dBool */
+            renderState = D3DRS_ZWRITEENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_ALPHATESTENABLE:        /* SVGA3dBool */
+            renderState = D3DRS_ALPHATESTENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_DITHERENABLE:           /* SVGA3dBool */
+            renderState = D3DRS_DITHERENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_BLENDENABLE:            /* SVGA3dBool */
+            renderState = D3DRS_ALPHABLENDENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_FOGENABLE:              /* SVGA3dBool */
+            renderState = D3DRS_FOGENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_SPECULARENABLE:         /* SVGA3dBool */
+            renderState = D3DRS_SPECULARENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_LIGHTINGENABLE:         /* SVGA3dBool */
+            renderState = D3DRS_LIGHTING;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_NORMALIZENORMALS:       /* SVGA3dBool */
+            renderState = D3DRS_NORMALIZENORMALS;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_POINTSPRITEENABLE:      /* SVGA3dBool */
+            renderState = D3DRS_POINTSPRITEENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_POINTSCALEENABLE:       /* SVGA3dBool */
+            renderState = D3DRS_POINTSCALEENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_POINTSIZE:              /* float */
+            renderState = D3DRS_POINTSIZE;
+            val = pRenderState[i].uintValue;
+            Log(("SVGA3D_RS_POINTSIZE: %d\n", (uint32_t) (pRenderState[i].floatValue * 100.0)));
+            break;
+
+        case SVGA3D_RS_POINTSIZEMIN:           /* float */
+            renderState = D3DRS_POINTSIZE_MIN;
+            val = pRenderState[i].uintValue;
+            Log(("SVGA3D_RS_POINTSIZEMIN: %d\n", (uint32_t) (pRenderState[i].floatValue * 100.0)));
+            break;
+
+        case SVGA3D_RS_POINTSIZEMAX:           /* float */
+            renderState = D3DRS_POINTSIZE_MAX;
+            val = pRenderState[i].uintValue;
+            Log(("SVGA3D_RS_POINTSIZEMAX: %d\n", (uint32_t) (pRenderState[i].floatValue * 100.0)));
+            break;
+
+        case SVGA3D_RS_POINTSCALE_A:           /* float */
+            renderState = D3DRS_POINTSCALE_A;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_POINTSCALE_B:           /* float */
+            renderState = D3DRS_POINTSCALE_B;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_POINTSCALE_C:           /* float */
+            renderState = D3DRS_POINTSCALE_C;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_AMBIENT:                /* SVGA3dColor - identical */
+            renderState = D3DRS_AMBIENT;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_CLIPPLANEENABLE:        /* SVGA3dClipPlanes - identical */
+            renderState = D3DRS_CLIPPLANEENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_FOGCOLOR:               /* SVGA3dColor - identical */
+            renderState = D3DRS_FOGCOLOR;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_FOGSTART:               /* float */
+            renderState = D3DRS_FOGSTART;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_FOGEND:                 /* float */
+            renderState = D3DRS_FOGEND;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_FOGDENSITY:             /* float */
+            renderState = D3DRS_FOGDENSITY;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_RANGEFOGENABLE:         /* SVGA3dBool */
+            renderState = D3DRS_RANGEFOGENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_FOGMODE:                /* SVGA3dFogMode */
+        {
+            SVGA3dFogMode mode;
+            mode.uintValue = pRenderState[i].uintValue;
+
+            switch (mode.s.function)
+            {
+            case SVGA3D_FOGFUNC_INVALID:
+                val = D3DFOG_NONE;
+                break;
+            case SVGA3D_FOGFUNC_EXP:
+                val = D3DFOG_EXP;
+                break;
+            case SVGA3D_FOGFUNC_EXP2:
+                val = D3DFOG_EXP2;
+                break;
+            case SVGA3D_FOGFUNC_LINEAR:
+                val = D3DFOG_LINEAR;
+                break;
+            case SVGA3D_FOGFUNC_PER_VERTEX: /* unable to find a d3d9 equivalent */
+                AssertMsgFailedReturn(("Unsupported fog function SVGA3D_FOGFUNC_PER_VERTEX\n"), VERR_INTERNAL_ERROR);
+                break;
+            default:
+                AssertMsgFailedReturn(("Unexpected fog function %d\n", mode.s.function), VERR_INTERNAL_ERROR);
+                break;
+            }
+
+            /* The fog type determines the render state. */
+            switch (mode.s.type)
+            {
+            case SVGA3D_FOGTYPE_VERTEX:
+                renderState = D3DRS_FOGVERTEXMODE;
+                break;
+            case SVGA3D_FOGTYPE_PIXEL:
+                renderState = D3DRS_FOGTABLEMODE;
+                break;
+            default:
+                AssertMsgFailedReturn(("Unexpected fog type %d\n", mode.s.type), VERR_INTERNAL_ERROR);
+                break;
+            }
+
+            /* Set the fog base to depth or range. */
+            switch (mode.s.base)
+            {
+            case SVGA3D_FOGBASE_DEPTHBASED:
+                hr = pContext->pDevice->SetRenderState(D3DRS_RANGEFOGENABLE, FALSE);
+                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetRenderState: SetRenderState SVGA3D_FOGBASE_DEPTHBASED failed with %x\n", hr), VERR_INTERNAL_ERROR);
+                break;
+            case SVGA3D_FOGBASE_RANGEBASED:
+                hr = pContext->pDevice->SetRenderState(D3DRS_RANGEFOGENABLE, TRUE);
+                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetRenderState: SetRenderState SVGA3D_FOGBASE_RANGEBASED failed with %x\n", hr), VERR_INTERNAL_ERROR);
+                break;
+            default:
+                /* ignore */
+                AssertMsgFailed(("Unexpected fog base %d\n", mode.s.base));
+                break;
+            }
+            break;
+        }
+
+        case SVGA3D_RS_FILLMODE:               /* SVGA3dFillMode */
+        {
+            SVGA3dFillMode mode;
+
+            mode.uintValue = pRenderState[i].uintValue;
+
+            switch (mode.s.mode)
+            {
+            case SVGA3D_FILLMODE_POINT:
+                val = D3DFILL_POINT;
+                break;
+            case SVGA3D_FILLMODE_LINE:
+                val = D3DFILL_WIREFRAME;
+                break;
+            case SVGA3D_FILLMODE_FILL:
+                val = D3DFILL_SOLID;
+                break;
+            default:
+                AssertMsgFailedReturn(("Unexpected fill mode %d\n", mode.s.mode), VERR_INTERNAL_ERROR);
+                break;
+            }
+            /* @todo ignoring face for now. */
+            renderState = D3DRS_FILLMODE;
+            break;
+        }
+
+        case SVGA3D_RS_SHADEMODE:              /* SVGA3dShadeMode */
+            renderState = D3DRS_SHADEMODE;
+            AssertCompile(D3DSHADE_FLAT == SVGA3D_SHADEMODE_FLAT);
+            val = pRenderState[i].uintValue;    /* SVGA3dShadeMode == D3DSHADEMODE */
+            break;
+
+        case SVGA3D_RS_LINEPATTERN:            /* SVGA3dLinePattern */
+            /* No longer supported by d3d; mesagl comments suggest not all backends support it */
+            /* @todo */
+            Log(("WARNING: SVGA3D_RS_LINEPATTERN %x not supported!!\n", pRenderState[i].uintValue));
+            /*
+            renderState = D3DRS_LINEPATTERN;
+            val = pRenderState[i].uintValue;
+            */
+            break;
+
+        case SVGA3D_RS_SRCBLEND:               /* SVGA3dBlendOp */
+            renderState = D3DRS_SRCBLEND;
+            val = vmsvga3dBlendOp2D3D(pRenderState[i].uintValue, D3DBLEND_ONE /* default */);
+            break;
+
+        case SVGA3D_RS_DSTBLEND:               /* SVGA3dBlendOp */
+            renderState = D3DRS_DESTBLEND;
+            val = vmsvga3dBlendOp2D3D(pRenderState[i].uintValue, D3DBLEND_ZERO /* default */);
+            break;
+
+        case SVGA3D_RS_BLENDEQUATION:          /* SVGA3dBlendEquation - identical */
+            AssertCompile(SVGA3D_BLENDEQ_MAXIMUM == D3DBLENDOP_MAX);
+            renderState = D3DRS_BLENDOP;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_CULLMODE:               /* SVGA3dFace */
+        {
+            switch (pRenderState[i].uintValue)
+            {
+            case SVGA3D_FACE_NONE:
+                val = D3DCULL_NONE;
+                break;
+            case SVGA3D_FACE_FRONT:
+                val = D3DCULL_CW;
+                break;
+            case SVGA3D_FACE_BACK:
+                val = D3DCULL_CCW;
+                break;
+            case SVGA3D_FACE_FRONT_BACK:
+                AssertFailed();
+                val = D3DCULL_CW;
+                break;
+            default:
+                AssertMsgFailedReturn(("Unexpected cull mode %d\n", pRenderState[i].uintValue), VERR_INTERNAL_ERROR);
+                break;
+            }
+            renderState = D3DRS_CULLMODE;
+            break;
+        }
+
+        case SVGA3D_RS_ZFUNC:                  /* SVGA3dCmpFunc - identical */
+            AssertCompile(SVGA3D_CMP_ALWAYS == D3DCMP_ALWAYS);
+            renderState = D3DRS_ZFUNC;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_ALPHAFUNC:              /* SVGA3dCmpFunc - identical */
+            renderState = D3DRS_ALPHAFUNC;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_STENCILENABLE:          /* SVGA3dBool */
+            renderState = D3DRS_STENCILENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_STENCILREF:             /* uint32_t */
+            renderState = D3DRS_STENCILREF;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_STENCILMASK:            /* uint32_t */
+            renderState = D3DRS_STENCILMASK;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_STENCILWRITEMASK:       /* uint32_t */
+            renderState = D3DRS_STENCILWRITEMASK;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_STENCILFUNC:            /* SVGA3dCmpFunc - identical */
+            renderState = D3DRS_STENCILFUNC;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_STENCILFAIL:            /* SVGA3dStencilOp - identical */
+            AssertCompile(D3DSTENCILOP_KEEP == SVGA3D_STENCILOP_KEEP);
+            AssertCompile(D3DSTENCILOP_DECR == SVGA3D_STENCILOP_DECR);
+            renderState = D3DRS_STENCILFAIL;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_STENCILZFAIL:           /* SVGA3dStencilOp - identical */
+            renderState = D3DRS_STENCILZFAIL;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_STENCILPASS:            /* SVGA3dStencilOp - identical */
+            renderState = D3DRS_STENCILPASS;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_ALPHAREF:               /* float (0.0 .. 1.0) */
+            renderState = D3DRS_ALPHAREF;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_FRONTWINDING:           /* SVGA3dFrontWinding */
+            Assert(pRenderState[i].uintValue == SVGA3D_FRONTWINDING_CW);
+            /*
+            renderState = D3DRS_FRONTWINDING; //D3DRS_TWOSIDEDSTENCILMODE
+            val = pRenderState[i].uintValue;
+            */
+            break;
+
+        case SVGA3D_RS_COORDINATETYPE:         /* SVGA3dCoordinateType */
+            Assert(pRenderState[i].uintValue == SVGA3D_COORDINATE_LEFTHANDED);
+            /* @todo setup a view matrix to scale the world space by -1 in the z-direction for right handed coordinates. */
+            /*
+            renderState = D3DRS_COORDINATETYPE;
+            val = pRenderState[i].uintValue;
+            */
+            break;
+
+        case SVGA3D_RS_ZBIAS:                  /* float */
+            /* @todo unknown meaning; depth bias is not identical
+            renderState = D3DRS_DEPTHBIAS;
+            val = pRenderState[i].uintValue;
+            */
+            Log(("vmsvga3dSetRenderState: WARNING unsupported SVGA3D_RS_ZBIAS\n"));
+            break;
+
+        case SVGA3D_RS_SLOPESCALEDEPTHBIAS:    /* float */
+            renderState = D3DRS_SLOPESCALEDEPTHBIAS;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_DEPTHBIAS:              /* float */
+            renderState = D3DRS_DEPTHBIAS;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_COLORWRITEENABLE:       /* SVGA3dColorMask - identical to D3DCOLORWRITEENABLE_* */
+            renderState = D3DRS_COLORWRITEENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_VERTEXMATERIALENABLE:   /* SVGA3dBool */
+            //AssertFailed();
+            renderState = D3DRS_INDEXEDVERTEXBLENDENABLE;       /* correct?? */
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_DIFFUSEMATERIALSOURCE:  /* SVGA3dVertexMaterial - identical */
+            AssertCompile(D3DMCS_COLOR2 == SVGA3D_VERTEXMATERIAL_SPECULAR);
+            renderState = D3DRS_DIFFUSEMATERIALSOURCE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_SPECULARMATERIALSOURCE: /* SVGA3dVertexMaterial - identical */
+            renderState = D3DRS_SPECULARMATERIALSOURCE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_AMBIENTMATERIALSOURCE:  /* SVGA3dVertexMaterial - identical */
+            renderState = D3DRS_AMBIENTMATERIALSOURCE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_EMISSIVEMATERIALSOURCE: /* SVGA3dVertexMaterial - identical */
+            renderState = D3DRS_EMISSIVEMATERIALSOURCE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_TEXTUREFACTOR:          /* SVGA3dColor - identical */
+            renderState = D3DRS_TEXTUREFACTOR;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_LOCALVIEWER:            /* SVGA3dBool */
+            renderState = D3DRS_LOCALVIEWER;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_SCISSORTESTENABLE:      /* SVGA3dBool */
+            renderState = D3DRS_SCISSORTESTENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_BLENDCOLOR:             /* SVGA3dColor - identical */
+            renderState = D3DRS_BLENDFACTOR;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_STENCILENABLE2SIDED:    /* SVGA3dBool */
+            renderState = D3DRS_TWOSIDEDSTENCILMODE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_CCWSTENCILFUNC:         /* SVGA3dCmpFunc - identical */
+            renderState = D3DRS_CCW_STENCILFUNC;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_CCWSTENCILFAIL:         /* SVGA3dStencilOp - identical */
+            renderState = D3DRS_CCW_STENCILFAIL;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_CCWSTENCILZFAIL:        /* SVGA3dStencilOp - identical */
+            renderState = D3DRS_CCW_STENCILZFAIL;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_CCWSTENCILPASS:         /* SVGA3dStencilOp - identical */
+            renderState = D3DRS_CCW_STENCILPASS;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_VERTEXBLEND:            /* SVGA3dVertexBlendFlags - identical */
+            AssertCompile(SVGA3D_VBLEND_DISABLE == D3DVBF_DISABLE);
+            renderState = D3DRS_VERTEXBLEND;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_OUTPUTGAMMA:            /* float */
+            //AssertFailed();
+            /*
+            D3DRS_SRGBWRITEENABLE ??
+            renderState = D3DRS_OUTPUTGAMMA;
+            val = pRenderState[i].uintValue;
+            */
+            break;
+
+        case SVGA3D_RS_ZVISIBLE:               /* SVGA3dBool */
+            AssertFailed();
+            /*
+            renderState = D3DRS_ZVISIBLE;
+            val = pRenderState[i].uintValue;
+            */
+            break;
+
+        case SVGA3D_RS_LASTPIXEL:              /* SVGA3dBool */
+            renderState = D3DRS_LASTPIXEL;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_CLIPPING:               /* SVGA3dBool */
+            renderState = D3DRS_CLIPPING;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP0:                  /* SVGA3dWrapFlags - identical */
+            Assert(SVGA3D_WRAPCOORD_3 == D3DWRAPCOORD_3);
+            renderState = D3DRS_WRAP0;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP1:                  /* SVGA3dWrapFlags - identical */
+            renderState = D3DRS_WRAP1;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP2:                  /* SVGA3dWrapFlags - identical */
+            renderState = D3DRS_WRAP2;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP3:                  /* SVGA3dWrapFlags - identical */
+            renderState = D3DRS_WRAP3;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP4:                  /* SVGA3dWrapFlags - identical */
+            renderState = D3DRS_WRAP4;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP5:                  /* SVGA3dWrapFlags - identical */
+            renderState = D3DRS_WRAP5;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP6:                  /* SVGA3dWrapFlags - identical */
+            renderState = D3DRS_WRAP6;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP7:                  /* SVGA3dWrapFlags - identical */
+            renderState = D3DRS_WRAP7;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP8:                  /* SVGA3dWrapFlags - identical */
+            renderState = D3DRS_WRAP8;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP9:                  /* SVGA3dWrapFlags - identical */
+            renderState = D3DRS_WRAP9;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP10:                 /* SVGA3dWrapFlags - identical */
+            renderState = D3DRS_WRAP10;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP11:                 /* SVGA3dWrapFlags - identical */
+            renderState = D3DRS_WRAP11;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP12:                 /* SVGA3dWrapFlags - identical */
+            renderState = D3DRS_WRAP12;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP13:                 /* SVGA3dWrapFlags - identical */
+            renderState = D3DRS_WRAP13;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP14:                 /* SVGA3dWrapFlags - identical */
+            renderState = D3DRS_WRAP14;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_WRAP15:                 /* SVGA3dWrapFlags - identical */
+            renderState = D3DRS_WRAP15;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_MULTISAMPLEANTIALIAS:   /* SVGA3dBool */
+            renderState = D3DRS_MULTISAMPLEANTIALIAS;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_MULTISAMPLEMASK:        /* uint32_t */
+            renderState = D3DRS_MULTISAMPLEMASK;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_INDEXEDVERTEXBLENDENABLE: /* SVGA3dBool */
+            renderState = D3DRS_INDEXEDVERTEXBLENDENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_TWEENFACTOR:            /* float */
+            renderState = D3DRS_TWEENFACTOR;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_ANTIALIASEDLINEENABLE:  /* SVGA3dBool */
+            renderState = D3DRS_ANTIALIASEDLINEENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_COLORWRITEENABLE1:      /* SVGA3dColorMask - identical to D3DCOLORWRITEENABLE_* */
+            renderState = D3DRS_COLORWRITEENABLE1;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_COLORWRITEENABLE2:      /* SVGA3dColorMask - identical to D3DCOLORWRITEENABLE_* */
+            renderState = D3DRS_COLORWRITEENABLE2;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_COLORWRITEENABLE3:      /* SVGA3dColorMask - identical to D3DCOLORWRITEENABLE_* */
+            renderState = D3DRS_COLORWRITEENABLE3;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_SEPARATEALPHABLENDENABLE: /* SVGA3dBool */
+            renderState = D3DRS_SEPARATEALPHABLENDENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_SRCBLENDALPHA:          /* SVGA3dBlendOp */
+            renderState = D3DRS_SRCBLENDALPHA;
+            val = vmsvga3dBlendOp2D3D(pRenderState[i].uintValue, D3DBLEND_ONE /* default */);
+            break;
+
+        case SVGA3D_RS_DSTBLENDALPHA:          /* SVGA3dBlendOp */
+            renderState = D3DRS_DESTBLENDALPHA;
+            val = vmsvga3dBlendOp2D3D(pRenderState[i].uintValue, D3DBLEND_ZERO /* default */);
+            break;
+
+        case SVGA3D_RS_BLENDEQUATIONALPHA:     /* SVGA3dBlendEquation - identical */
+            renderState = D3DRS_BLENDOPALPHA;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_TRANSPARENCYANTIALIAS:  /* SVGA3dTransparencyAntialiasType */
+            AssertFailed();
+            /*
+            renderState = D3DRS_TRANSPARENCYANTIALIAS;
+            val = pRenderState[i].uintValue;
+            */
+            break;
+
+        case SVGA3D_RS_LINEAA:                 /* SVGA3dBool */
+            renderState = D3DRS_ANTIALIASEDLINEENABLE;
+            val = pRenderState[i].uintValue;
+            break;
+
+        case SVGA3D_RS_LINEWIDTH:              /* float */
+            AssertFailed();
+            /*
+            renderState = D3DRS_LINEWIDTH;
+            val = pRenderState[i].uintValue;
+            */
+            break;
+        }
+
+        if (renderState != D3DRS_FORCE_DWORD)
+        {
+            hr = pContext->pDevice->SetRenderState(renderState, val);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetRenderState: SetRenderState failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        }
+    }
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSetRenderTarget(PVGASTATE pThis, uint32_t cid, SVGA3dRenderTargetType type, SVGA3dSurfaceImageId target)
+{
+    HRESULT                     hr;
+    PVMSVGA3DCONTEXT            pContext;
+    PVMSVGA3DSTATE              pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    PVMSVGA3DSURFACE            pRenderTarget;
+
+    AssertReturn(pState, VERR_NO_MEMORY);
+    AssertReturn(type < SVGA3D_RT_MAX, VERR_INVALID_PARAMETER);
+    AssertReturn(target.face == 0, VERR_INVALID_PARAMETER);
+    AssertReturn(target.mipmap == 0, VERR_INVALID_PARAMETER);
+
+    Log(("vmsvga3dSetRenderTarget cid=%x type=%x surface id=%x\n", cid, type, target.sid));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetRenderTarget invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+
+    /* Save for vm state save/restore. */
+    pContext->state.aRenderTargets[type] = target.sid;
+
+    if (target.sid == SVGA3D_INVALID_ID)
+    {
+        /* Disable render target. */
+        switch (type)
+        {
+        case SVGA3D_RT_DEPTH:
+            hr = pContext->pDevice->SetDepthStencilSurface(NULL);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetRenderTarget: SetDepthStencilSurface failed with %x\n", hr), VERR_INTERNAL_ERROR);
+            break;
+
+        case SVGA3D_RT_STENCIL:
+            /* ignore; correct?? */
+            break;
+
+        case SVGA3D_RT_COLOR0:
+        case SVGA3D_RT_COLOR1:
+        case SVGA3D_RT_COLOR2:
+        case SVGA3D_RT_COLOR3:
+        case SVGA3D_RT_COLOR4:
+        case SVGA3D_RT_COLOR5:
+        case SVGA3D_RT_COLOR6:
+        case SVGA3D_RT_COLOR7:
+            pContext->sidRenderTarget = SVGA3D_INVALID_ID;
+
+            if (pState->fSupportedSurfaceNULL)
+            {
+                /* Create a dummy render target to satisfy D3D. This path is usually taken only to render into a depth buffer without
+                 * wishing to update an actual color render target
+                 */
+                IDirect3DSurface9* pDummyRenderTarget;
+                hr = pContext->pDevice->CreateRenderTarget(pThis->svga.uWidth, 
+                                                           pThis->svga.uHeight, 
+                                                           FOURCC_NULL,
+                                                           D3DMULTISAMPLE_NONE, 
+                                                           0, 
+                                                           FALSE, 
+                                                           &pDummyRenderTarget, 
+                                                           NULL);
+
+                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetRenderTarget: CreateRenderTarget failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                hr = pContext->pDevice->SetRenderTarget(type - SVGA3D_RT_COLOR0, pDummyRenderTarget);
+                pDummyRenderTarget->Release();
+            }
+            else
+                hr = pContext->pDevice->SetRenderTarget(type - SVGA3D_RT_COLOR0, NULL);
+
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetRenderTarget: SetRenderTarget failed with %x\n", hr), VERR_INTERNAL_ERROR);
+            break;
+
+        default:
+            AssertFailedReturn(VERR_INVALID_PARAMETER);
+        }
+        return VINF_SUCCESS;
+    }
+
+    AssertReturn(target.sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+    AssertReturn(target.sid < pState->cSurfaces && pState->paSurface[target.sid].id == target.sid, VERR_INVALID_PARAMETER);
+    pRenderTarget = &pState->paSurface[target.sid];
+
+    switch (type)
+    {
+    case SVGA3D_RT_DEPTH:
+    case SVGA3D_RT_STENCIL:
+        if (!pRenderTarget->u.pSurface)
+        {
+            DWORD cQualityLevels = 0;
+
+            /* Query the nr of quality levels for this particular format */
+            if (pRenderTarget->multiSampleTypeD3D != D3DMULTISAMPLE_NONE)
+            {
+                hr = pState->pD3D9->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT,
+                                                               D3DDEVTYPE_HAL,
+                                                               pRenderTarget->formatD3D,
+                                                               TRUE,        /* Windowed */
+                                                               pRenderTarget->multiSampleTypeD3D,
+                                                               &cQualityLevels);
+                Assert(hr == D3D_OK || hr == D3DERR_NOTAVAILABLE);
+            }
+
+            if (    pState->fSupportedSurfaceINTZ
+                &&  pRenderTarget->multiSampleTypeD3D == D3DMULTISAMPLE_NONE
+                &&  (   pRenderTarget->formatD3D == D3DFMT_D24S8
+                     || pRenderTarget->formatD3D == D3DFMT_D24X8))
+            {
+                Log(("vmsvga3dSetRenderTarget: Creating stencil surface as texture!\n"));
+                int rc = vmsvga3dCreateTexture(pContext, cid, pRenderTarget);
+                AssertRC(rc);   /* non-fatal */
+            }
+            
+            if (!pRenderTarget->fStencilAsTexture)
+            {
+                Log(("vmsvga3dSetRenderTarget DEPTH/STENCIL; cQualityLevels=%d\n", cQualityLevels));
+                hr = pContext->pDevice->CreateDepthStencilSurface(pRenderTarget->pMipmapLevels[0].size.width, 
+                                                                  pRenderTarget->pMipmapLevels[0].size.height,
+                                                                  pRenderTarget->formatD3D,
+                                                                  pRenderTarget->multiSampleTypeD3D,
+                                                                  ((cQualityLevels >= 1) ? cQualityLevels - 1 : 0),   /* 0 - (levels-1) */
+                                                                  FALSE,    /* not discardable */
+                                                                  &pRenderTarget->u.pSurface,
+                                                                  NULL);
+                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetRenderTarget: CreateDepthStencilSurface failed with %x\n", hr), VERR_INTERNAL_ERROR);
+            }
+
+            pRenderTarget->idAssociatedContext = cid;
+
+#if 0 /* doesn't work */
+            if (    !pRenderTarget->fStencilAsTexture
+                &&  pRenderTarget->fDirty)
+            {
+                Log(("vmsvga3dSetRenderTarget: sync dirty depth/stencil buffer\n"));
+                Assert(pRenderTarget->faces[0].numMipLevels == 1);
+
+                for (uint32_t i = 0; i < pRenderTarget->faces[0].numMipLevels; i++)
+                {
+                    if (pRenderTarget->pMipmapLevels[i].fDirty)
+                    {
+                        D3DLOCKED_RECT LockedRect;
+
+                        hr = pRenderTarget->u.pSurface->LockRect(&LockedRect,
+                                                                 NULL,   /* entire surface */
+                                                                 0);
+
+                        AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetRenderTarget: LockRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                        Log(("vmsvga3dSetRenderTarget: sync dirty texture mipmap level %d (pitch %x vs %x)\n", i, LockedRect.Pitch, pRenderTarget->pMipmapLevels[i].cbSurfacePitch));
+
+                        uint8_t *pDest = (uint8_t *)LockedRect.pBits;
+                        uint8_t *pSrc  = (uint8_t *)pRenderTarget->pMipmapLevels[i].pSurfaceData;
+                        for (uint32_t j = 0; j < pRenderTarget->pMipmapLevels[i].size.height; j++)
+                        {
+                            memcpy(pDest, pSrc, pRenderTarget->pMipmapLevels[i].cbSurfacePitch);
+
+                            pDest += LockedRect.Pitch;
+                            pSrc  += pRenderTarget->pMipmapLevels[i].cbSurfacePitch;
+                        }
+
+                        hr = pRenderTarget->u.pSurface->UnlockRect();
+                        AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetRenderTarget: UnlockRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                        pRenderTarget->pMipmapLevels[i].fDirty = false;
+                    }
+                }
+            }
+#endif
+        }
+        Assert(pRenderTarget->idAssociatedContext == cid);
+
+        /* @todo Assert(!pRenderTarget->fDirty); */
+
+        AssertReturn(pRenderTarget->u.pSurface, VERR_INVALID_PARAMETER);
+
+        pRenderTarget->fUsageD3D            |= D3DUSAGE_DEPTHSTENCIL;
+        pRenderTarget->flags                |= SVGA3D_SURFACE_HINT_DEPTHSTENCIL;
+
+        if (pRenderTarget->fStencilAsTexture)
+        {
+            IDirect3DSurface9 *pStencilSurface;
+
+            hr = pRenderTarget->u.pTexture->GetSurfaceLevel(0, &pStencilSurface);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetRenderTarget: GetSurfaceLevel failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+            hr = pContext->pDevice->SetDepthStencilSurface(pStencilSurface);
+            pStencilSurface->Release();
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetRenderTarget: SetDepthStencilSurface failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        }
+        else
+        {
+            hr = pContext->pDevice->SetDepthStencilSurface(pRenderTarget->u.pSurface);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetRenderTarget: SetDepthStencilSurface failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        }
+        break;
+
+    case SVGA3D_RT_COLOR0:
+    case SVGA3D_RT_COLOR1:
+    case SVGA3D_RT_COLOR2:
+    case SVGA3D_RT_COLOR3:
+    case SVGA3D_RT_COLOR4:
+    case SVGA3D_RT_COLOR5:
+    case SVGA3D_RT_COLOR6:
+    case SVGA3D_RT_COLOR7:
+    {
+        IDirect3DSurface9 *pSurface;
+        bool fTexture = false;
+        bool fShared = false;
+
+        /* Must flush the other context's 3d pipeline to make sure all drawing is complete for the surface we're about to use. */
+        vmsvga3dSurfaceFlush(pThis, pRenderTarget);
+
+        if (pRenderTarget->flags & SVGA3D_SURFACE_HINT_TEXTURE)
+        {
+            fTexture = true;
+
+            /* A texture surface can be used as a render target to fill it and later on used as a texture. */
+            if (!pRenderTarget->u.pTexture)
+            {
+                Log(("vmsvga3dSetRenderTarget: create texture to be used as render target; surface id=%x type=%d format=%d -> create texture\n", target.sid, pRenderTarget->flags, pRenderTarget->format));
+                int rc = vmsvga3dCreateTexture(pContext, cid, pRenderTarget);
+                AssertRCReturn(rc, rc);
+            }
+
+#ifndef VBOX_VMSVGA3D_WITH_OPENGL
+            if (pRenderTarget->idAssociatedContext != cid)
+            {
+                Log(("vmsvga3dSetRenderTarget; using texture %x created for another context (%d vs %d)\n", target.sid, pRenderTarget->idAssociatedContext, cid));
+
+                PVMSVGA3DSHAREDSURFACE pSharedSurface = vmsvga3dSurfaceGetSharedCopy(pThis, pContext, pRenderTarget);
+                AssertReturn(pSharedSurface, VERR_INTERNAL_ERROR);
+
+                hr = pSharedSurface->u.pTexture->GetSurfaceLevel(0 /* Texture level 0 */,
+                                                                 &pSurface);
+
+                fShared = true;
+            }
+            else
+#endif
+                hr = pRenderTarget->u.pTexture->GetSurfaceLevel(0 /* Texture level 0 */,
+                                                                &pSurface);
+
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetRenderTarget: GetSurfaceLevel failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        }
+        else
+        {
+            if (!pRenderTarget->u.pSurface)
+            {
+                DWORD cQualityLevels = 0;
+
+                /* Query the nr of quality levels for this particular format */
+                if (pRenderTarget->multiSampleTypeD3D != D3DMULTISAMPLE_NONE)
+                {
+                    hr = pState->pD3D9->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT,
+                                                                   D3DDEVTYPE_HAL,
+                                                                   pRenderTarget->formatD3D,
+                                                                   TRUE,        /* Windowed */
+                                                                   pRenderTarget->multiSampleTypeD3D,
+                                                                   &cQualityLevels);
+                    Assert(hr == D3D_OK || hr == D3DERR_NOTAVAILABLE);
+                }
+
+                Log(("vmsvga3dSetRenderTarget COLOR; cQualityLevels=%d\n", cQualityLevels));
+                Log(("Create rendertarget (%d,%d) format=%x multisample=%x\n", pRenderTarget->pMipmapLevels[0].size.width, pRenderTarget->pMipmapLevels[0].size.height, pRenderTarget->formatD3D, pRenderTarget->multiSampleTypeD3D));
+
+                hr = pContext->pDevice->CreateRenderTarget(pRenderTarget->pMipmapLevels[0].size.width, 
+                                                           pRenderTarget->pMipmapLevels[0].size.height, 
+                                                           pRenderTarget->formatD3D,
+                                                           pRenderTarget->multiSampleTypeD3D,
+                                                           ((cQualityLevels >= 1) ? cQualityLevels - 1 : 0),   /* 0 - (levels-1) */
+                                                           TRUE,   /* lockable */
+                                                           &pRenderTarget->u.pSurface,
+                                                           NULL);
+                AssertReturn(hr == D3D_OK, VERR_INTERNAL_ERROR);
+
+                pRenderTarget->idAssociatedContext   = cid;
+            }
+            else
+                AssertReturn(pRenderTarget->fUsageD3D & D3DUSAGE_RENDERTARGET, VERR_INVALID_PARAMETER);
+
+            Assert(pRenderTarget->idAssociatedContext == cid);
+            pSurface = pRenderTarget->u.pSurface;
+        }
+
+        AssertReturn(pRenderTarget->u.pSurface, VERR_INVALID_PARAMETER);
+        Assert(!pRenderTarget->fDirty);
+
+        pRenderTarget->fUsageD3D            |= D3DUSAGE_RENDERTARGET;
+        pRenderTarget->flags                |= SVGA3D_SURFACE_HINT_RENDERTARGET;
+
+        hr = pContext->pDevice->SetRenderTarget(type - SVGA3D_RT_COLOR0, pSurface);
+        if (fTexture)
+            pSurface->Release();    /* Release reference to texture level 0 */
+        AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetRenderTarget: SetRenderTarget failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+        pContext->sidRenderTarget = target.sid;
+
+        /* Changing the render target resets the viewport; restore it here. */
+        if (pContext->state.u32UpdateFlags & VMSVGA3D_UPDATE_VIEWPORT)
+            vmsvga3dSetViewPort(pThis, cid, &pContext->state.RectViewPort);
+
+        break;
+    }
+
+    default:
+        AssertFailedReturn(VERR_INVALID_PARAMETER);
+    }
+
+    return VINF_SUCCESS;
+}
+
+/**
+ * Convert SVGA texture combiner value to its D3D equivalent
+ */
+static DWORD vmsvga3dTextureCombiner2D3D(uint32_t value)
+{
+    switch (value)
+    {
+    case SVGA3D_TC_DISABLE:
+        return D3DTOP_DISABLE;
+    case SVGA3D_TC_SELECTARG1:
+        return D3DTOP_SELECTARG1;
+    case SVGA3D_TC_SELECTARG2:
+        return D3DTOP_SELECTARG2;
+    case SVGA3D_TC_MODULATE:
+        return D3DTOP_MODULATE;
+    case SVGA3D_TC_ADD:
+        return D3DTOP_ADD;
+    case SVGA3D_TC_ADDSIGNED:
+        return D3DTOP_ADDSIGNED;
+    case SVGA3D_TC_SUBTRACT:
+        return D3DTOP_SUBTRACT;
+    case SVGA3D_TC_BLENDTEXTUREALPHA:
+        return D3DTOP_BLENDTEXTUREALPHA;
+    case SVGA3D_TC_BLENDDIFFUSEALPHA:
+        return D3DTOP_BLENDDIFFUSEALPHA;
+    case SVGA3D_TC_BLENDCURRENTALPHA:
+        return D3DTOP_BLENDCURRENTALPHA;
+    case SVGA3D_TC_BLENDFACTORALPHA:
+        return D3DTOP_BLENDFACTORALPHA;
+    case SVGA3D_TC_MODULATE2X:
+        return D3DTOP_MODULATE2X;
+    case SVGA3D_TC_MODULATE4X:
+        return D3DTOP_MODULATE4X;
+    case SVGA3D_TC_DSDT:
+        AssertFailed(); /* @todo ??? */
+        return D3DTOP_DISABLE;
+    case SVGA3D_TC_DOTPRODUCT3:
+        return D3DTOP_DOTPRODUCT3;
+    case SVGA3D_TC_BLENDTEXTUREALPHAPM:
+        return D3DTOP_BLENDTEXTUREALPHAPM;
+    case SVGA3D_TC_ADDSIGNED2X:
+        return D3DTOP_ADDSIGNED2X;
+    case SVGA3D_TC_ADDSMOOTH:
+        return D3DTOP_ADDSMOOTH;
+    case SVGA3D_TC_PREMODULATE:
+        return D3DTOP_PREMODULATE;
+    case SVGA3D_TC_MODULATEALPHA_ADDCOLOR:
+        return D3DTOP_MODULATEALPHA_ADDCOLOR;
+    case SVGA3D_TC_MODULATECOLOR_ADDALPHA:
+        return D3DTOP_MODULATECOLOR_ADDALPHA;
+    case SVGA3D_TC_MODULATEINVALPHA_ADDCOLOR:
+        return D3DTOP_MODULATEINVALPHA_ADDCOLOR;
+    case SVGA3D_TC_MODULATEINVCOLOR_ADDALPHA:
+        return D3DTOP_MODULATEINVCOLOR_ADDALPHA;
+    case SVGA3D_TC_BUMPENVMAPLUMINANCE:
+        return D3DTOP_BUMPENVMAPLUMINANCE;
+    case SVGA3D_TC_MULTIPLYADD:
+        return D3DTOP_MULTIPLYADD;
+    case SVGA3D_TC_LERP:
+        return D3DTOP_LERP;
+    default:
+        AssertFailed();
+        return D3DTOP_DISABLE;
+    }
+}
+
+/**
+ * Convert SVGA texture arg data value to its D3D equivalent
+ */
+static DWORD vmsvga3dTextureArgData2D3D(uint32_t value)
+{
+    switch (value)
+    {
+    case SVGA3D_TA_CONSTANT:
+        return D3DTA_CONSTANT;
+    case SVGA3D_TA_PREVIOUS:
+        return D3DTA_CURRENT;   /* current = previous */
+    case SVGA3D_TA_DIFFUSE:
+        return D3DTA_DIFFUSE;
+    case SVGA3D_TA_TEXTURE:
+        return D3DTA_TEXTURE;
+    case SVGA3D_TA_SPECULAR:
+        return D3DTA_SPECULAR;
+    default:
+        AssertFailed();
+        return 0;
+    }
+}
+
+/**
+ * Convert SVGA texture transform flag value to its D3D equivalent
+ */
+static DWORD vmsvga3dTextTransformFlags2D3D(uint32_t value)
+{
+    switch (value)
+    {
+    case SVGA3D_TEX_TRANSFORM_OFF:
+        return D3DTTFF_DISABLE;
+    case SVGA3D_TEX_TRANSFORM_S:
+        return D3DTTFF_COUNT1;      /* @todo correct? */
+    case SVGA3D_TEX_TRANSFORM_T:
+        return D3DTTFF_COUNT2;      /* @todo correct? */
+    case SVGA3D_TEX_TRANSFORM_R:
+        return D3DTTFF_COUNT3;      /* @todo correct? */
+    case SVGA3D_TEX_TRANSFORM_Q:
+        return D3DTTFF_COUNT4;      /* @todo correct? */
+    case SVGA3D_TEX_PROJECTED:
+        return D3DTTFF_PROJECTED;
+    default:
+        AssertFailed();
+        return 0;
+    }
+}
+
+int vmsvga3dSetTextureState(PVGASTATE pThis, uint32_t cid, uint32_t cTextureStates, SVGA3dTextureState *pTextureState)
+{
+    DWORD                       val;
+    HRESULT                     hr;
+    PVMSVGA3DCONTEXT            pContext;
+    PVMSVGA3DSTATE              pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dSetTextureState %x cTextureState=%d\n", cid, cTextureStates));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetTextureState invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+
+    for (unsigned i = 0; i < cTextureStates; i++)
+    {
+        D3DTEXTURESTAGESTATETYPE textureType = D3DTSS_FORCE_DWORD;
+        D3DSAMPLERSTATETYPE      samplerType = D3DSAMP_FORCE_DWORD;
+
+        Log(("vmsvga3dSetTextureState: cid=%x stage=%d type=%s (%x) val=%x\n", cid, pTextureState[i].stage, vmsvga3dTextureStateToString(pTextureState[i].name), pTextureState[i].name, pTextureState[i].value));
+        /* Record the texture state for vm state saving. */
+        if (    pTextureState[i].stage < SVGA3D_MAX_TEXTURE_STAGE
+            &&  pTextureState[i].name < SVGA3D_TS_MAX)
+        {
+            pContext->state.aTextureState[pTextureState[i].stage][pTextureState[i].name] = pTextureState[i];
+        }
+
+        switch (pTextureState[i].name)
+        {
+        case SVGA3D_TS_COLOROP:                     /* SVGA3dTextureCombiner */
+            textureType = D3DTSS_COLOROP;
+            val = vmsvga3dTextureCombiner2D3D(pTextureState[i].value);
+            break;
+
+        case SVGA3D_TS_COLORARG0:                   /* SVGA3dTextureArgData */
+            textureType = D3DTSS_COLORARG0;
+            val = vmsvga3dTextureArgData2D3D(pTextureState[i].value);
+            break;
+
+        case SVGA3D_TS_COLORARG1:                   /* SVGA3dTextureArgData */
+            textureType = D3DTSS_COLORARG1;
+            val = vmsvga3dTextureArgData2D3D(pTextureState[i].value);
+            break;
+
+        case SVGA3D_TS_COLORARG2:                   /* SVGA3dTextureArgData */
+            textureType = D3DTSS_COLORARG2;
+            val = vmsvga3dTextureArgData2D3D(pTextureState[i].value);
+            break;
+
+        case SVGA3D_TS_ALPHAOP:                     /* SVGA3dTextureCombiner */
+            textureType = D3DTSS_ALPHAOP;
+            val = vmsvga3dTextureCombiner2D3D(pTextureState[i].value);
+            break;
+
+        case SVGA3D_TS_ALPHAARG0:                   /* SVGA3dTextureArgData */
+            textureType = D3DTSS_ALPHAARG0;
+            val = vmsvga3dTextureArgData2D3D(pTextureState[i].value);
+            break;
+
+        case SVGA3D_TS_ALPHAARG1:                   /* SVGA3dTextureArgData */
+            textureType = D3DTSS_ALPHAARG1;
+            val = vmsvga3dTextureArgData2D3D(pTextureState[i].value);
+            break;
+
+        case SVGA3D_TS_ALPHAARG2:                   /* SVGA3dTextureArgData */
+            textureType = D3DTSS_ALPHAARG2;
+            val = vmsvga3dTextureArgData2D3D(pTextureState[i].value);
+            break;
+
+        case SVGA3D_TS_BUMPENVMAT00:                /* float */
+            textureType = D3DTSS_BUMPENVMAT00;
+            val = pTextureState[i].value;
+            break;
+
+        case SVGA3D_TS_BUMPENVMAT01:                /* float */
+            textureType = D3DTSS_BUMPENVMAT01;
+            val = pTextureState[i].value;
+            break;
+
+        case SVGA3D_TS_BUMPENVMAT10:                /* float */
+            textureType = D3DTSS_BUMPENVMAT10;
+            val = pTextureState[i].value;
+            break;
+
+        case SVGA3D_TS_BUMPENVMAT11:                /* float */
+            textureType = D3DTSS_BUMPENVMAT11;
+            val = pTextureState[i].value;
+            break;
+
+        case SVGA3D_TS_TEXCOORDINDEX:               /* uint32_t */
+            textureType = D3DTSS_TEXCOORDINDEX;
+            val = pTextureState[i].value;
+            break;
+
+        case SVGA3D_TS_BUMPENVLSCALE:               /* float */
+            textureType = D3DTSS_BUMPENVLSCALE;
+            val = pTextureState[i].value;
+            break;
+
+        case SVGA3D_TS_BUMPENVLOFFSET:              /* float */
+            textureType = D3DTSS_BUMPENVLOFFSET;
+            val = pTextureState[i].value;
+            break;
+
+        case SVGA3D_TS_TEXTURETRANSFORMFLAGS:       /* SVGA3dTexTransformFlags */
+            textureType = D3DTSS_TEXTURETRANSFORMFLAGS;
+            val = vmsvga3dTextTransformFlags2D3D(pTextureState[i].value);
+            break;
+
+        case SVGA3D_TS_BIND_TEXTURE:                /* SVGA3dSurfaceId */
+            if (pTextureState[i].value == SVGA3D_INVALID_ID)
+            {
+                Log(("SVGA3D_TS_BIND_TEXTURE: stage %d, texture surface id=%x\n", pTextureState[i].stage, pTextureState[i].value));
+
+                pContext->aSidActiveTexture[pTextureState[i].stage] = SVGA3D_INVALID_ID;
+                /* Unselect the currently associated texture. */
+                hr = pContext->pDevice->SetTexture(pTextureState[i].stage,
+                                                   NULL);
+                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetTextureState: SetTexture failed with %x\n", hr), VERR_INTERNAL_ERROR);
+            }
+            else
+            {
+                HRESULT hr;
+                uint32_t sid = pTextureState[i].value;
+
+                AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+                AssertReturn(sid < pState->cSurfaces && pState->paSurface[sid].id == sid, VERR_INVALID_PARAMETER);
+
+                PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];
+
+                Log(("SVGA3D_TS_BIND_TEXTURE: stage %d, texture surface id=%x (%d,%d)\n", pTextureState[i].stage, pTextureState[i].value, pSurface->pMipmapLevels[0].size.width, pSurface->pMipmapLevels[0].size.height));
+
+                if (!pSurface->u.pTexture)
+                {
+                    Assert(pSurface->idAssociatedContext == SVGA3D_INVALID_ID);
+                    Log(("CreateTexture (%d,%d) level=%d fUsage=%x format=%x\n", pSurface->pMipmapLevels[0].size.width, pSurface->pMipmapLevels[0].size.height, pSurface->faces[0].numMipLevels, pSurface->fUsageD3D, pSurface->formatD3D));
+                    int rc = vmsvga3dCreateTexture(pContext, cid, pSurface);
+                    AssertRCReturn(rc, rc);
+                }
+                else
+                {
+                    /* Must flush the other context's 3d pipeline to make sure all drawing is complete for the surface we're about to use. */
+                    vmsvga3dSurfaceFlush(pThis, pSurface);
+                }
+
+#ifndef VBOX_VMSVGA3D_WITH_OPENGL
+                if (pSurface->idAssociatedContext != cid)
+                {
+                    Log(("vmsvga3dSetTextureState; using texture %x created for another context (%d vs %d)\n", sid, pSurface->idAssociatedContext, cid));
+    
+                    PVMSVGA3DSHAREDSURFACE pSharedSurface = vmsvga3dSurfaceGetSharedCopy(pThis, pContext, pSurface);
+                    AssertReturn(pSharedSurface, VERR_INTERNAL_ERROR);
+
+                    hr = pContext->pDevice->SetTexture(pTextureState[i].stage,
+                                                       pSharedSurface->u.pTexture);
+                }
+                else
+#endif
+                    hr = pContext->pDevice->SetTexture(pTextureState[i].stage,
+                                                       pSurface->u.pTexture);
+
+                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetTextureState: SetTexture failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                pContext->aSidActiveTexture[pTextureState[i].stage] = sid;
+            }
+            /* Finished; continue with the next one. */
+            continue;
+
+        case SVGA3D_TS_ADDRESSW:                    /* SVGA3dTextureAddress */
+            samplerType = D3DSAMP_ADDRESSW;
+            val = pTextureState[i].value;   /* Identical otherwise */
+            Assert(pTextureState[i].value != SVGA3D_TEX_ADDRESS_EDGE);
+            break;
+
+        case SVGA3D_TS_ADDRESSU:                    /* SVGA3dTextureAddress */
+            samplerType = D3DSAMP_ADDRESSU;
+            val = pTextureState[i].value;   /* Identical otherwise */
+            Assert(pTextureState[i].value != SVGA3D_TEX_ADDRESS_EDGE);
+            break;
+
+        case SVGA3D_TS_ADDRESSV:                    /* SVGA3dTextureAddress */
+            samplerType = D3DSAMP_ADDRESSV;
+            val = pTextureState[i].value;   /* Identical otherwise */
+            Assert(pTextureState[i].value != SVGA3D_TEX_ADDRESS_EDGE);
+            break;
+
+        case SVGA3D_TS_MIPFILTER:                   /* SVGA3dTextureFilter */
+            samplerType = D3DSAMP_MIPFILTER;
+            val = pTextureState[i].value;   /* Identical otherwise */
+            Assert(pTextureState[i].value != SVGA3D_TEX_FILTER_FLATCUBIC);
+            Assert(pTextureState[i].value != SVGA3D_TEX_FILTER_GAUSSIANCUBIC);
+            break;
+
+        case SVGA3D_TS_MAGFILTER:                   /* SVGA3dTextureFilter */
+            samplerType = D3DSAMP_MAGFILTER;
+            val = pTextureState[i].value;   /* Identical otherwise */
+            Assert(pTextureState[i].value != SVGA3D_TEX_FILTER_FLATCUBIC);
+            Assert(pTextureState[i].value != SVGA3D_TEX_FILTER_GAUSSIANCUBIC);
+            break;
+
+        case SVGA3D_TS_MINFILTER:                   /* SVGA3dTextureFilter */
+            samplerType = D3DSAMP_MINFILTER;
+            val = pTextureState[i].value;   /* Identical otherwise */
+            Assert(pTextureState[i].value != SVGA3D_TEX_FILTER_FLATCUBIC);
+            Assert(pTextureState[i].value != SVGA3D_TEX_FILTER_GAUSSIANCUBIC);
+            break;
+
+        case SVGA3D_TS_BORDERCOLOR:                 /* SVGA3dColor */
+            samplerType = D3DSAMP_BORDERCOLOR;
+            val = pTextureState[i].value;   /* Identical */
+            break;
+            
+        case SVGA3D_TS_TEXTURE_LOD_BIAS:            /* float */
+            samplerType = D3DSAMP_MIPMAPLODBIAS;
+            val = pTextureState[i].value;   /* Identical */
+            break;
+            
+        case SVGA3D_TS_TEXTURE_MIPMAP_LEVEL:        /* uint32_t */
+            samplerType = D3DSAMP_MAXMIPLEVEL;
+            val = pTextureState[i].value;   /* Identical?? */
+            break;
+            
+        case SVGA3D_TS_TEXTURE_ANISOTROPIC_LEVEL:   /* uint32_t */
+            samplerType = D3DSAMP_MAXANISOTROPY;
+            val = pTextureState[i].value;   /* Identical?? */
+            break;
+            
+        case SVGA3D_TS_GAMMA:                       /* float */
+            samplerType = D3DSAMP_SRGBTEXTURE;
+            /* Boolean in D3D */
+            if (pTextureState[i].floatValue == 1.0f)
+                val = FALSE;
+            else
+                val = TRUE;
+            break;           
+
+        /* Internal commands, that don't map directly to the SetTextureStageState API. */
+        case SVGA3D_TS_TEXCOORDGEN:                 /* SVGA3dTextureCoordGen */
+            AssertFailed();
+            break;
+        }
+
+        if (textureType != D3DTSS_FORCE_DWORD)
+        {
+            hr = pContext->pDevice->SetTextureStageState(pTextureState[i].stage, textureType, val);
+        }
+        else
+        {
+            Assert(samplerType != D3DSAMP_FORCE_DWORD);
+            hr = pContext->pDevice->SetSamplerState(pTextureState[i].stage, samplerType, val);
+        }
+
+        AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetTextureState: SetTextureStageState failed with %x\n", hr), VERR_INTERNAL_ERROR);
+    }
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSetMaterial(PVGASTATE pThis, uint32_t cid, SVGA3dFace face, SVGA3dMaterial *pMaterial)
+{
+    HRESULT               hr;
+    D3DMATERIAL9          material;
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dSetMaterial %x face %d\n", cid, face));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetMaterial invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+
+    AssertReturn(face < SVGA3D_FACE_MAX, VERR_INVALID_PARAMETER);
+
+    /* Save for vm state save/restore. */
+    pContext->state.aMaterial[face].fValid = true;
+    pContext->state.aMaterial[face].material = *pMaterial;
+    pContext->state.u32UpdateFlags |= VMSVGA3D_UPDATE_MATERIAL;
+
+    /* @note face not used for D3D9 */
+    /* @todo ignore everything except SVGA3D_FACE_NONE? */
+    //Assert(face == SVGA3D_FACE_NONE);
+    if (face != SVGA3D_FACE_NONE)
+        Log(("Unsupported face %d!!\n", face));
+
+    material.Diffuse.r     = pMaterial->diffuse[0];
+    material.Diffuse.g     = pMaterial->diffuse[1];
+    material.Diffuse.b     = pMaterial->diffuse[2];
+    material.Diffuse.a     = pMaterial->diffuse[3];
+    material.Ambient.r     = pMaterial->ambient[0];
+    material.Ambient.g     = pMaterial->ambient[1];
+    material.Ambient.b     = pMaterial->ambient[2];
+    material.Ambient.a     = pMaterial->ambient[3];
+    material.Specular.r    = pMaterial->specular[0];
+    material.Specular.g    = pMaterial->specular[1];
+    material.Specular.b    = pMaterial->specular[2];
+    material.Specular.a    = pMaterial->specular[3];
+    material.Emissive.r    = pMaterial->emissive[0];
+    material.Emissive.g    = pMaterial->emissive[1];
+    material.Emissive.b    = pMaterial->emissive[2];
+    material.Emissive.a    = pMaterial->emissive[3];
+    material.Power         = pMaterial->shininess;
+
+    hr = pContext->pDevice->SetMaterial(&material);
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetMaterial: SetMaterial failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSetLightData(PVGASTATE pThis, uint32_t cid, uint32_t index, SVGA3dLightData *pData)
+{
+    HRESULT               hr;
+    D3DLIGHT9             light;
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dSetLightData %x index=%d\n", cid, index));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetLightData invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+
+    switch (pData->type)
+    {
+    case SVGA3D_LIGHTTYPE_POINT:
+        light.Type = D3DLIGHT_POINT;
+        break;
+
+    case SVGA3D_LIGHTTYPE_SPOT1:    /* 1-cone, in degrees */
+        light.Type = D3DLIGHT_SPOT;
+        break;
+
+    case SVGA3D_LIGHTTYPE_DIRECTIONAL:
+        light.Type = D3DLIGHT_DIRECTIONAL;
+        break;
+
+    case SVGA3D_LIGHTTYPE_SPOT2:    /* 2-cone, in radians */
+    default:
+        Log(("Unsupported light type!!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+
+    /* Store for vm state save/restore */
+    if (index < SVGA3D_MAX_LIGHTS)
+    {
+        pContext->state.aLightData[index].fValidData = true;
+        pContext->state.aLightData[index].data = *pData;
+    }
+    else
+        AssertFailed();
+
+    light.Diffuse.r     = pData->diffuse[0];
+    light.Diffuse.g     = pData->diffuse[1];
+    light.Diffuse.b     = pData->diffuse[2];
+    light.Diffuse.a     = pData->diffuse[3];
+    light.Specular.r    = pData->specular[0];
+    light.Specular.g    = pData->specular[1];
+    light.Specular.b    = pData->specular[2];
+    light.Specular.a    = pData->specular[3];
+    light.Ambient.r     = pData->ambient[0];
+    light.Ambient.g     = pData->ambient[1];
+    light.Ambient.b     = pData->ambient[2];
+    light.Ambient.a     = pData->ambient[3];
+    light.Position.x    = pData->position[0];
+    light.Position.y    = pData->position[1];
+    light.Position.z    = pData->position[2];       /* @note 4th position not available in D3D9 */
+    light.Direction.x   = pData->direction[0];
+    light.Direction.y   = pData->direction[1];
+    light.Direction.z   = pData->direction[2];      /* @note 4th position not available in D3D9 */
+    light.Range         = pData->range;
+    light.Falloff       = pData->falloff;
+    light.Attenuation0  = pData->attenuation0;
+    light.Attenuation1  = pData->attenuation1;
+    light.Attenuation2  = pData->attenuation2;
+    light.Theta         = pData->theta;
+    light.Phi           = pData->phi;
+
+    hr = pContext->pDevice->SetLight(index, &light);
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetLightData: SetLight failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSetLightEnabled(PVGASTATE pThis, uint32_t cid, uint32_t index, uint32_t enabled)
+{
+    HRESULT               hr;
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dSetLightEnabled %x %d -> %d\n", cid, index, enabled));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetLightEnabled invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+
+    /* Store for vm state save/restore */
+    if (index < SVGA3D_MAX_LIGHTS)
+        pContext->state.aLightData[index].fEnabled = !!enabled;
+    else
+        AssertFailed();
+
+    hr = pContext->pDevice->LightEnable(index, (BOOL)enabled);
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetLightEnabled: LightEnable failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSetViewPort(PVGASTATE pThis, uint32_t cid, SVGA3dRect *pRect)
+{
+    HRESULT               hr;
+    D3DVIEWPORT9          viewPort;
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dSetViewPort %x (%d,%d)(%d,%d)\n", cid, pRect->x, pRect->y, pRect->w, pRect->h));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetViewPort invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    /* Save for vm state save/restore. */
+    pContext = &pState->paContext[cid];
+    pContext->state.RectViewPort = *pRect;
+    pContext->state.u32UpdateFlags |= VMSVGA3D_UPDATE_VIEWPORT;
+
+    hr = pContext->pDevice->GetViewport(&viewPort);
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetViewPort: GetViewport failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    viewPort.X      = pRect->x;
+    viewPort.Y      = pRect->y;
+    viewPort.Width  = pRect->w;
+    viewPort.Height = pRect->h;
+    /* viewPort.MinZ & MaxZ are not changed from the current setting. */
+
+    hr = pContext->pDevice->SetViewport(&viewPort);
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetViewPort: SetViewport failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dSetClipPlane(PVGASTATE pThis, uint32_t cid,  uint32_t index, float plane[4])
+{
+    HRESULT               hr;
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dSetClipPlane %x %d (%d,%d)(%d,%d)\n", cid, index, (unsigned)(plane[0] * 100.0), (unsigned)(plane[1] * 100.0), (unsigned)(plane[2] * 100.0), (unsigned)(plane[3] * 100.0)));
+    AssertReturn(index <= SVGA3D_CLIPPLANE_MAX, VERR_INVALID_PARAMETER);
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetClipPlane invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+
+    /* Store for vm state save/restore. */
+    pContext->state.aClipPlane[index].fValid = true;
+    memcpy(pContext->state.aClipPlane[index].plane, plane, sizeof(plane));
+
+    hr = pContext->pDevice->SetClipPlane(index, plane);
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetClipPlane: SetClipPlane failed with %x\n", hr), VERR_INTERNAL_ERROR);
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dCommandClear(PVGASTATE pThis, uint32_t cid, SVGA3dClearFlag clearFlag, uint32_t color, float depth, uint32_t stencil, uint32_t cRects, SVGA3dRect *pRect)
+{
+    DWORD                 clearFlagD3D = 0;
+    D3DRECT              *pRectD3D = NULL;
+    HRESULT               hr;
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dCommandClear %x clearFlag=%x color=%x depth=%d stencil=%x cRects=%d\n", cid, clearFlag, color, (uint32_t)(depth * 100.0), stencil, cRects));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dCommandClear invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+
+    if (clearFlag & SVGA3D_CLEAR_COLOR)
+        clearFlagD3D |= D3DCLEAR_TARGET;
+    if (clearFlag & SVGA3D_CLEAR_STENCIL)
+        clearFlagD3D |= D3DCLEAR_STENCIL;
+    if (clearFlag & SVGA3D_CLEAR_DEPTH)
+        clearFlagD3D |= D3DCLEAR_ZBUFFER;
+
+    if (cRects)
+    {
+        pRectD3D = (D3DRECT *)RTMemAlloc(sizeof(D3DRECT) * cRects);
+        AssertReturn(pRectD3D, VERR_NO_MEMORY);
+
+        for (unsigned i=0; i < cRects; i++)
+        {
+            Log(("vmsvga3dCommandClear: rect %d (%d,%d)(%d,%d)\n", i, pRect[i].x, pRect[i].y, pRect[i].x + pRect[i].w, pRect[i].y + pRect[i].h));
+            pRectD3D[i].x1 = pRect[i].x;
+            pRectD3D[i].y1 = pRect[i].y;
+            pRectD3D[i].x2 = pRect[i].x + pRect[i].w;   /* exclusive */
+            pRectD3D[i].y2 = pRect[i].y + pRect[i].h;   /* exclusive */
+        }
+    }
+
+    hr = pContext->pDevice->Clear(cRects, pRectD3D, clearFlagD3D, (D3DCOLOR)color, depth, stencil);
+    if (pRectD3D)
+        RTMemFree(pRectD3D);
+
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dCommandClear: Clear failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    /* Make sure we can track drawing usage of active render targets. */
+    if (pContext->sidRenderTarget != SVGA3D_INVALID_ID)
+        vmsvga3dSurfaceTrackUsage(pThis, pContext, pContext->sidRenderTarget);
+
+    return VINF_SUCCESS;
+}
+
+/* Convert VMWare vertex declaration to its D3D equivalent. */
+int vmsvga3dVertexDecl2D3D(SVGA3dVertexArrayIdentity &identity, D3DVERTEXELEMENT9 *pVertexElement)
+{
+    /* usage, method and type are identical; make sure. */
+    AssertCompile(SVGA3D_DECLTYPE_FLOAT1 == D3DDECLTYPE_FLOAT1);
+    AssertCompile(SVGA3D_DECLTYPE_FLOAT16_4 == D3DDECLTYPE_FLOAT16_4);
+    AssertCompile(SVGA3D_DECLMETHOD_DEFAULT == D3DDECLMETHOD_DEFAULT);
+    AssertCompile(SVGA3D_DECLMETHOD_LOOKUPPRESAMPLED == D3DDECLMETHOD_LOOKUPPRESAMPLED);
+    AssertCompile(D3DDECLUSAGE_POSITION == SVGA3D_DECLUSAGE_POSITION);
+    AssertCompile(D3DDECLUSAGE_SAMPLE == SVGA3D_DECLUSAGE_SAMPLE);
+
+    pVertexElement->Stream      = 0;
+    pVertexElement->Offset      = 0;
+    pVertexElement->Type        = identity.type;
+    pVertexElement->Method      = identity.method;
+    pVertexElement->Usage       = identity.usage;
+    pVertexElement->UsageIndex  = identity.usageIndex;
+    return VINF_SUCCESS;
+}
+
+/* Convert VMWare primitive type to its D3D equivalent. */
+int vmsvga3dPrimitiveType2D3D(SVGA3dPrimitiveType PrimitiveType, D3DPRIMITIVETYPE *pPrimitiveTypeD3D)
+{
+    switch (PrimitiveType)
+    {
+    case SVGA3D_PRIMITIVE_TRIANGLELIST:
+        *pPrimitiveTypeD3D = D3DPT_TRIANGLELIST;
+        break;
+    case SVGA3D_PRIMITIVE_POINTLIST:
+        *pPrimitiveTypeD3D = D3DPT_POINTLIST;
+        break;
+    case SVGA3D_PRIMITIVE_LINELIST:
+        *pPrimitiveTypeD3D = D3DPT_LINELIST;
+        break;
+    case SVGA3D_PRIMITIVE_LINESTRIP:
+        *pPrimitiveTypeD3D = D3DPT_LINESTRIP;
+        break;
+    case SVGA3D_PRIMITIVE_TRIANGLESTRIP:
+        *pPrimitiveTypeD3D = D3DPT_TRIANGLESTRIP;
+        break;
+    case SVGA3D_PRIMITIVE_TRIANGLEFAN:
+        *pPrimitiveTypeD3D = D3DPT_TRIANGLEFAN;
+        break;
+    default:
+        return VERR_INVALID_PARAMETER;
+    }
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dDrawPrimitivesProcessVertexDecls(PVMSVGA3DSTATE pState, PVMSVGA3DCONTEXT pContext, uint32_t numVertexDecls, SVGA3dVertexDecl *pVertexDecl, uint32_t idStream, D3DVERTEXELEMENT9 *pVertexElement)
+{
+    HRESULT               hr;
+    int                   rc;
+    uint32_t              uVertexMinOffset = 0xffffffff;
+    uint32_t              uVertexMaxOffset = 0;
+
+    /* Create a vertex declaration array */
+    for (unsigned iVertex = 0; iVertex < numVertexDecls; iVertex++)
+    {
+        unsigned            sidVertex = pVertexDecl[iVertex].array.surfaceId;
+        PVMSVGA3DSURFACE    pVertexSurface;
+
+        AssertReturn(sidVertex < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER);
+        AssertReturn(sidVertex < pState->cSurfaces && pState->paSurface[sidVertex].id == sidVertex, VERR_INVALID_PARAMETER);
+
+        pVertexSurface = &pState->paSurface[sidVertex];
+        Log(("vmsvga3dDrawPrimitives: vertex surface %x stream %d\n", sidVertex, idStream));
+        Log(("vmsvga3dDrawPrimitives: type=%s (%d) method=%s (%d) usage=%s (%d) usageIndex=%d stride=%d offset=%d\n", vmsvgaDeclType2String(pVertexDecl[iVertex].identity.type), pVertexDecl[iVertex].identity.type, vmsvgaDeclMethod2String(pVertexDecl[iVertex].identity.method), pVertexDecl[iVertex].identity.method, vmsvgaDeclUsage2String(pVertexDecl[iVertex].identity.usage), pVertexDecl[iVertex].identity.usage, pVertexDecl[iVertex].identity.usageIndex, pVertexDecl[iVertex].array.stride, pVertexDecl[iVertex].array.offset));
+
+        rc = vmsvga3dVertexDecl2D3D(pVertexDecl[iVertex].identity, &pVertexElement[iVertex]);
+        AssertRCReturn(rc, rc);
+        pVertexElement[iVertex].Stream = idStream;
+
+#ifdef LOG_ENABLED
+        if (pVertexDecl[iVertex].array.stride == 0)
+            Log(("vmsvga3dDrawPrimitives: stride == 0! Can be valid\n"));
+#endif
+
+        /* Find the min and max vertex offset to determine the right base offset to use in the vertex declaration. */
+        if (pVertexDecl[iVertex].array.offset > uVertexMaxOffset)
+            uVertexMaxOffset = pVertexDecl[iVertex].array.offset;
+        if (pVertexDecl[iVertex].array.offset < uVertexMinOffset)
+            uVertexMinOffset = pVertexDecl[iVertex].array.offset;
+
+        if (!pVertexSurface->u.pVertexBuffer)
+        {
+            Assert(iVertex == 0);
+
+            Log(("vmsvga3dDrawPrimitives: create vertex buffer fDirty=%d\n", pVertexSurface->fDirty));
+            hr = pContext->pDevice->CreateVertexBuffer(pVertexSurface->pMipmapLevels[0].cbSurface,
+                                                       D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY /* possible severe performance penalty otherwise (according to d3d debug output) */,
+                                                       0, /* non-FVF */
+                                                       D3DPOOL_DEFAULT,
+                                                       &pVertexSurface->u.pVertexBuffer,
+                                                       NULL);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dDrawPrimitives: CreateVertexBuffer failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+            if (pVertexSurface->fDirty)
+            {
+                void *pData;
+
+                hr = pVertexSurface->u.pVertexBuffer->Lock(0, 0, &pData, 0);
+                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dDrawPrimitives: Lock vertex failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+                memcpy(pData, pVertexSurface->pMipmapLevels[0].pSurfaceData, pVertexSurface->pMipmapLevels[0].cbSurface);
+
+                hr = pVertexSurface->u.pVertexBuffer->Unlock();
+                AssertMsgReturn(hr == D3D_OK, ("vmsvga3dDrawPrimitives: Unlock vertex failed with %x\n", hr), VERR_INTERNAL_ERROR);
+                pVertexSurface->pMipmapLevels[0].fDirty = false;
+                pVertexSurface->fDirty = false;
+            }
+            pVertexSurface->flags |= SVGA3D_SURFACE_HINT_VERTEXBUFFER;
+        }
+        else
+            Assert(pVertexSurface->fDirty == false);
+    }
+
+    /* Set the right vertex offset values for each declaration. */
+    for (unsigned iVertex = 0; iVertex < numVertexDecls; iVertex++)
+    {
+        pVertexElement[iVertex].Offset = pVertexDecl[iVertex].array.offset - uVertexMinOffset;
+#ifdef LOG_ENABLED
+        if (pVertexElement[iVertex].Offset >= pVertexDecl[0].array.stride)
+            Log(("vmsvga3dDrawPrimitives: WARNING: offset > stride!!\n"));
+#endif
+
+        Log(("vmsvga3dDrawPrimitives: vertex %d offset = %d (stride %d) (min=%d max=%d)\n", iVertex, pVertexDecl[iVertex].array.offset, pVertexDecl[iVertex].array.stride, uVertexMinOffset, uVertexMaxOffset));
+    }
+
+    PVMSVGA3DSURFACE pVertexSurface;
+    unsigned         sidVertex = pVertexDecl[0].array.surfaceId;
+    unsigned         strideVertex = pVertexDecl[0].array.stride;
+
+    pVertexSurface = &pState->paSurface[sidVertex];
+
+    Log(("vmsvga3dDrawPrimitives: SetStreamSource %d min offset=%d stride=%d\n", idStream, uVertexMinOffset, strideVertex));
+    hr = pContext->pDevice->SetStreamSource(idStream,
+                                            pVertexSurface->u.pVertexBuffer,
+                                            uVertexMinOffset,
+                                            strideVertex);
+
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dDrawPrimitives: SetStreamSource failed with %x\n", hr), VERR_INTERNAL_ERROR);
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dDrawPrimitives(PVGASTATE pThis, uint32_t cid, uint32_t numVertexDecls, SVGA3dVertexDecl *pVertexDecl, uint32_t numRanges, SVGA3dPrimitiveRange *pRange, uint32_t cVertexDivisor, SVGA3dVertexDivisor *pVertexDivisor)
+{
+    PVMSVGA3DCONTEXT             pContext;
+    PVMSVGA3DSTATE               pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_INTERNAL_ERROR);
+    int                          rc;
+    HRESULT                      hr;
+    uint32_t                     iCurrentVertex, iCurrentStreamId;
+    IDirect3DVertexDeclaration9 *pVertexDeclD3D = NULL;
+    D3DVERTEXELEMENT9           *pVertexElement = NULL;
+    D3DVERTEXELEMENT9            VertexEnd = D3DDECL_END();
+
+    Log(("vmsvga3dDrawPrimitives %x numVertexDecls=%d numRanges=%d, cVertexDivisor=%d\n", cid, numVertexDecls, numRanges, cVertexDivisor));
+
+    AssertReturn(numVertexDecls && numVertexDecls <= SVGA3D_MAX_VERTEX_ARRAYS, VERR_INVALID_PARAMETER);
+    AssertReturn(numRanges && numRanges <= SVGA3D_MAX_DRAW_PRIMITIVE_RANGES, VERR_INVALID_PARAMETER);
+    AssertReturn(!cVertexDivisor || cVertexDivisor == numVertexDecls, VERR_INVALID_PARAMETER);
+    /* @todo */
+    Assert(!cVertexDivisor);
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dDrawPrimitives invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+
+    pContext = &pState->paContext[cid];
+
+    /* Begin a scene before rendering anything. */
+    hr = pContext->pDevice->BeginScene();
+    AssertMsgReturn(hr == D3D_OK, ("BeginScene failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    pVertexElement = (D3DVERTEXELEMENT9 *)RTMemAllocZ(sizeof(D3DVERTEXELEMENT9) * (numVertexDecls + 1));
+    if (!pVertexElement)
+    {
+        Assert(pVertexElement);
+        rc = VERR_INTERNAL_ERROR;
+        goto internal_error;
+    }
+
+    /* Process all vertex declarations. Each vertex buffer is represented by one stream source id. */
+    iCurrentVertex   = 0;
+    iCurrentStreamId = 0;
+    while (iCurrentVertex < numVertexDecls)
+    {
+        uint32_t sidVertex = SVGA_ID_INVALID;
+        uint32_t iVertex;
+        uint32_t uVertexMinOffset = 0xffffffff;
+
+        for (iVertex = iCurrentVertex; iVertex < numVertexDecls; iVertex++)
+        {
+            if (    (   sidVertex != SVGA_ID_INVALID
+                     && pVertexDecl[iVertex].array.surfaceId != sidVertex
+                    )
+                /* We must put vertex declarations that start at a different element in another stream as d3d only handles offsets < stride. */
+                ||  (   uVertexMinOffset != 0xffffffff
+                     && pVertexDecl[iVertex].array.offset >= uVertexMinOffset + pVertexDecl[iCurrentVertex].array.stride
+                    )
+               )
+                break;
+            sidVertex = pVertexDecl[iVertex].array.surfaceId;
+
+            if (uVertexMinOffset > pVertexDecl[iVertex].array.offset)
+                uVertexMinOffset = pVertexDecl[iVertex].array.offset;
+        }
+
+        rc = vmsvga3dDrawPrimitivesProcessVertexDecls(pState, pContext, iVertex - iCurrentVertex, &pVertexDecl[iCurrentVertex], iCurrentStreamId, &pVertexElement[iCurrentVertex]);
+        if (RT_FAILURE(rc))
+            goto internal_error;
+
+        iCurrentVertex = iVertex;
+        iCurrentStreamId++;
+    }
+
+    /* Mark the end. */
+    memcpy(&pVertexElement[numVertexDecls], &VertexEnd, sizeof(VertexEnd));
+
+    hr = pContext->pDevice->CreateVertexDeclaration(&pVertexElement[0],
+                                                    &pVertexDeclD3D);
+    if (hr != D3D_OK)
+    {
+        AssertMsg(hr == D3D_OK, ("vmsvga3dDrawPrimitives: CreateVertexDeclaration failed with %x\n", hr));
+        rc = VERR_INTERNAL_ERROR;
+        goto internal_error;
+    }
+
+    hr = pContext->pDevice->SetVertexDeclaration(pVertexDeclD3D);
+    if (hr != D3D_OK)
+    {
+        AssertMsg(hr == D3D_OK, ("vmsvga3dDrawPrimitives: SetVertexDeclaration failed with %x\n", hr));
+        rc = VERR_INTERNAL_ERROR;
+        goto internal_error;
+    }
+
+    /* Now draw the primitives. */
+    for (unsigned iPrimitive = 0; iPrimitive < numRanges; iPrimitive++)
+    {
+        D3DPRIMITIVETYPE PrimitiveTypeD3D;
+        unsigned         sidIndex  = pRange[iPrimitive].indexArray.surfaceId;
+        PVMSVGA3DSURFACE pIndexSurface = NULL;
+
+        Log(("Primitive %d: type %s\n", iPrimitive, vmsvga3dPrimitiveType2String(pRange[iPrimitive].primType)));
+        rc = vmsvga3dPrimitiveType2D3D(pRange[iPrimitive].primType, &PrimitiveTypeD3D);
+        if (RT_FAILURE(rc))
+        {
+            AssertRC(rc);
+            goto internal_error;
+        }
+
+        /* Triangle strips or fans with just one primitive don't make much sense and are identical to triangle lists.
+         * Workaround for NVidia driver crash when encountering some of these.
+         */
+        if (    pRange[iPrimitive].primitiveCount == 1
+            &&  (   PrimitiveTypeD3D == D3DPT_TRIANGLESTRIP
+                 || PrimitiveTypeD3D == D3DPT_TRIANGLEFAN))
+            PrimitiveTypeD3D = D3DPT_TRIANGLELIST;
+
+        if (sidIndex != SVGA3D_INVALID_ID)
+        {
+            AssertMsg(pRange[iPrimitive].indexWidth == sizeof(uint32_t) || pRange[iPrimitive].indexWidth == sizeof(uint16_t), ("Unsupported primitive width %d\n", pRange[iPrimitive].indexWidth));
+
+            if (    sidIndex >= SVGA3D_MAX_SURFACE_IDS
+                ||  sidIndex >= pState->cSurfaces 
+                ||  pState->paSurface[sidIndex].id != sidIndex)
+            {
+                Assert(sidIndex < SVGA3D_MAX_SURFACE_IDS);
+                Assert(sidIndex < pState->cSurfaces && pState->paSurface[sidIndex].id == sidIndex);
+                rc = VERR_INVALID_PARAMETER;
+                goto internal_error;
+            }
+            pIndexSurface = &pState->paSurface[sidIndex];
+            Log(("vmsvga3dDrawPrimitives: index surface %x\n", sidIndex));
+
+            if (!pIndexSurface->u.pIndexBuffer)
+            {
+                Log(("vmsvga3dDrawPrimitives: create index buffer fDirty=%d\n", pIndexSurface->fDirty));
+
+                hr = pContext->pDevice->CreateIndexBuffer(pIndexSurface->pMipmapLevels[0].cbSurface,
+                                                          D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY /* possible severe performance penalty otherwise (according to d3d debug output */,
+                                                          (pRange[iPrimitive].indexWidth == sizeof(uint16_t)) ? D3DFMT_INDEX16 : D3DFMT_INDEX32,
+                                                          D3DPOOL_DEFAULT,
+                                                          &pIndexSurface->u.pIndexBuffer,
+                                                          NULL);
+                if (hr != D3D_OK)
+                {
+                    AssertMsg(hr == D3D_OK, ("vmsvga3dDrawPrimitives: CreateIndexBuffer failed with %x\n", hr));
+                    rc = VERR_INTERNAL_ERROR;
+                    goto internal_error;
+                }
+
+                if (pIndexSurface->fDirty)
+                {
+                    void *pData;
+
+                    Log(("vmsvga3dDrawPrimitives: sync index buffer\n"));
+
+                    hr = pIndexSurface->u.pIndexBuffer->Lock(0, 0, &pData, 0);
+                    AssertMsg(hr == D3D_OK, ("vmsvga3dDrawPrimitives: Lock vertex failed with %x\n", hr));
+
+                    memcpy(pData, pIndexSurface->pMipmapLevels[0].pSurfaceData, pIndexSurface->pMipmapLevels[0].cbSurface);
+
+                    hr = pIndexSurface->u.pIndexBuffer->Unlock();
+                    AssertMsg(hr == D3D_OK, ("vmsvga3dDrawPrimitives: Unlock vertex failed with %x\n", hr));
+
+                    pIndexSurface->pMipmapLevels[0].fDirty = false;
+                    pIndexSurface->fDirty = false;
+                }
+                pIndexSurface->flags |= SVGA3D_SURFACE_HINT_INDEXBUFFER;
+            }
+            else
+                Assert(pIndexSurface->fDirty == false);
+
+            hr = pContext->pDevice->SetIndices(pIndexSurface->u.pIndexBuffer);
+            AssertMsg(hr == D3D_OK, ("vmsvga3dDrawPrimitives: SetIndices vertex failed with %x\n", hr));
+        }
+        else
+        {
+            hr = pContext->pDevice->SetIndices(NULL);
+            AssertMsg(hr == D3D_OK, ("vmsvga3dDrawPrimitives: SetIndices vertex (NULL) failed with %x\n", hr));
+        }
+
+        PVMSVGA3DSURFACE pVertexSurface;
+        unsigned         sidVertex = pVertexDecl[0].array.surfaceId;
+        unsigned         strideVertex = pVertexDecl[0].array.stride;
+
+        pVertexSurface = &pState->paSurface[sidVertex];
+
+        if (!pIndexSurface)
+        {
+            /* Render without an index buffer */
+            Log(("DrawPrimitive %x primitivecount=%d index index bias=%d stride=%d\n", PrimitiveTypeD3D, pRange[iPrimitive].primitiveCount,  pRange[iPrimitive].indexBias, strideVertex));
+
+            hr = pContext->pDevice->DrawPrimitive(PrimitiveTypeD3D,
+                                                  pRange[iPrimitive].indexBias,
+                                                  pRange[iPrimitive].primitiveCount);
+            if (hr != D3D_OK)
+            {
+                AssertMsg(hr == D3D_OK, ("vmsvga3dDrawPrimitives: DrawPrimitive failed with %x\n", hr));
+                rc = VERR_INTERNAL_ERROR;
+                goto internal_error;
+            }
+        }
+        else
+        {
+            Assert(pRange[iPrimitive].indexBias >= 0);  /* @todo */
+
+            UINT numVertices;
+
+            if (pVertexDecl[0].rangeHint.last) 
+                numVertices = pVertexDecl[0].rangeHint.last - pVertexDecl[0].rangeHint.first + 1;
+            else
+                numVertices = pVertexSurface->pMipmapLevels[0].cbSurface / strideVertex - pVertexDecl[0].array.offset / strideVertex - pVertexDecl[0].rangeHint.first - pRange[iPrimitive].indexBias;
+
+            /* Render with an index buffer */
+            Log(("DrawIndexedPrimitive %x startindex=%d numVertices=%d, primitivecount=%d index format=%d index bias=%d stride=%d\n", PrimitiveTypeD3D, pVertexDecl[0].rangeHint.first,  numVertices, pRange[iPrimitive].primitiveCount,  (pRange[iPrimitive].indexWidth == sizeof(uint16_t)) ? D3DFMT_INDEX16 : D3DFMT_INDEX32, pRange[iPrimitive].indexBias, strideVertex));
+
+            hr = pContext->pDevice->DrawIndexedPrimitive(PrimitiveTypeD3D,
+                                                         pRange[iPrimitive].indexBias,      /* BaseVertexIndex */
+                                                         0,                                 /* MinVertexIndex */
+                                                         numVertices,
+                                                         pRange[iPrimitive].indexArray.offset / pRange[iPrimitive].indexWidth,    /* StartIndex */
+                                                         pRange[iPrimitive].primitiveCount);
+            if (hr != D3D_OK)
+            {
+                AssertMsg(hr == D3D_OK, ("vmsvga3dDrawPrimitives: DrawIndexedPrimitive failed with %x\n", hr));
+                rc = VERR_INTERNAL_ERROR;
+                goto internal_error;
+            }
+        }
+    }
+    pVertexDeclD3D->Release();
+    RTMemFree(pVertexElement);
+
+    hr = pContext->pDevice->EndScene();
+    AssertMsgReturn(hr == D3D_OK, ("EndScene failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    /* Clear streams above 1 as they might accidentally be reused in the future. */
+    if (iCurrentStreamId > 1)
+    {
+        for (uint32_t i = 1; i < iCurrentStreamId; i++)
+        {
+            Log(("vmsvga3dDrawPrimitives: clear stream %d\n", i));
+            hr = pContext->pDevice->SetStreamSource(i, NULL, 0, 0);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dDrawPrimitives: SetStreamSource failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        }
+    }
+
+#if 0 /* Flush queue */
+    {
+        IDirect3DQuery9        *pQuery;
+        hr = pContext->pDevice->CreateQuery(D3DQUERYTYPE_EVENT, &pQuery);
+        AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceTrackUsage: CreateQuery failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+        hr = pQuery->Issue(D3DISSUE_END);
+        AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSurfaceTrackUsage: Issue failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        while (true)
+        {
+            hr = pQuery->GetData(NULL, 0, D3DGETDATA_FLUSH);
+            if (hr != S_FALSE) break;
+
+            RTThreadSleep(1);
+        }
+        AssertMsgReturn(hr == S_OK, ("vmsvga3dSurfaceFinishDrawing: GetData failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+        pQuery->Release();
+    }
+#endif
+
+    /* Make sure we can track drawing usage of active render targets and textures. */
+    vmsvga3dContextTrackUsage(pThis, pContext);
+
+#ifdef DEBUG_GFX_WINDOW
+    if (pContext->aSidActiveTexture[0] == 0x62)
+////    if (pContext->sidActiveTexture == 0x3d)
+    {
+        SVGA3dCopyRect rect;
+
+        rect.srcx = rect.srcy = rect.x = rect.y = 0;
+        rect.w = 800;
+        rect.h = 600;
+        vmsvga3dCommandPresent(pThis, pContext->sidRenderTarget /*pContext->aSidActiveTexture[0] */, 0, &rect);
+    }
+#endif
+    return rc;
+
+internal_error:
+    if (pVertexDeclD3D)
+        pVertexDeclD3D->Release();
+    if (pVertexElement)
+        RTMemFree(pVertexElement);
+
+    hr = pContext->pDevice->EndScene();
+    AssertMsgReturn(hr == D3D_OK, ("EndScene failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    return rc;
+}
+
+int vmsvga3dSetScissorRect(PVGASTATE pThis, uint32_t cid, SVGA3dRect *pRect)
+{
+    HRESULT               hr;
+    RECT                  rect;
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dSetScissorRect %x (%d,%d)(%d,%d)\n", cid, pRect->x, pRect->y, pRect->w, pRect->h));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dSetScissorRect invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+
+    /* Store for vm state save/restore. */
+    pContext->state.u32UpdateFlags |= VMSVGA3D_UPDATE_SCISSORRECT;
+    pContext->state.RectScissor = *pRect;
+
+    rect.left   = pRect->x;
+    rect.top    = pRect->y;
+    rect.right  = rect.left + pRect->w;  /* exclusive */
+    rect.bottom = rect.top + pRect->h;   /* exclusive */
+
+    hr = pContext->pDevice->SetScissorRect(&rect);
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetScissorRect: SetScissorRect failed with %x\n", hr), VERR_INTERNAL_ERROR);
+
+    return VINF_SUCCESS;
+}
+
+
+int vmsvga3dShaderDefine(PVGASTATE pThis, uint32_t cid, uint32_t shid, SVGA3dShaderType type, uint32_t cbData, uint32_t *pShaderData)
+{
+    HRESULT               hr;
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSHADER       pShader;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dShaderDefine %x shid=%x type=%s cbData=%x\n", cid, shid, (type == SVGA3D_SHADERTYPE_VS) ? "VERTEX" : "PIXEL", cbData));
+    LogFlow(("shader code:\n%.*Rhxd\n", cbData, pShaderData));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dShaderDefine invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+
+    AssertReturn(shid < SVGA3D_MAX_SHADER_IDS, VERR_INVALID_PARAMETER);
+    if (type == SVGA3D_SHADERTYPE_VS)
+    {
+        if (shid >= pContext->cVertexShaders)
+        {
+            pContext->paVertexShader = (PVMSVGA3DSHADER)RTMemRealloc(pContext->paVertexShader, sizeof(VMSVGA3DSHADER) * (shid + 1));
+            AssertReturn(pContext->paVertexShader, VERR_NO_MEMORY);
+            memset(&pContext->paVertexShader[pContext->cVertexShaders], 0, sizeof(VMSVGA3DSHADER) * (shid + 1 - pContext->cVertexShaders));
+            for (uint32_t i = pContext->cVertexShaders; i < shid + 1; i++)
+                pContext->paVertexShader[i].id = SVGA3D_INVALID_ID;
+            pContext->cVertexShaders = shid + 1;
+        }
+        /* If one already exists with this id, then destroy it now. */
+        if (pContext->paVertexShader[shid].id != SVGA3D_INVALID_ID)
+            vmsvga3dShaderDestroy(pThis, cid, shid, pContext->paVertexShader[shid].type);
+
+        pShader = &pContext->paVertexShader[shid];
+    }
+    else
+    {
+        Assert(type == SVGA3D_SHADERTYPE_PS);
+        if (shid >= pContext->cPixelShaders)
+        {
+            pContext->paPixelShader = (PVMSVGA3DSHADER)RTMemRealloc(pContext->paPixelShader, sizeof(VMSVGA3DSHADER) * (shid + 1));
+            AssertReturn(pContext->paPixelShader, VERR_NO_MEMORY);
+            memset(&pContext->paPixelShader[pContext->cPixelShaders], 0, sizeof(VMSVGA3DSHADER) * (shid + 1 - pContext->cPixelShaders));
+            for (uint32_t i = pContext->cPixelShaders; i < shid + 1; i++)
+                pContext->paPixelShader[i].id = SVGA3D_INVALID_ID;
+            pContext->cPixelShaders = shid + 1;
+        }
+        /* If one already exists with this id, then destroy it now. */
+        if (pContext->paPixelShader[shid].id != SVGA3D_INVALID_ID)
+            vmsvga3dShaderDestroy(pThis, cid, shid, pContext->paPixelShader[shid].type);
+
+        pShader = &pContext->paPixelShader[shid];
+    }
+
+    memset(pShader, 0, sizeof(*pShader));
+    pShader->id     = shid;
+    pShader->cid    = cid;
+    pShader->type   = type;
+    pShader->cbData = cbData;
+    pShader->pShaderProgram = RTMemAllocZ(cbData);
+    AssertReturn(pShader->pShaderProgram, VERR_NO_MEMORY);
+    memcpy(pShader->pShaderProgram, pShaderData, cbData);
+
+    switch (type)
+    {
+    case SVGA3D_SHADERTYPE_VS:
+        hr = pContext->pDevice->CreateVertexShader((const DWORD *)pShaderData, &pShader->u.pVertexShader);
+        break;
+
+    case SVGA3D_SHADERTYPE_PS:
+        hr = pContext->pDevice->CreatePixelShader((const DWORD *)pShaderData, &pShader->u.pPixelShader);
+        break;
+
+    default:
+        AssertFailedReturn(VERR_INVALID_PARAMETER);
+    }
+#ifdef DUMP_SHADER_DISASSEMBLY
+    LPD3DXBUFFER pDisassembly;
+
+    hr = D3DXDisassembleShader((const DWORD *)pShaderData, FALSE, NULL, &pDisassembly);
+    if (hr == D3D_OK)
+    {
+        Log(("Shader disassembly:\n%s\n", pDisassembly->GetBufferPointer()));
+        pDisassembly->Release();
+    }
+#endif
+    if (hr != D3D_OK)
+    {
+        RTMemFree(pShader->pShaderProgram);
+        memset(pShader, 0, sizeof(*pShader));
+        pShader->id = SVGA3D_INVALID_ID;
+    }
+
+    AssertMsgReturn(hr == D3D_OK, ("vmsvga3dShaderDefine: CreateVertex/PixelShader failed with %x\n", hr), VERR_INTERNAL_ERROR);
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dShaderDestroy(PVGASTATE pThis, uint32_t cid, uint32_t shid, SVGA3dShaderType type)
+{
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+    PVMSVGA3DSHADER       pShader = NULL;
+
+    Log(("vmsvga3dShaderDestroy %x shid=%x type=%s\n", cid, shid, (type == SVGA3D_SHADERTYPE_VS) ? "VERTEX" : "PIXEL"));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dShaderDestroy invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+
+    if (type == SVGA3D_SHADERTYPE_VS)
+    {
+        if (    shid < pContext->cVertexShaders
+            &&  pContext->paVertexShader[shid].id == shid)
+        {
+            pShader = &pContext->paVertexShader[shid];
+            pShader->u.pVertexShader->Release();
+        }
+    }
+    else
+    {
+        Assert(type == SVGA3D_SHADERTYPE_PS);
+        if (    shid < pContext->cPixelShaders
+            &&  pContext->paPixelShader[shid].id == shid)
+        {
+            pShader = &pContext->paPixelShader[shid];
+            pShader->u.pPixelShader->Release();
+        }
+    }
+
+    if (pShader)
+    {
+        if (pShader->pShaderProgram)
+            RTMemFree(pShader->pShaderProgram);
+
+        memset(pShader, 0, sizeof(*pShader));
+        pShader->id = SVGA3D_INVALID_ID;
+    }
+    else
+        AssertFailedReturn(VERR_INVALID_PARAMETER);
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dShaderSet(PVGASTATE pThis, uint32_t cid, SVGA3dShaderType type, uint32_t shid)
+{
+    PVMSVGA3DCONTEXT    pContext;
+    PVMSVGA3DSTATE      pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+    HRESULT             hr;
+
+    Log(("vmsvga3dShaderSet %x type=%s shid=%d\n", cid, (type == SVGA3D_SHADERTYPE_VS) ? "VERTEX" : "PIXEL", shid));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dShaderSet invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+
+    if (type == SVGA3D_SHADERTYPE_VS)
+    {
+        /* Save for vm state save/restore. */
+        pContext->state.shidVertex = shid;
+        pContext->state.u32UpdateFlags |= VMSVGA3D_UPDATE_VERTEXSHADER;
+
+        if (    shid < pContext->cVertexShaders
+            &&  pContext->paVertexShader[shid].id == shid)
+        {
+            PVMSVGA3DSHADER pShader = &pContext->paVertexShader[shid];
+            Assert(type == pShader->type);
+
+            hr = pContext->pDevice->SetVertexShader(pShader->u.pVertexShader);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dShaderSet: SetVertex/PixelShader failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        }
+        else
+        if (shid == SVGA_ID_INVALID)
+        {
+            /* Unselect shader. */
+            hr = pContext->pDevice->SetVertexShader(NULL);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dShaderSet: SetVertex/PixelShader failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        }
+        else
+            AssertFailedReturn(VERR_INVALID_PARAMETER);
+    }
+    else
+    {
+        /* Save for vm state save/restore. */
+        pContext->state.shidPixel = shid;
+        pContext->state.u32UpdateFlags |= VMSVGA3D_UPDATE_PIXELSHADER;
+
+        Assert(type == SVGA3D_SHADERTYPE_PS);
+        if (    shid < pContext->cPixelShaders
+            &&  pContext->paPixelShader[shid].id == shid)
+        {
+            PVMSVGA3DSHADER pShader = &pContext->paPixelShader[shid];
+            Assert(type == pShader->type);
+
+            hr = pContext->pDevice->SetPixelShader(pShader->u.pPixelShader);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dShaderSet: SetVertex/PixelShader failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        }
+        else
+        if (shid == SVGA_ID_INVALID)
+        {
+            /* Unselect shader. */
+            hr = pContext->pDevice->SetPixelShader(NULL);
+            AssertMsgReturn(hr == D3D_OK, ("vmsvga3dShaderSet: SetVertex/PixelShader failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        }
+        else
+            AssertFailedReturn(VERR_INVALID_PARAMETER);
+    }
+
+    return VINF_SUCCESS;
+}
+
+int vmsvga3dShaderSetConst(PVGASTATE pThis, uint32_t cid, uint32_t reg, SVGA3dShaderType type, SVGA3dShaderConstType ctype, uint32_t cRegisters, uint32_t *pValues)
+{
+    HRESULT               hr;
+    PVMSVGA3DCONTEXT      pContext;
+    PVMSVGA3DSTATE        pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
+    AssertReturn(pState, VERR_NO_MEMORY);
+
+    Log(("vmsvga3dShaderSetConst %x reg=%x type=%s ctype=%x\n", cid, reg, (type == SVGA3D_SHADERTYPE_VS) ? "VERTEX" : "PIXEL", ctype));
+
+    if (    cid >= pState->cContexts
+        ||  pState->paContext[cid].id != cid)
+    {
+        Log(("vmsvga3dShaderSetConst invalid context id!\n"));
+        return VERR_INVALID_PARAMETER;
+    }
+    pContext = &pState->paContext[cid];
+
+    for (uint32_t i = 0; i < cRegisters; i++)
+    {
+        Log(("Constant %d: value=%x-%x-%x-%x\n", reg + i, pValues[i*4 + 0], pValues[i*4 + 1], pValues[i*4 + 2], pValues[i*4 + 3]));
+        vmsvga3dSaveShaderConst(pContext, reg + i, type, ctype, pValues[i*4 + 0], pValues[i*4 + 1], pValues[i*4 + 2], pValues[i*4 + 3]);
+    }
+
+    switch (type)
+    {
+    case SVGA3D_SHADERTYPE_VS:
+        switch (ctype)
+        {
+        case SVGA3D_CONST_TYPE_FLOAT:
+            hr = pContext->pDevice->SetVertexShaderConstantF(reg, (const float *)pValues, cRegisters);
+            break;
+
+        case SVGA3D_CONST_TYPE_INT:
+            hr = pContext->pDevice->SetVertexShaderConstantI(reg, (const int *)pValues, cRegisters);
+            break;
+
+        case SVGA3D_CONST_TYPE_BOOL:
+            hr = pContext->pDevice->SetVertexShaderConstantB(reg, (const BOOL *)pValues, cRegisters);
+            break;
+
+        default:
+            AssertFailedReturn(VERR_INVALID_PARAMETER);
+        }
+        AssertMsgReturn(hr == D3D_OK, ("vmsvga3dShaderSetConst: SetVertexShader failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        break;
+
+    case SVGA3D_SHADERTYPE_PS:
+        switch (ctype)
+        {
+        case SVGA3D_CONST_TYPE_FLOAT:
+        {
+            hr = pContext->pDevice->SetPixelShaderConstantF(reg, (const float *)pValues, cRegisters);
+            break;
+        }
+
+        case SVGA3D_CONST_TYPE_INT:
+            hr = pContext->pDevice->SetPixelShaderConstantI(reg, (const int *)pValues, cRegisters);
+            break;
+
+        case SVGA3D_CONST_TYPE_BOOL:
+            hr = pContext->pDevice->SetPixelShaderConstantB(reg, (const BOOL *)pValues, cRegisters);
+            break;
+
+        default:
+            AssertFailedReturn(VERR_INVALID_PARAMETER);
+        }
+        AssertMsgReturn(hr == D3D_OK, ("vmsvga3dShaderSetConst: SetPixelShader failed with %x\n", hr), VERR_INTERNAL_ERROR);
+        break;
+
+    default:
+        AssertFailedReturn(VERR_INVALID_PARAMETER);
+    }
+    return VINF_SUCCESS;
+}
+
+
+int vmsvga3dQueryBegin(PVGASTATE pThis, uint32_t cid, SVGA3dQueryType type)
+{
+    AssertFailed();
+    return VERR_NOT_IMPLEMENTED;
+}
+
+int vmsvga3dQueryEnd(PVGASTATE pThis, uint32_t cid, SVGA3dQueryType type, SVGAGuestPtr guestResult)
+{
+    AssertFailed();
+    return VERR_NOT_IMPLEMENTED;
+}
+
+int vmsvga3dQueryWait(PVGASTATE pThis, uint32_t cid, SVGA3dQueryType type, SVGAGuestPtr guestResult)
+{
+    AssertFailed();
+    return VERR_NOT_IMPLEMENTED;
+}
+
+static void vmsvgaDumpD3DCaps(D3DCAPS9 *pCaps)
+{
+    LogRel(("\nD3D device caps: DevCaps2:\n"));
+    if (pCaps->DevCaps2 & D3DDEVCAPS2_ADAPTIVETESSRTPATCH)
+        LogRel((" - D3DDEVCAPS2_ADAPTIVETESSRTPATCH\n"));
+    if (pCaps->DevCaps2 & D3DDEVCAPS2_ADAPTIVETESSNPATCH)
+        LogRel((" - D3DDEVCAPS2_ADAPTIVETESSNPATCH\n"));
+    if (pCaps->DevCaps2 & D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES)
+        LogRel((" - D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES\n"));
+    if (pCaps->DevCaps2 & D3DDEVCAPS2_DMAPNPATCH)
+        LogRel((" - D3DDEVCAPS2_DMAPNPATCH\n"));
+    if (pCaps->DevCaps2 & D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH)
+        LogRel((" - D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH\n"));
+    if (pCaps->DevCaps2 & D3DDEVCAPS2_STREAMOFFSET)
+        LogRel((" - D3DDEVCAPS2_STREAMOFFSET\n"));
+    if (pCaps->DevCaps2 & D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET)
+        LogRel((" - D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET\n"));
+
+    LogRel(("\nCaps2:\n"));
+    if (pCaps->Caps2 & D3DCAPS2_CANAUTOGENMIPMAP)
+        LogRel((" - D3DCAPS2_CANAUTOGENMIPMAP\n"));
+    if (pCaps->Caps2 & D3DCAPS2_CANCALIBRATEGAMMA)
+        LogRel((" - D3DCAPS2_CANCALIBRATEGAMMA\n"));
+    if (pCaps->Caps2 & D3DCAPS2_CANSHARERESOURCE)
+        LogRel((" - D3DCAPS2_CANSHARERESOURCE\n"));
+    if (pCaps->Caps2 & D3DCAPS2_CANMANAGERESOURCE)
+        LogRel((" - D3DCAPS2_CANMANAGERESOURCE\n"));
+    if (pCaps->Caps2 & D3DCAPS2_DYNAMICTEXTURES)
+        LogRel((" - D3DCAPS2_DYNAMICTEXTURES\n"));
+    if (pCaps->Caps2 & D3DCAPS2_FULLSCREENGAMMA)
+        LogRel((" - D3DCAPS2_FULLSCREENGAMMA\n"));
+
+    LogRel(("\nCaps3:\n"));
+    if (pCaps->Caps3 & D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD)
+        LogRel((" - D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD\n"));
+    if (pCaps->Caps3 & D3DCAPS3_COPY_TO_VIDMEM)
+        LogRel((" - D3DCAPS3_COPY_TO_VIDMEM\n"));
+    if (pCaps->Caps3 & D3DCAPS3_COPY_TO_SYSTEMMEM)
+        LogRel((" - D3DCAPS3_COPY_TO_SYSTEMMEM\n"));
+    if (pCaps->Caps3 & D3DCAPS3_DXVAHD)
+        LogRel((" - D3DCAPS3_DXVAHD\n"));
+    if (pCaps->Caps3 & D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION)
+        LogRel((" - D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION\n"));
+
+    LogRel(("\nPresentationIntervals:\n"));
+    if (pCaps->PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE)
+        LogRel((" - D3DPRESENT_INTERVAL_IMMEDIATE\n"));
+    if (pCaps->PresentationIntervals & D3DPRESENT_INTERVAL_ONE)
+        LogRel((" - D3DPRESENT_INTERVAL_ONE\n"));
+    if (pCaps->PresentationIntervals & D3DPRESENT_INTERVAL_TWO)
+        LogRel((" - D3DPRESENT_INTERVAL_TWO\n"));
+    if (pCaps->PresentationIntervals & D3DPRESENT_INTERVAL_THREE)
+        LogRel((" - D3DPRESENT_INTERVAL_THREE\n"));
+    if (pCaps->PresentationIntervals & D3DPRESENT_INTERVAL_FOUR)
+        LogRel((" - D3DPRESENT_INTERVAL_FOUR\n"));
+
+    LogRel(("\nDevcaps:\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_CANBLTSYSTONONLOCAL)
+        LogRel((" - D3DDEVCAPS_CANBLTSYSTONONLOCAL\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_CANRENDERAFTERFLIP)
+        LogRel((" - D3DDEVCAPS_CANRENDERAFTERFLIP\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_DRAWPRIMITIVES2)
+        LogRel((" - D3DDEVCAPS_DRAWPRIMITIVES2\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX)
+        LogRel((" - D3DDEVCAPS_DRAWPRIMITIVES2EX\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_DRAWPRIMTLVERTEX)
+        LogRel((" - D3DDEVCAPS_DRAWPRIMTLVERTEX\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_EXECUTESYSTEMMEMORY)
+        LogRel((" - D3DDEVCAPS_EXECUTESYSTEMMEMORY\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_EXECUTEVIDEOMEMORY)
+        LogRel((" - D3DDEVCAPS_EXECUTEVIDEOMEMORY\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_HWRASTERIZATION)
+        LogRel((" - D3DDEVCAPS_HWRASTERIZATION\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT)
+        LogRel((" - D3DDEVCAPS_HWTRANSFORMANDLIGHT\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_NPATCHES)
+        LogRel((" - D3DDEVCAPS_NPATCHES\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_PUREDEVICE)
+        LogRel((" - D3DDEVCAPS_PUREDEVICE\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_QUINTICRTPATCHES)
+        LogRel((" - D3DDEVCAPS_QUINTICRTPATCHES\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_RTPATCHES)
+        LogRel((" - D3DDEVCAPS_RTPATCHES\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_RTPATCHHANDLEZERO)
+        LogRel((" - D3DDEVCAPS_RTPATCHHANDLEZERO\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_SEPARATETEXTUREMEMORIES)
+        LogRel((" - D3DDEVCAPS_SEPARATETEXTUREMEMORIES\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_TEXTURENONLOCALVIDMEM)
+        LogRel((" - D3DDEVCAPS_TEXTURENONLOCALVIDMEM\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_TEXTURESYSTEMMEMORY)
+        LogRel((" - D3DDEVCAPS_TEXTURESYSTEMMEMORY\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_TEXTUREVIDEOMEMORY)
+        LogRel((" - D3DDEVCAPS_TEXTUREVIDEOMEMORY\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_TLVERTEXSYSTEMMEMORY)
+        LogRel((" - D3DDEVCAPS_TLVERTEXSYSTEMMEMORY\n"));
+    if (pCaps->DevCaps & D3DDEVCAPS_TLVERTEXVIDEOMEMORY)
+        LogRel((" - D3DDEVCAPS_TLVERTEXVIDEOMEMORY\n"));
+
+    LogRel(("\nTextureCaps:\n"));
+    if (pCaps->TextureCaps & D3DPTEXTURECAPS_ALPHA)
+        LogRel((" - D3DPTEXTURECAPS_ALPHA\n"));
+    if (pCaps->TextureCaps & D3DPTEXTURECAPS_ALPHAPALETTE)
+        LogRel((" - D3DPTEXTURECAPS_ALPHAPALETTE\n"));
+    if (pCaps->TextureCaps & D3DPTEXTURECAPS_CUBEMAP)
+        LogRel((" - D3DPTEXTURECAPS_CUBEMAP\n"));
+    if (pCaps->TextureCaps & D3DPTEXTURECAPS_CUBEMAP_POW2)
+        LogRel((" - D3DPTEXTURECAPS_CUBEMAP_POW2\n"));
+    if (pCaps->TextureCaps & D3DPTEXTURECAPS_MIPCUBEMAP)
+        LogRel((" - D3DPTEXTURECAPS_MIPCUBEMAP\n"));
+    if (pCaps->TextureCaps & D3DPTEXTURECAPS_MIPMAP)
+        LogRel((" - D3DPTEXTURECAPS_MIPMAP\n"));
+    if (pCaps->TextureCaps & D3DPTEXTURECAPS_MIPVOLUMEMAP)
+        LogRel((" - D3DPTEXTURECAPS_MIPVOLUMEMAP\n"));
+    if (pCaps->TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL)
+        LogRel((" - D3DPTEXTURECAPS_NONPOW2CONDITIONAL\n"));
+    if (pCaps->TextureCaps & D3DPTEXTURECAPS_POW2)
+        LogRel((" - D3DPTEXTURECAPS_POW2\n"));
+    if (pCaps->TextureCaps & D3DPTEXTURECAPS_NOPROJECTEDBUMPENV)
+        LogRel((" - D3DPTEXTURECAPS_NOPROJECTEDBUMPENV\n"));
+    if (pCaps->TextureCaps & D3DPTEXTURECAPS_PERSPECTIVE)
+        LogRel((" - D3DPTEXTURECAPS_PERSPECTIVE\n"));
+    if (pCaps->TextureCaps & D3DPTEXTURECAPS_POW2)
+        LogRel((" - D3DPTEXTURECAPS_POW2\n"));
+    if (pCaps->TextureCaps & D3DPTEXTURECAPS_PROJECTED)
+        LogRel((" - D3DPTEXTURECAPS_PROJECTED\n"));
+    if (pCaps->TextureCaps & D3DPTEXTURECAPS_SQUAREONLY)
+        LogRel((" - D3DPTEXTURECAPS_SQUAREONLY\n"));
+    if (pCaps->TextureCaps & D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE)
+        LogRel((" - D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE\n"));
+    if (pCaps->TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP)
+        LogRel((" - D3DPTEXTURECAPS_VOLUMEMAP\n"));
+    if (pCaps->TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP_POW2)
+        LogRel((" - D3DPTEXTURECAPS_VOLUMEMAP_POW2\n"));
+
+    LogRel(("\nTextureFilterCaps\n"));
+    if (pCaps->TextureFilterCaps & D3DPTFILTERCAPS_CONVOLUTIONMONO)
+        LogRel((" - D3DPTFILTERCAPS_CONVOLUTIONMONO\n"));
+    if (pCaps->TextureFilterCaps & D3DPTFILTERCAPS_MAGFPOINT)
+        LogRel((" - D3DPTFILTERCAPS_MAGFPOINT\n"));
+    if (pCaps->TextureFilterCaps & D3DPTFILTERCAPS_MAGFLINEAR)
+        LogRel((" - D3DPTFILTERCAPS_MAGFLINEAR\n"));
+    if (pCaps->TextureFilterCaps & D3DPTFILTERCAPS_MAGFANISOTROPIC)
+        LogRel((" - D3DPTFILTERCAPS_MAGFANISOTROPIC\n"));
+    if (pCaps->TextureFilterCaps & D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD)
+        LogRel((" - D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD\n"));
+    if (pCaps->TextureFilterCaps & D3DPTFILTERCAPS_MAGFGAUSSIANQUAD)
+        LogRel((" - D3DPTFILTERCAPS_MAGFGAUSSIANQUAD\n"));
+    if (pCaps->TextureFilterCaps & D3DPTFILTERCAPS_MINFPOINT)
+        LogRel((" - D3DPTFILTERCAPS_MINFPOINT\n"));
+    if (pCaps->TextureFilterCaps & D3DPTFILTERCAPS_MINFLINEAR)
+        LogRel((" - D3DPTFILTERCAPS_MINFLINEAR\n"));
+    if (pCaps->TextureFilterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC)
+        LogRel((" - D3DPTFILTERCAPS_MINFANISOTROPIC\n"));
+    if (pCaps->TextureFilterCaps & D3DPTFILTERCAPS_MINFPYRAMIDALQUAD)
+        LogRel((" - D3DPTFILTERCAPS_MINFPYRAMIDALQUAD\n"));
+    if (pCaps->TextureFilterCaps & D3DPTFILTERCAPS_MINFGAUSSIANQUAD)
+        LogRel((" - D3DPTFILTERCAPS_MINFGAUSSIANQUAD\n"));
+    if (pCaps->TextureFilterCaps & D3DPTFILTERCAPS_MIPFPOINT)
+        LogRel((" - D3DPTFILTERCAPS_MIPFPOINT\n"));
+    if (pCaps->TextureFilterCaps & D3DPTFILTERCAPS_MIPFLINEAR)
+        LogRel((" - D3DPTFILTERCAPS_MIPFLINEAR\n"));
+
+    LogRel(("\nCubeTextureFilterCaps\n"));
+    if (pCaps->CubeTextureFilterCaps & D3DPTFILTERCAPS_CONVOLUTIONMONO)
+        LogRel((" - D3DPTFILTERCAPS_CONVOLUTIONMONO\n"));
+    if (pCaps->CubeTextureFilterCaps & D3DPTFILTERCAPS_MAGFPOINT)
+        LogRel((" - D3DPTFILTERCAPS_MAGFPOINT\n"));
+    if (pCaps->CubeTextureFilterCaps & D3DPTFILTERCAPS_MAGFLINEAR)
+        LogRel((" - D3DPTFILTERCAPS_MAGFLINEAR\n"));
+    if (pCaps->CubeTextureFilterCaps & D3DPTFILTERCAPS_MAGFANISOTROPIC)
+        LogRel((" - D3DPTFILTERCAPS_MAGFANISOTROPIC\n"));
+    if (pCaps->CubeTextureFilterCaps & D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD)
+        LogRel((" - D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD\n"));
+    if (pCaps->CubeTextureFilterCaps & D3DPTFILTERCAPS_MAGFGAUSSIANQUAD)
+        LogRel((" - D3DPTFILTERCAPS_MAGFGAUSSIANQUAD\n"));
+    if (pCaps->CubeTextureFilterCaps & D3DPTFILTERCAPS_MINFPOINT)
+        LogRel((" - D3DPTFILTERCAPS_MINFPOINT\n"));
+    if (pCaps->CubeTextureFilterCaps & D3DPTFILTERCAPS_MINFLINEAR)
+        LogRel((" - D3DPTFILTERCAPS_MINFLINEAR\n"));
+    if (pCaps->CubeTextureFilterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC)
+        LogRel((" - D3DPTFILTERCAPS_MINFANISOTROPIC\n"));
+    if (pCaps->CubeTextureFilterCaps & D3DPTFILTERCAPS_MINFPYRAMIDALQUAD)
+        LogRel((" - D3DPTFILTERCAPS_MINFPYRAMIDALQUAD\n"));
+    if (pCaps->CubeTextureFilterCaps & D3DPTFILTERCAPS_MINFGAUSSIANQUAD)
+        LogRel((" - D3DPTFILTERCAPS_MINFGAUSSIANQUAD\n"));
+    if (pCaps->CubeTextureFilterCaps & D3DPTFILTERCAPS_MIPFPOINT)
+        LogRel((" - D3DPTFILTERCAPS_MIPFPOINT\n"));
+    if (pCaps->CubeTextureFilterCaps & D3DPTFILTERCAPS_MIPFLINEAR)
+        LogRel((" - D3DPTFILTERCAPS_MIPFLINEAR\n"));
+
+    LogRel(("\nVolumeTextureFilterCaps\n"));
+    if (pCaps->VolumeTextureFilterCaps & D3DPTFILTERCAPS_CONVOLUTIONMONO)
+        LogRel((" - D3DPTFILTERCAPS_CONVOLUTIONMONO\n"));
+    if (pCaps->VolumeTextureFilterCaps & D3DPTFILTERCAPS_MAGFPOINT)
+        LogRel((" - D3DPTFILTERCAPS_MAGFPOINT\n"));
+    if (pCaps->VolumeTextureFilterCaps & D3DPTFILTERCAPS_MAGFLINEAR)
+        LogRel((" - D3DPTFILTERCAPS_MAGFLINEAR\n"));
+    if (pCaps->VolumeTextureFilterCaps & D3DPTFILTERCAPS_MAGFANISOTROPIC)
+        LogRel((" - D3DPTFILTERCAPS_MAGFANISOTROPIC\n"));
+    if (pCaps->VolumeTextureFilterCaps & D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD)
+        LogRel((" - D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD\n"));
+    if (pCaps->VolumeTextureFilterCaps & D3DPTFILTERCAPS_MAGFGAUSSIANQUAD)
+        LogRel((" - D3DPTFILTERCAPS_MAGFGAUSSIANQUAD\n"));
+    if (pCaps->VolumeTextureFilterCaps & D3DPTFILTERCAPS_MINFPOINT)
+        LogRel((" - D3DPTFILTERCAPS_MINFPOINT\n"));
+    if (pCaps->VolumeTextureFilterCaps & D3DPTFILTERCAPS_MINFLINEAR)
+        LogRel((" - D3DPTFILTERCAPS_MINFLINEAR\n"));
+    if (pCaps->VolumeTextureFilterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC)
+        LogRel((" - D3DPTFILTERCAPS_MINFANISOTROPIC\n"));
+    if (pCaps->VolumeTextureFilterCaps & D3DPTFILTERCAPS_MINFPYRAMIDALQUAD)
+        LogRel((" - D3DPTFILTERCAPS_MINFPYRAMIDALQUAD\n"));
+    if (pCaps->VolumeTextureFilterCaps & D3DPTFILTERCAPS_MINFGAUSSIANQUAD)
+        LogRel((" - D3DPTFILTERCAPS_MINFGAUSSIANQUAD\n"));
+    if (pCaps->VolumeTextureFilterCaps & D3DPTFILTERCAPS_MIPFPOINT)
+        LogRel((" - D3DPTFILTERCAPS_MIPFPOINT\n"));
+    if (pCaps->VolumeTextureFilterCaps & D3DPTFILTERCAPS_MIPFLINEAR)
+        LogRel((" - D3DPTFILTERCAPS_MIPFLINEAR\n"));
+
+    LogRel(("\nTextureAddressCaps:\n"));
+    if (pCaps->TextureAddressCaps & D3DPTADDRESSCAPS_BORDER)
+        LogRel((" - D3DPTADDRESSCAPS_BORDER\n"));
+    if (pCaps->TextureAddressCaps & D3DPTADDRESSCAPS_CLAMP)
+        LogRel((" - D3DPTADDRESSCAPS_CLAMP\n"));
+    if (pCaps->TextureAddressCaps & D3DPTADDRESSCAPS_INDEPENDENTUV)
+        LogRel((" - D3DPTADDRESSCAPS_INDEPENDENTUV\n"));
+    if (pCaps->TextureAddressCaps & D3DPTADDRESSCAPS_MIRROR)
+        LogRel((" - D3DPTADDRESSCAPS_MIRROR\n"));
+    if (pCaps->TextureAddressCaps & D3DPTADDRESSCAPS_MIRRORONCE)
+        LogRel((" - D3DPTADDRESSCAPS_MIRRORONCE\n"));
+    if (pCaps->TextureAddressCaps & D3DPTADDRESSCAPS_WRAP)
+        LogRel((" - D3DPTADDRESSCAPS_WRAP\n"));
+
+    LogRel(("\nTextureOpCaps:\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_DISABLE)
+        LogRel((" - D3DTEXOPCAPS_DISABLE\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_SELECTARG1)
+        LogRel((" - D3DTEXOPCAPS_SELECTARG1\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_SELECTARG2)
+        LogRel((" - D3DTEXOPCAPS_SELECTARG2\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_MODULATE)
+        LogRel((" - D3DTEXOPCAPS_MODULATE\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_MODULATE2X)
+        LogRel((" - D3DTEXOPCAPS_MODULATE2X\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_MODULATE4X)
+        LogRel((" - D3DTEXOPCAPS_MODULATE4X\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_ADD)
+        LogRel((" - D3DTEXOPCAPS_ADD\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_ADDSIGNED)
+        LogRel((" - D3DTEXOPCAPS_ADDSIGNED\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_ADDSIGNED2X)
+        LogRel((" - D3DTEXOPCAPS_ADDSIGNED2X\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_SUBTRACT)
+        LogRel((" - D3DTEXOPCAPS_SUBTRACT\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_ADDSMOOTH)
+        LogRel((" - D3DTEXOPCAPS_ADDSMOOTH\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_BLENDDIFFUSEALPHA)
+        LogRel((" - D3DTEXOPCAPS_BLENDDIFFUSEALPHA\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_BLENDTEXTUREALPHA)
+        LogRel((" - D3DTEXOPCAPS_BLENDTEXTUREALPHA\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_BLENDFACTORALPHA)
+        LogRel((" - D3DTEXOPCAPS_BLENDFACTORALPHA\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_BLENDTEXTUREALPHAPM)
+        LogRel((" - D3DTEXOPCAPS_BLENDTEXTUREALPHAPM\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_BLENDCURRENTALPHA)
+        LogRel((" - D3DTEXOPCAPS_BLENDCURRENTALPHA\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_PREMODULATE)
+        LogRel((" - D3DTEXOPCAPS_PREMODULATE\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR)
+        LogRel((" - D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA)
+        LogRel((" - D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR)
+        LogRel((" - D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA)
+        LogRel((" - D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_BUMPENVMAP)
+        LogRel((" - D3DTEXOPCAPS_BUMPENVMAP\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_BUMPENVMAPLUMINANCE)
+        LogRel((" - D3DTEXOPCAPS_BUMPENVMAPLUMINANCE\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_DOTPRODUCT3)
+        LogRel((" - D3DTEXOPCAPS_DOTPRODUCT3\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_MULTIPLYADD)
+        LogRel((" - D3DTEXOPCAPS_MULTIPLYADD\n"));
+    if (pCaps->TextureOpCaps & D3DTEXOPCAPS_LERP)
+        LogRel((" - D3DTEXOPCAPS_LERP\n"));
+
+}
+
Index: trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.h	(revision 53206)
+++ trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.h	(revision 53206)
@@ -0,0 +1,109 @@
+/** @file
+ * DevVMWare - VMWare SVGA device - 3D part
+ */
+/*
+ * Copyright (C) 2013 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef __DEVVMWARE3D_H__
+#define __DEVVMWARE3D_H__
+
+#include "vmsvga/svga_reg.h"
+#include "vmsvga/svga3d_reg.h"
+#include "vmsvga/svga_escape.h"
+#include "vmsvga/svga_overlay.h"
+
+#if defined(RT_OS_WINDOWS) && defined(IN_RING3)
+#include <windows.h>
+
+#define WM_VMSVGA3D_WAKEUP                      (WM_APP+1)
+#define WM_VMSVGA3D_CREATEWINDOW                (WM_APP+2)
+#define WM_VMSVGA3D_DESTROYWINDOW               (WM_APP+3)
+#define WM_VMSVGA3D_RESIZEWINDOW                (WM_APP+4)
+#define WM_VMSVGA3D_EXIT                        (WM_APP+5)
+
+DECLCALLBACK(int) vmsvga3dWindowThread(RTTHREAD ThreadSelf, void *pvUser);
+int vmsvga3dSendThreadMessage(RTTHREAD pWindowThread, RTSEMEVENT WndRequestSem, UINT msg, WPARAM wParam, LPARAM lParam);
+
+#endif
+
+/* Arbitrary limit */
+#define SVGA3D_MAX_SHADER_IDS                   0x100
+/* D3D allows up to 8 texture stages. */
+#define SVGA3D_MAX_TEXTURE_STAGE                8
+/* Arbitrary upper limit; seen 8 so far. */
+#define SVGA3D_MAX_LIGHTS                       32
+
+void vmsvgaGMRFree(PVGASTATE pThis, uint32_t idGMR);
+int vmsvgaGMRTransfer(PVGASTATE pThis, const SVGA3dTransferType transfer, uint8_t *pDest, int32_t cbDestPitch, SVGAGuestPtr src, uint32_t cbSrcOffset, int32_t cbSrcPitch, uint32_t cbWidth, uint32_t cHeight);
+
+int vmsvga3dInit(PVGASTATE pThis);
+int vmsvga3dPowerOn(PVGASTATE pThis);
+int vmsvga3dLoadExec(PVGASTATE pThis, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
+int vmsvga3dSaveExec(PVGASTATE pThis, PSSMHANDLE pSSM);
+int vmsvga3dTerminate(PVGASTATE pThis);
+int vmsvga3dReset(PVGASTATE pThis);
+int vmsvga3dQueryCaps(PVGASTATE pThis, uint32_t idx3dCaps, uint32_t *pu32Val);
+
+int vmsvga3dSurfaceDefine(PVGASTATE pThis, uint32_t sid, uint32_t surfaceFlags, SVGA3dSurfaceFormat format, SVGA3dSurfaceFace face[SVGA3D_MAX_SURFACE_FACES], uint32_t multisampleCount, SVGA3dTextureFilter autogenFilter, uint32_t cMipLevels, SVGA3dSize *pMipLevelSize);
+int vmsvga3dSurfaceDestroy(PVGASTATE pThis, uint32_t sid);
+int vmsvga3dSurfaceCopy(PVGASTATE pThis, SVGA3dSurfaceImageId dest, SVGA3dSurfaceImageId src, uint32_t cCopyBoxes, SVGA3dCopyBox *pBox);
+int vmsvga3dSurfaceStretchBlt(PVGASTATE pThis, SVGA3dSurfaceImageId dest, SVGA3dBox destBox, SVGA3dSurfaceImageId src, SVGA3dBox srcBox, SVGA3dStretchBltMode mode);
+int vmsvga3dSurfaceDMA(PVGASTATE pThis, SVGA3dGuestImage guest, SVGA3dSurfaceImageId host, SVGA3dTransferType transfer, uint32_t cCopyBoxes, SVGA3dCopyBox *pBoxes);
+int vmsvga3dSurfaceBlitToScreen(PVGASTATE pThis, uint32_t dest, SVGASignedRect destRect, SVGA3dSurfaceImageId src, SVGASignedRect srcRect, uint32_t cRects, SVGASignedRect *pRect);
+
+int vmsvga3dContextDefine(PVGASTATE pThis, uint32_t cid);
+int vmsvga3dContextDestroy(PVGASTATE pThis, uint32_t cid);
+
+int vmsvga3dChangeMode(PVGASTATE pThis);
+
+int vmsvga3dSetTransform(PVGASTATE pThis, uint32_t cid, SVGA3dTransformType type, float matrix[16]);
+int vmsvga3dSetZRange(PVGASTATE pThis, uint32_t cid, SVGA3dZRange zRange);
+int vmsvga3dSetRenderState(PVGASTATE pThis, uint32_t cid, uint32_t cRenderStates, SVGA3dRenderState *pRenderState);
+int vmsvga3dSetRenderTarget(PVGASTATE pThis, uint32_t cid, SVGA3dRenderTargetType type, SVGA3dSurfaceImageId target);
+int vmsvga3dSetTextureState(PVGASTATE pThis, uint32_t cid, uint32_t cTextureStates, SVGA3dTextureState *pTextureState);
+int vmsvga3dSetMaterial(PVGASTATE pThis, uint32_t cid, SVGA3dFace face, SVGA3dMaterial *pMaterial);
+int vmsvga3dSetLightData(PVGASTATE pThis, uint32_t cid, uint32_t index, SVGA3dLightData *pData);
+int vmsvga3dSetLightEnabled(PVGASTATE pThis, uint32_t cid, uint32_t index, uint32_t enabled);
+int vmsvga3dSetViewPort(PVGASTATE pThis, uint32_t cid, SVGA3dRect *pRect);
+int vmsvga3dSetClipPlane(PVGASTATE pThis, uint32_t cid,  uint32_t index, float plane[4]);
+int vmsvga3dCommandClear(PVGASTATE pThis, uint32_t cid, SVGA3dClearFlag clearFlag, uint32_t color, float depth, uint32_t stencil, uint32_t cRects, SVGA3dRect *pRect);
+int vmsvga3dCommandPresent(PVGASTATE pThis, uint32_t sid, uint32_t cRects, SVGA3dCopyRect *pRect);
+int vmsvga3dDrawPrimitives(PVGASTATE pThis, uint32_t cid, uint32_t numVertexDecls, SVGA3dVertexDecl *pVertexDecl, uint32_t numRanges, SVGA3dPrimitiveRange *pNumRange, uint32_t cVertexDivisor, SVGA3dVertexDivisor *pVertexDivisor);
+int vmsvga3dSetScissorRect(PVGASTATE pThis, uint32_t cid, SVGA3dRect *pRect);
+int vmsvga3dGenerateMipmaps(PVGASTATE pThis, uint32_t sid, SVGA3dTextureFilter filter);
+
+int vmsvga3dShaderDefine(PVGASTATE pThis, uint32_t cid, uint32_t shid, SVGA3dShaderType type, uint32_t cbData, uint32_t *pShaderData);
+int vmsvga3dShaderDestroy(PVGASTATE pThis, uint32_t cid, uint32_t shid, SVGA3dShaderType type);
+int vmsvga3dShaderSet(PVGASTATE pThis, uint32_t cid, SVGA3dShaderType type, uint32_t shid);
+int vmsvga3dShaderSetConst(PVGASTATE pThis, uint32_t cid, uint32_t reg, SVGA3dShaderType type, SVGA3dShaderConstType ctype, uint32_t cRegisters, uint32_t *pValues);
+
+int vmsvga3dQueryBegin(PVGASTATE pThis, uint32_t cid, SVGA3dQueryType type);
+int vmsvga3dQueryEnd(PVGASTATE pThis, uint32_t cid, SVGA3dQueryType type, SVGAGuestPtr guestResult);
+int vmsvga3dQueryWait(PVGASTATE pThis, uint32_t cid, SVGA3dQueryType type, SVGAGuestPtr guestResult);
+
+
+uint32_t vmsvga3dSurfaceFormatSize(SVGA3dSurfaceFormat format);
+
+#ifdef LOG_ENABLED
+const char *vmsvga3dGetCapString(uint32_t idxCap);
+const char *vmsvga3dGet3dFormatString(uint32_t format);
+const char *vmsvga3dGetRenderStateName(uint32_t state);
+const char *vmsvga3dTextureStateToString(SVGA3dTextureStateName textureState);
+const char *vmsvgaTransformToString(SVGA3dTransformType type);
+const char *vmsvgaDeclUsage2String(SVGA3dDeclUsage usage);
+const char *vmsvgaDeclType2String(SVGA3dDeclType type);
+const char *vmsvgaDeclMethod2String(SVGA3dDeclMethod method);
+const char *vmsvgaSurfaceType2String(SVGA3dSurfaceFormat format);
+const char *vmsvga3dPrimitiveType2String(SVGA3dPrimitiveType PrimitiveType);
+#endif
+
+#endif  /* __DEVVMWARE3D_H__ */
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/accctrl.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/accctrl.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/accctrl.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/access.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/access.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/access.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/aclapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/aclapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/aclapi.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/aclui.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/aclui.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/aclui.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/activaut.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/activaut.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/activaut.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef DO_NO_IMPORTS
 import "ocidl.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/activdbg.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/activdbg.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/activdbg.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 import "ocidl.idl";
 import "activscp.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/activscp.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/activscp.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/activscp.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/adshlp.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/adshlp.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/adshlp.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/advpub.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/advpub.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/advpub.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_ADVPUB_H
 #define __WINE_ADVPUB_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/af_irda.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/af_irda.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/af_irda.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef AF_IRDA_H
 #define AF_IRDA_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/amaudio.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/amaudio.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/amaudio.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/amstream.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/amstream.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/amstream.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 import "unknwn.idl";
 import "mmstream.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/amvideo.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/amvideo.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/amvideo.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 import "objidl.idl";
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/appcompatapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/appcompatapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/appcompatapi.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __APPCOMPAT_H
 #define __APPCOMPAT_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/appmgmt.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/appmgmt.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/appmgmt.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/asptlb.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/asptlb.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/asptlb.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/asynot.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/asynot.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/asynot.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/asysta.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/asysta.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/asysta.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/atlbase.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/atlbase.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/atlbase.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/atliface.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/atliface.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/atliface.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/atlwin.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/atlwin.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/atlwin.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/audevcod.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/audevcod.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/audevcod.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/audioclient.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/audioclient.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/audioclient.idl	(revision 53206)
@@ -18,4 +18,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  *
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/audiopolicy.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/audiopolicy.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/audiopolicy.idl	(revision 53206)
@@ -18,4 +18,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  *
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/audiosessiontypes.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/audiosessiontypes.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/audiosessiontypes.h	(revision 53206)
@@ -19,4 +19,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  *
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/austream.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/austream.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/austream.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/aviriff.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/aviriff.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/aviriff.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/avrt.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/avrt.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/avrt.h	(revision 53206)
@@ -18,4 +18,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  *
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/axcore.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/axcore.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/axcore.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #define CHARS_IN_GUID 39
 cpp_quote("#define CHARS_IN_GUID 39")
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/axextend.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/axextend.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/axextend.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/basetsd.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/basetsd.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/basetsd.h	(revision 53206)
@@ -18,4 +18,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/basetyps.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/basetyps.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/basetyps.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/bcrypt.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/bcrypt.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/bcrypt.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/binres.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/binres.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/binres.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/bits.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/bits.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/bits.idl	(revision 53206)
@@ -20,4 +20,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef DO_NO_IMPORTS
 import "unknwn.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/bits1_5.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/bits1_5.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/bits1_5.idl	(revision 53206)
@@ -18,4 +18,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  *
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/bitsmsg.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/bitsmsg.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/bitsmsg.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cderr.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cderr.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cderr.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cfgmgr32.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cfgmgr32.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cfgmgr32.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cguid.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cguid.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cguid.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/chprst.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/chprst.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/chprst.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cierror.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cierror.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cierror.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/clusapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/clusapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/clusapi.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cmdbas.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cmdbas.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cmdbas.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cmdtxt.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cmdtxt.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cmdtxt.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/comcat.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/comcat.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/comcat.idl	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/commctrl.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/commctrl.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/commctrl.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/commdlg.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/commdlg.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/commdlg.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/commoncontrols.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/commoncontrols.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/commoncontrols.idl	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/compobj.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/compobj.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/compobj.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_COMPOBJ_H
 #define __WINE_COMPOBJ_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/control.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/control.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/control.idl	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cor.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cor.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cor.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cordebug.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cordebug.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cordebug.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/corerror.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/corerror.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/corerror.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/corhdr.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/corhdr.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/corhdr.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cpl.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cpl.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cpl.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/crtrow.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/crtrow.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/crtrow.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cryptdlg.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cryptdlg.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cryptdlg.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __CRYPTDLG_H__
 #define __CRYPTDLG_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cryptuiapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cryptuiapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cryptuiapi.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __CRYPTUIAPI_H__
 #define __CRYPTUIAPI_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ctfutb.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ctfutb.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ctfutb.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ctxtcall.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ctxtcall.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ctxtcall.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/custcntl.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/custcntl.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/custcntl.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cvconst.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cvconst.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/cvconst.h	(revision 53206)
@@ -18,4 +18,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10_1.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10_1.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10_1.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10_1shader.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10_1shader.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10_1shader.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10effect.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10effect.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10effect.h	(revision 53206)
@@ -16,4 +16,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  *
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10misc.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10misc.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10misc.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10shader.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10shader.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d10shader.h	(revision 53206)
@@ -16,4 +16,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  *
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d11.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d11.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d11.idl	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d11sdklayers.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d11sdklayers.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d11sdklayers.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d11shader.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d11shader.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d11shader.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d8.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d8.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d8.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d8caps.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d8caps.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d8caps.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d8types.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d8types.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d8types.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d9.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d9.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d9.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d9caps.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d9caps.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d9caps.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d9types.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d9types.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d9types.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dcaps.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dcaps.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dcaps.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dcommon.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dcommon.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dcommon.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dcompiler.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dcompiler.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dcompiler.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dhal.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dhal.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dhal.h	(revision 53206)
@@ -18,4 +18,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3drm.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3drm.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3drm.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3drmdef.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3drmdef.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3drmdef.h	(revision 53206)
@@ -19,4 +19,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __D3DRMDEFS_H__
 #define __D3DRMDEFS_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3drmobj.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3drmobj.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3drmobj.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3drmwin.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3drmwin.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3drmwin.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dtypes.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dtypes.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dtypes.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9anim.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9anim.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9anim.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9core.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9core.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9core.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9effect.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9effect.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9effect.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9math.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9math.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9math.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9mesh.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9mesh.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9mesh.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9shader.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9shader.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9shader.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9shape.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9shape.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9shape.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9tex.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9tex.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9tex.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #include <d3dx9.h>
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9xof.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9xof.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3dx9xof.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbccmd.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbccmd.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbccmd.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbcses.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbcses.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbcses.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbdsad.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbdsad.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbdsad.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbghelp.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbghelp.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbghelp.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbinit.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbinit.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbinit.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 [
     object,
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbprop.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbprop.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbprop.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbs.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbs.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbs.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbt.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbt.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dbt.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dciddi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dciddi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dciddi.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dciman.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dciman.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dciman.h	(revision 53206)
@@ -19,4 +19,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef _INC_DCIMAN
 #define _INC_DCIMAN
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dcommon.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dcommon.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dcommon.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_DCOMMON_H
 #define __WINE_DCOMMON_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dde.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dde.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dde.h	(revision 53206)
@@ -18,4 +18,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddeml.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddeml.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddeml.h	(revision 53206)
@@ -18,4 +18,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/compstui.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/compstui.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/compstui.h	(revision 53206)
@@ -18,4 +18,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  *
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/hidsdi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/hidsdi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/hidsdi.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/imm.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/imm.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/imm.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/mountmgr.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/mountmgr.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/mountmgr.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/ntddcdvd.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/ntddcdvd.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/ntddcdvd.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/ntddk.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/ntddk.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/ntddk.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/ntddser.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/ntddser.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/ntddser.h	(revision 53206)
@@ -18,4 +18,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/ntddtape.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/ntddtape.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/ntddtape.h	(revision 53206)
@@ -18,4 +18,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usb.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usb.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usb.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usb100.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usb100.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usb100.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usb200.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usb200.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usb200.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __DDK_USB200_H__
 #define __DDK_USB200_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usbdlib.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usbdlib.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usbdlib.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usbioctl.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usbioctl.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usbioctl.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __DDK_USBIOCTL_H__
 #define __DDK_USBIOCTL_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usbiodef.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usbiodef.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/usbiodef.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __DDK_USBIODEF_H__
 #define __DDK_USBIODEF_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/wdm.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/wdm.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/wdm.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/winddiui.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/winddiui.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/winddiui.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/winsplp.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/winsplp.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddk/winsplp.h	(revision 53206)
@@ -21,4 +21,13 @@
  * "providor" is not a spelling error in this file. It's the real name.
  *
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddraw.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddraw.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddraw.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddrawgdi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddrawgdi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddrawgdi.h	(revision 53206)
@@ -19,4 +19,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_DDRAWGDI_H
 #define __WINE_DDRAWGDI_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddrawi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddrawi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddrawi.h	(revision 53206)
@@ -18,4 +18,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddstream.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddstream.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ddstream.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/delayloadhandler.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/delayloadhandler.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/delayloadhandler.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/devenum.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/devenum.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/devenum.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/devguid.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/devguid.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/devguid.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/devicetopology.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/devicetopology.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/devicetopology.idl	(revision 53206)
@@ -20,4 +20,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 interface IPart;
 interface IControlInterface;
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/devpkey.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/devpkey.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/devpkey.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/devpropdef.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/devpropdef.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/devpropdef.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/difxapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/difxapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/difxapi.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/digitalv.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/digitalv.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/digitalv.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dimm.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dimm.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dimm.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef DO_NO_IMPORTS
 import "unknwn.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dinput.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dinput.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dinput.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dinputd.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dinputd.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dinputd.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dispdib.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dispdib.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dispdib.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dispex.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dispex.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dispex.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef DO_NO_IMPORTS
 import "ocidl.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dlgs.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dlgs.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dlgs.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dls1.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dls1.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dls1.h	(revision 53206)
@@ -17,4 +17,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
  
 #ifndef __WINE_INCLUDE_DLS1_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dls2.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dls2.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dls2.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmdls.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmdls.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmdls.h	(revision 53206)
@@ -17,4 +17,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
  
 #ifndef __WINE_DMUSIC_DLS_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmerror.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmerror.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmerror.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmksctrl.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmksctrl.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmksctrl.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmo.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmo.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmo.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __DMO_H__
 #define __DMO_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmoreg.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmoreg.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmoreg.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmort.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmort.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmort.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __DMORT_H__
 #define __DMORT_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmplugin.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmplugin.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmplugin.h	(revision 53206)
@@ -17,4 +17,13 @@
  *  License along with this program; if not, write to the Free Software
  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmusbuff.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmusbuff.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmusbuff.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmusicc.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmusicc.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmusicc.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmusicf.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmusicf.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmusicf.h	(revision 53206)
@@ -17,4 +17,13 @@
  *  License along with this program; if not, write to the Free Software
  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmusici.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmusici.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmusici.h	(revision 53206)
@@ -17,4 +17,13 @@
  *  License along with this program; if not, write to the Free Software
  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmusics.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmusics.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dmusics.h	(revision 53206)
@@ -17,4 +17,13 @@
  *  License along with this program; if not, write to the Free Software
  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/docobj.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/docobj.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/docobj.idl	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/docobjectservice.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/docobjectservice.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/docobjectservice.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/downloadmgr.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/downloadmgr.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/downloadmgr.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dpaddr.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dpaddr.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dpaddr.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dplay.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dplay.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dplay.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dplay8.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dplay8.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dplay8.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dplobby.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dplobby.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dplobby.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dplobby8.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dplobby8.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dplobby8.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dpnathlp.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dpnathlp.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dpnathlp.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dsconf.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dsconf.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dsconf.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dsgetdc.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dsgetdc.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dsgetdc.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dshow.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dshow.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dshow.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dsound.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dsound.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dsound.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dsrole.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dsrole.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dsrole.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dvdmedia.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dvdmedia.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dvdmedia.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dwmapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dwmapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dwmapi.h	(revision 53206)
@@ -13,4 +13,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dwrite.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dwrite.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dwrite.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dwrite_1.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dwrite_1.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dwrite_1.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxdiag.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxdiag.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxdiag.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxerr8.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxerr8.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxerr8.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxerr9.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxerr9.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxerr9.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxfile.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxfile.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxfile.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxgi.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxgi.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxgi.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 import "oaidl.idl";
 import "ocidl.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxgiformat.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxgiformat.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxgiformat.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxgitype.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxgitype.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dxgitype.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dyngraph.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dyngraph.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/dyngraph.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/endpointvolume.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/endpointvolume.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/endpointvolume.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/errorrep.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/errorrep.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/errorrep.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/errors.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/errors.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/errors.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/errrec.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/errrec.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/errrec.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/evcode.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/evcode.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/evcode.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/evntprov.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/evntprov.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/evntprov.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/evntrace.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/evntrace.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/evntrace.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/excpt.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/excpt.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/excpt.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/exdisp.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/exdisp.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/exdisp.idl	(revision 53206)
@@ -21,4 +21,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 import "ocidl.idl";
 import "docobj.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/exdispid.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/exdispid.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/exdispid.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/fci.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/fci.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/fci.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_FCI_H
 #define __WINE_FCI_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/fdi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/fdi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/fdi.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_FDI_H
 #define __WINE_FDI_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/fileapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/fileapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/fileapi.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/fusion.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/fusion.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/fusion.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gameux.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gameux.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gameux.idl	(revision 53206)
@@ -18,4 +18,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplus.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplus.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplus.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdipluscolor.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdipluscolor.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdipluscolor.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdipluscolormatrix.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdipluscolormatrix.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdipluscolormatrix.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusenums.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusenums.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusenums.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusflat.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusflat.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusflat.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusgpstubs.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusgpstubs.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusgpstubs.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusimaging.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusimaging.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusimaging.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusinit.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusinit.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusinit.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusmem.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusmem.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusmem.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusmetaheader.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusmetaheader.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplusmetaheader.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdipluspixelformats.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdipluspixelformats.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdipluspixelformats.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplustypes.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplustypes.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/gdiplustypes.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/guiddef.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/guiddef.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/guiddef.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/hlguids.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/hlguids.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/hlguids.h	(revision 53206)
@@ -19,4 +19,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_HLGUIDS_H__
 #define __WINE_HLGUIDS_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/hlink.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/hlink.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/hlink.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/htiface.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/htiface.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/htiface.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/htiframe.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/htiframe.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/htiframe.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/htmlhelp.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/htmlhelp.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/htmlhelp.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/http.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/http.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/http.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/httprequest.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/httprequest.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/httprequest.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/httprequestid.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/httprequestid.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/httprequestid.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/i_cryptasn1tls.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/i_cryptasn1tls.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/i_cryptasn1tls.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/iads.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/iads.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/iads.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/icftypes.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/icftypes.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/icftypes.idl	(revision 53206)
@@ -18,4 +18,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  *
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/icm.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/icm.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/icm.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/icmpapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/icmpapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/icmpapi.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/idispids.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/idispids.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/idispids.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_IDISPIDS_H__
 #define __WINE_IDISPIDS_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/iextag.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/iextag.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/iextag.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ifdef.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ifdef.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ifdef.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef WINE_IFDEF_H
 #define WINE_IFDEF_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ifmib.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ifmib.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ifmib.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_IFMIB_H
 #define __WINE_IFMIB_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/imagehlp.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/imagehlp.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/imagehlp.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/imm.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/imm.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/imm.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/imnact.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/imnact.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/imnact.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/imnxport.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/imnxport.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/imnxport.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/in6addr.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/in6addr.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/in6addr.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/inaddr.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/inaddr.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/inaddr.h	(revision 53206)
@@ -16,4 +16,13 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  *
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/indexsrv.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/indexsrv.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/indexsrv.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/initguid.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/initguid.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/initguid.h	(revision 53206)
@@ -23,4 +23,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #define INITGUID
 #include <guiddef.h>
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/intshcut.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/intshcut.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/intshcut.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ipexport.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ipexport.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ipexport.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/iphlpapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/iphlpapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/iphlpapi.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef WINE_IPHLPAPI_H__
 #define WINE_IPHLPAPI_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ipifcons.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ipifcons.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ipifcons.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef WINE_IPIFCONS_H__
 #define WINE_IPIFCONS_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ipmib.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ipmib.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ipmib.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_IPMIB_H
 #define __WINE_IPMIB_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/iprtrmib.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/iprtrmib.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/iprtrmib.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef WINE_IPRTRMIB_H__
 #define WINE_IPRTRMIB_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/iptypes.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/iptypes.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/iptypes.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/isguids.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/isguids.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/isguids.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef _ISGUIDS_H_
 #define _ISGUIDS_H_
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/knownfolders.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/knownfolders.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/knownfolders.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ks.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ks.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ks.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ksguid.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ksguid.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ksguid.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #define INITGUID
 #include <guiddef.h>
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ksmedia.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ksmedia.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ksmedia.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lm.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lm.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lm.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmaccess.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmaccess.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmaccess.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmapibuf.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmapibuf.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmapibuf.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmat.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmat.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmat.h	(revision 53206)
@@ -19,4 +19,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_LMAT_H
 #define __WINE_LMAT_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmbrowsr.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmbrowsr.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmbrowsr.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmcons.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmcons.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmcons.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmerr.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmerr.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmerr.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmjoin.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmjoin.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmjoin.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmmsg.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmmsg.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmmsg.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef _LMMSG_
 #define _LMMSG_
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmserver.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmserver.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmserver.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef _LMSERVER_
 #define _LMSERVER_
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmshare.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmshare.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmshare.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef _LMSHARE_H
 #define _LMSHARE_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmstats.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmstats.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmstats.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmuse.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmuse.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmuse.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef _LMUSE_H
 #define _LMUSE_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmuseflg.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmuseflg.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmuseflg.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_LMUSEFLG_H
 #define __WINE_LMUSEFLG_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmwksta.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmwksta.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lmwksta.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/loadperf.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/loadperf.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/loadperf.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lzexpand.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lzexpand.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/lzexpand.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapi.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapicode.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapicode.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapicode.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapidefs.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapidefs.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapidefs.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapiform.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapiform.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapiform.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapiguid.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapiguid.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapiguid.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapitags.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapitags.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapitags.h	(revision 53206)
@@ -18,4 +18,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef MAPITAGS_H
 #define MAPITAGS_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapiutil.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapiutil.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapiutil.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapival.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapival.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapival.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapix.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapix.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mapix.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mciavi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mciavi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mciavi.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mcx.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mcx.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mcx.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mediaerr.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mediaerr.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mediaerr.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef _MEDIAERR_H_
 #define _MEDIAERR_H_
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mediaobj.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mediaobj.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mediaobj.idl	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/metahost.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/metahost.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/metahost.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 import "unknwn.idl";
 import "oaidl.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/midles.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/midles.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/midles.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mimeinfo.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mimeinfo.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mimeinfo.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mimeole.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mimeole.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mimeole.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/minmax.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/minmax.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/minmax.h	(revision 53206)
@@ -19,4 +19,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_MINMAX_H
 #define __WINE_MINMAX_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mlang.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mlang.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mlang.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmc.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmc.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmc.idl	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmddk.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmddk.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmddk.h	(revision 53206)
@@ -19,4 +19,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmdeviceapi.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmdeviceapi.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmdeviceapi.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 import "unknwn.idl";
 import "propsys.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmreg.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmreg.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmreg.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmstream.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmstream.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmstream.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmsystem.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmsystem.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mmsystem.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mprapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mprapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mprapi.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msacm.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msacm.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msacm.h	(revision 53206)
@@ -19,4 +19,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_MSACM_H
 #define __WINE_MSACM_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msacmdlg.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msacmdlg.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msacmdlg.h	(revision 53206)
@@ -19,4 +19,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #define DLG_ACMFORMATCHOOSE_ID              70
 #define IDD_ACMFORMATCHOOSE_BTN_HELP        9
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msacmdrv.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msacmdrv.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msacmdrv.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mscat.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mscat.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mscat.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mscoree.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mscoree.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mscoree.idl	(revision 53206)
@@ -18,4 +18,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 import "unknwn.idl";
 cpp_quote("/* FIXME: #include <gcghost.h> */")
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msctf.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msctf.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msctf.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msdadc.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msdadc.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msdadc.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msdaguid.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msdaguid.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msdaguid.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_MSDAGUID_H
 #define __WINE_MSDAGUID_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msdasc.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msdasc.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msdasc.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mshtmcid.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mshtmcid.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mshtmcid.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mshtmdid.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mshtmdid.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mshtmdid.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mshtmhst.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mshtmhst.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mshtmhst.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mshtml.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mshtml.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mshtml.idl	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msi.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msidefs.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msidefs.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msidefs.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msident.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msident.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msident.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msinkaut.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msinkaut.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msinkaut.idl	(revision 53206)
@@ -14,4 +14,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msiquery.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msiquery.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msiquery.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mssip.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mssip.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mssip.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mstask.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mstask.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mstask.idl	(revision 53206)
@@ -20,4 +20,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 import "oaidl.idl";
 import "oleidl.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mstcpip.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mstcpip.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mstcpip.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_MSTCPIP_H
 #define __WINE_MSTCPIP_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/assert.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/assert.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/assert.h	(revision 53206)
@@ -19,4 +19,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #include <crtdefs.h>
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/crtdbg.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/crtdbg.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/crtdbg.h	(revision 53206)
@@ -18,4 +18,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_CRTDBG_H_
 #define __WINE_CRTDBG_H_
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/crtdefs.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/crtdefs.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/crtdefs.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/eh.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/eh.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/eh.h	(revision 53206)
@@ -18,4 +18,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_EH_H
 #define __WINE_EH_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/errno.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/errno.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/errno.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/locale.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/locale.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/locale.h	(revision 53206)
@@ -18,4 +18,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_LOCALE_H
 #define __WINE_LOCALE_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/malloc.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/malloc.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/malloc.h	(revision 53206)
@@ -18,4 +18,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_MALLOC_H
 #define __WINE_MALLOC_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/mbctype.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/mbctype.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/mbctype.h	(revision 53206)
@@ -18,4 +18,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_MBCTYPE_H
 #define __WINE_MBCTYPE_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/mbstring.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/mbstring.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/mbstring.h	(revision 53206)
@@ -18,4 +18,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_MBSTRING_H
 #define __WINE_MBSTRING_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/search.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/search.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/search.h	(revision 53206)
@@ -18,4 +18,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_SEARCH_H
 #define __WINE_SEARCH_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/setjmp.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/setjmp.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/setjmp.h	(revision 53206)
@@ -18,4 +18,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_SETJMP_H
 #define __WINE_SETJMP_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/signal.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/signal.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/signal.h	(revision 53206)
@@ -18,4 +18,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef _WINE_SIGNAL_H
 #define _WINE_SIGNAL_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/stddef.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/stddef.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/stddef.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_STDDEF_H
 #define __WINE_STDDEF_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/sys/locking.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/sys/locking.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/sys/locking.h	(revision 53206)
@@ -18,4 +18,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_SYS_LOCKING_H__
 #define __WINE_SYS_LOCKING_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/sys/timeb.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/sys/timeb.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/sys/timeb.h	(revision 53206)
@@ -18,4 +18,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_SYS_TIMEB_H
 #define __WINE_SYS_TIMEB_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/sys/types.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/sys/types.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/sys/types.h	(revision 53206)
@@ -18,4 +18,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_SYS_TYPES_H
 #define __WINE_SYS_TYPES_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/sys/utime.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/sys/utime.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/sys/utime.h	(revision 53206)
@@ -18,4 +18,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_SYS_UTIME_H
 #define __WINE_SYS_UTIME_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/time.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/time.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/time.h	(revision 53206)
@@ -18,4 +18,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_TIME_H
 #define __WINE_TIME_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/wctype.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/wctype.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msvcrt/wctype.h	(revision 53206)
@@ -18,4 +18,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_WCTYPE_H
 #define __WINE_WCTYPE_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mswsock.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mswsock.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/mswsock.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef _MSWSOCK_
 #define _MSWSOCK_
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxml.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxml.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxml.idl	(revision 53206)
@@ -18,4 +18,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #include <msxmldid.h>
 #include <msxml2did.h>
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxml2.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxml2.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxml2.idl	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxml2did.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxml2did.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxml2did.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxml6.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxml6.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxml6.idl	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxml6did.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxml6did.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxml6did.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __MSXML6DID_H__
 #define __MSXML6DID_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxmldid.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxmldid.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/msxmldid.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/nb30.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/nb30.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/nb30.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ndrtypes.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ndrtypes.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ndrtypes.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/netcon.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/netcon.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/netcon.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/netfw.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/netfw.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/netfw.idl	(revision 53206)
@@ -20,4 +20,13 @@
  * The firewall management interface
  *
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/nldef.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/nldef.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/nldef.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_NLDEF_H
 #define __WINE_NLDEF_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/npapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/npapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/npapi.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_NPAPI_H__
 #define __WINE_NPAPI_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/nspapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/nspapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/nspapi.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntddcdrm.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntddcdrm.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntddcdrm.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntddndis.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntddndis.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntddndis.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntddscsi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntddscsi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntddscsi.h	(revision 53206)
@@ -18,4 +18,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntddstor.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntddstor.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntddstor.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntdsapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntdsapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntdsapi.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntquery.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntquery.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntquery.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntsecapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntsecapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntsecapi.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntsecpkg.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntsecpkg.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntsecpkg.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntstatus.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntstatus.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ntstatus.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oaidl.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oaidl.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oaidl.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/objbase.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/objbase.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/objbase.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/objectarray.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/objectarray.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/objectarray.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/objidl.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/objidl.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/objidl.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef DO_NO_IMPORTS
 import "unknwn.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/objsafe.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/objsafe.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/objsafe.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ocidl.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ocidl.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ocidl.idl	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ocmm.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ocmm.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ocmm.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/odbcinst.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/odbcinst.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/odbcinst.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ole2.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ole2.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ole2.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ole2ver.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ole2ver.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ole2ver.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oleacc.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oleacc.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oleacc.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oleauto.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oleauto.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oleauto.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/olectl.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/olectl.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/olectl.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oledb.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oledb.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oledb.idl	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 cpp_quote("#ifdef _WIN64")
 cpp_quote("#include <pshpack8.h>")
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oledberr.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oledberr.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oledberr.h	(revision 53206)
@@ -18,4 +18,12 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
 
 #ifndef __WINE_OLEDBERR_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oledlg.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oledlg.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oledlg.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oleidl.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oleidl.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/oleidl.idl	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/opnrst.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/opnrst.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/opnrst.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/optary.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/optary.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/optary.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/patchapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/patchapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/patchapi.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pdh.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pdh.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pdh.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pdhmsg.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pdhmsg.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pdhmsg.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/perhist.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/perhist.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/perhist.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pktdef.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pktdef.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pktdef.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/poppack.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/poppack.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/poppack.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #if defined(__WINE_PSHPACK_H15)
 #  ifndef __WINE_INTERNAL_POPPACK
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/powrprof.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/powrprof.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/powrprof.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/profinfo.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/profinfo.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/profinfo.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/propidl.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/propidl.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/propidl.idl	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/propkey.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/propkey.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/propkey.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/propkeydef.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/propkeydef.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/propkeydef.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/propsys.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/propsys.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/propsys.idl	(revision 53206)
@@ -20,4 +20,12 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
 
 import "objidl.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/propvarutil.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/propvarutil.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/propvarutil.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/prsht.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/prsht.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/prsht.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/psapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/psapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/psapi.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pshpack1.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pshpack1.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pshpack1.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pshpack2.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pshpack2.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pshpack2.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pshpack4.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pshpack4.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pshpack4.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pshpack8.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pshpack8.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pshpack8.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pstore.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pstore.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/pstore.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 import "wtypes.idl";
 import "oaidl.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/qedit.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/qedit.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/qedit.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ras.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ras.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ras.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rasdlg.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rasdlg.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rasdlg.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #include <ras.h>
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/raserror.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/raserror.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/raserror.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_RASERROR_H
 #define __WINE_RASERROR_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/reason.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/reason.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/reason.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/regstr.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/regstr.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/regstr.h	(revision 53206)
@@ -19,4 +19,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef _INC_REGSTR
 #define _INC_REGSTR
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/restartmanager.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/restartmanager.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/restartmanager.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/richedit.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/richedit.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/richedit.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/richole.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/richole.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/richole.idl	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rmxfguid.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rmxfguid.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rmxfguid.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/row.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/row.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/row.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rowchg.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rowchg.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rowchg.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 [
     local,
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rowpos.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rowpos.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rowpos.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rowpsc.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rowpsc.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rowpsc.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpc.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpc.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpc.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcasync.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcasync.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcasync.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_RPCASYNC_H
 #define __WINE_RPCASYNC_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcdce.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcdce.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcdce.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_RPCDCE_H
 #define __WINE_RPCDCE_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcdcep.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcdcep.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcdcep.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcndr.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcndr.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcndr.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcnterr.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcnterr.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcnterr.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcproxy.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcproxy.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcproxy.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcsal.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcsal.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rpcsal.h	(revision 53206)
@@ -17,4 +17,12 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
 
 #ifndef __RPCSAL_H_VERSION__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rstbas.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rstbas.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rstbas.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rstinf.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rstinf.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rstinf.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rstloc.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rstloc.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rstloc.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rstnot.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rstnot.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rstnot.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rtutils.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rtutils.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/rtutils.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/scarderr.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/scarderr.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/scarderr.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/schannel.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/schannel.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/schannel.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_SCHANNEL_H__
 #define __WINE_SCHANNEL_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/schemadef.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/schemadef.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/schemadef.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/schnlsp.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/schnlsp.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/schnlsp.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_SHNLSP_H__
 #define __WINE_SHNLSP_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sddl.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sddl.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sddl.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __SDDL_H__
 #define __SDDL_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/secext.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/secext.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/secext.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/security.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/security.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/security.h	(revision 53206)
@@ -15,4 +15,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef _SECURITY_H
 #define _SECURITY_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sensapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sensapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sensapi.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sensevts.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sensevts.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sensevts.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/servprov.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/servprov.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/servprov.idl	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sesprp.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sesprp.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sesprp.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/setupapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/setupapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/setupapi.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sfc.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sfc.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sfc.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shdeprecated.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shdeprecated.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shdeprecated.idl	(revision 53206)
@@ -19,4 +19,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 import "objidl.idl";
 import "ocidl.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shdispid.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shdispid.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shdispid.h	(revision 53206)
@@ -19,4 +19,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef _SHDISPID_H_
 #define _SHDISPID_H_
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shellapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shellapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shellapi.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shldisp.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shldisp.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shldisp.idl	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shlguid.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shlguid.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shlguid.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shlobj.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shlobj.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shlobj.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shlwapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shlwapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shlwapi.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shobjidl.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shobjidl.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shobjidl.idl	(revision 53206)
@@ -18,4 +18,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shtypes.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shtypes.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/shtypes.idl	(revision 53206)
@@ -18,4 +18,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sipbase.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sipbase.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sipbase.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_SIPBASE_H
 #define __WINE_SIPBASE_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/slerror.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/slerror.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/slerror.h	(revision 53206)
@@ -17,4 +17,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_SLERROR_H
 #define __WINE_SLERROR_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/slpublic.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/slpublic.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/slpublic.h	(revision 53206)
@@ -17,4 +17,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_SLPUBLIC_H
 #define __WINE_SLPUBLIC_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/snmp.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/snmp.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/snmp.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef _WINE_SNMP_H
 #define _WINE_SNMP_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/softpub.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/softpub.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/softpub.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_SOFTPUB_H
 #define __WINE_SOFTPUB_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sql.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sql.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sql.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sqlext.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sqlext.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sqlext.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sqltypes.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sqltypes.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sqltypes.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __SQLTYPES_H
 #define __SQLTYPES_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/srcrst.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/srcrst.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/srcrst.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/srrestoreptapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/srrestoreptapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/srrestoreptapi.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sspi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sspi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sspi.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_SSPI_H__
 #define __WINE_SSPI_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/stdole2.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/stdole2.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/stdole2.idl	(revision 53206)
@@ -19,4 +19,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 [
   uuid(00020430-0000-0000-C000-000000000046),
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sti.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sti.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/sti.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/storage.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/storage.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/storage.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_STORAGE_H
 #define __WINE_STORAGE_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/strmif.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/strmif.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/strmif.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 import "unknwn.idl";
 import "objidl.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/strsafe.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/strsafe.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/strsafe.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_STRSAFE_H
 #define __WINE_STRSAFE_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/structuredquerycondition.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/structuredquerycondition.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/structuredquerycondition.idl	(revision 53206)
@@ -20,4 +20,12 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
 
 import "oaidl.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/svrapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/svrapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/svrapi.h	(revision 53206)
@@ -16,4 +16,13 @@
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
 
 #ifndef SVRAPI_INCLUDED
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/t2embapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/t2embapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/t2embapi.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tapi.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tchar.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tchar.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tchar.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tcpmib.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tcpmib.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tcpmib.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_TCPMIB_H
 #define __WINE_TCPMIB_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/textserv.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/textserv.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/textserv.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/textstor.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/textstor.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/textstor.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef DO_NO_IMPORTS
 import "oaidl.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tlhelp32.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tlhelp32.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tlhelp32.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tlogstg.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tlogstg.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tlogstg.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tmschema.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tmschema.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tmschema.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tom.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tom.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/tom.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/traffic.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/traffic.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/traffic.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/transact.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/transact.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/transact.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/txcoord.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/txcoord.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/txcoord.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/txdtc.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/txdtc.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/txdtc.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/udpmib.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/udpmib.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/udpmib.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_UDPMIB_H
 #define __WINE_UDPMIB_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uiautomation.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uiautomation.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uiautomation.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #include <uiautomationcore.h>
 #include <uiautomationclient.h>
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uiautomationclient.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uiautomationclient.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uiautomationclient.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uiautomationcore.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uiautomationcore.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uiautomationcore.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uiautomationcoreapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uiautomationcoreapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uiautomationcoreapi.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/unknwn.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/unknwn.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/unknwn.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/urlhist.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/urlhist.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/urlhist.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/urlmon.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/urlmon.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/urlmon.idl	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/userenv.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/userenv.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/userenv.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/usp10.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/usp10.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/usp10.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uuids.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uuids.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uuids.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uxtheme.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uxtheme.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/uxtheme.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vdmdbg.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vdmdbg.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vdmdbg.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ver.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ver.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ver.h	(revision 53206)
@@ -20,4 +20,14 @@
  * VER.H obsolete, include winver.h instead
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_VER_H
 #define __WINE_VER_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/verrsrc.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/verrsrc.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/verrsrc.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vfw.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vfw.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vfw.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vfwmsgs.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vfwmsgs.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vfwmsgs.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vmr9.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vmr9.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vmr9.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 import "unknwn.idl";
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vmrender.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vmrender.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vmrender.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 cpp_quote("#if 0")
 typedef DWORD IDirectDrawSurface7;
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vsstyle.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vsstyle.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vsstyle.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vssym32.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vssym32.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/vssym32.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wbemcli.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wbemcli.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wbemcli.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wbemdisp.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wbemdisp.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wbemdisp.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wbemprov.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wbemprov.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wbemprov.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 [
     uuid(092df710-7010-11d1-ad90-00c04fd8fdff)
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/werapi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/werapi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/werapi.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wfext.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wfext.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wfext.h	(revision 53206)
@@ -16,4 +16,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_WFEXT_H
 #define __WINE_WFEXT_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wia.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wia.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wia.h	(revision 53206)
@@ -17,4 +17,12 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
 
 #ifdef __WINESRC__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wia_lh.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wia_lh.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wia_lh.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wia_xp.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wia_xp.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wia_xp.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winbase.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winbase.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winbase.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wincodec.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wincodec.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wincodec.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 import "wtypes.idl";
 import "propidl.idl";
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wincodecsdk.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wincodecsdk.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wincodecsdk.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wincon.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wincon.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wincon.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wincred.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wincred.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wincred.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wincrypt.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wincrypt.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wincrypt.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/windef.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/windef.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/windef.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/windns.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/windns.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/windns.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/windows.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/windows.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/windows.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/windowsx.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/windowsx.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/windowsx.h	(revision 53206)
@@ -14,4 +14,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/dcetypes.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/dcetypes.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/dcetypes.idl	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/debug.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/debug.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/debug.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/dplaysp.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/dplaysp.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/dplaysp.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/epm.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/epm.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/epm.idl	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/exception.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/exception.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/exception.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/gdi_driver.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/gdi_driver.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/gdi_driver.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/irot.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/irot.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/irot.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/itss.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/itss.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/itss.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/library.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/library.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/library.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/list.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/list.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/list.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/mmsystem16.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/mmsystem16.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/mmsystem16.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/mscvpdb.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/mscvpdb.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/mscvpdb.h	(revision 53206)
@@ -19,4 +19,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/port.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/port.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/port.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/rbtree.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/rbtree.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/rbtree.h	(revision 53206)
@@ -20,4 +20,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_WINE_RBTREE_H
 #define __WINE_WINE_RBTREE_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/server.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/server.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/server.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/strmbase.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/strmbase.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/strmbase.h	(revision 53206)
@@ -18,4 +18,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/svcctl.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/svcctl.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/svcctl.idl	(revision 53206)
@@ -20,4 +20,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 import "wtypes.idl";
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/test.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/test.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/test.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/unicode.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/unicode.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/unicode.h	(revision 53206)
@@ -19,4 +19,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_WINE_UNICODE_H
 #define __WINE_WINE_UNICODE_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/winaspi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/winaspi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/winaspi.h	(revision 53206)
@@ -18,4 +18,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/winbase16.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/winbase16.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/winbase16.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/windef16.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/windef16.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/windef16.h	(revision 53206)
@@ -19,4 +19,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/wine_common_ver.rc
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/wine_common_ver.rc	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/wine_common_ver.rc	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/winedxgi.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/winedxgi.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/winedxgi.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/wingdi16.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/wingdi16.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/wingdi16.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/winnet16.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/winnet16.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/winnet16.h	(revision 53206)
@@ -18,4 +18,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/winuser16.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/winuser16.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/winuser16.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/wpp.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/wpp.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wine/wpp.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winerror.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winerror.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winerror.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winevt.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winevt.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winevt.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wingdi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wingdi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wingdi.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winhttp.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winhttp.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winhttp.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wininet.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wininet.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wininet.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winineti.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winineti.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winineti.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winioctl.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winioctl.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winioctl.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winldap.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winldap.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winldap.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winnetwk.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winnetwk.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winnetwk.h	(revision 53206)
@@ -17,4 +17,12 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
 
 #ifndef _WINNETWK_H_
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winnls.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winnls.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winnls.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winnls32.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winnls32.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winnls32.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef _WINNLS32_
 #define _WINNLS32_
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winnt.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winnt.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winnt.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winperf.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winperf.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winperf.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winreg.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winreg.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winreg.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winresrc.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winresrc.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winresrc.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsafer.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsafer.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsafer.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winscard.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winscard.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winscard.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsmcrd.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsmcrd.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsmcrd.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsnmp.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsnmp.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsnmp.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsock.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsock.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsock.h	(revision 53206)
@@ -19,4 +19,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsock2.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsock2.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsock2.h	(revision 53206)
@@ -20,4 +20,13 @@
  *
  * FIXME: Still missing required Winsock 2 definitions.
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winspool.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winspool.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winspool.h	(revision 53206)
@@ -20,4 +20,14 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __WINE_WINSPOOL_H
 #define __WINE_WINSPOOL_H
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsvc.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsvc.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsvc.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsxs.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsxs.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winsxs.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wintab.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wintab.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wintab.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wintabx.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wintabx.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wintabx.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winternl.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winternl.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winternl.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wintrust.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wintrust.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wintrust.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winuser.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winuser.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winuser.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winver.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winver.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/winver.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wmistr.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wmistr.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wmistr.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wmiutils.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wmiutils.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wmiutils.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wmsbuffer.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wmsbuffer.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wmsbuffer.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wmsdkidl.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wmsdkidl.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wmsdkidl.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wnaspi32.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wnaspi32.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wnaspi32.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wownt32.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wownt32.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wownt32.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wpcapi.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wpcapi.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wpcapi.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ws2def.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ws2def.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ws2def.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ws2ipdef.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ws2ipdef.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ws2ipdef.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ws2spi.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ws2spi.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ws2spi.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ws2tcpip.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ws2tcpip.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ws2tcpip.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wshisotp.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wshisotp.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wshisotp.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef _WINE_WSHISOTP_
 #define _WINE_WSHISOTP_
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wsipx.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wsipx.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wsipx.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wsnwlink.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wsnwlink.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wsnwlink.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wtsapi32.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wtsapi32.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wtsapi32.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wtypes.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wtypes.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wtypes.idl	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wuapi.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wuapi.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/wuapi.idl	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 import "oaidl.idl";
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xcmc.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xcmc.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xcmc.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xinput.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xinput.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xinput.h	(revision 53206)
@@ -16,4 +16,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmldom.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmldom.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmldom.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 /* xmldom.idl is included by msxml.idl so it doesn't need a stand-alone header */
 #include <msxml.h>
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmldom.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmldom.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmldom.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmldomdid.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmldomdid.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmldomdid.h	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmldso.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmldso.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmldso.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmldsodid.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmldsodid.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmldsodid.h	(revision 53206)
@@ -17,4 +17,13 @@
  */
 
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
+ */
+
 #ifndef __XMLDSODID_H__
 #define __XMLDSODID_H__
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmllite.idl
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmllite.idl	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/xmllite.idl	(revision 53206)
@@ -15,4 +15,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
Index: trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/zmouse.h
===================================================================
--- trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/zmouse.h	(revision 53205)
+++ trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/zmouse.h	(revision 53206)
@@ -17,4 +17,13 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/*
+ * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
+ * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
+ * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
+ * a choice of LGPL license versions is made available with the language indicating
+ * that LGPLv2 or any later version may be used, or where a choice of which version
+ * of the LGPL is applied is otherwise unspecified.
  */
 
