Index: trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/Makefile.kmk
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/Makefile.kmk	(revision 63024)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/Makefile.kmk	(revision 63025)
@@ -44,5 +44,12 @@
 #  -wd4245: '=' : conversion from 'int' to 'DWORD', signed/unsigned mismatch
 #  -wd4305: 'function' : truncation from 'double' to 'GLclampf'
-TEMPLATE_VBoxGuestWineDLL_CFLAGS = $(filter-out -WX,$(TEMPLATE_VBOXGUESTR3NPDLL_CFLAGS)) -wd4100  -wd4204 -wd4245 -wd4305
+#  -wd4305: 'function' : truncation from 'double' to 'GLclampf'
+#  -wd4018: '>' : signed/unsigned mismatch
+#  -wd4389: '!=' : signed/unsigned mismatch
+#  -wd4221: nonstandard extension used : 'render_targets' : cannot be initialized using address of automatic variable 'dst_surface'
+#  -wd4334: '<<' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
+#  -wd4267: 'function' : conversion from 'size_t' to 'GLsizei', possible loss of data
+TEMPLATE_VBoxGuestWineDLL_CFLAGS = $(filter-out -WX,$(TEMPLATE_VBOXGUESTR3NPDLL_CFLAGS)) \
+	-wd4100  -wd4204 -wd4245 -wd4305 -wd4018 -wd4389 -wd4221 -wd4334 -wd4267
 
 #
Index: trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/d3d8/device.c
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/d3d8/device.c	(revision 63024)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/d3d8/device.c	(revision 63025)
@@ -36,4 +36,7 @@
 #define NONAMELESSUNION
 #define NONAMELESSSTRUCT
+#ifdef VBOX
+# include "d3d8_private.h" /* Must include windows stuff with COBJMACROS defined. */
+#endif
 #include "windef.h"
 #include "winbase.h"
@@ -2465,5 +2468,5 @@
     }
 
-    hr = wined3d_shader_get_byte_code(shader_impl->wined3d_shader, data, data_size);
+    hr = wined3d_shader_get_byte_code(shader_impl->wined3d_shader, data, (UINT *)data_size);
     wined3d_mutex_unlock();
 
@@ -2709,5 +2712,5 @@
     }
 
-    hr = wined3d_shader_get_byte_code(shader_impl->wined3d_shader, data, data_size);
+    hr = wined3d_shader_get_byte_code(shader_impl->wined3d_shader, data, (UINT *)data_size);
     wined3d_mutex_unlock();
 
@@ -3071,5 +3074,5 @@
     HRESULT hr;
 
-    device->IDirect3DDevice8_iface.lpVtbl = &d3d8_device_vtbl;
+    device->IDirect3DDevice8_iface.lpVtbl = (struct IDirect3DDevice8Vtbl *)&d3d8_device_vtbl;
     device->device_parent.ops = &d3d8_wined3d_device_parent_ops;
     device->ref = 1;
Index: trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/d3d8/directx.c
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/d3d8/directx.c	(revision 63024)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/d3d8/directx.c	(revision 63025)
@@ -36,8 +36,12 @@
 #define NONAMELESSUNION
 #define NONAMELESSSTRUCT
+#ifndef VBOX
 #include "windef.h"
 #include "winbase.h"
 #include "wingdi.h"
 #include "winuser.h"
+#else
+# include <iprt/win/windows.h>
+#endif
 #include "wine/debug.h"
 #include "wine/unicode.h"
@@ -416,5 +420,5 @@
     DWORD flags = WINED3D_LEGACY_DEPTH_BIAS | WINED3D_VIDMEM_ACCOUNTING;
 
-    d3d8->IDirect3D8_iface.lpVtbl = &d3d8_vtbl;
+    d3d8->IDirect3D8_iface.lpVtbl = (struct IDirect3D8Vtbl *)&d3d8_vtbl;
     d3d8->refcount = 1;
 
Index: trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/vbox/VBoxDbgGl.c
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/vbox/VBoxDbgGl.c	(revision 63024)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/vbox/VBoxDbgGl.c	(revision 63025)
@@ -304,5 +304,5 @@
         GLint curTex = 0;
         int iLevel;
-        struct gl_texture *pGlTex;
+        struct gl_texture const *pGlTex;
         const struct wined3d_texture *pTexture = (const struct wined3d_texture*)pDevice->stateBlock->state.textures[iStage];
 
@@ -348,4 +348,5 @@
             Assert(surface->texture_target == pTexture->target);
             Assert(surface->texture_name == (pTexture->flags & WINED3D_TEXTURE_IS_SRGB) ? pTexture->texture_srgb.name : pTexture->texture_rgb.name);
+            NOREF(surface);
 #if 0
             if (pSurf->flags & SFLAG_INSYSMEM && !pSurf->Flags & SFLAG_PBO)
Index: trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/vbox/libWineStub/include/wine/debug.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/vbox/libWineStub/include/wine/debug.h	(revision 63024)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/vbox/libWineStub/include/wine/debug.h	(revision 63025)
@@ -32,5 +32,9 @@
 
 #include <stdarg.h>
+#ifndef VBOX_WINE_WITHOUT_LIBWINE
 #include <windef.h>
+#else
+# include <iprt/win/windows.h>
+#endif
 #ifndef GUID_DEFINED
 #include <guiddef.h>
Index: trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/arb_program_shader.c
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/arb_program_shader.c	(revision 63024)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/arb_program_shader.c	(revision 63025)
@@ -4232,5 +4232,5 @@
     /* Base Declarations */
     shader_generate_arb_declarations(shader, reg_maps, buffer, gl_info,
-            &priv_ctx.vs_clipplanes, &priv_ctx);
+            (DWORD *)&priv_ctx.vs_clipplanes, &priv_ctx);
 
     for(i = 0; i < MAX_CONST_I; i++)
Index: trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/buffer.c
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/buffer.c	(revision 63024)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/buffer.c	(revision 63025)
@@ -371,7 +371,9 @@
     BOOL support_d3dcolor = adapter->gl_info.supported[ARB_VERTEX_ARRAY_BGRA];
     BOOL support_xyzrhw = adapter->d3d_info.xyzrhw;
+#ifdef VBOX_WITH_WINE_FIX_BUFOFFSET
+    DWORD stride_this_run = 0;
+    DWORD offset_this_run = 0;
+#else
     UINT stride_this_run = 0;
-#ifdef VBOX_WITH_WINE_FIX_BUFOFFSET
-    UINT offset_this_run = 0;
 #endif
     BOOL ret = FALSE;
@@ -866,7 +868,10 @@
     struct wined3d_context *context;
     BOOL decl_changed = FALSE;
+#ifndef VBOX_WITH_WINE_FIX_BUFOFFSET
     unsigned int i, j;
+#endif
     BYTE *data;
 #ifdef VBOX_WITH_WINE_FIX_BUFOFFSET
+    unsigned int j;
     BYTE *cur_ptr;
     UINT conv_start, conv_end;
Index: trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/context.c
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/context.c	(revision 63024)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/context.c	(revision 63025)
@@ -792,5 +792,5 @@
     if (backup || !wglMakeCurrent(ctx->hdc, ctx->glCtx))
 #else
-    if (!wglMakeCurrent(ctx->swapchain->hDC, ctx->glCtx))
+    if (!wglMakeCurrent(swapchain->hDC, ctx->glCtx))
 #endif
     {
@@ -804,5 +804,5 @@
 #else
         WARN("Failed to make GL context %p current on device context %p, last error %#x.\n",
-                ctx->glCtx, ctx->swapchain->hDC, GetLastError());
+                ctx->glCtx, swapchain->hDC, GetLastError());
 #endif
         ctx->valid = 0;
@@ -1628,5 +1628,8 @@
     struct wined3d_context *ret;
     BOOL auxBuffers = FALSE;
-    HGLRC ctx, share_ctx;
+    HGLRC ctx;
+#ifndef VBOX
+    HGLRC share_ctx;
+#endif
     int pixel_format;
     unsigned int s;
Index: trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/directx.c
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/directx.c	(revision 63024)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/directx.c	(revision 63025)
@@ -1775,5 +1775,7 @@
         const char *gl_renderer)
 {
+#ifndef VBOX_WITH_WDDM
     UINT d3d_level = d3d_level_from_gl_info(gl_info);
+#endif
     unsigned int i;
 
@@ -1877,4 +1879,5 @@
     }
 
+#ifndef VBOX_WITH_WDDM
     /* Both the GeforceFX, 6xxx and 7xxx series support D3D9. The last two types have more
      * shader capabilities, so we use the shader capabilities to distinguish between FX and 6xxx/7xxx.
@@ -1973,4 +1976,5 @@
 
     return CARD_NVIDIA_RIVA_TNT; /* Riva TNT, Vanta */
+#endif /* !VBOX_WITH_WDDM */
 }
 
@@ -1978,5 +1982,7 @@
         const char *gl_renderer)
 {
+#ifndef VBOX_WITH_WDDM
     UINT d3d_level = d3d_level_from_gl_info(gl_info);
+#endif
 
     /* See http://developer.amd.com/drivers/pc_vendor_id/Pages/default.aspx
@@ -2073,4 +2079,5 @@
     }
 
+#ifndef VBOX_WITH_WDDM
     if (d3d_level >= 9)
     {
@@ -2110,4 +2117,5 @@
 
     return PCI_DEVICE_NONE;
+#endif /*!VBOX_WITH_WDDM*/
 }
 
@@ -2651,5 +2659,5 @@
 static void load_gl_funcs(struct wined3d_gl_info *gl_info)
 {
-#define USE_GL_FUNC(pfn) (*(PROC *)(&gl_info->gl_ops.ext.p_##pfn)) = wglGetProcAddress(#pfn);
+#define USE_GL_FUNC(pfn) (*(PROC *)&gl_info->gl_ops.ext.p_##pfn) = wglGetProcAddress(#pfn);
     GL_EXT_FUNCS_GEN;
 #undef USE_GL_FUNC
@@ -5343,5 +5351,5 @@
         ALL_WGL_FUNCS
 # undef USE_GL_FUNC
-        gl_info->gl_ops.wgl.p_wglSwapBuffers = (void *)GetProcAddress(mod_gl, "wglSwapBuffers");
+        *(FARPROC *)&gl_info->gl_ops.wgl.p_wglSwapBuffers = GetProcAddress(mod_gl, "wglSwapBuffers");
     }
 #else
Index: trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/resource.c
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/resource.c	(revision 63024)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/resource.c	(revision 63025)
@@ -99,5 +99,7 @@
         )
 {
+#ifndef VBOX_WITH_WDDM
     const struct wined3d *d3d = device->wined3d;
+#endif
 
     resource->ref = 1;
@@ -184,5 +186,7 @@
 void resource_cleanup(struct wined3d_resource *resource)
 {
+#ifndef VBOX_WITH_WDDM
     const struct wined3d *d3d = resource->device->wined3d;
+#endif
     struct private_data *data;
     struct list *e1, *e2;
Index: trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/surface.c
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/surface.c	(revision 63024)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/surface.c	(revision 63025)
@@ -655,5 +655,5 @@
 {
     struct wined3d_device *device = surface->resource.device;
-    const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
+//    const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
     DWORD alloc_flag = SFLAG_ALLOCATED;
 //    DWORD alloc_flag = srgb ? SFLAG_SRGBALLOCATED : SFLAG_ALLOCATED;
@@ -749,5 +749,5 @@
             if (VBOXSHRC_IS_SHARED_OPENED(surface))
             {
-                struct wined3d_gl_info *gl_info = &surface->resource.device->adapter->gl_info;
+                //struct wined3d_gl_info *gl_info = &surface->resource.device->adapter->gl_info;
                 ERR("should not be here!");
                 surface->texture_name = (GLuint)VBOXSHRC_GET_SHAREHANDLE(surface);
Index: trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/vboxext.c
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/vboxext.c	(revision 63024)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/vboxext.c	(revision 63025)
@@ -283,5 +283,5 @@
 
 
-static HRESULT vboxExtInit()
+static HRESULT vboxExtInit(void)
 {
     HRESULT hr = S_OK;
@@ -307,7 +307,7 @@
 
 
-static HRESULT vboxExtWndCleanup();
-
-static HRESULT vboxExtTerm()
+static HRESULT vboxExtWndCleanup(void);
+
+static HRESULT vboxExtTerm(void)
 {
     HRESULT hr = vboxExtWndCleanup();
@@ -502,5 +502,5 @@
 #define VBOXEXTWND_NAME "VboxDispD3DWineWnd"
 
-static HRESULT vboxExtWndDoCleanup()
+static HRESULT vboxExtWndDoCleanup(void)
 {
     HRESULT hr = S_OK;
@@ -685,5 +685,5 @@
 }
 
-static HRESULT vboxExtWndCleanup()
+static HRESULT vboxExtWndCleanup(void)
 {
     HRESULT hr;
Index: trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/wined3d_gl.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/wined3d_gl.h	(revision 63024)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/wined3d_gl.h	(revision 63025)
@@ -208,5 +208,6 @@
 
 
-#define VBOX_USE_GL_FUNC(pfn) p##pfn = (void *)wglGetProcAddress(#pfn);
+/* Right, we just have to do things our own way some undisclosed reason. sigh. */
+#define VBOX_USE_GL_FUNC(pfn) (*(PROC *)&(p##pfn)) = wglGetProcAddress(#pfn);
 
 # define VBOX_GL_FUNCS_GEN \
Index: trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/wined3d_main.c
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/wined3d_main.c	(revision 63024)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Wine_new/wined3d/wined3d_main.c	(revision 63025)
@@ -340,9 +340,9 @@
             wined3d_settings.always_offscreen = FALSE;
         }
-        if (!get_config_key_dword(hkey, appkey, "MaxShaderModelVS", &wined3d_settings.max_sm_vs))
+        if (!get_config_key_dword(hkey, appkey, "MaxShaderModelVS", (DWORD *)&wined3d_settings.max_sm_vs))
             TRACE("Limiting VS shader model to %u.\n", wined3d_settings.max_sm_vs);
-        if (!get_config_key_dword(hkey, appkey, "MaxShaderModelGS", &wined3d_settings.max_sm_gs))
+        if (!get_config_key_dword(hkey, appkey, "MaxShaderModelGS", (DWORD *)&wined3d_settings.max_sm_gs))
             TRACE("Limiting GS shader model to %u.\n", wined3d_settings.max_sm_gs);
-        if (!get_config_key_dword(hkey, appkey, "MaxShaderModelPS", &wined3d_settings.max_sm_ps))
+        if (!get_config_key_dword(hkey, appkey, "MaxShaderModelPS", (DWORD *)&wined3d_settings.max_sm_ps))
             TRACE("Limiting PS shader model to %u.\n", wined3d_settings.max_sm_ps);
         if (!get_config_key(hkey, appkey, "DirectDrawRenderer", buffer, size)
