summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Franco2016-01-18 15:33:30 +0100
committerPierre Franco2016-01-18 15:33:30 +0100
commitbbb6f55840752e219623493144055e4e8a862690 (patch)
tree92800acc9a6d2dc900657324f79d39dbffb8640f
parent7af12f90cc6f19be203ccfd70b25b86f6e43bebf (diff)
downloadaur-bbb6f55840752e219623493144055e4e8a862690.tar.gz
Updated to version 1.9.1-1
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD14
-rw-r--r--nine-1.9.1.patch (renamed from nine-1.9.0.patch)34
-rw-r--r--steam.patch2
-rw-r--r--wbemprox_query_v2.patch354
5 files changed, 200 insertions, 226 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c0cbedaebdd0..b1f64537d0dd 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,8 @@
# Generated by mksrcinfo v8
-# Mon Jan 4 17:08:41 UTC 2016
+# Mon Jan 18 14:33:16 UTC 2016
pkgbase = wine-gaming-nine
pkgdesc = Based off wine-staging, including the gallium-nine patches and some more hacks
- pkgver = 1.9.0
+ pkgver = 1.9.1
pkgrel = 1
url = http://www.wine-staging.com
install = wine.install
@@ -130,31 +130,31 @@ pkgbase = wine-gaming-nine
optdepends = cups
optdepends = samba
optdepends = dosbox
- provides = wine=1.9.0
- provides = wine-wow64=1.9.0
- provides = wine-staging=1.9.0
+ provides = wine=1.9.1
+ provides = wine-wow64=1.9.1
+ provides = wine-staging=1.9.1
conflicts = wine
conflicts = wine-wow64
conflicts = wine-staging
options = staticlibs
- source = https://github.com/wine-compholio/wine-patched/archive/staging-1.9.0.tar.gz
+ source = https://github.com/wine-compholio/wine-patched/archive/staging-1.9.1.tar.gz
source = 30-win32-aliases.conf
source = hd7700m_support.patch
source = heap_perf.patch
source = keybindings.patch
source = mipmap.patch
- source = nine-1.9.0.patch
+ source = nine-1.9.1.patch
source = steam.patch
source = wbemprox_query_v2.patch
- sha1sums = 1f05e9732d5b28f1ac46bd69e0a5d20439cf63d4
+ sha1sums = d18ac6f55a1c6333cfe6961980685fad4404c695
sha1sums = 023a5c901c6a091c56e76b6a62d141d87cce9fdb
sha1sums = 8fa4b03f68f18b4de80f10c7a43c0e99a5cb017c
sha1sums = 0f4ac455436d5714a2cf0b537ed25f4fa5c1a7fd
sha1sums = f3febb8836f38320742a546c667106608d4c4395
sha1sums = c3096fccbac23e520d03f592db7f23350cbbc0bc
- sha1sums = ad066e931f4c752406e8a4f079c7138533220bdc
- sha1sums = a7da16c5fac7d74c665e7a76bddbcd6c8333830b
- sha1sums = e26d369e9964657b481ac4b7b18c575786ec9c8c
+ sha1sums = 71d3dbd5f23436d0ea85d7477cd560787c6ae079
+ sha1sums = 74aae040fde9ff3c9e8da9c840557e87afdbc3a0
+ sha1sums = 644e141125a9f2407e64d23c85ec84a691c7caae
pkgname = wine-gaming-nine
depends = attr
diff --git a/PKGBUILD b/PKGBUILD
index be4e93077bc0..b5b6086ed42d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -10,7 +10,7 @@
# -HD7700M support (not referenced in Wine)
pkgname=wine-gaming-nine
-pkgver=1.9.0
+pkgver=1.9.1
pkgrel=1
_pkgbasever=${pkgver/rc/-rc}
@@ -22,19 +22,19 @@ source=("https://github.com/wine-compholio/wine-patched/archive/staging-$_pkgbas
heap_perf.patch
keybindings.patch
mipmap.patch
- nine-1.9.0.patch
+ nine-1.9.1.patch
steam.patch
wbemprox_query_v2.patch
)
-sha1sums=('1f05e9732d5b28f1ac46bd69e0a5d20439cf63d4'
+sha1sums=('d18ac6f55a1c6333cfe6961980685fad4404c695'
'023a5c901c6a091c56e76b6a62d141d87cce9fdb'
'8fa4b03f68f18b4de80f10c7a43c0e99a5cb017c'
'0f4ac455436d5714a2cf0b537ed25f4fa5c1a7fd'
'f3febb8836f38320742a546c667106608d4c4395'
'c3096fccbac23e520d03f592db7f23350cbbc0bc'
- 'ad066e931f4c752406e8a4f079c7138533220bdc'
- 'a7da16c5fac7d74c665e7a76bddbcd6c8333830b'
- 'e26d369e9964657b481ac4b7b18c575786ec9c8c'
+ '71d3dbd5f23436d0ea85d7477cd560787c6ae079'
+ '74aae040fde9ff3c9e8da9c840557e87afdbc3a0'
+ '644e141125a9f2407e64d23c85ec84a691c7caae'
)
pkgdesc="Based off wine-staging, including the gallium-nine patches and some more hacks"
@@ -132,7 +132,7 @@ prepare()
{
cd wine-patched-staging-$_pkgbasever
- patch -p1 < ../nine-1.9.0.patch
+ patch -p1 < ../nine-1.9.1.patch
patch -p1 < ../steam.patch
patch -p1 < ../mipmap.patch
patch -p1 < ../heap_perf.patch
diff --git a/nine-1.9.0.patch b/nine-1.9.1.patch
index 5db93574ef16..4328742bb29c 100644
--- a/nine-1.9.0.patch
+++ b/nine-1.9.1.patch
@@ -1,5 +1,5 @@
diff --git a/configure b/configure
-index ad84e74..7c257c0 100755
+index 18e02b7..e29874a 100755
--- a/configure
+++ b/configure
@@ -681,6 +681,8 @@ XSLT_LIBS
@@ -28,7 +28,7 @@ index ad84e74..7c257c0 100755
with_osmesa
with_oss
with_pcap
-@@ -1008,6 +1013,7 @@ enable_d3d10core
+@@ -1009,6 +1014,7 @@ enable_d3d10core
enable_d3d11
enable_d3d8
enable_d3d9
@@ -36,7 +36,7 @@ index ad84e74..7c257c0 100755
enable_d3dcompiler_33
enable_d3dcompiler_34
enable_d3dcompiler_35
-@@ -2220,6 +2226,9 @@ Optional Packages:
+@@ -2221,6 +2227,9 @@ Optional Packages:
--without-openal do not use OpenAL
--without-opencl do not use OpenCL
--without-opengl do not use OpenGL
@@ -46,7 +46,7 @@ index ad84e74..7c257c0 100755
--without-osmesa do not use the OSMesa library
--without-oss do not use the OSS sound support
--without-pcap do not use the Packet Capture library
-@@ -3460,6 +3469,18 @@ if test "${with_opengl+set}" = set; then :
+@@ -3461,6 +3470,18 @@ if test "${with_opengl+set}" = set; then :
fi
@@ -65,7 +65,7 @@ index ad84e74..7c257c0 100755
# Check whether --with-osmesa was given.
if test "${with_osmesa+set}" = set; then :
withval=$with_osmesa;
-@@ -6239,6 +6260,9 @@ fi
+@@ -6240,6 +6261,9 @@ fi
OPENGL_LIBS=""
@@ -75,7 +75,7 @@ index ad84e74..7c257c0 100755
# Check whether --enable-largefile was given.
if test "${enable_largefile+set}" = set; then :
-@@ -11078,6 +11102,632 @@ This is an error since --with-va was requested." "$LINENO" 5 ;;
+@@ -11083,6 +11107,632 @@ This is an error since --with-va was requested." "$LINENO" 5 ;;
esac
fi
@@ -708,7 +708,7 @@ index ad84e74..7c257c0 100755
CPPFLAGS="$ac_save_CPPFLAGS"
else
X_CFLAGS=""
-@@ -17723,6 +18373,7 @@ ac_config_commands="$ac_config_commands include/stamp-h"
+@@ -17728,6 +18378,7 @@ ac_config_commands="$ac_config_commands include/stamp-h"
$as_echo_n "creating Makefile rules..." >&6
ALL_VARS_RULES="OPENGL_LIBS = $OPENGL_LIBS
@@ -716,7 +716,7 @@ index ad84e74..7c257c0 100755
SOCKET_LIBS = $SOCKET_LIBS
COREFOUNDATION_LIBS = $COREFOUNDATION_LIBS
IOKIT_LIBS = $IOKIT_LIBS
-@@ -17742,6 +18393,8 @@ X_CFLAGS = $X_CFLAGS
+@@ -17747,6 +18398,8 @@ X_CFLAGS = $X_CFLAGS
X_PRE_LIBS = $X_PRE_LIBS
X_LIBS = $X_LIBS
X_EXTRA_LIBS = $X_EXTRA_LIBS
@@ -725,7 +725,7 @@ index ad84e74..7c257c0 100755
XML2_CFLAGS = $XML2_CFLAGS
XML2_LIBS = $XML2_LIBS
XSLT_CFLAGS = $XSLT_CFLAGS
-@@ -18011,6 +18664,7 @@ wine_fn_config_dll d3d8 enable_d3d8 implib
+@@ -18017,6 +18670,7 @@ wine_fn_config_dll d3d8 enable_d3d8 implib
wine_fn_config_test dlls/d3d8/tests d3d8_test
wine_fn_config_dll d3d9 enable_d3d9 implib
wine_fn_config_test dlls/d3d9/tests d3d9_test
@@ -734,7 +734,7 @@ index ad84e74..7c257c0 100755
wine_fn_config_dll d3dcompiler_34 enable_d3dcompiler_34
wine_fn_config_dll d3dcompiler_35 enable_d3dcompiler_35
diff --git a/configure.ac b/configure.ac
-index e999818..9893d33 100644
+index d487c75..9098d8d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,6 +67,8 @@ AC_ARG_WITH(openal, AS_HELP_STRING([--without-openal],[do not use OpenAL]),
@@ -755,7 +755,7 @@ index e999818..9893d33 100644
dnl **** Check for header files ****
AC_SYS_LARGEFILE()
-@@ -1203,6 +1207,45 @@ OpenGL and Direct3D won't be supported.])
+@@ -1205,6 +1209,45 @@ 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.])
@@ -801,7 +801,7 @@ index e999818..9893d33 100644
CPPFLAGS="$ac_save_CPPFLAGS"
else
X_CFLAGS=""
-@@ -2836,6 +2879,7 @@ WINE_CONFIG_DLL(d3d8,,[implib])
+@@ -2839,6 +2882,7 @@ WINE_CONFIG_DLL(d3d8,,[implib])
WINE_CONFIG_TEST(dlls/d3d8/tests)
WINE_CONFIG_DLL(d3d9,,[implib])
WINE_CONFIG_TEST(dlls/d3d9/tests)
@@ -4837,7 +4837,7 @@ index 098cf46..11a7065 100644
struct x11drv_escape_flush_gl_drawable
diff --git a/include/config.h.in b/include/config.h.in
-index efb82fc..0acbf38 100644
+index 8ac8388..3626e84 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -4,6 +4,12 @@
@@ -4853,7 +4853,7 @@ index efb82fc..0acbf38 100644
/* Define to a function attribute for Microsoft hotpatch assembly prefix. */
#undef DECLSPEC_HOTPATCH
-@@ -1356,6 +1362,9 @@
+@@ -1359,6 +1365,9 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
@@ -4863,7 +4863,7 @@ index efb82fc..0acbf38 100644
/* Define to the soname of the libcairo library. */
#undef SONAME_LIBCAIRO
-@@ -1371,6 +1380,9 @@
+@@ -1374,6 +1383,9 @@
/* Define to the soname of the libdbus-1 library. */
#undef SONAME_LIBDBUS_1
@@ -4873,7 +4873,7 @@ index efb82fc..0acbf38 100644
/* Define to the soname of the libfontconfig library. */
#undef SONAME_LIBFONTCONFIG
-@@ -1419,6 +1431,9 @@
+@@ -1422,6 +1434,9 @@
/* Define to the soname of the libpng library. */
#undef SONAME_LIBPNG
@@ -4883,7 +4883,7 @@ index efb82fc..0acbf38 100644
/* Define to the soname of the libsane library. */
#undef SONAME_LIBSANE
-@@ -1443,6 +1458,21 @@
+@@ -1446,6 +1461,21 @@
/* Define to the soname of the libX11 library. */
#undef SONAME_LIBX11
diff --git a/steam.patch b/steam.patch
index 0bd7396a2945..deef1b5cd8f8 100644
--- a/steam.patch
+++ b/steam.patch
@@ -1,5 +1,5 @@
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
-index 40d804d..ee6c6ce 100644
+index 6e7b23e..63eda34 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -2429,6 +2429,33 @@ static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_A
diff --git a/wbemprox_query_v2.patch b/wbemprox_query_v2.patch
index 5c55edfc4b8d..d58bcaa8b1a8 100644
--- a/wbemprox_query_v2.patch
+++ b/wbemprox_query_v2.patch
@@ -1,190 +1,164 @@
-diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
-index 2ff3f50..1f97dc9 100644
---- a/dlls/wbemprox/builtin.c
-+++ b/dlls/wbemprox/builtin.c
-@@ -2824,7 +2824,7 @@ static UINT32 get_bits_per_pixel( UINT *hres, UINT *vres )
- ReleaseDC( NULL, hdc );
- return ret;
- }
--static WCHAR *get_pnpdeviceid( DXGI_ADAPTER_DESC *desc )
-+static WCHAR *get_pnpdeviceid( DXGI_ADAPTER_DESC1 *desc )
- {
- static const WCHAR fmtW[] =
- {'P','C','I','\\','V','E','N','_','%','0','4','X','&','D','E','V','_','%','0','4','X',
-@@ -2837,14 +2837,92 @@ static WCHAR *get_pnpdeviceid( DXGI_ADAPTER_DESC *desc )
- return ret;
- }
-
--static enum fill_status fill_videocontroller( struct table *table, const struct expr *cond )
-+/* some games like to continuously ask for the video controller
-+ since dxgi is expensive, cache results for subsequent calls */
-+static IDXGIFactory1 *factory = NULL;
-+static IDXGIAdapter1 *adapter = NULL;
-+static struct record_videocontroller *static_rec = NULL;
-+
-+static void cache_videocontroller(struct record_videocontroller *rec)
-+{
-+ if (!(static_rec = heap_alloc(sizeof(struct record_videocontroller))))
-+ return;
-+
-+ static_rec->adapter_dactype = heap_strdupW( rec->adapter_dactype );
-+ static_rec->adapter_ram = rec->adapter_ram;
-+ static_rec->availability = rec->availability;
-+ static_rec->caption = heap_strdupW( rec->caption );
-+ static_rec->current_bitsperpixel = rec->current_bitsperpixel;
-+ static_rec->current_horizontalres = rec->current_horizontalres;
-+ static_rec->current_refreshrate = rec->current_refreshrate;
-+ static_rec->current_scanmode = rec->current_scanmode;
-+ static_rec->current_verticalres = rec->current_verticalres;
-+ static_rec->description = heap_strdupW( rec->description );
-+ static_rec->device_id = heap_strdupW( rec->device_id );
-+ static_rec->driverversion = heap_strdupW( rec->driverversion );
-+ static_rec->name = heap_strdupW( rec->name );
-+ static_rec->pnpdevice_id = heap_strdupW( rec->pnpdevice_id );
-+ static_rec->videoarchitecture = rec->videoarchitecture;
-+ static_rec->videomemorytype = rec->videomemorytype;
-+ static_rec->videoprocessor = heap_strdupW( rec->videoprocessor );
-+}
-+
-+static void videocontroller_from_cache(struct record_videocontroller *rec)
-+{
-+ rec->adapter_dactype = heap_strdupW( static_rec->adapter_dactype );
-+ rec->adapter_ram = static_rec->adapter_ram;
-+ rec->availability = 3; /* Running or Full Power */
-+ rec->caption = heap_strdupW( static_rec->caption );
-+ rec->current_bitsperpixel = static_rec->current_bitsperpixel;
-+ rec->current_horizontalres = static_rec->current_horizontalres;
-+ rec->current_refreshrate = 0; /* default refresh rate */
-+ rec->current_scanmode = 2; /* Unknown */
-+ rec->current_verticalres = static_rec->current_verticalres;
-+ rec->description = heap_strdupW( static_rec->description );
-+ rec->device_id = heap_strdupW( static_rec->device_id );
-+ rec->driverversion = heap_strdupW( static_rec->driverversion );
-+ rec->name = heap_strdupW( static_rec->name );
-+ rec->pnpdevice_id = heap_strdupW( static_rec->pnpdevice_id );
-+ rec->videoarchitecture = 2; /* Unknown */
-+ rec->videomemorytype = 2; /* Unknown */
-+ rec->videoprocessor = heap_strdupW( static_rec->videoprocessor );
-+}
-+
-+void free_videocontroller_cache()
- {
-+ if (!static_rec)
-+ return;
-+
-+ heap_free(static_rec->adapter_dactype);
-+ heap_free(static_rec->caption);
-+ heap_free(static_rec->description);
-+ heap_free(static_rec->device_id);
-+ heap_free(static_rec->driverversion);
-+ heap_free(static_rec->name);
-+ heap_free(static_rec->pnpdevice_id);
-+ heap_free(static_rec->videoprocessor);
-+
-+ heap_free(static_rec);
-+ static_rec = NULL;
-+
-+ if (factory)
-+ {
-+ IDXGIFactory1_Release( factory );
-+ factory = NULL;
-+ }
-
-+ if (adapter)
-+ {
-+ IDXGIAdapter1_Release( adapter );
-+ adapter = NULL;
-+ }
-+}
-+
-+static enum fill_status fill_videocontroller( struct table *table, const struct expr *cond )
-+{
- struct record_videocontroller *rec;
- HRESULT hr;
-- IDXGIFactory *factory = NULL;
-- IDXGIAdapter *adapter = NULL;
-- DXGI_ADAPTER_DESC desc;
-+ DXGI_ADAPTER_DESC1 desc;
- UINT hres = 1024, vres = 768, vidmem = 512 * 1024 * 1024;
- const WCHAR *name = videocontroller_deviceidW;
- enum fill_status status = FILL_STATUS_UNFILTERED;
-@@ -2852,14 +2930,24 @@ static enum fill_status fill_videocontroller( struct table *table, const struct
-
- if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
-
-+ rec = (struct record_videocontroller *)table->data;
-+ if (static_rec && factory && IDXGIFactory1_IsCurrent(factory))
-+ {
-+ TRACE("using cached data at %p\n", static_rec);
-+ videocontroller_from_cache(rec);
-+ goto done_cached;
-+ }
-+
-+ free_videocontroller_cache();
-+
- memset (&desc, 0, sizeof(desc));
-- hr = CreateDXGIFactory( &IID_IDXGIFactory, (void **)&factory );
-+ hr = CreateDXGIFactory1( &IID_IDXGIFactory, (void **)&factory );
- if (FAILED(hr)) goto done;
-
-- hr = IDXGIFactory_EnumAdapters( factory, 0, &adapter );
-+ hr = IDXGIFactory1_EnumAdapters1( factory, 0, &adapter );
- if (FAILED(hr)) goto done;
-
-- hr = IDXGIAdapter_GetDesc( adapter, &desc );
-+ hr = IDXGIAdapter1_GetDesc1( adapter, &desc );
- if (SUCCEEDED(hr))
- {
- vidmem = desc.DedicatedVideoMemory;
-@@ -2867,7 +2955,6 @@ static enum fill_status fill_videocontroller( struct table *table, const struct
- }
-
- done:
-- rec = (struct record_videocontroller *)table->data;
- rec->adapter_dactype = videocontroller_dactypeW;
- rec->adapter_ram = vidmem;
- rec->availability = 3; /* Running or Full Power */
-@@ -2885,14 +2972,15 @@ done:
- rec->videoarchitecture = 2; /* Unknown */
- rec->videomemorytype = 2; /* Unknown */
- rec->videoprocessor = heap_strdupW( name );
-+ cache_videocontroller(rec);
-+
-+done_cached:
- if (!match_row( table, row, cond, &status )) free_row_values( table, row );
- else row++;
-
- TRACE("created %u rows\n", row);
- table->num_rows = row;
-
-- if (adapter) IDXGIAdapter_Release( adapter );
-- if (factory) IDXGIFactory_Release( factory );
- return status;
- }
-
-diff --git a/dlls/wbemprox/main.c b/dlls/wbemprox/main.c
-index e6ccd5c..feb489f 100644
---- a/dlls/wbemprox/main.c
-+++ b/dlls/wbemprox/main.c
-@@ -123,6 +123,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
- DisableThreadLibraryCalls(hinstDLL);
- init_table_list();
- break;
-+ case DLL_PROCESS_DETACH:
-+ free_videocontroller_cache();
-+ break;
- }
-
- return TRUE;
-diff --git a/dlls/wbemprox/wbemprox_private.h b/dlls/wbemprox/wbemprox_private.h
-index ba25a02..de16fb7 100644
---- a/dlls/wbemprox/wbemprox_private.h
-+++ b/dlls/wbemprox/wbemprox_private.h
-@@ -186,6 +186,7 @@ void free_columns( struct column *, UINT ) DECLSPEC_HIDDEN;
- void free_row_values( const struct table *, UINT ) DECLSPEC_HIDDEN;
- void clear_table( struct table * ) DECLSPEC_HIDDEN;
- void free_table( struct table * ) DECLSPEC_HIDDEN;
-+void free_videocontroller_cache(void) DECLSPEC_HIDDEN;
- UINT get_type_size( CIMTYPE ) DECLSPEC_HIDDEN;
- HRESULT eval_cond( const struct table *, UINT, const struct expr *, LONGLONG *, UINT * ) DECLSPEC_HIDDEN;
- HRESULT get_column_index( const struct table *, const WCHAR *, UINT * ) DECLSPEC_HIDDEN; \ No newline at end of file
+diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
+index 13f708f..ddb8d7d 100644
+--- a/dlls/wbemprox/builtin.c
++++ b/dlls/wbemprox/builtin.c
+@@ -2927,7 +2927,7 @@ static UINT32 get_bits_per_pixel( UINT *hres, UINT *vres )
+ ReleaseDC( NULL, hdc );
+ return ret;
+ }
+-static WCHAR *get_pnpdeviceid( DXGI_ADAPTER_DESC *desc )
++static WCHAR *get_pnpdeviceid( DXGI_ADAPTER_DESC1 *desc )
+ {
+ static const WCHAR fmtW[] =
+ {'P','C','I','\\','V','E','N','_','%','0','4','X','&','D','E','V','_','%','0','4','X',
+@@ -2940,14 +2940,93 @@ static WCHAR *get_pnpdeviceid( DXGI_ADAPTER_DESC *desc )
+ return ret;
+ }
+
++/* some games like to continuously ask for the video controller
++ since dxgi is expensive, cache results for subsequent calls */
++static IDXGIFactory1 *factory = NULL;
++static IDXGIAdapter1 *adapter = NULL;
++static struct record_videocontroller *static_rec = NULL;
++
++static void cache_videocontroller(struct record_videocontroller *rec)
++{
++ if (!(static_rec = heap_alloc(sizeof(struct record_videocontroller))))
++ return;
++
++ static_rec->adapter_dactype = heap_strdupW( rec->adapter_dactype );
++ static_rec->adapter_ram = rec->adapter_ram;
++ static_rec->availability = rec->availability;
++ static_rec->caption = heap_strdupW( rec->caption );
++ static_rec->current_bitsperpixel = rec->current_bitsperpixel;
++ static_rec->current_horizontalres = rec->current_horizontalres;
++ static_rec->current_refreshrate = rec->current_refreshrate;
++ static_rec->current_scanmode = rec->current_scanmode;
++ static_rec->current_verticalres = rec->current_verticalres;
++ static_rec->description = heap_strdupW( rec->description );
++ static_rec->device_id = heap_strdupW( rec->device_id );
++ static_rec->driverversion = heap_strdupW( rec->driverversion );
++ static_rec->name = heap_strdupW( rec->name );
++ static_rec->pnpdevice_id = heap_strdupW( rec->pnpdevice_id );
++ static_rec->videoarchitecture = rec->videoarchitecture;
++ static_rec->videomemorytype = rec->videomemorytype;
++ static_rec->videoprocessor = heap_strdupW( rec->videoprocessor );
++}
++
++static void videocontroller_from_cache(struct record_videocontroller *rec)
++{
++ rec->adapter_dactype = heap_strdupW( static_rec->adapter_dactype );
++ rec->adapter_ram = static_rec->adapter_ram;
++ rec->availability = 3; /* Running or Full Power */
++ rec->caption = heap_strdupW( static_rec->caption );
++ rec->current_bitsperpixel = static_rec->current_bitsperpixel;
++ rec->current_horizontalres = static_rec->current_horizontalres;
++ rec->current_refreshrate = 0; /* default refresh rate */
++ rec->current_scanmode = 2; /* Unknown */
++ rec->current_verticalres = static_rec->current_verticalres;
++ rec->description = heap_strdupW( static_rec->description );
++ rec->device_id = heap_strdupW( static_rec->device_id );
++ rec->driverversion = heap_strdupW( static_rec->driverversion );
++ rec->name = heap_strdupW( static_rec->name );
++ rec->pnpdevice_id = heap_strdupW( static_rec->pnpdevice_id );
++ rec->videoarchitecture = 2; /* Unknown */
++ rec->videomemorytype = 2; /* Unknown */
++ rec->videoprocessor = heap_strdupW( static_rec->videoprocessor );
++}
++
++void free_videocontroller_cache()
++{
++ if (!static_rec)
++ return;
++
++ heap_free(static_rec->adapter_dactype);
++ heap_free(static_rec->caption);
++ heap_free(static_rec->description);
++ heap_free(static_rec->device_id);
++ heap_free(static_rec->driverversion);
++ heap_free(static_rec->name);
++ heap_free(static_rec->pnpdevice_id);
++ heap_free(static_rec->videoprocessor);
++
++ heap_free(static_rec);
++ static_rec = NULL;
++
++ if (factory)
++ {
++ IDXGIFactory1_Release( factory );
++ factory = NULL;
++ }
++
++ if (adapter)
++ {
++ IDXGIAdapter1_Release( adapter );
++ adapter = NULL;
++ }
++}
++
+ static enum fill_status fill_videocontroller( struct table *table, const struct expr *cond )
+ {
+ static const WCHAR fmtW[] = {'%','u',' ','x',' ','%','u',' ','x',' ','%','I','6','4','u',' ','c','o','l','o','r','s',0};
+ struct record_videocontroller *rec;
+ HRESULT hr;
+- IDXGIFactory *factory = NULL;
+- IDXGIAdapter *adapter = NULL;
+- DXGI_ADAPTER_DESC desc;
++ DXGI_ADAPTER_DESC1 desc;
+ UINT row = 0, hres = 1024, vres = 768, vidmem = 512 * 1024 * 1024;
+ const WCHAR *name = videocontroller_deviceidW;
+ enum fill_status status = FILL_STATUS_UNFILTERED;
+@@ -2955,14 +3034,24 @@ static enum fill_status fill_videocontroller( struct table *table, const struct
+
+ if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED;
+
++ rec = (struct record_videocontroller *)table->data;
++ if (static_rec && factory && IDXGIFactory1_IsCurrent(factory))
++ {
++ TRACE("using cached data at %p\n", static_rec);
++ videocontroller_from_cache(rec);
++ goto done_cached;
++ }
++
++ free_videocontroller_cache();
++
+ memset (&desc, 0, sizeof(desc));
+- hr = CreateDXGIFactory( &IID_IDXGIFactory, (void **)&factory );
++ hr = CreateDXGIFactory1( &IID_IDXGIFactory, (void **)&factory );
+ if (FAILED(hr)) goto done;
+
+- hr = IDXGIFactory_EnumAdapters( factory, 0, &adapter );
++ hr = IDXGIFactory1_EnumAdapters1( factory, 0, &adapter );
+ if (FAILED(hr)) goto done;
+
+- hr = IDXGIAdapter_GetDesc( adapter, &desc );
++ hr = IDXGIAdapter1_GetDesc1( adapter, &desc );
+ if (SUCCEEDED(hr))
+ {
+ vidmem = desc.DedicatedVideoMemory;
+@@ -2970,7 +3059,6 @@ static enum fill_status fill_videocontroller( struct table *table, const struct
+ }
+
+ done:
+- rec = (struct record_videocontroller *)table->data;
+ rec->adapter_dactype = videocontroller_dactypeW;
+ rec->adapter_ram = vidmem;
+ rec->availability = 3; /* Running or Full Power */
+@@ -2990,14 +3078,15 @@ done:
+ wsprintfW( mode, fmtW, hres, vres, (UINT64)1 << rec->current_bitsperpixel );
+ rec->videomodedescription = heap_strdupW( mode );
+ rec->videoprocessor = heap_strdupW( name );
++ cache_videocontroller(rec);
++
++done_cached:
+ if (!match_row( table, row, cond, &status )) free_row_values( table, row );
+ else row++;
+
+ TRACE("created %u rows\n", row);
+ table->num_rows = row;
+
+- if (adapter) IDXGIAdapter_Release( adapter );
+- if (factory) IDXGIFactory_Release( factory );
+ return status;
+ }
+