From 53ae89575a57bf2ecdaeaeb0d2be170f6ec4e5f4 Mon Sep 17 00:00:00 2001 From: Nick Sarnie Date: Sun, 16 Dec 2018 14:27:05 -0500 Subject: [PATCH] Revert "Rebase against ixit/wine" This reverts commit 6ceb131574616bc5f5c2b8bcc4d96bddea370fd2. Imploded --- wine-d3d9.patch | 1557 +++++------------------------------------------ 1 file changed, 136 insertions(+), 1421 deletions(-) diff --git a/wine-d3d9.patch b/wine-d3d9.patch index 254efed..afa3777 100644 --- a/wine-d3d9.patch +++ b/wine-d3d9.patch @@ -1,36 +1,28 @@ -From e3086a42e8a7341b50d901abc691c623d163438d Mon Sep 17 00:00:00 2001 +From a961f76498acb65c6e6b82229b76d54db4361f3f Mon Sep 17 00:00:00 2001 From: Nick Sarnie -Date: Sun, 16 Dec 2018 14:05:10 -0500 +Date: Sun, 25 Nov 2018 11:43:50 -0500 Subject: [PATCH] Wine D3D9 Signed-off-by: Nick Sarnie --- - configure.ac | 196 +++ - dlls/d3d9-nine/Makefile.in | 15 + - dlls/d3d9-nine/d3d9-nine.spec | 14 + - dlls/d3d9-nine/d3d9_main.c | 173 ++ - dlls/d3d9-nine/d3dadapter9.c | 898 ++++++++++ - dlls/d3d9-nine/d3dadapter9.h | 32 + - dlls/d3d9-nine/device_wrap.c | 500 ++++++ - dlls/d3d9-nine/device_wrap.h | 26 + - dlls/d3d9-nine/dri3.c | 1430 ++++++++++++++++ - dlls/d3d9-nine/dri3.h | 91 ++ - dlls/d3d9-nine/present.c | 1817 +++++++++++++++++++++ - dlls/d3d9-nine/present.h | 40 + - dlls/d3d9-nine/shader_validator.c | 88 + - dlls/d3d9-nine/shader_validator.h | 29 + - dlls/d3d9-nine/version.rc | 26 + - dlls/d3d9-nine/wndproc.c | 277 ++++ - dlls/d3d9-nine/wndproc.h | 41 + - dlls/winex11.drv/init.c | 1 + - dlls/winex11.drv/x11drv.h | 1 + - include/config.h.in | 54 + - programs/ninewinecfg/Makefile.in | 10 + - programs/ninewinecfg/main.c | 853 ++++++++++ - programs/ninewinecfg/ninewinecfg.manifest | 16 + - programs/ninewinecfg/ninewinecfg.rc | 80 + - programs/ninewinecfg/resource.h | 51 + - 25 files changed, 6759 insertions(+) + configure.ac | 188 ++++ + dlls/d3d9-nine/Makefile.in | 15 + + dlls/d3d9-nine/d3d9-nine.spec | 14 + + dlls/d3d9-nine/d3d9_main.c | 173 +++ + dlls/d3d9-nine/d3dadapter9.c | 898 +++++++++++++++ + dlls/d3d9-nine/d3dadapter9.h | 32 + + dlls/d3d9-nine/device_wrap.c | 500 +++++++++ + dlls/d3d9-nine/device_wrap.h | 26 + + dlls/d3d9-nine/dri3.c | 1426 +++++++++++++++++++++++ + dlls/d3d9-nine/dri3.h | 91 ++ + dlls/d3d9-nine/present.c | 1748 +++++++++++++++++++++++++++++ + dlls/d3d9-nine/present.h | 40 + + dlls/d3d9-nine/shader_validator.c | 88 ++ + dlls/d3d9-nine/shader_validator.h | 29 + + dlls/d3d9-nine/version.rc | 26 + + dlls/d3d9-nine/wndproc.c | 277 +++++ + dlls/d3d9-nine/wndproc.h | 41 + + 17 files changed, 5612 insertions(+) create mode 100644 dlls/d3d9-nine/Makefile.in create mode 100644 dlls/d3d9-nine/d3d9-nine.spec create mode 100644 dlls/d3d9-nine/d3d9_main.c @@ -47,17 +39,12 @@ Signed-off-by: Nick Sarnie create mode 100644 dlls/d3d9-nine/version.rc create mode 100644 dlls/d3d9-nine/wndproc.c create mode 100644 dlls/d3d9-nine/wndproc.h - create mode 100644 programs/ninewinecfg/Makefile.in - create mode 100644 programs/ninewinecfg/main.c - create mode 100644 programs/ninewinecfg/ninewinecfg.manifest - create mode 100644 programs/ninewinecfg/ninewinecfg.rc - create mode 100644 programs/ninewinecfg/resource.h diff --git a/configure.ac b/configure.ac -index 294fe4ba89..713abccabd 100644 +index 0a407f31ec..bbbb93842a 100644 --- a/configure.ac +++ b/configure.ac -@@ -68,6 +68,14 @@ AC_ARG_WITH(openal, AS_HELP_STRING([--without-openal],[do not use OpenAL]), +@@ -70,6 +70,14 @@ AC_ARG_WITH(openal, AS_HELP_STRING([--without-openal],[do not use OpenAL]), AC_ARG_WITH(opencl, AS_HELP_STRING([--without-opencl],[do not use OpenCL]), [if test "x$withval" = "xno"; then ac_cv_header_CL_cl_h=no; ac_cv_header_OpenCL_opencl_h=no; fi]) AC_ARG_WITH(opengl, AS_HELP_STRING([--without-opengl],[do not use OpenGL])) @@ -72,7 +59,7 @@ index 294fe4ba89..713abccabd 100644 AC_ARG_WITH(osmesa, AS_HELP_STRING([--without-osmesa],[do not use the OSMesa library])) AC_ARG_WITH(oss, AS_HELP_STRING([--without-oss],[do not use the OSS sound support])) AC_ARG_WITH(pcap, AS_HELP_STRING([--without-pcap],[do not use the Packet Capture library]), -@@ -413,6 +421,8 @@ AC_CHECK_LIB(ossaudio,_oss_ioctl) +@@ -424,6 +432,8 @@ AC_CHECK_LIB(ossaudio,_oss_ioctl) AC_SUBST(OPENGL_LIBS,"") @@ -81,9 +68,9 @@ index 294fe4ba89..713abccabd 100644 dnl **** Check for header files **** AC_SYS_LARGEFILE() -@@ -1224,6 +1234,190 @@ This probably prevents linking to OpenGL. Try deleting the file and restarting c - WINE_WARNING_WITH(opengl,[test -n "$opengl_msg"],[$opengl_msg - OpenGL and Direct3D won't be supported.]) +@@ -1275,6 +1285,183 @@ OpenGL and Direct3D won't be supported.]) + WINE_NOTICE_WITH(va,[test "x$ac_cv_lib_soname_va" = "x" -o "x$ac_cv_lib_soname_va_x11" = "x" -o "x$ac_cv_lib_soname_va_drm" = "x"], + [libva ${notice_platform}development files not found, GPU video acceleration won't be supported.]) + dnl Check for d3d9-nine support + if test "x$with_d3d9_nine" = "xauto" && (test "x$with_d3d9_nine_module" = "xauto" || test "x$with_d3d9_nine_headers_path" = "xauto") @@ -104,7 +91,6 @@ index 294fe4ba89..713abccabd 100644 + then + AC_MSG_NOTICE([Checking for d3dadapter9 library dependencies]) + D3D9NINE_LIBS="" -+ NINEWINECFG_LIBS="" + D3D9NINE_MISSING_LIBS="" + AC_CHECK_LIB(xcb,xcb_request_check,[AC_SUBST(D3D9NINE_LIBS,["$D3D9NINE_LIBS -lxcb"])]) + test "x$ac_cv_lib_xcb_xcb_request_check" != xyes && D3D9NINE_MISSING_LIBS="libxcb " @@ -124,12 +110,7 @@ index 294fe4ba89..713abccabd 100644 + AC_CHECK_LIB(GL,glGenFramebuffers,[AC_SUBST(D3D9NINE_LIBS,["$D3D9NINE_LIBS -lGL"])]) + test "x$ac_cv_lib_GL_glGenFramebuffers" != xyes && D3D9NINE_MISSING_LIBS="libGL " + AC_CHECK_LIB(EGL,eglCreateContext,[AC_SUBST(D3D9NINE_LIBS,["$D3D9NINE_LIBS -lEGL"])]) -+ test "x$ac_cv_lib_EGL_eglCreateContext" != xyes && D3D9NINE_MISSING_LIBS="${D3D9NINE_MISSING_LIBS}libEGL " -+ # libdl -+ AC_CHECK_LIB(dl,dlopen,[AC_SUBST(NINEWINECFG_LIBS,["$NINEWINECFG_LIBS -ldl"])]) -+ test "x$ac_cv_lib_dl_dlopen" != xyes && D3D9NINE_MISSING_LIBS="${D3D9NINE_MISSING_LIBS}libdl " -+ -+ AC_DEFINE(NINEWINECFG_LIBS, $NINEWINECFG_LIBS, [ninewinecfg extra libs]) ++ test "x$ac_cv_lib_EGL_eglCreateContext" != xyes && D3D9NINE_MISSING_LIBS="${D3D9NINE_MISSING_LIBS}libEGL" + + if test "x$D3D9NINE_MISSING_LIBS" != x + then @@ -208,7 +189,6 @@ index 294fe4ba89..713abccabd 100644 + fi + fi + AC_DEFINE_UNQUOTED(D3D9NINE_MODULEPATH, ["`echo ${D3DADAPTER9_MODULEDIR}/d3dadapter9.so.1`"], [Gallium Nine module path]) -+ + # Check module + CPPFLAGSBAK=$CPPFLAGS + # link against libdl @@ -272,7 +252,7 @@ index 294fe4ba89..713abccabd 100644 CPPFLAGS="$ac_save_CPPFLAGS" else X_CFLAGS="" -@@ -3144,6 +3338,7 @@ WINE_CONFIG_MAKEFILE(dlls/d3d8) +@@ -3264,6 +3451,7 @@ WINE_CONFIG_MAKEFILE(dlls/d3d8) WINE_CONFIG_MAKEFILE(dlls/d3d8/tests) WINE_CONFIG_MAKEFILE(dlls/d3d9) WINE_CONFIG_MAKEFILE(dlls/d3d9/tests) @@ -280,14 +260,6 @@ index 294fe4ba89..713abccabd 100644 WINE_CONFIG_MAKEFILE(dlls/d3dcompiler_33) WINE_CONFIG_MAKEFILE(dlls/d3dcompiler_34) WINE_CONFIG_MAKEFILE(dlls/d3dcompiler_35) -@@ -3917,6 +4112,7 @@ WINE_CONFIG_MAKEFILE(programs/msinfo32) - WINE_CONFIG_MAKEFILE(programs/net) - WINE_CONFIG_MAKEFILE(programs/netsh) - WINE_CONFIG_MAKEFILE(programs/netstat) -+WINE_CONFIG_MAKEFILE(programs/ninewinecfg) - WINE_CONFIG_MAKEFILE(programs/ngen) - WINE_CONFIG_MAKEFILE(programs/notepad) - WINE_CONFIG_MAKEFILE(programs/oleview) diff --git a/dlls/d3d9-nine/Makefile.in b/dlls/d3d9-nine/Makefile.in new file mode 100644 index 0000000000..c6df8d7dbe @@ -1990,10 +1962,10 @@ index 0000000000..8f5e7206a0 +#endif /* __NINE_DEVICE_WRAP_H */ diff --git a/dlls/d3d9-nine/dri3.c b/dlls/d3d9-nine/dri3.c new file mode 100644 -index 0000000000..b2fd0c3e85 +index 0000000000..3946e7f8bf --- /dev/null +++ b/dlls/d3d9-nine/dri3.c -@@ -0,0 +1,1430 @@ +@@ -0,0 +1,1426 @@ +/* + * Wine DRI3 interface + * @@ -2092,6 +2064,7 @@ index 0000000000..b2fd0c3e85 + XID window; + uint64_t last_msc; + uint64_t last_target; ++ uint32_t last_serial_given; + xcb_special_event_t *special_event; + PRESENTPixmapPriv *first_present_priv; + int pixmap_present_pending; @@ -2125,9 +2098,6 @@ index 0000000000..b2fd0c3e85 + PRESENTPixmapPriv *next; +}; + -+/* TODO: use atomics */ -+static uint32_t last_serial_given = 0; -+ +BOOL DRI3CheckExtension(Display *dpy, int major, int minor) +{ + xcb_connection_t *xcb_connection = XGetXCBConnection(dpy); @@ -2627,7 +2597,7 @@ index 0000000000..b2fd0c3e85 + present_pixmap_priv = PRESENTFindPixmapPriv(present_priv, ce->serial); + if (!present_pixmap_priv || ce->kind != XCB_PRESENT_COMPLETE_KIND_PIXMAP) + { -+ /* We received an event from another instance - ignore */ ++ ERR("FATAL ERROR: PRESENT handling failed\n"); + free(ce); + return; + } @@ -2651,7 +2621,7 @@ index 0000000000..b2fd0c3e85 + present_pixmap_priv = PRESENTFindPixmapPriv(present_priv, ie->serial); + if (!present_pixmap_priv || present_pixmap_priv->pixmap != ie->pixmap) + { -+ /* We received an event from another instance - ignore */ ++ ERR("FATAL ERROR: PRESENT handling failed\n"); + free(ie); + return; + } @@ -2865,7 +2835,6 @@ index 0000000000..b2fd0c3e85 +/* Destroy the content, except the link and the struct mem */ +static void PRESENTDestroyPixmapContent(Display *dpy, PRESENTPixmapPriv *present_pixmap) +{ -+ TRACE("Releasing pixmap priv %p\n", present_pixmap); + XFreePixmap(dpy, present_pixmap->pixmap); +#ifdef D3D9NINE_DRI2 + if (present_pixmap->dri2_info.is_dri2) @@ -2951,8 +2920,8 @@ index 0000000000..b2fd0c3e85 +#endif + free(reply); + -+ last_serial_given++; -+ (*present_pixmap_priv)->serial = last_serial_given; ++ present_priv->last_serial_given++; ++ (*present_pixmap_priv)->serial = present_priv->last_serial_given; + present_priv->first_present_priv = *present_pixmap_priv; + + LeaveCriticalSection(&present_priv->mutex_present); @@ -3076,8 +3045,8 @@ index 0000000000..b2fd0c3e85 + (*present_pixmap_priv)->dri2_info.texture_read = texture_read; + (*present_pixmap_priv)->dri2_info.texture_write = texture_write; + -+ last_serial_given++; -+ (*present_pixmap_priv)->serial = last_serial_given; ++ present_priv->last_serial_given++; ++ (*present_pixmap_priv)->serial = present_priv->last_serial_given; + present_priv->first_present_priv = *present_pixmap_priv; + + eglBindAPI(current_api); @@ -3103,7 +3072,6 @@ index 0000000000..b2fd0c3e85 + if (!present_pixmap_priv->released || present_pixmap_priv->present_complete_pending) + { + LeaveCriticalSection(&present_priv->mutex_present); -+ TRACE("Releasing pixmap priv %p later\n", present_pixmap_priv); + return FALSE; + } + @@ -3523,10 +3491,10 @@ index 0000000000..3c9309dedb +#endif /* __WINE_DRI3_H */ diff --git a/dlls/d3d9-nine/present.c b/dlls/d3d9-nine/present.c new file mode 100644 -index 0000000000..8741b38f4f +index 0000000000..2d9390a358 --- /dev/null +++ b/dlls/d3d9-nine/present.c -@@ -0,0 +1,1817 @@ +@@ -0,0 +1,1748 @@ +/* + * Wine ID3DAdapter9 support functions + * @@ -3625,11 +3593,6 @@ index 0000000000..8741b38f4f + Drawable drawable; /* X11 drawable */ + HDC hdc; + HWND wnd; /* HWND (for convenience) */ -+ RECT windowRect; -+ POINT offset; /* offset of the client area compared to the X11 drawable */ -+ unsigned int width; -+ unsigned int height; -+ unsigned int depth; +}; + +struct DRI3Present @@ -3684,7 +3647,6 @@ index 0000000000..8741b38f4f +static void destroy_d3dadapter_drawable(Display *gdi_display, HWND hwnd) +{ + struct d3d_drawable *d3d; -+ TRACE("This=%p hwnd=%p\n", gdi_display, hwnd); + + EnterCriticalSection(&context_section); + if (!XFindContext(gdi_display, (XID)hwnd, @@ -3696,107 +3658,32 @@ index 0000000000..8741b38f4f + LeaveCriticalSection(&context_section); +} + -+static void DRI3Present_FillOffset(Display *gdi_display, struct d3d_drawable *d3d) ++static RECT DRI3Present_GetClientRecWindowRelative(HWND hwnd) +{ -+ struct x11drv_escape_get_drawable extesc = { X11DRV_GET_DRAWABLE }; -+ HWND desktop; -+ Drawable wineRoot; -+ POINT relWineRootPos; -+ POINT relXRootPos; -+ Drawable drawable; -+ HDC hdc; -+ Window Wroot; -+ int x, y; -+ unsigned int border_width; -+ -+ TRACE("hwnd=%p\n", d3d->wnd); -+ -+ /* Finding the offset is hard because a drawable -+ * doesn't always start a the top left of a hwnd window, -+ * for example if the windows window decoration is replaced -+ * by the window managed. -+ * In the case of non-virtual desktop, wine root is -+ * the X root. -+ * In the case of virtual desktop, We assume the root drawable -+ * begins at pos (0, 0) */ -+ -+ /* Note: Another method that works for virtual desktop, -+ * but fails else because of the window manager replacing -+ * decoration issue stated above: -+ * RECT wnd; -+ * GetWindowRect(hwnd, &wnd); -+ * MapWindowPoints(HWND_DESKTOP, hwnd, (LPPOINT) &wnd, 2); -+ * relWineRootPos.x = -wnd.left; -+ * relWineRootPos.y = -wnd.top; -+ */ -+ -+ d3d->offset.x = d3d->offset.y = 0; -+ relWineRootPos.x = relWineRootPos.y = 0; -+ relXRootPos.x = relXRootPos.y = 0; -+ -+ desktop = GetDesktopWindow(); -+ hdc = GetDCEx(desktop, 0, DCX_CACHE | DCX_CLIPSIBLINGS); -+ if (!hdc) -+ return; -+ if (ExtEscape(hdc, X11DRV_ESCAPE, sizeof(extesc), (LPCSTR)&extesc, -+ sizeof(extesc), (LPSTR)&extesc) <= 0) -+ { -+ ERR("Unexpected error in X Drawable lookup (hwnd=%p, hdc=%p)\n", desktop, hdc); -+ ReleaseDC(desktop, hdc); -+ return; -+ } -+ ReleaseDC(desktop, hdc); -+ wineRoot = extesc.drawable; -+ -+ if (!XGetGeometry(gdi_display, d3d->drawable, &Wroot, &x, &y, &d3d->width, &d3d->height, &border_width, &d3d->depth)) -+ { -+ d3d->width = 0; -+ d3d->height = 0; -+ d3d->depth= 0; -+ } ++ RECT rect; ++ RECT wnd; + -+ /* The position of the top left client area -+ * compared to wine root window */ -+ ClientToScreen(d3d->wnd, &relWineRootPos); -+ TRACE("Coord client area: %d %d\n", relWineRootPos.x, relWineRootPos.y); ++ /* Get client space dimensions */ ++ GetClientRect(hwnd, &rect); + -+ /* Now we compute the position of the drawable -+ * compared to wine root window */ ++ /* Get window in screen space */ ++ GetWindowRect(hwnd, &wnd); + -+ drawable = d3d->drawable; ++ /* Transform to offset */ ++ MapWindowPoints(HWND_DESKTOP, hwnd, (LPPOINT) &wnd, 2); ++ wnd.top *= -1; ++ wnd.left *= -1; ++ wnd.bottom = wnd.top + rect.bottom; ++ wnd.right = wnd.left + rect.right; + -+ while (1) { -+ Window Wparent, *Wchildren; -+ unsigned int numchildren, width, height, depth; -+ if (!XGetGeometry(gdi_display, drawable, &Wroot, &x, &y, &width, &height, &border_width, &depth)) -+ break; -+ /* Should we really add border_width ? */ -+ relXRootPos.x += x + border_width; -+ relXRootPos.y += y + border_width; -+ if (!XQueryTree(gdi_display, drawable, &Wroot, &Wparent, &Wchildren, &numchildren)) -+ break; -+ if (Wchildren) -+ free(Wchildren); -+ drawable = Wparent; -+ if (drawable == Wroot || drawable == wineRoot) -+ { -+ TRACE("Successfully determined drawable pos (debug: %ld, %ld, %ld)\n", drawable, Wroot, wineRoot); -+ break; -+ } -+ } -+ TRACE("Coord drawable: %d %d\n", relXRootPos.x, relXRootPos.y); -+ d3d->offset.x = relWineRootPos.x - relXRootPos.x; -+ d3d->offset.y = relWineRootPos.y - relXRootPos.y; -+ TRACE("Offset: %d %d\n", d3d->offset.x, d3d->offset.y); ++ return wnd; +} + -+static struct d3d_drawable *create_d3dadapter_drawable(Display *gdi_display, HWND hwnd) ++static struct d3d_drawable *create_d3dadapter_drawable(HWND hwnd) +{ + struct x11drv_escape_get_drawable extesc = { X11DRV_GET_DRAWABLE }; + struct d3d_drawable *d3d; + -+ TRACE("hwnd=%p\n", hwnd); -+ + d3d = HeapAlloc(GetProcessHeap(), 0, sizeof(*d3d)); + if (!d3d) + { @@ -3814,11 +3701,8 @@ index 0000000000..8741b38f4f + return NULL; + } + -+ TRACE("hwnd created drawable: %ld\n", extesc.drawable); + d3d->drawable = extesc.drawable; + d3d->wnd = hwnd; -+ GetWindowRect(hwnd, &d3d->windowRect); -+ DRI3Present_FillOffset(gdi_display, d3d); + + return d3d; +} @@ -3827,8 +3711,6 @@ index 0000000000..8741b38f4f +{ + struct d3d_drawable *d3d, *race; + -+ TRACE("hwnd=%p\n", hwnd); -+ + EnterCriticalSection(&context_section); + if (!XFindContext(gdi_display, (XID)hwnd, d3d_hwnd_context, (char **)&d3d)) + { @@ -3838,7 +3720,7 @@ index 0000000000..8741b38f4f + + TRACE("No d3d_drawable attached to hwnd %p, creating one.\n", hwnd); + -+ d3d = create_d3dadapter_drawable(gdi_display, hwnd); ++ d3d = create_d3dadapter_drawable(hwnd); + if (!d3d) + return NULL; + @@ -3959,8 +3841,6 @@ index 0000000000..8741b38f4f + HeapFree(GetProcessHeap(), 0, *out); + return D3DERR_DRIVERINTERNALERROR; + } -+ -+ TRACE("This=%p buffer=%p\n", This, *out); + return D3D_OK; +} + @@ -3970,7 +3850,6 @@ index 0000000000..8741b38f4f + /* the pixmap is managed by the PRESENT backend. + * But if it can delete it right away, we may have + * better performance */ -+ TRACE("This=%p buffer=%p of priv %p\n", This, buffer, buffer->present_pixmap_priv); + PRESENTTryFreePixmap(This->gdi_display, buffer->present_pixmap_priv); + HeapFree(GetProcessHeap(), 0, buffer); + return D3D_OK; @@ -3979,7 +3858,6 @@ index 0000000000..8741b38f4f +static HRESULT WINAPI DRI3Present_WaitBufferReleased(struct DRI3Present *This, + struct D3DWindowBuffer *buffer) +{ -+ TRACE("This=%p buffer=%p\n", This, buffer); + if(!PRESENTWaitPixmapReleased(buffer->present_pixmap_priv)) + { + ERR("PRESENTWaitPixmapReleased failed\n"); @@ -4001,13 +3879,76 @@ index 0000000000..8741b38f4f + return D3DERR_DRIVERINTERNALERROR; +} + ++/* Try to detect client side window decorations by walking the X Drawable up. ++ * In case there's an intermediate Drawable, server side window decorations are used. ++ * TODO: Find a X11 function to query for window decorations. ++ */ ++static BOOL DRI3Present_HasClientSideWindowDecorations(struct DRI3Present *This, ++ HWND hwnd) ++{ ++ struct x11drv_escape_get_drawable extesc = { X11DRV_GET_DRAWABLE }; ++ Window Wroot; ++ Window Wparent; ++ Window *Wchildren; ++ unsigned int numchildren; ++ HWND parent; ++ HDC hdc; ++ BOOL ret = TRUE; ++ ++ parent = GetParent(hwnd); ++ if (!parent) ++ parent = GetDesktopWindow(); ++ if (!parent) ++ { ++ ERR("Unexpected error getting the parent hwnd (hwnd=%p)\n", hwnd); ++ return FALSE; ++ } ++ ++ hdc = GetDCEx(hwnd, 0, DCX_CACHE | DCX_CLIPSIBLINGS); ++ if (!hdc) ++ return FALSE; ++ if (ExtEscape(hdc, X11DRV_ESCAPE, sizeof(extesc), (LPCSTR)&extesc, ++ sizeof(extesc), (LPSTR)&extesc) <= 0) ++ { ++ ERR("Unexpected error in X Drawable lookup (hwnd=%p, hdc=%p)\n", hwnd, hdc); ++ ReleaseDC(hwnd, hdc); ++ return FALSE; ++ } ++ ReleaseDC(hwnd, hdc); ++ ++ if (XQueryTree(This->gdi_display, extesc.drawable, &Wroot, &Wparent, &Wchildren, &numchildren)) ++ { ++ hdc = GetDCEx(parent, 0, DCX_CACHE | DCX_CLIPSIBLINGS); ++ if (!hdc) ++ return FALSE; ++ ++ if (ExtEscape(hdc, X11DRV_ESCAPE, sizeof(extesc), (LPCSTR)&extesc, ++ sizeof(extesc), (LPSTR)&extesc) <= 0) ++ { ++ ERR("Unexpected error in X Drawable lookup (hwnd=%p, hdc=%p)\n", parent, hdc); ++ ReleaseDC(parent, hdc); ++ return FALSE; ++ } ++ ReleaseDC(parent, hdc); ++ ++ if (Wparent != extesc.drawable) ++ { ++ /* Found at least one intermediate window */ ++ ret = FALSE; ++ } ++ if (Wchildren) ++ free(Wchildren); ++ } ++ ++ return ret; ++} ++ +static HRESULT WINAPI DRI3Present_PresentBuffer( struct DRI3Present *This, + struct D3DWindowBuffer *buffer, HWND hWndOverride, const RECT *pSourceRect, + const RECT *pDestRect, const RGNDATA *pDirtyRegion, DWORD Flags ) +{ + struct d3d_drawable *d3d; + RECT dest_translate; -+ RECT windowRect; + RECT offset; + HWND hwnd; + @@ -4018,8 +3959,6 @@ index 0000000000..8741b38f4f + else + hwnd = This->focus_wnd; + -+ TRACE("This=%p hwnd=%p\n", This, hwnd); -+ + d3d = get_d3d_drawable(This->gdi_display, hwnd); + + if (!d3d) @@ -4031,37 +3970,25 @@ index 0000000000..8741b38f4f + + This->d3d = d3d; + -+ GetWindowRect(d3d->wnd, &windowRect); -+ /* The "correct" way to detect offset changes -+ * would be to catch any window related change with a -+ * listener. But it is complicated and this heuristic -+ * is fast and should work well. */ -+ if (windowRect.top != d3d->windowRect.top || -+ windowRect.left != d3d->windowRect.left || -+ windowRect.bottom != d3d->windowRect.bottom || -+ windowRect.right != d3d->windowRect.right) ++ /* In case of client side window decorations we need to add an offset within ++ * the X drawable. ++ * FIXME: Call once on window style / size change */ ++ if (DRI3Present_HasClientSideWindowDecorations(This, hwnd)) + { -+ d3d->windowRect = windowRect; -+ DRI3Present_FillOffset(This->gdi_display, d3d); -+ } ++ offset = DRI3Present_GetClientRecWindowRelative(hwnd); + -+ GetClientRect(d3d->wnd, &offset); -+ offset.left += d3d->offset.x; -+ offset.top += d3d->offset.y; -+ offset.right += d3d->offset.x; -+ offset.bottom += d3d->offset.y; -+ -+ if ((offset.top != 0) || (offset.left != 0)) -+ { -+ if (!pDestRect) -+ pDestRect = (const RECT *) &offset; -+ else ++ if ((offset.top != 0) || (offset.left != 0)) + { -+ dest_translate.top = pDestRect->top + offset.top; -+ dest_translate.left = pDestRect->left + offset.left; -+ dest_translate.bottom = pDestRect->bottom + offset.bottom; -+ dest_translate.right = pDestRect->right + offset.right; -+ pDestRect = (const RECT *) &dest_translate; ++ if (!pDestRect) ++ pDestRect = (const RECT *) &offset; ++ else ++ { ++ dest_translate.top = pDestRect->top + offset.top; ++ dest_translate.left = pDestRect->left + offset.left; ++ dest_translate.bottom = pDestRect->bottom + offset.bottom; ++ dest_translate.right = pDestRect->right + offset.right; ++ pDestRect = (const RECT *) &dest_translate; ++ } + } + } + @@ -4070,7 +3997,6 @@ index 0000000000..8741b38f4f + pSourceRect, pDestRect, pDirtyRegion)) + { + release_d3d_drawable(d3d); -+ TRACE("Present call failed\n"); + return D3DERR_DRIVERINTERNALERROR; + } + release_d3d_drawable(d3d); @@ -4263,28 +4189,11 @@ index 0000000000..8741b38f4f + HRESULT hr; + RECT pRect; + -+ TRACE("This=%p hwnd=%p\n", This, hWnd); -+ -+ /* For fullscreen modes, use the dimensions of the X11 window instead of -+ * the game window. This is for compability with Valve's "fullscreen hack", -+ * which won't switch to the game's resolution anymore, but instead scales -+ * the game window to the root window. Only then can page flipping be used. -+ */ -+ if (!This->params.Windowed && This->d3d) -+ if (This->d3d->width > 0 && This->d3d->height > 0 && This->d3d->depth > 0) -+ { -+ *width = This->d3d->width; -+ *height = This->d3d->height; -+ *depth = This->d3d->depth; -+ return D3D_OK; -+ } -+ + if (!hWnd) + hWnd = This->focus_wnd; + hr = GetClientRect(hWnd, &pRect); + if (!hr) + return D3DERR_INVALIDCALL; -+ TRACE("pRect: %d %d %d %d\n", pRect.left, pRect.top, pRect.right, pRect.bottom); + *width = pRect.right - pRect.left; + *height = pRect.bottom - pRect.top; + *depth = 24; //TODO @@ -4337,7 +4246,6 @@ index 0000000000..8741b38f4f + +static BOOL WINAPI DRI3Present_IsBufferReleased( struct DRI3Present *This, struct D3DWindowBuffer *buffer ) +{ -+ TRACE("This=%p buffer=%p\n", This, buffer); + return PRESENTIsPixmapReleased(buffer->present_pixmap_priv); +} + @@ -5169,16 +5077,12 @@ index 0000000000..8741b38f4f + + rc = RegQueryValueExA(regkey, "ModulePath", 0, &type, NULL, &size); + if (rc == ERROR_FILE_NOT_FOUND) -+ { -+ RegCloseKey(regkey); + goto use_default_path; -+ } + + TRACE("Reading registry key for module path\n"); + if (rc != ERROR_SUCCESS || type != REG_SZ) + { + ERR("Failed to read Direct3DNine ModulePath registry key: Invalid content\n"); -+ RegCloseKey(regkey); + goto cleanup; + } + @@ -5186,14 +5090,12 @@ index 0000000000..8741b38f4f + if (!path) + { + ERR("Out of memory\n"); -+ RegCloseKey(regkey); + return FALSE; + } + rc = RegQueryValueExA(regkey, "ModulePath", 0, &type, (LPBYTE)path, &size); + if (rc != ERROR_SUCCESS) + { + ERR("Failed to read Direct3DNine registry\n"); -+ RegCloseKey(regkey); + goto cleanup; + } + /* Split colon separated path for multi-arch support */ @@ -5217,7 +5119,6 @@ index 0000000000..8741b38f4f + TRACE("Failed to load '%s': %s\n", tmp_path, errbuf); + ERR("Failed to load '%s' and '%s' set by ModulePath.\n", + path, tmp_path); -+ RegCloseKey(regkey); + goto cleanup; + } + } @@ -5230,7 +5131,6 @@ index 0000000000..8741b38f4f + { + TRACE("Failed to load %s: %s\n", path, errbuf); + ERR("Failed to load '%s' set by ModulePath.\n", path); -+ RegCloseKey(regkey); + goto cleanup; + } + } @@ -5238,7 +5138,6 @@ index 0000000000..8741b38f4f + pathbuf[sizeof(pathbuf)-1] = 0; + + HeapFree(GetProcessHeap(), 0, path); -+ RegCloseKey(regkey); + } + +use_default_path: @@ -5881,1190 +5780,6 @@ index 0000000000..15f26d491a +#define NINE_WINDOW_CLASS_NAME "Gallium_Nine_Window" + +#endif -diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c -index 326873314c..85cc13ef7b 100644 ---- a/dlls/winex11.drv/init.c -+++ b/dlls/winex11.drv/init.c -@@ -229,6 +229,7 @@ static INT X11DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_d - { - struct x11drv_escape_get_drawable *data = out_data; - data->drawable = physDev->drawable; -+ data->dc_rect = physDev->dc_rect; - return TRUE; - } - break; -diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h -index a0308b0675..790390bae6 100644 ---- a/dlls/winex11.drv/x11drv.h -+++ b/dlls/winex11.drv/x11drv.h -@@ -300,6 +300,7 @@ struct x11drv_escape_get_drawable - Drawable drawable; /* X drawable */ - Drawable gl_drawable; /* GL drawable */ - int pixel_format; /* internal GL pixel format */ -+ RECT dc_rect; /* DC rectangle relative to drawable */ - }; - - struct x11drv_escape_flush_gl_drawable -diff --git a/include/config.h.in b/include/config.h.in -index c5a3cb4807..1557383d78 100644 ---- a/include/config.h.in -+++ b/include/config.h.in -@@ -4,6 +4,15 @@ - #define __WINE_CONFIG_H - #ifndef WINE_CROSSTEST - -+/* Whether d3d9-nine DRI2 fallback is compiled */ -+#undef D3D9NINE_DRI2 -+ -+/* Gallium Nine headers cflags */ -+#undef D3D9NINE_HEADERS_CFLAGS -+ -+/* Gallium Nine module path */ -+#undef D3D9NINE_MODULEPATH -+ - /* Define to a function attribute for Microsoft hotpatch assembly prefix. */ - #undef DECLSPEC_HOTPATCH - -@@ -107,6 +116,9 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_CURSES_H - -+/* Whether d3d9-nine.dll is built */ -+#undef HAVE_D3D9NINE -+ - /* Define if you have the daylight variable */ - #undef HAVE_DAYLIGHT - -@@ -129,6 +141,9 @@ - /* Define to 1 if you have the `dlopen' function. */ - #undef HAVE_DLOPEN - -+/* Define to 1 if you have the header file. */ -+#undef HAVE_EGL_EGLEXT_H -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_EGL_EGL_H - -@@ -267,6 +282,12 @@ - /* Define to 1 if you have the `getuid' function. */ - #undef HAVE_GETUID - -+/* Define to 1 if you have the header file. */ -+#undef HAVE_GL_GLEXT_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_GL_GL_H -+ - /* Define to 1 if you have the `gnutls_cipher_init' function. */ - #undef HAVE_GNUTLS_CIPHER_INIT - -@@ -405,6 +426,12 @@ - /* Define to 1 if you have the `lgammaf' function. */ - #undef HAVE_LGAMMAF - -+/* Define to 1 if you have the header file. */ -+#undef HAVE_LIBDRM_DRM_FOURCC_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_LIBDRM_DRM_H -+ - /* Define to 1 if you have the `gettextpo' library (-lgettextpo). */ - #undef HAVE_LIBGETTEXTPO - -@@ -1293,6 +1320,15 @@ - /* Define to 1 if you have the `vsnprintf' function. */ - #undef HAVE_VSNPRINTF - -+/* Define to 1 if you have the header file. */ -+#undef HAVE_X11_EXTENSIONS_DRI2PROTO_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_X11_EXTENSIONS_DRI2TOKENS_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_X11_EXTENSIONS_EXTUTIL_H -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_X11_EXTENSIONS_SHAPE_H - -@@ -1332,12 +1368,27 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_X11_XKBLIB_H - -+/* Define to 1 if you have the header file. */ -+#undef HAVE_X11_XLIBINT_H -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_X11_XLIB_H - -+/* Define to 1 if you have the header file. */ -+#undef HAVE_X11_XLIB_XCB_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_X11_XMD_H -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_X11_XUTIL_H - -+/* Define to 1 if you have the header file. */ -+#undef HAVE_XCB_DRI3_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_XCB_PRESENT_H -+ - /* Define to 1 if `xcookie' is a member of `XEvent'. */ - #undef HAVE_XEVENT_XCOOKIE - -@@ -1449,6 +1500,9 @@ - . */ - #undef MAJOR_IN_SYSMACROS - -+/* ninewinecfg extra libs */ -+#undef NINEWINECFG_LIBS -+ - /* Define to the address where bug reports for this package should be sent. */ - #undef PACKAGE_BUGREPORT - -diff --git a/programs/ninewinecfg/Makefile.in b/programs/ninewinecfg/Makefile.in -new file mode 100644 -index 0000000000..af5c33d25a ---- /dev/null -+++ b/programs/ninewinecfg/Makefile.in -@@ -0,0 +1,10 @@ -+MODULE = ninewinecfg.exe -+APPMODE = -mwindows -+IMPORTS = shell32 gdi32 advapi32 user32 comctl32 ole32 -+EXTRALIBS = $(NINEWINECFG_LIBS) -+ -+C_SRCS = main.c -+ -+RC_SRCS = ninewinecfg.rc -+ -+INSTALL_LIB = ninewinecfg.exe ninewinecfg -diff --git a/programs/ninewinecfg/main.c b/programs/ninewinecfg/main.c -new file mode 100644 -index 0000000000..6bc3d1076b ---- /dev/null -+++ b/programs/ninewinecfg/main.c -@@ -0,0 +1,853 @@ -+/* -+ * NineWineCfg main entry point -+ * -+ * Copyright 2002 Jaco Greeff -+ * Copyright 2003 Dimitrie O. Paun -+ * Copyright 2003 Mike Hearn -+ * Copyright 2017 Patrick Rudolph -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ * -+ */ -+ -+#define WIN32_LEAN_AND_MEAN -+#define NONAMELESSUNION -+ -+#include "config.h" -+#include -+#include -+#define WIN32_NO_STATUS -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include "resource.h" -+ -+WINE_DEFAULT_DEBUG_CHANNEL(ninecfg); -+ -+#ifndef WINE_STAGING -+#warning DO NOT DEFINE WINE_STAGING TO 1 ON STABLE BRANCHES, ONLY ON WINE-STAGING ENABLED WINES -+#define WINE_STAGING 1 -+#endif -+ -+#if !WINE_STAGING -+ -+#if HAVE_DLADDR -+#define _GNU_SOURCE -+#include -+#else -+#error neither HAVE_DLADDR nor WINE_STAGING is set -+#endif -+ -+static BOOL isWin64(void) -+{ -+ return sizeof(void*) == 8; -+} -+ -+static BOOL Call32bitNineWineCfg(BOOL state) -+{ -+ STARTUPINFOA si; -+ PROCESS_INFORMATION pi; -+ CHAR buf[MAX_PATH]; -+ -+ ZeroMemory( &si, sizeof(si) ); -+ si.cb = sizeof(si); -+ ZeroMemory( &pi, sizeof(pi) ); -+ -+ if (!GetSystemWow64DirectoryA((LPSTR)buf, sizeof(buf))) -+ return FALSE; -+ -+ strcat(buf, "\\ninewinecfg.exe"); -+ -+ if (state) -+ strcat(buf, " -e -n"); -+ else -+ strcat(buf, " -d -n"); -+ -+ if (!CreateProcessA(NULL, buf, NULL, NULL, -+ FALSE, 0, NULL, NULL, &si, &pi )) { -+ WINE_ERR("Failed to call CreateProcess, error=%d", GetLastError()); -+ return FALSE; -+ } -+ else -+ WaitForSingleObject( pi.hProcess, INFINITE ); -+ -+ return TRUE; -+} -+ -+static BOOL isWoW64(void) -+{ -+ BOOL is_wow64; -+ -+ return IsWow64Process( GetCurrentProcess(), &is_wow64 ) && is_wow64; -+} -+ -+static BOOL Call64bitNineWineCfg(BOOL state) -+{ -+ STARTUPINFOA si; -+ PROCESS_INFORMATION pi; -+ void *redir; -+ DWORD exit_code; -+ CHAR buf[MAX_PATH]; -+ -+ Wow64DisableWow64FsRedirection( &redir ); -+ -+ ZeroMemory( &si, sizeof(si) ); -+ si.cb = sizeof(si); -+ ZeroMemory( &pi, sizeof(pi) ); -+ -+ if (!GetSystemDirectoryA((LPSTR)buf, sizeof(buf))) -+ return FALSE; -+ -+ strcat(buf, "\\ninewinecfg.exe"); -+ -+ if (state) -+ strcat(buf, " -e -n"); -+ else -+ strcat(buf, " -d -n"); -+ -+ if (!CreateProcessA(NULL, buf, NULL, NULL, -+ FALSE, 0, NULL, NULL, &si, &pi )) { -+ WINE_ERR("Failed to call CreateProcess, error=%d", GetLastError()); -+ return FALSE; -+ } -+ else -+ WaitForSingleObject( pi.hProcess, INFINITE ); -+ GetExitCodeProcess( pi.hProcess, &exit_code ); -+ -+ Wow64RevertWow64FsRedirection( redir ); -+ return TRUE; -+} -+ -+/* helper functions taken from NTDLL and KERNEL32 */ -+static LPWSTR FILE_name_AtoW(LPCSTR name, int optarg) -+{ -+ ANSI_STRING str; -+ UNICODE_STRING strW, *pstrW; -+ NTSTATUS status; -+ -+ RtlInitAnsiString( &str, name ); -+ pstrW = &strW ; -+ status = RtlAnsiStringToUnicodeString( pstrW, &str, TRUE ); -+ if (status == STATUS_SUCCESS) return pstrW->Buffer; -+ return NULL; -+} -+ -+static BOOL WINAPI CreateSymLinkW(LPCWSTR lpFileName, LPCSTR existingUnixFileName, -+ LPSECURITY_ATTRIBUTES lpSecurityAttributes) -+{ -+ NTSTATUS status; -+ UNICODE_STRING ntDest; -+ ANSI_STRING unixDest; -+ BOOL ret = FALSE; -+ -+ TRACE("(%s, %s, %p)\n", debugstr_w(lpFileName), -+ existingUnixFileName, lpSecurityAttributes); -+ -+ ntDest.Buffer = NULL; -+ if (!RtlDosPathNameToNtPathName_U( lpFileName, &ntDest, NULL, NULL )) -+ { -+ SetLastError( ERROR_PATH_NOT_FOUND ); -+ goto err; -+ } -+ -+ unixDest.Buffer = NULL; -+ status = wine_nt_to_unix_file_name( &ntDest, &unixDest, FILE_CREATE, FALSE ); -+ if (!status) /* destination must not exist */ -+ { -+ status = STATUS_OBJECT_NAME_EXISTS; -+ } else if (status == STATUS_NO_SUCH_FILE) -+ { -+ status = STATUS_SUCCESS; -+ } -+ -+ if (status) -+ SetLastError( RtlNtStatusToDosError(status) ); -+ else if (!symlink( existingUnixFileName, unixDest.Buffer )) -+ { -+ TRACE("Symlinked '%s' to '%s'\n", debugstr_a( unixDest.Buffer ), -+ existingUnixFileName); -+ ret = TRUE; -+ } -+ -+ RtlFreeAnsiString( &unixDest ); -+ -+err: -+ RtlFreeUnicodeString( &ntDest ); -+ return ret; -+} -+ -+static BOOL WINAPI CreateSymLinkA(LPCSTR lpFileName, LPCSTR lpExistingUnixFileName, -+ LPSECURITY_ATTRIBUTES lpSecurityAttributes) -+{ -+ WCHAR *destW; -+ BOOL res; -+ -+ if (!(destW = FILE_name_AtoW( lpFileName, TRUE ))) -+ { -+ return FALSE; -+ } -+ -+ res = CreateSymLinkW( destW, lpExistingUnixFileName, lpSecurityAttributes ); -+ -+ HeapFree( GetProcessHeap(), 0, destW ); -+ -+ return res; -+} -+ -+static BOOL WINAPI IsFileSymLinkW(LPCWSTR lpExistingFileName) -+{ -+ NTSTATUS status; -+ UNICODE_STRING ntSource; -+ ANSI_STRING unixSource; -+ BOOL ret = FALSE; -+ struct stat sb; -+ -+ TRACE("(%s)\n", debugstr_w(lpExistingFileName)); -+ -+ ntSource.Buffer = NULL; -+ if (!RtlDosPathNameToNtPathName_U( lpExistingFileName, &ntSource, NULL, NULL )) -+ { -+ SetLastError( ERROR_PATH_NOT_FOUND ); -+ goto err; -+ } -+ -+ unixSource.Buffer = NULL; -+ status = wine_nt_to_unix_file_name( &ntSource, &unixSource, FILE_OPEN, FALSE ); -+ if (status == STATUS_NO_SUCH_FILE) -+ { -+ SetLastError( ERROR_PATH_NOT_FOUND ); -+ goto err; -+ } -+ -+ if (!lstat( unixSource.Buffer, &sb) && (sb.st_mode & S_IFMT) == S_IFLNK) -+ { -+ ret = TRUE; -+ } -+ -+ RtlFreeAnsiString( &unixSource ); -+ -+err: -+ RtlFreeUnicodeString( &ntSource ); -+ return ret; -+} -+ -+static BOOL WINAPI IsFileSymLinkA(LPCSTR lpExistingFileName) -+{ -+ WCHAR *sourceW; -+ BOOL res; -+ -+ if (!(sourceW = FILE_name_AtoW( lpExistingFileName, TRUE ))) -+ { -+ return FALSE; -+ } -+ -+ res = IsFileSymLinkW( sourceW ); -+ -+ HeapFree( GetProcessHeap(), 0, sourceW ); -+ -+ return res; -+} -+ -+static BOOL nine_get_system_path(CHAR *pOut, DWORD SizeOut) -+{ -+ if (isWoW64()) { -+ return !!GetSystemWow64DirectoryA((LPSTR)pOut, SizeOut); -+ } else { -+ return !!GetSystemDirectoryA((LPSTR)pOut, SizeOut); -+ } -+} -+ -+#endif -+ -+/* -+ * Winecfg -+ */ -+/* this is called from the WM_SHOWWINDOW handlers of each tab page. -+ * -+ * it's a nasty hack, necessary because the property sheet insists on resetting the window title -+ * to the title of the tab, which is utterly useless. dropping the property sheet is on the todo list. -+ */ -+void set_window_title(HWND dialog) -+{ -+ WCHAR newtitle[256]; -+ -+ LoadStringW (GetModuleHandleW(NULL), IDS_NINECFG_TITLE, newtitle, -+ sizeof(newtitle)/sizeof(newtitle[0])); -+ -+ WINE_TRACE("setting title to %s\n", wine_dbgstr_w (newtitle)); -+ SendMessageW (GetParent(dialog), PSM_SETTITLEW, 0, (LPARAM) newtitle); -+} -+ -+WCHAR* load_string (UINT id) -+{ -+ WCHAR buf[1024]; -+ int len; -+ WCHAR* newStr; -+ -+ LoadStringW (GetModuleHandleW(NULL), id, buf, sizeof(buf)/sizeof(buf[0])); -+ -+ len = lstrlenW (buf); -+ newStr = HeapAlloc (GetProcessHeap(), 0, (len + 1) * sizeof (WCHAR)); -+ memcpy (newStr, buf, len * sizeof (WCHAR)); -+ newStr[len] = 0; -+ return newStr; -+} -+ -+/* -+ * Gallium nine -+ */ -+static BOOL nine_get(void) -+{ -+ BOOL ret = 0; -+ HKEY regkey; -+ -+#if WINE_STAGING -+ if (!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\DllRedirects", ®key)) -+ { -+ DWORD type; -+ DWORD size = 0; -+ LSTATUS rc; -+ rc = RegQueryValueExA(regkey, "d3d9", 0, &type, NULL, &size); -+ if (rc != ERROR_FILE_NOT_FOUND && type == REG_SZ) -+ { -+ char *val = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size + 1); -+ if (!val) -+ { -+ RegCloseKey(regkey); -+ return 0; -+ } -+ rc = RegQueryValueExA(regkey, "d3d9", 0, &type, (LPBYTE)val, &size); -+ if (rc == ERROR_SUCCESS) -+ { -+ ret = !!val && !strcmp(val, "d3d9-nine.dll"); -+ } -+ else -+ { -+ WINE_ERR("Failed to read value 'd3d9'. rc = %d\n", rc); -+ } -+ HeapFree(GetProcessHeap(), 0, val); -+ } -+ else -+ WINE_WARN("Failed to read value 'd3d9'. rc = %d\n", rc); -+ -+ RegCloseKey(regkey); -+ } -+ else -+ { -+ WINE_ERR("Failed to open path 'HKCU\\Software\\Wine\\DllRedirects'\n"); -+ } -+#else -+ -+ CHAR buf[MAX_PATH]; -+ -+ if (!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\DllOverrides", ®key)) -+ { -+ DWORD type; -+ DWORD size = 0; -+ LSTATUS rc; -+ rc = RegQueryValueExA(regkey, "d3d9", 0, &type, NULL, &size); -+ if (rc != ERROR_FILE_NOT_FOUND && type == REG_SZ) -+ { -+ char *val = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size + 1); -+ if (!val) -+ { -+ RegCloseKey(regkey); -+ return 0; -+ } -+ rc = RegQueryValueExA(regkey, "d3d9", 0, &type, (LPBYTE)val, &size); -+ if (rc == ERROR_SUCCESS) -+ { -+ ret = !!val && !strcmp(val, "native"); -+ } -+ else -+ ret = FALSE; -+ -+ HeapFree(GetProcessHeap(), 0, val); -+ } -+ else -+ ret = FALSE; -+ -+ RegCloseKey(regkey); -+ } -+ else -+ WINE_WARN("Failed to open path 'HKCU\\Software\\Wine\\DllOverrides'\n"); -+ -+ if (!ret) -+ return ret; -+ -+ if (!nine_get_system_path(buf, sizeof(buf))) { -+ WINE_ERR("Failed to get system path\n"); -+ return FALSE; -+ } -+ -+ strcat(buf, "\\d3d9.dll"); -+ /* FIXME: Test symlink destination */ -+ ret = IsFileSymLinkA(buf); -+#endif -+ return ret; -+} -+ -+static void nine_set(BOOL status, BOOL NoOtherArch) -+{ -+ HKEY regkey; -+ -+#if WINE_STAGING -+ /* Active dll redirect */ -+ if (!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\DllRedirects", ®key)) -+ { -+ LSTATUS rc; -+ -+ if (!status) -+ { -+ rc = RegDeleteValueA(regkey, "d3d9"); -+ } -+ else -+ { -+ rc = RegSetValueExA(regkey, "d3d9", 0, REG_SZ, (LPBYTE)"d3d9-nine.dll", strlen("d3d9-nine.dll")); -+ } -+ if (rc != NO_ERROR) -+ { -+ WINE_ERR("Failed to write 'HKCU\\Software\\Wine\\DllRedirects\\d3d9'. rc = %d\n", rc); -+ } -+ RegCloseKey(regkey); -+ } -+ else -+ WINE_ERR("Failed to open path 'HKCU\\Software\\Wine\\DllRedirects'\n"); -+#else -+ CHAR dst[MAX_PATH]; -+ -+ /* Prevent infinite recursion if called from other arch already */ -+ if (!NoOtherArch) { -+ /* Started as 64bit, call 32bit process */ -+ if (isWin64()) -+ Call32bitNineWineCfg(status); -+ /* Started as 32bit, call 64bit process */ -+ else if (isWoW64()) -+ Call64bitNineWineCfg(status); -+ } -+ -+ /* enable native dll */ -+ if (!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\DllOverrides", ®key)) -+ { -+ LSTATUS rc; -+ -+ if (!status) -+ { -+ rc = RegDeleteValueA(regkey, "d3d9"); -+ } -+ else -+ { -+ rc = RegSetValueExA(regkey, "d3d9", 0, REG_SZ, (LPBYTE)"native", strlen("native")); -+ } -+ if (rc != NO_ERROR) -+ WINE_WARN("Failed to write 'HKCU\\Software\\Wine\\DllOverrides\\d3d9'. rc = %d\n", rc); -+ -+ RegCloseKey(regkey); -+ } -+ else -+ WINE_WARN("Failed to open path 'HKCU\\Software\\Wine\\DllRedirects'\n"); -+ -+ if (!nine_get_system_path(dst, sizeof(dst))) { -+ WINE_ERR("Failed to get system path\n"); -+ return; -+ } -+ strcat(dst, "\\d3d9.dll"); -+ -+ if (status) { -+ HMODULE hmod; -+ -+ /* FIXME: Test symlink destination */ -+ if (IsFileSymLinkA(dst)) -+ return; -+ -+ /* Just in case native dll has been installed */ -+ DeleteFileA(dst); -+ -+ hmod = LoadLibraryExA("d3d9-nine.dll", NULL, DONT_RESOLVE_DLL_REFERENCES); -+ if (hmod) -+ { -+#if HAVE_DLADDR -+ Dl_info info; -+ -+ if (dladdr(hmod, &info) && info.dli_fname) -+ { -+ if (!CreateSymLinkA(dst, info.dli_fname, NULL)) -+ WINE_ERR("CreateSymLinkA(%s,%s) failed\n", dst, info.dli_fname); -+ -+ } -+ else -+ WINE_ERR("dladdr failed to get file path\n"); -+#endif -+ -+ FreeLibrary(hmod); -+ } -+ else -+ WINE_ERR("d3d9-nine.dll not found.\n"); -+ } -+ else -+ DeleteFileA(dst); -+ -+#endif -+} -+ -+typedef HRESULT (WINAPI *LPDIRECT3DCREATE9EX)( UINT, void **); -+ -+static const WCHAR emptyW[1]; -+ -+static void load_staging_settings(HWND dialog) -+{ -+ HMODULE hmod = NULL; -+ char have_d3d9nine = 0; -+ char have_modpath = 0; -+ char *mod_path = NULL; -+ LPDIRECT3DCREATE9EX Direct3DCreate9ExPtr = NULL; -+ HRESULT ret = -1; -+ void *iface = NULL; -+ HKEY regkey; -+ void *handle; -+ char errbuf[1024]; -+ -+#if defined(HAVE_D3D9NINE) -+ have_d3d9nine = 1; -+#endif -+#if defined(D3D9NINE_MODULEPATH) -+ have_modpath = 1; -+ mod_path = (char*)D3D9NINE_MODULEPATH; -+#endif -+ -+ CheckDlgButton(dialog, IDC_ENABLE_NATIVE_D3D9, nine_get() ? BST_CHECKED : BST_UNCHECKED); -+ -+ SendDlgItemMessageW(dialog, IDC_NINE_STATE_TIP1, WM_SETTEXT, 1, (LPARAM)emptyW); -+ SendDlgItemMessageW(dialog, IDC_NINE_STATE_TIP2, WM_SETTEXT, 1, (LPARAM)emptyW); -+ SendDlgItemMessageW(dialog, IDC_NINE_STATE_TIP3, WM_SETTEXT, 1, (LPARAM)emptyW); -+ SendDlgItemMessageW(dialog, IDC_NINE_STATE_TIP4, WM_SETTEXT, 1, (LPARAM)emptyW); -+ SendDlgItemMessageW(dialog, IDC_NINE_STATE_TIP5, WM_SETTEXT, 1, (LPARAM)emptyW); -+ -+ CheckDlgButton(dialog, IDC_NINE_STATE1, BST_UNCHECKED); -+ CheckDlgButton(dialog, IDC_NINE_STATE2, BST_UNCHECKED); -+ CheckDlgButton(dialog, IDC_NINE_STATE3, BST_UNCHECKED); -+ CheckDlgButton(dialog, IDC_NINE_STATE4, BST_UNCHECKED); -+ CheckDlgButton(dialog, IDC_NINE_STATE5, BST_UNCHECKED); -+ -+ if (have_d3d9nine) -+ { -+ CheckDlgButton(dialog, IDC_NINE_STATE1, BST_CHECKED); -+ } -+ else -+ { -+ SendDlgItemMessageW(dialog, IDC_NINE_STATE_TIP1, WM_SETTEXT, 1, -+ (LPARAM)load_string (IDS_NINECFG_NINE_SUPPORT_NOT_COMPILED)); -+ goto out; -+ } -+ -+ if (!have_modpath && !RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Direct3DNine", ®key)) -+ { -+ DWORD type; -+ DWORD size = 0; -+ LSTATUS rc; -+ -+ rc = RegQueryValueExA(regkey, "ModulePath", 0, &type, NULL, &size); -+ if (rc != ERROR_FILE_NOT_FOUND && type == REG_SZ) -+ { -+ mod_path = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size + 1); -+ rc = RegQueryValueExA(regkey, "ModulePath", 0, &type, (LPBYTE)mod_path, &size); -+ if (rc == ERROR_SUCCESS) -+ { -+ have_modpath = 1; -+ } -+ } -+ RegCloseKey(regkey); -+ } -+ -+ if (have_modpath) -+ { -+ SendDlgItemMessageA(dialog, IDC_NINE_STATE_TIP2, WM_SETTEXT, 1, (LPARAM)mod_path); -+ CheckDlgButton(dialog, IDC_NINE_STATE2, BST_CHECKED); -+ } -+ else -+ { -+ goto out; -+ } -+ -+ handle = wine_dlopen(mod_path, RTLD_GLOBAL | RTLD_NOW, errbuf, sizeof(errbuf)); -+ if (handle) -+ { -+ CheckDlgButton(dialog, IDC_NINE_STATE3, BST_CHECKED); -+ } -+ else -+ { -+ SendDlgItemMessageA(dialog, IDC_NINE_STATE_TIP3, WM_SETTEXT, 1, (LPARAM)errbuf); -+ goto out; -+ } -+ -+ hmod = LoadLibraryA("d3d9-nine.dll"); -+ if (hmod) -+ Direct3DCreate9ExPtr = (LPDIRECT3DCREATE9EX) -+ GetProcAddress(hmod, "Direct3DCreate9Ex"); -+ -+ if (hmod && Direct3DCreate9ExPtr) -+ { -+ CheckDlgButton(dialog, IDC_NINE_STATE4, BST_CHECKED); -+ } -+ else -+ { -+ wchar_t buf[256]; -+ FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), -+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)buf, 256, NULL); -+ -+ SendDlgItemMessageW(dialog, IDC_NINE_STATE_TIP4, WM_SETTEXT, 1, (LPARAM)buf); -+ goto out; -+ } -+ -+ /* FIXME: don't leak iface here ... */ -+ ret = Direct3DCreate9ExPtr(0, &iface); -+ if (!ret && iface) -+ { -+ CheckDlgButton(dialog, IDC_NINE_STATE5, BST_CHECKED); -+ } -+ else -+ { -+ SendDlgItemMessageW(dialog, IDC_NINE_STATE_TIP5, WM_SETTEXT, 1, -+ (LPARAM)load_string (IDS_NINECFG_D3D_ERROR)); -+ goto out; -+ } -+ -+ if (hmod) -+ FreeLibrary(hmod); -+ -+ return; -+out: -+ EnableWindow(GetDlgItem(dialog, IDC_ENABLE_NATIVE_D3D9), 0); -+ -+ if (hmod) -+ FreeLibrary(hmod); -+} -+ -+BOOL ProcessCmdLine(WCHAR *cmdline) -+{ -+ WCHAR **argv; -+ int argc, i; -+ BOOL NoOtherArch = FALSE; -+ BOOL NineSet = FALSE; -+ BOOL NineClear = FALSE; -+ -+ argv = CommandLineToArgvW(cmdline, &argc); -+ -+ if (!argv) -+ return FALSE; -+ -+ if (argc == 1) -+ { -+ LocalFree(argv); -+ return FALSE; -+ } -+ -+ for (i = 1; i < argc; i++) -+ { -+ if (argv[i][0] != '/' && argv[i][0] != '-') -+ break; /* No flags specified. */ -+ -+ if (!argv[i][1] && argv[i][0] == '-') -+ break; /* '-' is a filename. It indicates we should use stdin. */ -+ -+ if (argv[i][1] && argv[i][2] && argv[i][2] != ':') -+ break; /* This is a file path beginning with '/'. */ -+ -+ switch (toupperW(argv[i][1])) -+ { -+ case '?': -+ WINE_ERR("\nSupported arguments: [ -e | -d ][ -n ]\n-e Enable nine\n-d Disable nine\n-n Do not call other arch exe\n"); -+ return TRUE; -+ case 'E': -+ NineSet = TRUE; -+ break; -+ case 'D': -+ NineClear = TRUE; -+ break; -+ case 'N': -+ NoOtherArch = TRUE; -+ break; -+ default: -+ return FALSE; -+ } -+ } -+ -+ if (NineSet && !NineClear) -+ { -+ nine_set(TRUE, NoOtherArch); -+ return TRUE; -+ } -+ else if (NineClear && !NineSet) -+ { -+ nine_set(FALSE, NoOtherArch); -+ return TRUE; -+ } -+ -+ return FALSE; -+} -+ -+static INT_PTR CALLBACK AppDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -+{ -+ switch (uMsg) -+ { -+ case WM_INITDIALOG: -+ break; -+ -+ case WM_NOTIFY: -+ if (((LPNMHDR)lParam)->code == PSN_SETACTIVE) -+ load_staging_settings(hDlg); -+ break; -+ -+ case WM_SHOWWINDOW: -+ set_window_title(hDlg); -+ break; -+ -+ case WM_DESTROY: -+ break; -+ -+ case WM_COMMAND: -+ if (HIWORD(wParam) != BN_CLICKED) break; -+ switch (LOWORD(wParam)) -+ { -+ case IDC_ENABLE_NATIVE_D3D9: -+ nine_set(IsDlgButtonChecked(hDlg, IDC_ENABLE_NATIVE_D3D9) == BST_CHECKED, FALSE); -+ SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0); -+ return TRUE; -+ } -+ break; -+ } -+ return FALSE; -+} -+ -+static INT CALLBACK -+PropSheetCallback (HWND hWnd, UINT uMsg, LPARAM lParam) -+{ -+ return 0; -+} -+ -+static INT_PTR -+doPropertySheet (HINSTANCE hInstance, HWND hOwner) -+{ -+ PROPSHEETPAGEW psp[2]; -+ PROPSHEETHEADERW psh; -+ -+ -+ psp[0].dwSize = sizeof (PROPSHEETPAGEW); -+ psp[0].dwFlags = PSP_USETITLE; -+ psp[0].hInstance = hInstance; -+ psp[0].u.pszTemplate = MAKEINTRESOURCEW (IDD_NINE); -+ psp[0].u2.pszIcon = NULL; -+ psp[0].pfnDlgProc = AppDlgProc; -+ psp[0].pszTitle = load_string (IDS_TAB_MAIN); -+ psp[0].lParam = 0; -+ -+ psp[1].dwSize = sizeof (PROPSHEETPAGEW); -+ psp[1].dwFlags = PSP_USETITLE; -+ psp[1].hInstance = hInstance; -+ psp[1].u.pszTemplate = MAKEINTRESOURCEW (IDD_ABOUT); -+ psp[1].u2.pszIcon = NULL; -+ psp[1].pfnDlgProc = NULL; -+ psp[1].pszTitle = load_string (IDS_TAB_ABOUT); -+ psp[1].lParam = 0; -+ -+ /* -+ * Fill out the PROPSHEETHEADER -+ */ -+ psh.dwSize = sizeof (PROPSHEETHEADERW); -+ psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK; -+ psh.hwndParent = hOwner; -+ psh.hInstance = hInstance; -+ psh.u.pszIcon = NULL; -+ psh.pszCaption = load_string (IDS_NINECFG_TITLE); -+ psh.nPages = sizeof(psp) / sizeof(psp[0]); -+ psh.u3.ppsp = &psp[0]; -+ psh.pfnCallback = PropSheetCallback; -+ psh.u2.nStartPage = 0; -+ -+ /* -+ * Display the modal property sheet -+ */ -+ return PropertySheetW (&psh); -+} -+ -+/***************************************************************************** -+ * Name : WinMain -+ * Description: Main windows entry point -+ * Parameters : hInstance -+ * hPrev -+ * szCmdLine -+ * nShow -+ * Returns : Program exit code -+ */ -+int WINAPI -+WinMain (HINSTANCE hInstance, HINSTANCE hPrev, LPSTR szCmdLine, int nShow) -+{ -+#if 0 -+ BOOL is_wow64; -+ -+ if (IsWow64Process( GetCurrentProcess(), &is_wow64 ) && is_wow64) -+ { -+ STARTUPINFOW si; -+ PROCESS_INFORMATION pi; -+ WCHAR filename[MAX_PATH]; -+ void *redir; -+ DWORD exit_code; -+ -+ memset( &si, 0, sizeof(si) ); -+ si.cb = sizeof(si); -+ GetModuleFileNameW( 0, filename, MAX_PATH ); -+ -+ Wow64DisableWow64FsRedirection( &redir ); -+ if (CreateProcessW( filename, GetCommandLineW(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi )) -+ { -+ WINE_TRACE( "restarting %s\n", wine_dbgstr_w(filename) ); -+ WaitForSingleObject( pi.hProcess, INFINITE ); -+ GetExitCodeProcess( pi.hProcess, &exit_code ); -+ ExitProcess( exit_code ); -+ } -+ else WINE_ERR( "failed to restart 64-bit %s, err %d\n", wine_dbgstr_w(filename), GetLastError() ); -+ Wow64RevertWow64FsRedirection( redir ); -+ } -+#endif -+ if (ProcessCmdLine(GetCommandLineW())) { -+ return 0; -+ } -+ -+ /* -+ * The next 9 lines should be all that is needed -+ * for the Wine Configuration property sheet -+ */ -+ InitCommonControls (); -+ CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); -+ if (doPropertySheet (hInstance, NULL) > 0) { -+ WINE_TRACE("OK\n"); -+ } else { -+ WINE_TRACE("Cancel\n"); -+ } -+ CoUninitialize(); -+ ExitProcess (0); -+ -+ return 0; -+} -diff --git a/programs/ninewinecfg/ninewinecfg.manifest b/programs/ninewinecfg/ninewinecfg.manifest -new file mode 100644 -index 0000000000..55a12fd052 ---- /dev/null -+++ b/programs/ninewinecfg/ninewinecfg.manifest -@@ -0,0 +1,16 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/programs/ninewinecfg/ninewinecfg.rc b/programs/ninewinecfg/ninewinecfg.rc -new file mode 100644 -index 0000000000..818a87699e ---- /dev/null -+++ b/programs/ninewinecfg/ninewinecfg.rc -@@ -0,0 +1,80 @@ -+/* -+ * WineCfg resources -+ * -+ * Copyright 2002 Jaco Greeff -+ * Copyright 2003 Dimitrie O. Paun -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ * -+ */ -+ -+#include "config.h" /* Needed for the PACKAGE_STRING definition */ -+#include "resource.h" -+ -+#pragma makedep po -+ -+LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT -+ -+STRINGTABLE -+BEGIN -+ IDS_TAB_MAIN "Global options" -+ IDS_TAB_ABOUT "About" -+ -+ IDS_NINECFG_TITLE "Nine configuration" -+ IDS_NINECFG_TITLE_APP "ninecfg" -+ IDS_NINECFG_NINE_SUPPORT_NOT_COMPILED "Tip: Run ./configure and enable nine. Make sure to set PKG_CONFIG_PATH." -+ IDS_NINECFG_NINE_LOADABLE "Tip: Make sure d3d9-nine.dll has the correct ARCH." -+ IDS_NINECFG_D3D_ERROR "Tip: Make sure that d3dadapter9.so is installed." -+ -+END -+ -+IDD_ABOUT DIALOG 0, 0, 260, 220 -+STYLE WS_CHILD | WS_DISABLED -+FONT 8, "MS Shell Dlg" -+BEGIN -+ GROUPBOX "License Wine (d3d9-nine.dll)",IDC_STATIC,8,4,244,36 -+ LTEXT "GNU Lesser General Public License, version 2.1\n",IDC_STATIC,16,16,230,8 -+ GROUPBOX "License MESA",IDC_STATIC,8,44,244,36 -+ LTEXT "MIT License\n",IDC_STATIC,16,60,230,8 -+ -+ GROUPBOX "Authors",IDC_STATIC,8,88,244,120 -+ LTEXT "Joakim Sindholt\nChristoph Bumiller\nTiziano Bacocco\nDavid Heidelberger\nAxel Davy\nNick Sarnie\nPatrick Rudolph\n\n\n\n",IDC_STATIC,16,100,230,92 -+END -+ -+IDD_NINE DIALOG 0, 0, 260, 220 -+STYLE WS_CHILD | WS_DISABLED -+FONT 8, "MS Shell Dlg" -+BEGIN -+ GROUPBOX "Gallium Nine settings",IDC_STATIC,8,4,244,60 -+ LTEXT "The following settings are experimental and may break stuff!\nMake sure to reset them again in case of a problem.\nGallium Nine requires MESA graphic drivers and AMD/Nvidia GPU.\n",IDC_STATIC,16,16,230,24 -+ CONTROL "Enable &Gallium Nine for better D3D9 graphic performance.",IDC_ENABLE_NATIVE_D3D9,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,44,230,8 -+ -+ GROUPBOX "Install state",IDC_STATIC,8,74,244,134 -+ CONTROL "Support for Gallium Nine compiled in",IDC_NINE_STATE1,"Button",BS_AUTOCHECKBOX | WS_DISABLED,16,90,230,8 -+ LTEXT "Tip",IDC_NINE_STATE_TIP1,32,98,210,8 -+ CONTROL "d3dadapter module path is set",IDC_NINE_STATE2,"Button",BS_AUTOCHECKBOX | WS_DISABLED,16,106,230,8 -+ LTEXT "Tip",IDC_NINE_STATE_TIP2,32,114,210,8 -+ CONTROL "Loading of d3d9adapter succeeded",IDC_NINE_STATE3,"Button",BS_AUTOCHECKBOX | WS_DISABLED,16,122,230,8 -+ LTEXT "Tip",IDC_NINE_STATE_TIP3,32,130,210,16 -+ CONTROL "d3d9-nine.dll is loadable",IDC_NINE_STATE4,"Button",BS_AUTOCHECKBOX | WS_DISABLED,16,146,230,8 -+ LTEXT "Tip",IDC_NINE_STATE_TIP4,32,154,210,8 -+ CONTROL "Creating a D3D9 device succeeded",IDC_NINE_STATE5,"Button",BS_AUTOCHECKBOX | WS_DISABLED,16,162,230,8 -+ LTEXT "Tip",IDC_NINE_STATE_TIP5,32,170,210,8 -+END -+ -+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -+ -+/* @makedep: ninewinecfg.manifest */ -+1 RT_MANIFEST ninewinecfg.manifest -diff --git a/programs/ninewinecfg/resource.h b/programs/ninewinecfg/resource.h -new file mode 100644 -index 0000000000..d418ea8321 ---- /dev/null -+++ b/programs/ninewinecfg/resource.h -@@ -0,0 +1,51 @@ -+/* -+ * Ninewinecfg resource definitions -+ * -+ * Copyright 2017 Patrick Rudolph -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ * -+ */ -+ -+#include -+#include -+#include -+ -+#define IDC_STATIC -1 -+#define IDS_TAB_MAIN 1 -+#define IDS_TAB_ABOUT 2 -+ -+#define IDS_NINECFG_TITLE 4 -+#define IDS_NINECFG_TITLE_APP 5 -+#define IDS_NINECFG_NINE_SUPPORT_NOT_COMPILED 6 -+#define IDS_NINECFG_NINE_LOADABLE 7 -+#define IDS_NINECFG_D3D_ERROR 8 -+ -+#define IDD_NINE 10 -+#define IDD_WINECFG 11 -+#define IDC_ENABLE_NATIVE_D3D9 12 -+#define IDC_NINE_STATE1 13 -+#define IDC_NINE_STATE2 14 -+#define IDC_NINE_STATE3 15 -+#define IDC_NINE_STATE4 16 -+#define IDC_NINE_STATE5 17 -+ -+#define IDC_NINE_STATE_TIP1 18 -+#define IDC_NINE_STATE_TIP2 19 -+#define IDC_NINE_STATE_TIP3 20 -+#define IDC_NINE_STATE_TIP4 21 -+#define IDC_NINE_STATE_TIP5 22 -+ -+#define IDD_ABOUT 24 -- -2.20.0 +2.19.2