You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Compare commits
108 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
7d92cd315b | ||
|
3931c93628 | ||
|
813de5d6f8 | ||
|
dfc3b0f583 | ||
|
3e39e3132b | ||
|
76ba9d2387 | ||
|
d4918b4305 | ||
|
dcd4faf1c9 | ||
|
7557b3e2eb | ||
|
4b12c5a4e3 | ||
|
ca73dc62cd | ||
|
4147635dfc | ||
|
4e6a477acd | ||
|
169c49055d | ||
|
7b0b95ee53 | ||
|
1785a56934 | ||
|
f2d1cc1a8c | ||
|
8a46f19ece | ||
|
d33cdb84fd | ||
|
69a4e4baa2 | ||
|
2ad422ff4d | ||
|
a8b95783eb | ||
|
4581daea3b | ||
|
77d29cbee9 | ||
|
f90eb74f8d | ||
|
abc772e286 | ||
|
2c2eabb5c0 | ||
|
75637c26ea | ||
|
4e0031b058 | ||
|
0d8d1f0447 | ||
|
029c249e78 | ||
|
8d4d0a840e | ||
|
767b90c5dd | ||
|
a23c076055 | ||
|
e2c2447841 | ||
|
4861c47f2b | ||
|
437038604a | ||
|
4c160ec82a | ||
|
528144a4ad | ||
|
76900de5bb | ||
|
776306026a | ||
|
c4c72e90ab | ||
|
f8c3c9a6f8 | ||
|
39678da196 | ||
|
be8a670b5b | ||
|
4d11895651 | ||
|
bf3fbb7bdf | ||
|
160a5024b4 | ||
|
f36c844f11 | ||
|
732ab97a7e | ||
|
46fbb7d31e | ||
|
44d1a45e98 | ||
|
f23b6cb7dc | ||
|
4d01e48843 | ||
|
90109a5fc5 | ||
|
e8abb98858 | ||
|
56b4eed468 | ||
|
755d1ca559 | ||
|
001ea51fb5 | ||
|
db80e169c7 | ||
|
7757a2d4f6 | ||
|
1a980ed93d | ||
|
528306ccb6 | ||
|
7fe7d87f09 | ||
|
805f2e9252 | ||
|
18f7125892 | ||
|
f993930ee6 | ||
|
2a9e87abea | ||
|
af97ec8ce0 | ||
|
b14430433d | ||
|
f9d1798edb | ||
|
e5da84dc36 | ||
|
75c7644c3d | ||
|
7c7868f4bb | ||
|
d1a8b6bc14 | ||
|
53b02cd0ee | ||
|
36b8b8cc65 | ||
|
13536af59c | ||
|
a6f3bd989e | ||
|
0830db32cd | ||
|
cd7d77fe36 | ||
|
2e9977f4ac | ||
|
a1246b5e92 | ||
|
676dd02663 | ||
|
648db00708 | ||
|
6bfaa3b0a5 | ||
|
cbf7f73313 | ||
|
c896e5cb69 | ||
|
4d65ec9456 | ||
|
d14250ab03 | ||
|
789f5c7c64 | ||
|
69cb47fd36 | ||
|
8450903b5c | ||
|
ffe93505d2 | ||
|
5213d551f8 | ||
|
e61a75f75f | ||
|
7428dd8656 | ||
|
40e84b052b | ||
|
92b2688a74 | ||
|
f7eec766a5 | ||
|
b4e0277488 | ||
|
f54b943bca | ||
|
6138369b4f | ||
|
59fe96c14c | ||
|
afdf5020ff | ||
|
2fc5c88068 | ||
|
ad3de029e7 | ||
|
4ff3984c49 |
@@ -1,4 +1,4 @@
|
||||
From d216f85a593a09e7983d9178fb3e1f20bfcf08cc Mon Sep 17 00:00:00 2001
|
||||
From 449d193d2cc9255387903c16fe803219fa63f29a Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Thu, 29 May 2014 23:43:45 +0200
|
||||
Subject: [PATCH] loader: Add commandline option --patches to show the patch
|
||||
@@ -14,7 +14,7 @@ Subject: [PATCH] loader: Add commandline option --patches to show the patch
|
||||
6 files changed, 58 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/misc.c b/dlls/ntdll/misc.c
|
||||
index c29a1c26c..8906e1942 100644
|
||||
index c29a1c26c26..8906e194272 100644
|
||||
--- a/dlls/ntdll/misc.c
|
||||
+++ b/dlls/ntdll/misc.c
|
||||
@@ -60,6 +60,14 @@ const char * CDECL NTDLL_wine_get_version(void)
|
||||
@@ -33,10 +33,10 @@ index c29a1c26c..8906e1942 100644
|
||||
* wine_get_build_id (NTDLL.@)
|
||||
*/
|
||||
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
|
||||
index 7aa953ca6..cf7d5b6f9 100644
|
||||
index 4f5fa8c21d4..f4784428e2e 100644
|
||||
--- a/dlls/ntdll/ntdll.spec
|
||||
+++ b/dlls/ntdll/ntdll.spec
|
||||
@@ -1566,6 +1566,7 @@
|
||||
@@ -1575,6 +1575,7 @@
|
||||
|
||||
# Version
|
||||
@ cdecl wine_get_version() NTDLL_wine_get_version
|
||||
@@ -45,22 +45,22 @@ index 7aa953ca6..cf7d5b6f9 100644
|
||||
@ cdecl wine_get_host_version(ptr ptr) NTDLL_wine_get_host_version
|
||||
|
||||
diff --git a/include/wine/library.h b/include/wine/library.h
|
||||
index a6fe28059..511bf4722 100644
|
||||
index 090b8349559..b8a4a2df576 100644
|
||||
--- a/include/wine/library.h
|
||||
+++ b/include/wine/library.h
|
||||
@@ -47,6 +47,7 @@ extern const char *wine_get_data_dir(void);
|
||||
extern const char *wine_get_server_dir(void);
|
||||
extern const char *wine_get_user_name(void);
|
||||
@@ -42,6 +42,7 @@ extern "C" {
|
||||
/* configuration */
|
||||
|
||||
extern const char *wine_get_version(void);
|
||||
+extern const void *wine_get_patches(void);
|
||||
extern const char *wine_get_build_id(void);
|
||||
extern void wine_init_argv0_path( const char *argv0 );
|
||||
extern void wine_exec_wine_binary( const char *name, char **argv, const char *env_var );
|
||||
diff --git a/libs/wine/config.c b/libs/wine/config.c
|
||||
index 2a3314cbf..5b66c063d 100644
|
||||
index f5b4c0de9af..e52739d55ad 100644
|
||||
--- a/libs/wine/config.c
|
||||
+++ b/libs/wine/config.c
|
||||
@@ -504,6 +504,12 @@ const char *wine_get_version(void)
|
||||
@@ -515,6 +515,12 @@ const char *wine_get_version(void)
|
||||
return PACKAGE_VERSION;
|
||||
}
|
||||
|
||||
@@ -74,22 +74,22 @@ index 2a3314cbf..5b66c063d 100644
|
||||
const char *wine_get_build_id(void)
|
||||
{
|
||||
diff --git a/libs/wine/wine.map b/libs/wine/wine.map
|
||||
index 3f2c430fa..ca46979f5 100644
|
||||
index 1143b129734..55f874d3e74 100644
|
||||
--- a/libs/wine/wine.map
|
||||
+++ b/libs/wine/wine.map
|
||||
@@ -28,6 +28,7 @@ WINE_1.0
|
||||
wine_get_ss;
|
||||
wine_get_user_name;
|
||||
@@ -13,6 +13,7 @@ WINE_1.0
|
||||
wine_exec_wine_binary;
|
||||
wine_get_build_id;
|
||||
wine_get_version;
|
||||
+ wine_get_patches;
|
||||
wine_init;
|
||||
wine_init_argv0_path;
|
||||
wine_ldt_alloc_entries;
|
||||
wine_mmap_add_reserved_area;
|
||||
diff --git a/loader/main.c b/loader/main.c
|
||||
index f197cf802..f6629128d 100644
|
||||
index 407c897892d..d97d6b28bf8 100644
|
||||
--- a/loader/main.c
|
||||
+++ b/loader/main.c
|
||||
@@ -54,7 +54,8 @@ static void check_command_line( int argc, char *argv[] )
|
||||
@@ -53,7 +53,8 @@ static void check_command_line( int argc, char *argv[] )
|
||||
static const char usage[] =
|
||||
"Usage: wine PROGRAM [ARGUMENTS...] Run the specified program\n"
|
||||
" wine --help Display this help and exit\n"
|
||||
@@ -99,7 +99,7 @@ index f197cf802..f6629128d 100644
|
||||
|
||||
if (argc <= 1)
|
||||
{
|
||||
@@ -71,6 +72,45 @@ static void check_command_line( int argc, char *argv[] )
|
||||
@@ -70,6 +71,45 @@ static void check_command_line( int argc, char *argv[] )
|
||||
printf( "%s\n", wine_get_build_id() );
|
||||
exit(0);
|
||||
}
|
||||
@@ -146,5 +146,5 @@ index f197cf802..f6629128d 100644
|
||||
|
||||
|
||||
--
|
||||
2.25.0
|
||||
2.26.2
|
||||
|
||||
|
@@ -1,313 +0,0 @@
|
||||
From c07a490a6950f4efe563e38ca78b1aa459dfad86 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Wed, 28 May 2014 19:50:51 +0200
|
||||
Subject: [PATCH] loader: Add commandline option --check-libs.
|
||||
|
||||
---
|
||||
include/wine/library.h | 2 +
|
||||
libs/wine/config.c | 124 +++++++++++++++++++++++++++++++++++++++++
|
||||
libs/wine/loader.c | 36 ++++++++++++
|
||||
libs/wine/wine.map | 2 +
|
||||
loader/main.c | 50 ++++++++++++++++-
|
||||
5 files changed, 213 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/wine/library.h b/include/wine/library.h
|
||||
index 511bf4722..557cec20c 100644
|
||||
--- a/include/wine/library.h
|
||||
+++ b/include/wine/library.h
|
||||
@@ -44,6 +44,7 @@ extern "C" {
|
||||
extern const char *wine_get_build_dir(void);
|
||||
extern const char *wine_get_config_dir(void);
|
||||
extern const char *wine_get_data_dir(void);
|
||||
+extern const char **wine_get_libs(void);
|
||||
extern const char *wine_get_server_dir(void);
|
||||
extern const char *wine_get_user_name(void);
|
||||
extern const char *wine_get_version(void);
|
||||
@@ -56,6 +57,7 @@ extern void wine_exec_wine_binary( const char *name, char **argv, const char *en
|
||||
|
||||
typedef void (*load_dll_callback_t)( void *, const char * );
|
||||
|
||||
+extern int wine_dladdr( void *addr, void *info, char *error, size_t errorsize );
|
||||
extern void *wine_dlopen( const char *filename, int flag, char *error, size_t errorsize );
|
||||
extern void *wine_dlsym( void *handle, const char *symbol, char *error, size_t errorsize );
|
||||
extern int wine_dlclose( void *handle, char *error, size_t errorsize );
|
||||
diff --git a/libs/wine/config.c b/libs/wine/config.c
|
||||
index 5b66c063d..e0988513e 100644
|
||||
--- a/libs/wine/config.c
|
||||
+++ b/libs/wine/config.c
|
||||
@@ -470,6 +470,130 @@ const char *wine_get_build_dir(void)
|
||||
return build_dir;
|
||||
}
|
||||
|
||||
+const char *wine_libs[] = {
|
||||
+#ifdef SONAME_LIBCAIRO
|
||||
+ SONAME_LIBCAIRO,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBCAPI20
|
||||
+ SONAME_LIBCAPI20,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBCUPS
|
||||
+ SONAME_LIBCUPS,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBCURSES
|
||||
+ SONAME_LIBCURSES,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBDBUS_1
|
||||
+ SONAME_LIBDBUS_1,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBFONTCONFIG
|
||||
+ SONAME_LIBFONTCONFIG,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBFREETYPE
|
||||
+ SONAME_LIBFREETYPE,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBGL
|
||||
+ SONAME_LIBGL,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBGNUTLS
|
||||
+ SONAME_LIBGNUTLS,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBGOBJECT_2_0
|
||||
+ SONAME_LIBGOBJECT_2_0,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBGSM
|
||||
+ SONAME_LIBGSM,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBGTK_3
|
||||
+ SONAME_LIBGTK_3,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBHAL
|
||||
+ SONAME_LIBHAL,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBJPEG
|
||||
+ SONAME_LIBJPEG,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBNCURSES
|
||||
+ SONAME_LIBNCURSES,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBNETAPI
|
||||
+ SONAME_LIBNETAPI,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBODBC
|
||||
+ SONAME_LIBODBC,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBOSMESA
|
||||
+ SONAME_LIBOSMESA,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBPCAP
|
||||
+ SONAME_LIBPCAP,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBPNG
|
||||
+ SONAME_LIBPNG,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBSANE
|
||||
+ SONAME_LIBSANE,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBTIFF
|
||||
+ SONAME_LIBTIFF,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBTXC_DXTN
|
||||
+ SONAME_LIBTXC_DXTN,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBV4L1
|
||||
+ SONAME_LIBV4L1,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBVA
|
||||
+ SONAME_LIBVA,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBVA_DRM
|
||||
+ SONAME_LIBVA_DRM,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBVA_X11
|
||||
+ SONAME_LIBVA_X11,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBX11
|
||||
+ SONAME_LIBX11,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBX11_XCB
|
||||
+ SONAME_LIBX11_XCB,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBXCOMPOSITE
|
||||
+ SONAME_LIBXCOMPOSITE,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBXCURSOR
|
||||
+ SONAME_LIBXCURSOR,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBXEXT
|
||||
+ SONAME_LIBXEXT,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBXI
|
||||
+ SONAME_LIBXI,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBXINERAMA
|
||||
+ SONAME_LIBXINERAMA,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBXRANDR
|
||||
+ SONAME_LIBXRANDR,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBXRENDER
|
||||
+ SONAME_LIBXRENDER,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBXSLT
|
||||
+ SONAME_LIBXSLT,
|
||||
+#endif
|
||||
+#ifdef SONAME_LIBXXF86VM
|
||||
+ SONAME_LIBXXF86VM,
|
||||
+#endif
|
||||
+ NULL
|
||||
+};
|
||||
+
|
||||
+/* return the list of shared libs used by wine */
|
||||
+const char **wine_get_libs(void)
|
||||
+{
|
||||
+ return &wine_libs[0];
|
||||
+}
|
||||
+
|
||||
/* return the full name of the server directory (the one containing the socket) */
|
||||
const char *wine_get_server_dir(void)
|
||||
{
|
||||
diff --git a/libs/wine/loader.c b/libs/wine/loader.c
|
||||
index 2a569f5b7..5f10c3f9d 100644
|
||||
--- a/libs/wine/loader.c
|
||||
+++ b/libs/wine/loader.c
|
||||
@@ -1072,6 +1072,42 @@ void *wine_dlopen( const char *filename, int flag, char *error, size_t errorsize
|
||||
return ret;
|
||||
}
|
||||
|
||||
+/***********************************************************************
|
||||
+ * wine_dladdr
|
||||
+ */
|
||||
+int wine_dladdr( void *addr, void *info, char *error, size_t errorsize )
|
||||
+{
|
||||
+#ifdef HAVE_DLADDR
|
||||
+ int ret;
|
||||
+ const char *s;
|
||||
+ dlerror(); dlerror();
|
||||
+ ret = dladdr( addr, (Dl_info *)info );
|
||||
+ s = dlerror();
|
||||
+ if (error && errorsize)
|
||||
+ {
|
||||
+ if (s)
|
||||
+ {
|
||||
+ size_t len = strlen(s);
|
||||
+ if (len >= errorsize) len = errorsize - 1;
|
||||
+ memcpy( error, s, len );
|
||||
+ error[len] = 0;
|
||||
+ }
|
||||
+ else error[0] = 0;
|
||||
+ }
|
||||
+ dlerror();
|
||||
+ return ret;
|
||||
+#else
|
||||
+ if (error)
|
||||
+ {
|
||||
+ static const char msg[] = "dladdr interface not detected by configure";
|
||||
+ size_t len = min( errorsize, sizeof(msg) );
|
||||
+ memcpy( error, msg, len );
|
||||
+ error[len - 1] = 0;
|
||||
+ }
|
||||
+ return 0;
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
/***********************************************************************
|
||||
* wine_dlsym
|
||||
*/
|
||||
diff --git a/libs/wine/wine.map b/libs/wine/wine.map
|
||||
index ca46979f5..22a4e73b0 100644
|
||||
--- a/libs/wine/wine.map
|
||||
+++ b/libs/wine/wine.map
|
||||
@@ -9,6 +9,7 @@ WINE_1.0
|
||||
wine_anon_mmap;
|
||||
wine_casemap_lower;
|
||||
wine_casemap_upper;
|
||||
+ wine_dladdr;
|
||||
wine_dlclose;
|
||||
wine_dll_enum_load_path;
|
||||
wine_dll_set_callback;
|
||||
@@ -24,6 +25,7 @@ WINE_1.0
|
||||
wine_get_es;
|
||||
wine_get_fs;
|
||||
wine_get_gs;
|
||||
+ wine_get_libs;
|
||||
wine_get_server_dir;
|
||||
wine_get_ss;
|
||||
wine_get_user_name;
|
||||
diff --git a/loader/main.c b/loader/main.c
|
||||
index f6629128d..a2dc40c51 100644
|
||||
--- a/loader/main.c
|
||||
+++ b/loader/main.c
|
||||
@@ -36,6 +36,12 @@
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
+#ifdef HAVE_DLADDR
|
||||
+# include <dlfcn.h>
|
||||
+#endif
|
||||
+#ifdef HAVE_LINK_H
|
||||
+# include <link.h>
|
||||
+#endif
|
||||
#include <pthread.h>
|
||||
|
||||
#include "wine/library.h"
|
||||
@@ -55,7 +61,8 @@ static void check_command_line( int argc, char *argv[] )
|
||||
"Usage: wine PROGRAM [ARGUMENTS...] Run the specified program\n"
|
||||
" wine --help Display this help and exit\n"
|
||||
" wine --version Output version information and exit\n"
|
||||
- " wine --patches Output patch information and exit";
|
||||
+ " wine --patches Output patch information and exit\n"
|
||||
+ " wine --check-libs Checks if shared libs are installed";
|
||||
|
||||
if (argc <= 1)
|
||||
{
|
||||
@@ -111,6 +118,47 @@ static void check_command_line( int argc, char *argv[] )
|
||||
|
||||
exit(0);
|
||||
}
|
||||
+ if (!strcmp( argv[1], "--check-libs" ))
|
||||
+ {
|
||||
+ void* lib_handle;
|
||||
+ int ret = 0;
|
||||
+ const char **wine_libs = wine_get_libs();
|
||||
+
|
||||
+ for(; *wine_libs; wine_libs++)
|
||||
+ {
|
||||
+ lib_handle = wine_dlopen( *wine_libs, RTLD_NOW, NULL, 0 );
|
||||
+ if (lib_handle)
|
||||
+ {
|
||||
+ #ifdef HAVE_DLADDR
|
||||
+ Dl_info libinfo;
|
||||
+ void* symbol;
|
||||
+
|
||||
+ #ifdef HAVE_LINK_H
|
||||
+ struct link_map *lm = (struct link_map *)lib_handle;
|
||||
+ symbol = (void *)lm->l_addr;
|
||||
+ #else
|
||||
+ symbol = wine_dlsym( lib_handle, "_init", NULL, 0 );
|
||||
+ #endif
|
||||
+ if (symbol && wine_dladdr( symbol, &libinfo, NULL, 0 ))
|
||||
+ {
|
||||
+ printf( "%s: %s\n", *wine_libs, libinfo.dli_fname );
|
||||
+ }
|
||||
+ else
|
||||
+ #endif
|
||||
+ {
|
||||
+ printf( "%s: found\n", *wine_libs );
|
||||
+ }
|
||||
+ wine_dlclose( lib_handle, NULL, 0 );
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ printf( "%s: missing\n", *wine_libs );
|
||||
+ ret = 1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ exit(ret);
|
||||
+ }
|
||||
}
|
||||
|
||||
|
||||
--
|
||||
2.25.0
|
||||
|
@@ -1,60 +0,0 @@
|
||||
From 07ca5e888c3265c57c88ef1758e6c47fbea4fb07 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 27 Jun 2015 19:28:51 +0200
|
||||
Subject: loader: Print library paths for --check-libs on Mac OS X.
|
||||
|
||||
---
|
||||
loader/main.c | 30 +++++++++++++++++++++++++++++-
|
||||
1 file changed, 29 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/loader/main.c b/loader/main.c
|
||||
index a2dc40c51c..1642fb0965 100644
|
||||
--- a/loader/main.c
|
||||
+++ b/loader/main.c
|
||||
@@ -50,6 +50,30 @@
|
||||
/* the preloader will set this variable */
|
||||
const struct wine_preload_info *wine_main_preload_info = NULL;
|
||||
|
||||
+#ifdef __APPLE__
|
||||
+#include <mach-o/dyld.h>
|
||||
+
|
||||
+static const char *get_macho_library_path( const char *libname )
|
||||
+{
|
||||
+ unsigned int path_len, libname_len = strlen( libname );
|
||||
+ uint32_t i, count = _dyld_image_count();
|
||||
+
|
||||
+ for (i = 0; i < count; i++)
|
||||
+ {
|
||||
+ const char *path = _dyld_get_image_name( i );
|
||||
+ if (!path) continue;
|
||||
+
|
||||
+ path_len = strlen( path );
|
||||
+ if (path_len < libname_len + 1) continue;
|
||||
+ if (path[path_len - libname_len - 1] != '/') continue;
|
||||
+ if (strcmp( path + path_len - libname_len, libname )) continue;
|
||||
+
|
||||
+ return path;
|
||||
+ }
|
||||
+ return NULL;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
/***********************************************************************
|
||||
* check_command_line
|
||||
*
|
||||
@@ -146,7 +170,11 @@ static void check_command_line( int argc, char *argv[] )
|
||||
else
|
||||
#endif
|
||||
{
|
||||
- printf( "%s: found\n", *wine_libs );
|
||||
+ const char *path = NULL;
|
||||
+ #ifdef __APPLE__
|
||||
+ path = get_macho_library_path( *wine_libs );
|
||||
+ #endif
|
||||
+ printf( "%s: %s\n", *wine_libs, path ? path : "found");
|
||||
}
|
||||
wine_dlclose( lib_handle, NULL, 0 );
|
||||
}
|
||||
--
|
||||
2.14.1
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 8959c13f2be7e2a31f27c8483ee2202692f00710 Mon Sep 17 00:00:00 2001
|
||||
From bfd774b59dbfd3cc1f3b2d61d60797eb20654e96 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 5 Aug 2017 01:45:29 +0200
|
||||
Subject: [PATCH] ntdll: Add function to create new tokens for elevation
|
||||
@@ -14,10 +14,10 @@ Subject: [PATCH] ntdll: Add function to create new tokens for elevation
|
||||
6 files changed, 117 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
|
||||
index d626e0bf2..5057e2b07 100644
|
||||
index fd60ec270ba..c50e83b5aa7 100644
|
||||
--- a/dlls/ntdll/ntdll.spec
|
||||
+++ b/dlls/ntdll/ntdll.spec
|
||||
@@ -1556,6 +1556,9 @@
|
||||
@@ -1573,6 +1573,9 @@
|
||||
# Virtual memory
|
||||
@ cdecl __wine_locked_recvmsg(long ptr long)
|
||||
|
||||
@@ -28,24 +28,24 @@ index d626e0bf2..5057e2b07 100644
|
||||
@ cdecl wine_get_version() NTDLL_wine_get_version
|
||||
@ cdecl wine_get_patches() NTDLL_wine_get_patches
|
||||
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
|
||||
index ac1469412..6c2345c6c 100644
|
||||
index 2e26d189a1e..6af681e5bde 100644
|
||||
--- a/dlls/ntdll/ntdll_misc.h
|
||||
+++ b/dlls/ntdll/ntdll_misc.h
|
||||
@@ -89,6 +89,9 @@ extern void init_user_process_params( SIZE_T data_size ) DECLSPEC_HIDDEN;
|
||||
extern char **build_envp( const WCHAR *envW ) DECLSPEC_HIDDEN;
|
||||
extern NTSTATUS restart_process( RTL_USER_PROCESS_PARAMETERS *params, NTSTATUS status ) DECLSPEC_HIDDEN;
|
||||
@@ -104,6 +104,9 @@ extern int __wine_main_argc;
|
||||
extern char **__wine_main_argv;
|
||||
extern WCHAR **__wine_main_wargv;
|
||||
|
||||
+/* token */
|
||||
+extern HANDLE CDECL __wine_create_default_token(BOOL admin);
|
||||
+
|
||||
/* server support */
|
||||
extern timeout_t server_start_time DECLSPEC_HIDDEN;
|
||||
extern unsigned int server_cpus DECLSPEC_HIDDEN;
|
||||
extern const char *build_dir DECLSPEC_HIDDEN;
|
||||
extern const char *data_dir DECLSPEC_HIDDEN;
|
||||
diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c
|
||||
index 52d7ea429..e24691b8a 100644
|
||||
index d2a3421ac58..d360491e770 100644
|
||||
--- a/dlls/ntdll/process.c
|
||||
+++ b/dlls/ntdll/process.c
|
||||
@@ -125,6 +125,24 @@ HANDLE CDECL __wine_make_process_system(void)
|
||||
@@ -124,6 +124,24 @@ HANDLE CDECL __wine_make_process_system(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -71,10 +71,10 @@ index 52d7ea429..e24691b8a 100644
|
||||
|
||||
#define UNIMPLEMENTED_INFO_CLASS(c) \
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index e908f2131..0177cb579 100644
|
||||
index f152afb97b6..68c66bc2fcb 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3734,6 +3734,14 @@ struct handle_info
|
||||
@@ -3754,6 +3754,14 @@ struct handle_info
|
||||
@END
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ index e908f2131..0177cb579 100644
|
||||
@REQ(create_completion)
|
||||
unsigned int access; /* desired access to a port */
|
||||
diff --git a/server/security.h b/server/security.h
|
||||
index 6c337143c..21e90ccf2 100644
|
||||
index 6c337143c3d..21e90ccf23f 100644
|
||||
--- a/server/security.h
|
||||
+++ b/server/security.h
|
||||
@@ -49,6 +49,7 @@ extern const PSID security_builtin_users_sid;
|
||||
@@ -102,10 +102,10 @@ index 6c337143c..21e90ccf2 100644
|
||||
|
||||
/* token functions */
|
||||
diff --git a/server/token.c b/server/token.c
|
||||
index 381ae6871..fcab79955 100644
|
||||
index c4f1cd943c2..970ed1838da 100644
|
||||
--- a/server/token.c
|
||||
+++ b/server/token.c
|
||||
@@ -79,6 +79,7 @@ static const SID anonymous_logon_sid = { SID_REVISION, 1, { SECURITY_NT_AUTHORIT
|
||||
@@ -77,6 +77,7 @@ static const SID anonymous_logon_sid = { SID_REVISION, 1, { SECURITY_NT_AUTHORIT
|
||||
static const SID authenticated_user_sid = { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_AUTHENTICATED_USER_RID } };
|
||||
static const SID local_system_sid = { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_LOCAL_SYSTEM_RID } };
|
||||
static const SID high_label_sid = { SID_REVISION, 1, { SECURITY_MANDATORY_LABEL_AUTHORITY }, { SECURITY_MANDATORY_HIGH_RID } };
|
||||
@@ -113,7 +113,7 @@ index 381ae6871..fcab79955 100644
|
||||
static const SID_N(5) local_user_sid = { SID_REVISION, 5, { SECURITY_NT_AUTHORITY }, { SECURITY_NT_NON_UNIQUE, 0, 0, 0, 1000 } };
|
||||
static const SID_N(2) builtin_admins_sid = { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS } };
|
||||
static const SID_N(2) builtin_users_sid = { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_USERS } };
|
||||
@@ -95,6 +96,7 @@ const PSID security_builtin_admins_sid = (PSID)&builtin_admins_sid;
|
||||
@@ -93,6 +94,7 @@ const PSID security_builtin_admins_sid = (PSID)&builtin_admins_sid;
|
||||
const PSID security_builtin_users_sid = (PSID)&builtin_users_sid;
|
||||
const PSID security_domain_users_sid = (PSID)&domain_users_sid;
|
||||
const PSID security_high_label_sid = (PSID)&high_label_sid;
|
||||
@@ -121,7 +121,7 @@ index 381ae6871..fcab79955 100644
|
||||
|
||||
static luid_t prev_luid_value = { 1000, 0 };
|
||||
|
||||
@@ -917,6 +919,64 @@ struct token *token_create_admin( void )
|
||||
@@ -915,6 +917,64 @@ struct token *token_create_admin( void )
|
||||
return token;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ index 381ae6871..fcab79955 100644
|
||||
static struct privilege *token_find_privilege( struct token *token, const LUID *luid, int enabled_only )
|
||||
{
|
||||
struct privilege *privilege;
|
||||
@@ -1722,3 +1782,27 @@ DECL_HANDLER(set_token_default_dacl)
|
||||
@@ -1720,3 +1780,27 @@ DECL_HANDLER(set_token_default_dacl)
|
||||
release_object( token );
|
||||
}
|
||||
}
|
||||
@@ -215,5 +215,5 @@ index 381ae6871..fcab79955 100644
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.23.0
|
||||
2.26.2
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 6a09d34647aa517e45bc0bb20a92d0d94a1da888 Mon Sep 17 00:00:00 2001
|
||||
From 2f03ded51b6f537ac6a4f3bfb51e1d0998a27c48 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 5 Aug 2017 03:39:55 +0200
|
||||
Subject: [PATCH] ntdll: Implement process token elevation through manifests.
|
||||
@@ -12,10 +12,10 @@ Subject: [PATCH] ntdll: Implement process token elevation through manifests.
|
||||
5 files changed, 67 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index 2f203447e..7c5dd308b 100644
|
||||
index 38c893e3eb4..d32b57612d5 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -3804,6 +3804,32 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow
|
||||
@@ -4045,6 +4045,32 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ index 2f203447e..7c5dd308b 100644
|
||||
/***********************************************************************
|
||||
* load_global_options
|
||||
*/
|
||||
@@ -4233,6 +4259,7 @@ void __wine_process_init(void)
|
||||
@@ -4478,6 +4504,7 @@ void __wine_process_init(void)
|
||||
's','y','s','t','e','m','3','2','\\',
|
||||
'k','e','r','n','e','l','3','2','.','d','l','l',0};
|
||||
RTL_USER_PROCESS_PARAMETERS *params;
|
||||
@@ -56,7 +56,7 @@ index 2f203447e..7c5dd308b 100644
|
||||
WINE_MODREF *wm;
|
||||
NTSTATUS status;
|
||||
ANSI_STRING func_name;
|
||||
@@ -4324,6 +4351,16 @@ void __wine_process_init(void)
|
||||
@@ -4575,6 +4602,16 @@ void __wine_process_init(void)
|
||||
|
||||
virtual_set_large_address_space();
|
||||
|
||||
@@ -71,10 +71,10 @@ index 2f203447e..7c5dd308b 100644
|
||||
+ }
|
||||
+
|
||||
/* the main exe needs to be the first in the load order list */
|
||||
RemoveEntryList( &wm->ldr.InLoadOrderModuleList );
|
||||
InsertHeadList( &peb->LdrData->InLoadOrderModuleList, &wm->ldr.InLoadOrderModuleList );
|
||||
RemoveEntryList( &wm->ldr.InLoadOrderLinks );
|
||||
InsertHeadList( &peb->LdrData->InLoadOrderModuleList, &wm->ldr.InLoadOrderLinks );
|
||||
diff --git a/server/process.c b/server/process.c
|
||||
index 4c7da9223..d6f71a774 100644
|
||||
index 4c7da9223c1..d6f71a774f3 100644
|
||||
--- a/server/process.c
|
||||
+++ b/server/process.c
|
||||
@@ -1107,6 +1107,14 @@ struct process_snapshot *process_snap( int *count )
|
||||
@@ -93,7 +93,7 @@ index 4c7da9223..d6f71a774 100644
|
||||
DECL_HANDLER(new_process)
|
||||
{
|
||||
diff --git a/server/process.h b/server/process.h
|
||||
index 5b83e111a..dfe5c4e52 100644
|
||||
index 5b83e111a6f..dfe5c4e52d8 100644
|
||||
--- a/server/process.h
|
||||
+++ b/server/process.h
|
||||
@@ -139,6 +139,7 @@ extern void kill_debugged_processes( struct thread *debugger, int exit_code );
|
||||
@@ -105,10 +105,10 @@ index 5b83e111a..dfe5c4e52 100644
|
||||
/* console functions */
|
||||
extern void inherit_console( struct thread *parent_thread, struct process *parent,
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 6022e1715..45ab670ea 100644
|
||||
index 68c66bc2fcb..55c821ac1e2 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3755,6 +3755,13 @@ struct handle_info
|
||||
@@ -3762,6 +3762,13 @@ struct handle_info
|
||||
@END
|
||||
|
||||
|
||||
@@ -123,10 +123,10 @@ index 6022e1715..45ab670ea 100644
|
||||
@REQ(create_completion)
|
||||
unsigned int access; /* desired access to a port */
|
||||
diff --git a/server/token.c b/server/token.c
|
||||
index fcab79955..181219d21 100644
|
||||
index 970ed1838da..1c1d49989b3 100644
|
||||
--- a/server/token.c
|
||||
+++ b/server/token.c
|
||||
@@ -1806,3 +1806,17 @@ DECL_HANDLER(create_token)
|
||||
@@ -1804,3 +1804,17 @@ DECL_HANDLER(create_token)
|
||||
release_object( token );
|
||||
}
|
||||
}
|
||||
@@ -145,5 +145,5 @@ index fcab79955..181219d21 100644
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.24.0
|
||||
2.26.0
|
||||
|
||||
|
@@ -285,14 +285,14 @@ index 00000000000..d7ed6eeddf3
|
||||
+
|
||||
+BOOL gcrypt_initialize(void)
|
||||
+{
|
||||
+ if (!(libgcrypt_handle = wine_dlopen( SONAME_LIBGCRYPT, RTLD_NOW, NULL, 0 )))
|
||||
+ if (!(libgcrypt_handle = dlopen( SONAME_LIBGCRYPT, RTLD_NOW)))
|
||||
+ {
|
||||
+ ERR_(winediag)( "failed to load libgcrypt, no support for diffie hellman key exchange\n" );
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+#define LOAD_FUNCPTR(f) \
|
||||
+ if (!(p##f = wine_dlsym( libgcrypt_handle, #f, NULL, 0 ))) \
|
||||
+ if (!(p##f = dlsym( libgcrypt_handle, #f))) \
|
||||
+ { \
|
||||
+ ERR( "failed to load %s\n", #f ); \
|
||||
+ goto fail; \
|
||||
@@ -314,7 +314,7 @@ index 00000000000..d7ed6eeddf3
|
||||
+ return TRUE;
|
||||
+
|
||||
+fail:
|
||||
+ wine_dlclose( libgcrypt_handle, NULL, 0 );
|
||||
+ dlclose( libgcrypt_handle);
|
||||
+ libgcrypt_handle = NULL;
|
||||
+ return FALSE;
|
||||
+}
|
||||
@@ -322,7 +322,7 @@ index 00000000000..d7ed6eeddf3
|
||||
+
|
||||
+void gcrypt_uninitialize(void)
|
||||
+{
|
||||
+ wine_dlclose( libgcrypt_handle, NULL, 0 );
|
||||
+ dlclose( libgcrypt_handle);
|
||||
+ libgcrypt_handle = NULL;
|
||||
+}
|
||||
+
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From ad23e816eb724d81032306f8ac6d4faa96ccaf4a Mon Sep 17 00:00:00 2001
|
||||
From c88a1acf9ac625cb2a7cbfc90ac3bb2d426889a0 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Tue, 12 Nov 2019 18:13:20 +0800
|
||||
Subject: [PATCH] comctl32: Bump version to 6.0.
|
||||
@@ -14,12 +14,12 @@ Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/comctl32/comctl32.h b/dlls/comctl32/comctl32.h
|
||||
index 78e97983381..42b434a96d9 100644
|
||||
index 66b341ae5ad..1af9baea7ee 100644
|
||||
--- a/dlls/comctl32/comctl32.h
|
||||
+++ b/dlls/comctl32/comctl32.h
|
||||
@@ -192,7 +192,7 @@ INT Str_GetPtrAtoW (LPCSTR lpSrc, LPWSTR lpDest, INT nMaxLen) DECLSPEC_HIDDEN;
|
||||
BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc) DECLSPEC_HIDDEN;
|
||||
@@ -193,7 +193,7 @@ BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc) DECLSPEC_HIDDEN;
|
||||
BOOL Str_SetPtrWtoA (LPSTR *lppDest, LPCWSTR lpSrc) DECLSPEC_HIDDEN;
|
||||
BOOL imagelist_has_alpha(HIMAGELIST, UINT) DECLSPEC_HIDDEN;
|
||||
|
||||
-#define COMCTL32_VERSION_MINOR 81
|
||||
+#define COMCTL32_VERSION_MINOR 0
|
||||
@@ -40,7 +40,7 @@ index c9aa1ba6253..be6e2425193 100644
|
||||
#define WINE_PRODUCTVERSION_STR WINE_FILEVERSION_STR
|
||||
|
||||
diff --git a/include/commctrl.h b/include/commctrl.h
|
||||
index 700b335fbb7..029a4b45457 100644
|
||||
index dfd2f4a37d2..0784478ce14 100644
|
||||
--- a/include/commctrl.h
|
||||
+++ b/include/commctrl.h
|
||||
@@ -51,7 +51,7 @@ enum _LI_METRIC
|
||||
@@ -50,8 +50,8 @@ index 700b335fbb7..029a4b45457 100644
|
||||
-#define COMCTL32_VERSION 5 /* dll version */
|
||||
+#define COMCTL32_VERSION 6 /* dll version */
|
||||
|
||||
#ifndef _WIN32_IE
|
||||
#define _WIN32_IE 0x0400
|
||||
#define ICC_LISTVIEW_CLASSES 0x00000001 /* listview, header */
|
||||
#define ICC_TREEVIEW_CLASSES 0x00000002 /* treeview, tooltips */
|
||||
--
|
||||
2.24.1
|
||||
2.25.1
|
||||
|
||||
|
@@ -1,64 +0,0 @@
|
||||
From cdcb9581d105a7964b06ca9c5525e28db25d6206 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Costa <titan.costa@gmail.com>
|
||||
Date: Sun, 16 Jul 2017 17:39:28 +0200
|
||||
Subject: d3dx9_36/tests: Remove useless \n within some ok messages.
|
||||
|
||||
---
|
||||
dlls/d3dx9_36/tests/mesh.c | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
|
||||
index 95dd06e4662..b1ab0aaf594 100644
|
||||
--- a/dlls/d3dx9_36/tests/mesh.c
|
||||
+++ b/dlls/d3dx9_36/tests/mesh.c
|
||||
@@ -10195,10 +10195,10 @@ static void test_clone_mesh(void)
|
||||
|
||||
hr = mesh->lpVtbl->CloneMesh(mesh, tc[i].clone_options, tc[i].new_declaration,
|
||||
test_context->device, &mesh_clone);
|
||||
- ok(hr == D3D_OK, "CloneMesh test case %d failed. Got %x\n, expected D3D_OK\n", i, hr);
|
||||
+ ok(hr == D3D_OK, "CloneMesh test case %d failed. Got %x, expected D3D_OK.\n", i, hr);
|
||||
|
||||
hr = mesh_clone->lpVtbl->GetDeclaration(mesh_clone, new_declaration);
|
||||
- ok(hr == D3D_OK, "GetDeclaration test case %d failed. Got %x\n, expected D3D_OK\n", i, hr);
|
||||
+ ok(hr == D3D_OK, "GetDeclaration test case %d failed. Got %x, expected D3D_OK.\n", i, hr);
|
||||
/* Check declaration elements */
|
||||
for (j = 0; tc[i].new_declaration[j].Stream != 0xFF; j++)
|
||||
{
|
||||
@@ -10385,7 +10385,7 @@ static void test_valid_mesh(void)
|
||||
|
||||
hr = D3DXValidMesh(mesh, tc[i].adjacency, &errors_and_warnings);
|
||||
todo_wine ok(hr == tc[i].exp_hr, "D3DXValidMesh test case %d failed. "
|
||||
- "Got %x\n, expected %x\n", i, hr, tc[i].exp_hr);
|
||||
+ "Got %x, expected %x.\n", i, hr, tc[i].exp_hr);
|
||||
|
||||
/* Note errors_and_warnings is deliberately not checked because that
|
||||
* would require copying wast amounts of the text output. */
|
||||
@@ -10529,7 +10529,7 @@ static void test_optimize_faces(void)
|
||||
tc[i].num_vertices, tc[i].indices_are_32bit,
|
||||
face_remap);
|
||||
ok(hr == D3D_OK, "D3DXOptimizeFaces test case %d failed. "
|
||||
- "Got %x\n, expected D3D_OK\n", i, hr);
|
||||
+ "Got %x, expected D3D_OK.\n", i, hr);
|
||||
|
||||
/* Compare face remap with expected face remap */
|
||||
for (j = 0; j < tc[i].num_faces; j++)
|
||||
@@ -10547,14 +10547,14 @@ static void test_optimize_faces(void)
|
||||
tc[0].num_vertices, tc[0].indices_are_32bit,
|
||||
NULL);
|
||||
ok(hr == D3DERR_INVALIDCALL, "D3DXOptimizeFaces passed NULL face_remap "
|
||||
- "pointer. Got %x\n, expected D3DERR_INVALIDCALL\n", hr);
|
||||
+ "pointer. Got %x, expected D3DERR_INVALIDCALL.\n", hr);
|
||||
|
||||
/* Number of faces must be smaller than 2^15 */
|
||||
hr = D3DXOptimizeFaces(tc[0].indices, 2 << 15,
|
||||
tc[0].num_vertices, FALSE,
|
||||
&smallest_face_remap);
|
||||
ok(hr == D3DERR_INVALIDCALL, "D3DXOptimizeFaces should not accept 2^15 "
|
||||
- "faces when using 16-bit indices. Got %x\n, expected D3DERR_INVALIDCALL\n", hr);
|
||||
+ "faces when using 16-bit indices. Got %x, expected D3DERR_INVALIDCALL.\n", hr);
|
||||
}
|
||||
|
||||
static HRESULT clear_normals(ID3DXMesh *mesh)
|
||||
--
|
||||
2.13.1
|
||||
|
@@ -1,316 +0,0 @@
|
||||
From 4693069d7c35e2c186943b2394ab4a657253c5e1 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Costa <titan.costa@gmail.com>
|
||||
Date: Sun, 26 May 2013 19:42:08 +0200
|
||||
Subject: [PATCH] d3dx9_36: Implement ID3DXFontImpl_DrawText.
|
||||
|
||||
Changes by Sebastian Lackner <sebastian@fds-team.de>:
|
||||
* Use pitch value for locked buffer instead of assuming that pitch = width * bytesperpixel
|
||||
* Avoid one for loop to simplify code
|
||||
* Ensure that DrawText doesn't dereference a NULL pointer when count != 0.
|
||||
|
||||
Changes by Christian Costa <titan.costa@gmail.com>
|
||||
* Use dedicated variables for text width & height instead of reusing rect.right and rect.bottom
|
||||
* Remove useless test in pixel conversion
|
||||
* Remove left over 'partial stub' in fixme
|
||||
|
||||
Changes by Sebastian Lackner <sebastian@fds-team.de>:
|
||||
* Replace code to convert text from ascii to widechar
|
||||
* Strip terminating NULL chars before drawing text
|
||||
---
|
||||
dlls/d3dx9_36/font.c | 214 +++++++++++++++++++++++++++++++++++++++----
|
||||
1 file changed, 195 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c
|
||||
index cb09af22f57..89a60c9baf1 100644
|
||||
--- a/dlls/d3dx9_36/font.c
|
||||
+++ b/dlls/d3dx9_36/font.c
|
||||
@@ -32,6 +32,12 @@ struct d3dx_font
|
||||
|
||||
HDC hdc;
|
||||
HFONT hfont;
|
||||
+
|
||||
+ UINT tex_width;
|
||||
+ UINT tex_height;
|
||||
+ IDirect3DTexture9 *texture;
|
||||
+ HBITMAP bitmap;
|
||||
+ BYTE *bits;
|
||||
};
|
||||
|
||||
static inline struct d3dx_font *impl_from_ID3DXFont(ID3DXFont *iface)
|
||||
@@ -60,19 +66,27 @@ static HRESULT WINAPI ID3DXFontImpl_QueryInterface(ID3DXFont *iface, REFIID riid
|
||||
static ULONG WINAPI ID3DXFontImpl_AddRef(ID3DXFont *iface)
|
||||
{
|
||||
struct d3dx_font *This = impl_from_ID3DXFont(iface);
|
||||
- ULONG ref=InterlockedIncrement(&This->ref);
|
||||
+ ULONG ref = InterlockedIncrement(&This->ref);
|
||||
+
|
||||
TRACE("%p increasing refcount to %u\n", iface, ref);
|
||||
+
|
||||
return ref;
|
||||
}
|
||||
|
||||
static ULONG WINAPI ID3DXFontImpl_Release(ID3DXFont *iface)
|
||||
{
|
||||
struct d3dx_font *This = impl_from_ID3DXFont(iface);
|
||||
- ULONG ref=InterlockedDecrement(&This->ref);
|
||||
+ ULONG ref = InterlockedDecrement(&This->ref);
|
||||
|
||||
TRACE("%p decreasing refcount to %u\n", iface, ref);
|
||||
|
||||
- if(ref==0) {
|
||||
+ if (!ref)
|
||||
+ {
|
||||
+ if (This->texture)
|
||||
+ {
|
||||
+ IDirect3DTexture9_Release(This->texture);
|
||||
+ DeleteObject(This->bitmap);
|
||||
+ }
|
||||
DeleteObject(This->hfont);
|
||||
DeleteDC(This->hdc);
|
||||
IDirect3DDevice9_Release(This->device);
|
||||
@@ -175,17 +189,170 @@ static HRESULT WINAPI ID3DXFontImpl_PreloadTextW(ID3DXFont *iface, const WCHAR *
|
||||
static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||
const char *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
|
||||
{
|
||||
- FIXME("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x stub!\n",
|
||||
+ LPWSTR stringW;
|
||||
+ INT countW, ret = 0;
|
||||
+
|
||||
+ TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
|
||||
iface, sprite, debugstr_a(string), count, wine_dbgstr_rect(rect), format, color);
|
||||
- return 1;
|
||||
+
|
||||
+ if (!string || count <= 0)
|
||||
+ return 0;
|
||||
+
|
||||
+ countW = MultiByteToWideChar(CP_ACP, 0, string, count, NULL, 0);
|
||||
+ stringW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR));
|
||||
+ if (stringW)
|
||||
+ {
|
||||
+ MultiByteToWideChar(CP_ACP, 0, string, count, stringW, countW);
|
||||
+ ret = ID3DXFont_DrawTextW(iface, sprite, stringW, countW, rect, format, color);
|
||||
+ HeapFree(GetProcessHeap(), 0, stringW);
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||
const WCHAR *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
|
||||
{
|
||||
- FIXME("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x stub!\n",
|
||||
+ struct d3dx_font *This = impl_from_ID3DXFont(iface);
|
||||
+ RECT calc_rect = *rect;
|
||||
+ INT height;
|
||||
+
|
||||
+ TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
|
||||
iface, sprite, debugstr_w(string), count, wine_dbgstr_rect(rect), format, color);
|
||||
- return 1;
|
||||
+
|
||||
+ if (!string || count <= 0)
|
||||
+ return 0;
|
||||
+
|
||||
+ /* Strip terminating NULL characters */
|
||||
+ while (count > 0 && !string[count-1])
|
||||
+ count--;
|
||||
+
|
||||
+ height = DrawTextW(This->hdc, string, count, &calc_rect, format | DT_CALCRECT);
|
||||
+
|
||||
+ if (format & DT_CALCRECT)
|
||||
+ {
|
||||
+ *rect = calc_rect;
|
||||
+ return height;
|
||||
+ }
|
||||
+
|
||||
+ if (height && (calc_rect.left < calc_rect.right))
|
||||
+ {
|
||||
+ D3DLOCKED_RECT locked_rect;
|
||||
+ D3DXVECTOR3 position;
|
||||
+ UINT text_width, text_height;
|
||||
+ RECT text_rect;
|
||||
+ ID3DXSprite *target = sprite;
|
||||
+ HRESULT hr;
|
||||
+ int i, j;
|
||||
+
|
||||
+ /* Get rect position and dimensions */
|
||||
+ position.x = calc_rect.left;
|
||||
+ position.y = calc_rect.top;
|
||||
+ position.z = 0;
|
||||
+ text_width = calc_rect.right - calc_rect.left;
|
||||
+ text_height = calc_rect.bottom - calc_rect.top;
|
||||
+ text_rect.left = 0;
|
||||
+ text_rect.top = 0;
|
||||
+ text_rect.right = text_width;
|
||||
+ text_rect.bottom = text_height;
|
||||
+
|
||||
+ /* We need to flush as it seems all draws in the begin/end sequence use only the latest updated texture */
|
||||
+ if (sprite)
|
||||
+ ID3DXSprite_Flush(sprite);
|
||||
+
|
||||
+ /* Extend texture and DIB section to contain text */
|
||||
+ if ((text_width > This->tex_width) || (text_height > This->tex_height))
|
||||
+ {
|
||||
+ BITMAPINFOHEADER header;
|
||||
+
|
||||
+ if (text_width > This->tex_width)
|
||||
+ This->tex_width = make_pow2(text_width);
|
||||
+ if (text_height > This->tex_height)
|
||||
+ This->tex_height = make_pow2(text_height);
|
||||
+
|
||||
+ if (This->texture)
|
||||
+ {
|
||||
+ IDirect3DTexture9_Release(This->texture);
|
||||
+ DeleteObject(This->bitmap);
|
||||
+ }
|
||||
+
|
||||
+ hr = D3DXCreateTexture(This->device, This->tex_width, This->tex_height, 1, D3DUSAGE_DYNAMIC,
|
||||
+ D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &This->texture);
|
||||
+ if (FAILED(hr))
|
||||
+ {
|
||||
+ This->texture = NULL;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ header.biSize = sizeof(header);
|
||||
+ header.biWidth = This->tex_width;
|
||||
+ header.biHeight = -This->tex_height;
|
||||
+ header.biPlanes = 1;
|
||||
+ header.biBitCount = 32;
|
||||
+ header.biCompression = BI_RGB;
|
||||
+ header.biSizeImage = sizeof(DWORD) * This->tex_width * This->tex_height;
|
||||
+ header.biXPelsPerMeter = 0;
|
||||
+ header.biYPelsPerMeter = 0;
|
||||
+ header.biClrUsed = 0;
|
||||
+ header.biClrImportant = 0;
|
||||
+
|
||||
+ This->bitmap = CreateDIBSection(This->hdc, (const BITMAPINFO*)&header,
|
||||
+ DIB_RGB_COLORS, (void**)&This->bits, NULL, 0);
|
||||
+ if (!This->bitmap)
|
||||
+ {
|
||||
+ IDirect3DTexture9_Release(This->texture);
|
||||
+ This->texture = NULL;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ SelectObject(This->hdc, This->bitmap);
|
||||
+ }
|
||||
+
|
||||
+ if (FAILED(IDirect3DTexture9_LockRect(This->texture, 0, &locked_rect, &text_rect, D3DLOCK_DISCARD)))
|
||||
+ return 0;
|
||||
+
|
||||
+ /* Clear rect */
|
||||
+ for (i = 0; i < text_height; i++)
|
||||
+ memset(This->bits + i * This->tex_width * sizeof(DWORD), 0,
|
||||
+ text_width * sizeof(DWORD));
|
||||
+
|
||||
+ DrawTextW(This->hdc, string, count, &text_rect, format);
|
||||
+
|
||||
+ /* All RGB components are equal so take one as alpha and set RGB
|
||||
+ * color to white, so it can be modulated with color parameter */
|
||||
+ for (i = 0; i < text_height; i++)
|
||||
+ {
|
||||
+ DWORD *src = (DWORD *)This->bits + i * This->tex_width;
|
||||
+ DWORD *dst = (DWORD *)((BYTE *)locked_rect.pBits + i * locked_rect.Pitch);
|
||||
+ for (j = 0; j < text_width; j++)
|
||||
+ {
|
||||
+ *dst++ = (*src++ << 24) | 0xFFFFFF;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ IDirect3DTexture9_UnlockRect(This->texture, 0);
|
||||
+
|
||||
+ if (!sprite)
|
||||
+ {
|
||||
+ hr = D3DXCreateSprite(This->device, &target);
|
||||
+ if (FAILED(hr))
|
||||
+ return 0;
|
||||
+ ID3DXSprite_Begin(target, 0);
|
||||
+ }
|
||||
+
|
||||
+ hr = target->lpVtbl->Draw(target, This->texture, &text_rect, NULL, &position, color);
|
||||
+
|
||||
+ if (!sprite)
|
||||
+ {
|
||||
+ ID3DXSprite_End(target);
|
||||
+ ID3DXSprite_Release(target);
|
||||
+ }
|
||||
+
|
||||
+ if (FAILED(hr))
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return height;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ID3DXFontImpl_OnLostDevice(ID3DXFont *iface)
|
||||
@@ -298,46 +465,55 @@ HRESULT WINAPI D3DXCreateFontIndirectW(IDirect3DDevice9 *device, const D3DXFONT_
|
||||
|
||||
TRACE("(%p, %p, %p)\n", device, desc, font);
|
||||
|
||||
- if( !device || !desc || !font ) return D3DERR_INVALIDCALL;
|
||||
+ if (!device || !desc || !font) return D3DERR_INVALIDCALL;
|
||||
|
||||
- /* the device MUST support D3DFMT_A8R8G8B8 */
|
||||
+ TRACE("desc: %d %d %d %d %d %d %d %d %d %s\n", desc->Height, desc->Width, desc->Weight, desc->MipLevels, desc->Italic,
|
||||
+ desc->CharSet, desc->OutputPrecision, desc->Quality, desc->PitchAndFamily, debugstr_w(desc->FaceName));
|
||||
+
|
||||
+ /* The device MUST support D3DFMT_A8R8G8B8 */
|
||||
IDirect3DDevice9_GetDirect3D(device, &d3d);
|
||||
IDirect3DDevice9_GetCreationParameters(device, &cpars);
|
||||
IDirect3DDevice9_GetDisplayMode(device, 0, &mode);
|
||||
hr = IDirect3D9_CheckDeviceFormat(d3d, cpars.AdapterOrdinal, cpars.DeviceType, mode.Format, 0, D3DRTYPE_TEXTURE, D3DFMT_A8R8G8B8);
|
||||
- if(FAILED(hr)) {
|
||||
+ if (FAILED(hr))
|
||||
+ {
|
||||
IDirect3D9_Release(d3d);
|
||||
return D3DXERR_INVALIDDATA;
|
||||
}
|
||||
IDirect3D9_Release(d3d);
|
||||
|
||||
- object = HeapAlloc(GetProcessHeap(), 0, sizeof(struct d3dx_font));
|
||||
- if(object==NULL) {
|
||||
- *font=NULL;
|
||||
+ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct d3dx_font));
|
||||
+ if (!object)
|
||||
+ {
|
||||
+ *font = NULL;
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
object->ID3DXFont_iface.lpVtbl = &D3DXFont_Vtbl;
|
||||
- object->ref=1;
|
||||
- object->device=device;
|
||||
- object->desc=*desc;
|
||||
+ object->ref = 1;
|
||||
+ object->device = device;
|
||||
+ object->desc = *desc;
|
||||
|
||||
object->hdc = CreateCompatibleDC(NULL);
|
||||
- if( !object->hdc ) {
|
||||
+ if (!object->hdc)
|
||||
+ {
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return D3DXERR_INVALIDDATA;
|
||||
}
|
||||
|
||||
object->hfont = CreateFontW(desc->Height, desc->Width, 0, 0, desc->Weight, desc->Italic, FALSE, FALSE, desc->CharSet,
|
||||
desc->OutputPrecision, CLIP_DEFAULT_PRECIS, desc->Quality, desc->PitchAndFamily, desc->FaceName);
|
||||
- if( !object->hfont ) {
|
||||
+ if (!object->hfont)
|
||||
+ {
|
||||
DeleteDC(object->hdc);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return D3DXERR_INVALIDDATA;
|
||||
}
|
||||
SelectObject(object->hdc, object->hfont);
|
||||
+ SetTextColor(object->hdc, 0x00ffffff);
|
||||
+ SetBkColor(object->hdc, 0x00000000);
|
||||
|
||||
IDirect3DDevice9_AddRef(device);
|
||||
- *font=&object->ID3DXFont_iface;
|
||||
+ *font = &object->ID3DXFont_iface;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
--
|
||||
2.25.0
|
||||
|
@@ -1,32 +0,0 @@
|
||||
From 93b91dc6b0ccaf6c9babab7adb218454df93b750 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Costa <titan.costa@gmail.com>
|
||||
Date: Sun, 4 Jan 2015 18:43:42 +0100
|
||||
Subject: d3dx9_36: Fix horizontal centering in ID3DXFont_DrawText.
|
||||
|
||||
Fix remaining text issues in Air Strike.
|
||||
Should fix text placement in Stronghold Kingdoms.
|
||||
---
|
||||
dlls/d3dx9_36/font.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c
|
||||
index 368c784..fa52859 100644
|
||||
--- a/dlls/d3dx9_36/font.c
|
||||
+++ b/dlls/d3dx9_36/font.c
|
||||
@@ -254,6 +254,13 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||
return height;
|
||||
}
|
||||
|
||||
+ if (format & DT_CENTER)
|
||||
+ {
|
||||
+ UINT new_width = calc_rect.right - calc_rect.left;
|
||||
+ calc_rect.left = (rect->right + rect->left - new_width) / 2;
|
||||
+ calc_rect.right = calc_rect.left + new_width;
|
||||
+ }
|
||||
+
|
||||
if (height && (calc_rect.left < calc_rect.right))
|
||||
{
|
||||
D3DLOCKED_RECT locked_rect;
|
||||
--
|
||||
2.2.1
|
||||
|
@@ -1,47 +0,0 @@
|
||||
From 0b6fc918564f580a9d62f14d76da83349075574f Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 4 Dec 2015 09:22:35 +1100
|
||||
Subject: [PATCH] d3dx9_36: Support NULL terminated strings in
|
||||
ID3DXFont_DrawText
|
||||
|
||||
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
---
|
||||
dlls/d3dx9_36/font.c | 10 ++++++++--
|
||||
dlls/d3dx9_36/tests/core.c | 1 -
|
||||
2 files changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c
|
||||
index ad1eb2383e4..83fec560fc5 100644
|
||||
--- a/dlls/d3dx9_36/font.c
|
||||
+++ b/dlls/d3dx9_36/font.c
|
||||
@@ -210,9 +210,12 @@ static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||
TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
|
||||
iface, sprite, debugstr_a(string), count, wine_dbgstr_rect(rect), format, color);
|
||||
|
||||
- if (!string || count <= 0)
|
||||
+ if (!string || count == 0)
|
||||
return 0;
|
||||
|
||||
+ if (count < 0)
|
||||
+ count = -1;
|
||||
+
|
||||
countW = MultiByteToWideChar(CP_ACP, 0, string, count, NULL, 0);
|
||||
stringW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR));
|
||||
if (stringW)
|
||||
@@ -235,9 +238,12 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||
TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
|
||||
iface, sprite, debugstr_w(string), count, wine_dbgstr_rect(rect), format, color);
|
||||
|
||||
- if (!string || count <= 0)
|
||||
+ if (!string || count == 0)
|
||||
return 0;
|
||||
|
||||
+ if (count < 0)
|
||||
+ count = lstrlenW(string);
|
||||
+
|
||||
/* Strip terminating NULL characters */
|
||||
while (count > 0 && !string[count-1])
|
||||
count--;
|
||||
--
|
||||
2.17.1
|
||||
|
@@ -1,43 +0,0 @@
|
||||
From ccf7cfe0cd7cbaa15ee34b4390dd6c30cf7e84ec Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Sat, 5 Dec 2015 15:31:06 +1100
|
||||
Subject: [PATCH] d3dx9_36: ID3DXFont_DrawText calc_rect can be null
|
||||
|
||||
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
---
|
||||
dlls/d3dx9_36/font.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c
|
||||
index 83fec560fc5..f5c704ebabb 100644
|
||||
--- a/dlls/d3dx9_36/font.c
|
||||
+++ b/dlls/d3dx9_36/font.c
|
||||
@@ -232,7 +232,7 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||
const WCHAR *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
|
||||
{
|
||||
struct d3dx_font *This = impl_from_ID3DXFont(iface);
|
||||
- RECT calc_rect = *rect;
|
||||
+ RECT calc_rect;
|
||||
INT height;
|
||||
|
||||
TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
|
||||
@@ -248,11 +248,15 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||
while (count > 0 && !string[count-1])
|
||||
count--;
|
||||
|
||||
+ if (rect)
|
||||
+ calc_rect = *rect;
|
||||
+
|
||||
height = DrawTextW(This->hdc, string, count, &calc_rect, format | DT_CALCRECT);
|
||||
|
||||
if (format & DT_CALCRECT)
|
||||
{
|
||||
- *rect = calc_rect;
|
||||
+ if (rect)
|
||||
+ *rect = calc_rect;
|
||||
return height;
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@@ -1,3 +0,0 @@
|
||||
Fixes: [24754] Support for ID3DXFont::DrawTextA/W
|
||||
#Disabled since it's in the process of being upstreamed.
|
||||
Disabled: true
|
@@ -1,15 +1,15 @@
|
||||
From e920f461eaf4c5d19c0cfc8e9c9a40671269dd93 Mon Sep 17 00:00:00 2001
|
||||
From b17741a716e2633c02c2237eb424f126860a0c39 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Mon, 6 Oct 2014 05:06:06 +0200
|
||||
Subject: [PATCH] dbghelp: Always check for debug symbols in BINDIR.
|
||||
|
||||
---
|
||||
dlls/dbghelp/Makefile.in | 2 +-
|
||||
dlls/dbghelp/elf_module.c | 8 +++++---
|
||||
2 files changed, 6 insertions(+), 4 deletions(-)
|
||||
dlls/dbghelp/elf_module.c | 1 +
|
||||
2 files changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/dbghelp/Makefile.in b/dlls/dbghelp/Makefile.in
|
||||
index f08464cd422..aa7a767110b 100644
|
||||
index 076c50323dd..ddb69c96dd4 100644
|
||||
--- a/dlls/dbghelp/Makefile.in
|
||||
+++ b/dlls/dbghelp/Makefile.in
|
||||
@@ -1,6 +1,6 @@
|
||||
@@ -18,27 +18,20 @@ index f08464cd422..aa7a767110b 100644
|
||||
-EXTRADEFS = -D_IMAGEHLP_SOURCE_
|
||||
+EXTRADEFS = -D_IMAGEHLP_SOURCE_ -DBINDIR="\"${bindir}\""
|
||||
DELAYIMPORTS = version
|
||||
EXTRAINCL = $(Z_CFLAGS)
|
||||
EXTRALIBS = $(Z_LIBS) $(CORESERVICES_LIBS) $(COREFOUNDATION_LIBS)
|
||||
|
||||
EXTRADLLFLAGS = -mno-cygwin
|
||||
diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c
|
||||
index 96b16fd5c0c..611533ee098 100644
|
||||
index ab2a693ecaf..2add1025e39 100644
|
||||
--- a/dlls/dbghelp/elf_module.c
|
||||
+++ b/dlls/dbghelp/elf_module.c
|
||||
@@ -1644,9 +1644,11 @@ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename,
|
||||
if (!ret && !strchrW(filename, '/'))
|
||||
{
|
||||
ret = elf_load_file_from_path(pcs, filename, load_offset, dyn_addr,
|
||||
- getenv("PATH"), elf_info) ||
|
||||
- elf_load_file_from_path(pcs, filename, load_offset, dyn_addr,
|
||||
- getenv("LD_LIBRARY_PATH"), elf_info);
|
||||
+ getenv("PATH"), elf_info);
|
||||
+ if (!ret) ret = elf_load_file_from_path(pcs, filename, load_offset, dyn_addr,
|
||||
+ getenv("LD_LIBRARY_PATH"), elf_info);
|
||||
+ if (!ret) ret = elf_load_file_from_path(pcs, filename, load_offset, dyn_addr,
|
||||
+ BINDIR, elf_info);
|
||||
if (!ret) ret = elf_load_file_from_dll_path(pcs, filename,
|
||||
load_offset, dyn_addr, elf_info);
|
||||
@@ -1436,6 +1436,7 @@ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename,
|
||||
load_elf.elf_info = elf_info;
|
||||
|
||||
ret = search_unix_path(filename, getenv("LD_LIBRARY_PATH"), elf_load_file_cb, &load_elf)
|
||||
+ || search_unix_path(filename, BINDIR, elf_load_file_cb, &load_elf)
|
||||
|| search_dll_path(pcs, filename, elf_load_file_cb, &load_elf);
|
||||
}
|
||||
|
||||
--
|
||||
2.20.1
|
||||
2.26.0
|
||||
|
||||
|
@@ -1,235 +0,0 @@
|
||||
From 4c6b3da41feef98226bbfe14c2b0e88acf39807e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 25 Aug 2015 11:15:59 +0200
|
||||
Subject: ddraw/tests: Add more tests for IDirectDraw7::EnumSurfaces.
|
||||
|
||||
---
|
||||
dlls/ddraw/ddraw.c | 3 +
|
||||
dlls/ddraw/tests/d3d.c | 177 ++++++++++++++++++++++++++++++++++++++++++++++---
|
||||
2 files changed, 172 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
|
||||
index b3caba2..4b7a207 100644
|
||||
--- a/dlls/ddraw/ddraw.c
|
||||
+++ b/dlls/ddraw/ddraw.c
|
||||
@@ -3135,6 +3135,9 @@ static HRESULT WINAPI ddraw7_EnumSurfaces(IDirectDraw7 *iface, DWORD Flags,
|
||||
if (!Callback)
|
||||
return DDERR_INVALIDPARAMS;
|
||||
|
||||
+ if (!all && !DDSD)
|
||||
+ return DDERR_INVALIDPARAMS;
|
||||
+
|
||||
wined3d_mutex_lock();
|
||||
|
||||
/* Use the _SAFE enumeration, the app may destroy enumerated surfaces */
|
||||
diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c
|
||||
index ec4197a..e9c616e 100644
|
||||
--- a/dlls/ddraw/tests/d3d.c
|
||||
+++ b/dlls/ddraw/tests/d3d.c
|
||||
@@ -57,6 +57,12 @@ typedef struct {
|
||||
int total;
|
||||
} D3D7ECancelTest;
|
||||
|
||||
+typedef struct
|
||||
+{
|
||||
+ int found;
|
||||
+ int surfaces;
|
||||
+} EnumSurfaceTest;
|
||||
+
|
||||
#define MAX_ENUMERATION_COUNT 10
|
||||
typedef struct
|
||||
{
|
||||
@@ -85,17 +91,21 @@ static ULONG getRefcount(IUnknown *iface)
|
||||
|
||||
static HRESULT WINAPI SurfaceCounter(IDirectDrawSurface7 *surface, DDSURFACEDESC2 *desc, void *context)
|
||||
{
|
||||
- UINT *num = context;
|
||||
- (*num)++;
|
||||
- IDirectDrawSurface_Release(surface);
|
||||
+ EnumSurfaceTest *count = context;
|
||||
+ count->found++;
|
||||
+ if (surface)
|
||||
+ {
|
||||
+ count->surfaces++;
|
||||
+ IDirectDrawSurface_Release(surface);
|
||||
+ }
|
||||
return DDENUMRET_OK;
|
||||
}
|
||||
|
||||
static BOOL CreateDirect3D(void)
|
||||
{
|
||||
HRESULT rc;
|
||||
- DDSURFACEDESC2 ddsd;
|
||||
- UINT num;
|
||||
+ DDSURFACEDESC2 ddsd, ddsd2;
|
||||
+ EnumSurfaceTest count;
|
||||
|
||||
rc = pDirectDrawCreateEx(NULL, (void**)&lpDD,
|
||||
&IID_IDirectDraw7, NULL);
|
||||
@@ -122,9 +132,160 @@ static BOOL CreateDirect3D(void)
|
||||
if (FAILED(rc))
|
||||
return FALSE;
|
||||
|
||||
- num = 0;
|
||||
- IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_ALL | DDENUMSURFACES_DOESEXIST, NULL, &num, SurfaceCounter);
|
||||
- ok(num == 1, "Has %d surfaces, expected 1\n", num);
|
||||
+ memset(&ddsd2, 0, sizeof(ddsd2));
|
||||
+ ddsd2.dwSize = sizeof(ddsd2);
|
||||
+ ddsd2.dwFlags = DDSD_WIDTH | DDSD_HEIGHT;
|
||||
+ ddsd2.dwWidth = 256;
|
||||
+ ddsd2.dwHeight = 256;
|
||||
+
|
||||
+ /* without search type flags */
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, 0, NULL, &count, SurfaceCounter);
|
||||
+ ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, 0, &ddsd, &count, SurfaceCounter);
|
||||
+ todo_wine ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_ALL, NULL, &count, SurfaceCounter);
|
||||
+ todo_wine ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ todo_wine ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ todo_wine ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_MATCH, NULL, &count, SurfaceCounter);
|
||||
+ ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_NOMATCH, NULL, &count, SurfaceCounter);
|
||||
+ ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+
|
||||
+ /* search type DDENUMSURFACES_DOESEXIST */
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST, NULL, &count, SurfaceCounter);
|
||||
+ ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST, &ddsd, &count, SurfaceCounter);
|
||||
+ ok(rc == DD_OK, "Expected DD_OK, got %x\n", rc);
|
||||
+ ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST, &ddsd2, &count, SurfaceCounter);
|
||||
+ ok(rc == DD_OK, "Expected DD_OK, got %x\n", rc);
|
||||
+ ok(count.found == 1, "Has %d surface descriptions, expected 1\n", count.found);
|
||||
+ ok(count.surfaces == 1, "Has %d surfaces, expected 1\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_ALL,
|
||||
+ NULL, &count, SurfaceCounter);
|
||||
+ ok(rc == DD_OK, "Expected DD_OK, got %x\n", rc);
|
||||
+ ok(count.found == 1, "Has %d surface descriptions, expected 1\n", count.found);
|
||||
+ ok(count.surfaces == 1, "Has %d surfaces, expected 1\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_MATCH,
|
||||
+ &ddsd, &count, SurfaceCounter);
|
||||
+ ok(rc == DD_OK, "Expected DD_OK, got %x\n", rc);
|
||||
+ ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_NOMATCH,
|
||||
+ &ddsd, &count, SurfaceCounter);
|
||||
+ ok(rc == DD_OK, "Expected DD_OK, got %x\n", rc);
|
||||
+ ok(count.found == 1, "Has %d surface descriptions, expected 1\n", count.found);
|
||||
+ ok(count.surfaces == 1, "Has %d surfaces, expected 1\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_MATCH,
|
||||
+ &ddsd2, &count, SurfaceCounter);
|
||||
+ ok(rc == DD_OK, "Expected DD_OK, got %x\n", rc);
|
||||
+ ok(count.found == 1, "Has %d surface descriptions, expected 1\n", count.found);
|
||||
+ ok(count.surfaces == 1, "Has %d surfaces, expected 1\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_NOMATCH,
|
||||
+ &ddsd2, &count, SurfaceCounter);
|
||||
+ ok(rc == DD_OK, "Expected DD_OK, got %x\n", rc);
|
||||
+ todo_wine ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ todo_wine ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_ALL |
|
||||
+ DDENUMSURFACES_MATCH, NULL, &count, SurfaceCounter);
|
||||
+ todo_wine ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ todo_wine ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ todo_wine ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_ALL |
|
||||
+ DDENUMSURFACES_NOMATCH, NULL, &count, SurfaceCounter);
|
||||
+ todo_wine ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ todo_wine ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ todo_wine ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_MATCH |
|
||||
+ DDENUMSURFACES_NOMATCH, NULL, &count, SurfaceCounter);
|
||||
+ ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+
|
||||
+ /* search type DDENUMSURFACES_CANBECREATED */
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_CANBECREATED, &ddsd, &count, SurfaceCounter);
|
||||
+ todo_wine ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_ALL,
|
||||
+ &ddsd, &count, SurfaceCounter);
|
||||
+ todo_wine ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ todo_wine ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ todo_wine ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_NOMATCH,
|
||||
+ &ddsd, &count, SurfaceCounter);
|
||||
+ todo_wine ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ todo_wine ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ todo_wine ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_MATCH,
|
||||
+ NULL, &count, SurfaceCounter);
|
||||
+ ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_MATCH,
|
||||
+ &ddsd, &count, SurfaceCounter);
|
||||
+ ok(rc == DD_OK, "Expected DD_OK, got %x\n", rc);
|
||||
+ todo_wine ok(count.found == 1, "Has %d surface descriptions, expected 1\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+
|
||||
+ /* combination of DDENUMSURFACES_DOESEXIST and DDENUMSURFACES_CANBECREATED */
|
||||
+ count.found = count.surfaces = 0;
|
||||
+ rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_CANBECREATED |
|
||||
+ DDENUMSURFACES_MATCH, &ddsd, &count, SurfaceCounter);
|
||||
+ ok(rc == DD_OK, "Expected DD_OK, got %x\n", rc);
|
||||
+ todo_wine ok(count.found == 1, "Has %d surface descriptions, expected 1\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
|
||||
memset(&ddsd, 0, sizeof(ddsd));
|
||||
ddsd.dwSize = sizeof(ddsd);
|
||||
--
|
||||
2.5.0
|
||||
|
@@ -1,248 +0,0 @@
|
||||
From 5dcbd836e663da908a9a39b5791da65d64a00eb8 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 25 Aug 2015 11:17:07 +0200
|
||||
Subject: ddraw: Implement DDENUMSURFACES_CANBECREATED flag in
|
||||
ddraw7_EnumSurfaces.
|
||||
|
||||
Also fixes various test failures related to DDENUMSURFACES_DOESEXIST.
|
||||
|
||||
The "Unexpected destination texture level pixels" testfailure on the w8 VM is not related to this patch.
|
||||
---
|
||||
dlls/ddraw/ddraw.c | 98 +++++++++++++++++++++++++++++++++++++-------------
|
||||
dlls/ddraw/tests/d3d.c | 42 +++++++++++-----------
|
||||
2 files changed, 94 insertions(+), 46 deletions(-)
|
||||
|
||||
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
|
||||
index 4b7a207..19ed213 100644
|
||||
--- a/dlls/ddraw/ddraw.c
|
||||
+++ b/dlls/ddraw/ddraw.c
|
||||
@@ -3122,49 +3122,97 @@ static HRESULT WINAPI ddraw7_EnumSurfaces(IDirectDraw7 *iface, DWORD Flags,
|
||||
{
|
||||
struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
|
||||
struct ddraw_surface *surf;
|
||||
- BOOL all, nomatch;
|
||||
- DDSURFACEDESC2 desc;
|
||||
- struct list *entry, *entry2;
|
||||
+ DWORD match_flags = Flags & (DDENUMSURFACES_ALL | DDENUMSURFACES_NOMATCH | DDENUMSURFACES_MATCH);
|
||||
|
||||
TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
|
||||
iface, Flags, DDSD, Context, Callback);
|
||||
|
||||
- all = Flags & DDENUMSURFACES_ALL;
|
||||
- nomatch = Flags & DDENUMSURFACES_NOMATCH;
|
||||
-
|
||||
if (!Callback)
|
||||
return DDERR_INVALIDPARAMS;
|
||||
|
||||
- if (!all && !DDSD)
|
||||
- return DDERR_INVALIDPARAMS;
|
||||
+ if (Flags & DDENUMSURFACES_CANBECREATED)
|
||||
+ {
|
||||
+ IDirectDrawSurface7 *surface;
|
||||
+ DDSURFACEDESC2 testdesc;
|
||||
+ HRESULT hr;
|
||||
|
||||
- wined3d_mutex_lock();
|
||||
+ if (match_flags != DDENUMSURFACES_MATCH)
|
||||
+ return DDERR_INVALIDPARAMS;
|
||||
|
||||
- /* Use the _SAFE enumeration, the app may destroy enumerated surfaces */
|
||||
- LIST_FOR_EACH_SAFE(entry, entry2, &ddraw->surface_list)
|
||||
- {
|
||||
- surf = LIST_ENTRY(entry, struct ddraw_surface, surface_list_entry);
|
||||
+ if (!DDSD)
|
||||
+ return DDERR_INVALIDPARAMS;
|
||||
+
|
||||
+ memcpy(&testdesc, DDSD, sizeof(testdesc));
|
||||
+ if (!(testdesc.dwFlags & DDSD_WIDTH))
|
||||
+ {
|
||||
+ testdesc.dwFlags |= DDSD_WIDTH;
|
||||
+ testdesc.dwWidth = 512;
|
||||
+ }
|
||||
+ if (!(testdesc.dwFlags & DDSD_HEIGHT))
|
||||
+ {
|
||||
+ testdesc.dwFlags |= DDSD_HEIGHT;
|
||||
+ testdesc.dwHeight = 512;
|
||||
+ }
|
||||
|
||||
- if (!surf->iface_count)
|
||||
+ hr = IDirectDraw7_CreateSurface(iface, &testdesc, &surface, NULL);
|
||||
+ if (SUCCEEDED(hr))
|
||||
{
|
||||
- WARN("Not enumerating surface %p because it doesn't have any references.\n", surf);
|
||||
- continue;
|
||||
+ surf = unsafe_impl_from_IDirectDrawSurface7(surface);
|
||||
+ Callback(NULL, &surf->surface_desc, Context);
|
||||
+ IDirectDrawSurface7_Release(surface);
|
||||
}
|
||||
+ else
|
||||
+ ERR("Failed to create surface, hr %#x.\n", hr);
|
||||
+ }
|
||||
+ else if (Flags & DDENUMSURFACES_DOESEXIST)
|
||||
+ {
|
||||
+ BOOL all, nomatch;
|
||||
+ DDSURFACEDESC2 desc;
|
||||
+ struct list *entry, *entry2;
|
||||
+
|
||||
+ /* a combination of match flags is not allowed */
|
||||
+ if (match_flags != 0 &&
|
||||
+ match_flags != DDENUMSURFACES_ALL &&
|
||||
+ match_flags != DDENUMSURFACES_MATCH &&
|
||||
+ match_flags != DDENUMSURFACES_NOMATCH)
|
||||
+ return DDERR_INVALIDPARAMS;
|
||||
+
|
||||
+ all = (Flags & DDENUMSURFACES_ALL) != 0;
|
||||
+ nomatch = (Flags & DDENUMSURFACES_NOMATCH) != 0;
|
||||
+
|
||||
+ if (!all && !DDSD)
|
||||
+ return DDERR_INVALIDPARAMS;
|
||||
|
||||
- if (all || (nomatch != ddraw_match_surface_desc(DDSD, &surf->surface_desc)))
|
||||
+ wined3d_mutex_lock();
|
||||
+
|
||||
+ /* Use the _SAFE enumeration, the app may destroy enumerated surfaces */
|
||||
+ LIST_FOR_EACH_SAFE(entry, entry2, &ddraw->surface_list)
|
||||
{
|
||||
- TRACE("Enumerating surface %p.\n", surf);
|
||||
- desc = surf->surface_desc;
|
||||
- IDirectDrawSurface7_AddRef(&surf->IDirectDrawSurface7_iface);
|
||||
- if (Callback(&surf->IDirectDrawSurface7_iface, &desc, Context) != DDENUMRET_OK)
|
||||
+ surf = LIST_ENTRY(entry, struct ddraw_surface, surface_list_entry);
|
||||
+
|
||||
+ if (!surf->iface_count)
|
||||
{
|
||||
- wined3d_mutex_unlock();
|
||||
- return DD_OK;
|
||||
+ WARN("Not enumerating surface %p because it doesn't have any references.\n", surf);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (all || (nomatch != ddraw_match_surface_desc(DDSD, &surf->surface_desc)))
|
||||
+ {
|
||||
+ TRACE("Enumerating surface %p.\n", surf);
|
||||
+ desc = surf->surface_desc;
|
||||
+ IDirectDrawSurface7_AddRef(&surf->IDirectDrawSurface7_iface);
|
||||
+ if (Callback(&surf->IDirectDrawSurface7_iface, &desc, Context) != DDENUMRET_OK)
|
||||
+ {
|
||||
+ wined3d_mutex_unlock();
|
||||
+ return DD_OK;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
- }
|
||||
|
||||
- wined3d_mutex_unlock();
|
||||
+ wined3d_mutex_unlock();
|
||||
+ }
|
||||
+ else
|
||||
+ return DDERR_INVALIDPARAMS;
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c
|
||||
index e9c616e..930460f 100644
|
||||
--- a/dlls/ddraw/tests/d3d.c
|
||||
+++ b/dlls/ddraw/tests/d3d.c
|
||||
@@ -147,15 +147,15 @@ static BOOL CreateDirect3D(void)
|
||||
|
||||
count.found = count.surfaces = 0;
|
||||
rc = IDirectDraw7_EnumSurfaces(lpDD, 0, &ddsd, &count, SurfaceCounter);
|
||||
- todo_wine ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
|
||||
count.found = count.surfaces = 0;
|
||||
rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_ALL, NULL, &count, SurfaceCounter);
|
||||
- todo_wine ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
- todo_wine ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
- todo_wine ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+ ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
|
||||
count.found = count.surfaces = 0;
|
||||
rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_MATCH, NULL, &count, SurfaceCounter);
|
||||
@@ -220,22 +220,22 @@ static BOOL CreateDirect3D(void)
|
||||
rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_NOMATCH,
|
||||
&ddsd2, &count, SurfaceCounter);
|
||||
ok(rc == DD_OK, "Expected DD_OK, got %x\n", rc);
|
||||
- todo_wine ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
- todo_wine ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+ ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
|
||||
count.found = count.surfaces = 0;
|
||||
rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_ALL |
|
||||
DDENUMSURFACES_MATCH, NULL, &count, SurfaceCounter);
|
||||
- todo_wine ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
- todo_wine ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
- todo_wine ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+ ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
|
||||
count.found = count.surfaces = 0;
|
||||
rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_ALL |
|
||||
DDENUMSURFACES_NOMATCH, NULL, &count, SurfaceCounter);
|
||||
- todo_wine ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
- todo_wine ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
- todo_wine ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+ ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
|
||||
count.found = count.surfaces = 0;
|
||||
rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_MATCH |
|
||||
@@ -247,23 +247,23 @@ static BOOL CreateDirect3D(void)
|
||||
/* search type DDENUMSURFACES_CANBECREATED */
|
||||
count.found = count.surfaces = 0;
|
||||
rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_CANBECREATED, &ddsd, &count, SurfaceCounter);
|
||||
- todo_wine ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
|
||||
count.found = count.surfaces = 0;
|
||||
rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_ALL,
|
||||
&ddsd, &count, SurfaceCounter);
|
||||
- todo_wine ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
- todo_wine ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
- todo_wine ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+ ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
|
||||
count.found = count.surfaces = 0;
|
||||
rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_NOMATCH,
|
||||
&ddsd, &count, SurfaceCounter);
|
||||
- todo_wine ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
- todo_wine ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
- todo_wine ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
+ ok(rc == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %x\n", rc);
|
||||
+ ok(count.found == 0, "Has %d surface descriptions, expected 0\n", count.found);
|
||||
+ ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
|
||||
count.found = count.surfaces = 0;
|
||||
rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_MATCH,
|
||||
@@ -276,7 +276,7 @@ static BOOL CreateDirect3D(void)
|
||||
rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_MATCH,
|
||||
&ddsd, &count, SurfaceCounter);
|
||||
ok(rc == DD_OK, "Expected DD_OK, got %x\n", rc);
|
||||
- todo_wine ok(count.found == 1, "Has %d surface descriptions, expected 1\n", count.found);
|
||||
+ ok(count.found == 1, "Has %d surface descriptions, expected 1\n", count.found);
|
||||
ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
|
||||
/* combination of DDENUMSURFACES_DOESEXIST and DDENUMSURFACES_CANBECREATED */
|
||||
@@ -284,7 +284,7 @@ static BOOL CreateDirect3D(void)
|
||||
rc = IDirectDraw7_EnumSurfaces(lpDD, DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_CANBECREATED |
|
||||
DDENUMSURFACES_MATCH, &ddsd, &count, SurfaceCounter);
|
||||
ok(rc == DD_OK, "Expected DD_OK, got %x\n", rc);
|
||||
- todo_wine ok(count.found == 1, "Has %d surface descriptions, expected 1\n", count.found);
|
||||
+ ok(count.found == 1, "Has %d surface descriptions, expected 1\n", count.found);
|
||||
ok(count.surfaces == 0, "Has %d surfaces, expected 0\n", count.surfaces);
|
||||
|
||||
memset(&ddsd, 0, sizeof(ddsd));
|
||||
--
|
||||
2.5.0
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: [17233] Implement DDENUMSURFACES_CANBECREATED in IDirectDraw7::EnumSurfaces
|
@@ -1,4 +1,4 @@
|
||||
From da87296baa62ed82f5334236ef9b259aac818e5d Mon Sep 17 00:00:00 2001
|
||||
From 2097fbe83a66a3a423bdd148ecfc4f16c1237110 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Wed, 29 Jul 2015 17:09:50 +0200
|
||||
Subject: [PATCH] ddraw: Create rendering targets in video memory if possible.
|
||||
@@ -12,10 +12,10 @@ Based on a patch by Henri Verbeet.
|
||||
4 files changed, 56 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
|
||||
index 535f33f1c7d..00fd337ead4 100644
|
||||
index 050f625f7..9655f9e47 100644
|
||||
--- a/dlls/ddraw/ddraw.c
|
||||
+++ b/dlls/ddraw/ddraw.c
|
||||
@@ -4298,7 +4298,7 @@ static HRESULT WINAPI d3d7_CreateDevice(IDirect3D7 *iface, REFCLSID riid,
|
||||
@@ -4214,7 +4214,7 @@ static HRESULT WINAPI d3d7_CreateDevice(IDirect3D7 *iface, REFCLSID riid,
|
||||
TRACE("iface %p, riid %s, surface %p, device %p.\n", iface, debugstr_guid(riid), surface, device);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
@@ -24,7 +24,7 @@ index 535f33f1c7d..00fd337ead4 100644
|
||||
{
|
||||
*device = &object->IDirect3DDevice7_iface;
|
||||
}
|
||||
@@ -4327,7 +4327,7 @@ static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid,
|
||||
@@ -4243,7 +4243,7 @@ static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid,
|
||||
return CLASS_E_NOAGGREGATION;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
@@ -33,7 +33,7 @@ index 535f33f1c7d..00fd337ead4 100644
|
||||
{
|
||||
*device = &device_impl->IDirect3DDevice3_iface;
|
||||
}
|
||||
@@ -4353,7 +4353,7 @@ static HRESULT WINAPI d3d2_CreateDevice(IDirect3D2 *iface, REFCLSID riid,
|
||||
@@ -4269,7 +4269,7 @@ static HRESULT WINAPI d3d2_CreateDevice(IDirect3D2 *iface, REFCLSID riid,
|
||||
iface, debugstr_guid(riid), surface, device);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
@@ -43,10 +43,10 @@ index 535f33f1c7d..00fd337ead4 100644
|
||||
*device = &device_impl->IDirect3DDevice2_iface;
|
||||
}
|
||||
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h
|
||||
index 42a7a85e4ec..1a7e48fdffa 100644
|
||||
index f4fe970a6..ba0ec73d8 100644
|
||||
--- a/dlls/ddraw/ddraw_private.h
|
||||
+++ b/dlls/ddraw/ddraw_private.h
|
||||
@@ -310,6 +310,7 @@ struct d3d_device
|
||||
@@ -313,6 +313,7 @@ struct d3d_device
|
||||
IUnknown IUnknown_inner;
|
||||
LONG ref;
|
||||
UINT version;
|
||||
@@ -54,8 +54,8 @@ index 42a7a85e4ec..1a7e48fdffa 100644
|
||||
|
||||
IUnknown *outer_unknown;
|
||||
struct wined3d_device *wined3d_device;
|
||||
@@ -356,7 +357,7 @@ struct d3d_device
|
||||
struct wined3d_stateblock *recording, *state, *update_state;
|
||||
@@ -360,7 +361,7 @@ struct d3d_device
|
||||
const struct wined3d_stateblock_state *stateblock_state;
|
||||
};
|
||||
|
||||
-HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUnknown *rt_iface,
|
||||
@@ -64,10 +64,10 @@ index 42a7a85e4ec..1a7e48fdffa 100644
|
||||
enum wined3d_depth_buffer_type d3d_device_update_depth_stencil(struct d3d_device *device) DECLSPEC_HIDDEN;
|
||||
|
||||
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
|
||||
index 7acc8e0db0b..390d9a9040d 100644
|
||||
index 048ba7fba..ce74a0fb8 100644
|
||||
--- a/dlls/ddraw/device.c
|
||||
+++ b/dlls/ddraw/device.c
|
||||
@@ -1856,7 +1856,7 @@ static HRESULT d3d_device7_SetRenderTarget(IDirect3DDevice7 *iface,
|
||||
@@ -1858,7 +1858,7 @@ static HRESULT d3d_device7_SetRenderTarget(IDirect3DDevice7 *iface,
|
||||
return DDERR_INVALIDCAPS;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ index 7acc8e0db0b..390d9a9040d 100644
|
||||
{
|
||||
WARN("Surface %p is not in video memory.\n", target_impl);
|
||||
wined3d_mutex_unlock();
|
||||
@@ -1932,7 +1932,7 @@ static HRESULT WINAPI d3d_device3_SetRenderTarget(IDirect3DDevice3 *iface,
|
||||
@@ -1934,7 +1934,7 @@ static HRESULT WINAPI d3d_device3_SetRenderTarget(IDirect3DDevice3 *iface,
|
||||
return DDERR_INVALIDPIXELFORMAT;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ index 7acc8e0db0b..390d9a9040d 100644
|
||||
{
|
||||
WARN("Surface %p is not in video memory.\n", target_impl);
|
||||
IDirectDrawSurface4_AddRef(target);
|
||||
@@ -1981,7 +1981,7 @@ static HRESULT WINAPI d3d_device2_SetRenderTarget(IDirect3DDevice2 *iface,
|
||||
@@ -1983,7 +1983,7 @@ static HRESULT WINAPI d3d_device2_SetRenderTarget(IDirect3DDevice2 *iface,
|
||||
return DDERR_INVALIDPIXELFORMAT;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ index 7acc8e0db0b..390d9a9040d 100644
|
||||
{
|
||||
WARN("Surface %p is not in video memory.\n", target_impl);
|
||||
IDirectDrawSurface_AddRef(target);
|
||||
@@ -6956,7 +6956,7 @@ static void ddraw_reset_viewport_state(struct ddraw *ddraw)
|
||||
@@ -6951,7 +6951,7 @@ static void ddraw_reset_viewport_state(struct ddraw *ddraw)
|
||||
wined3d_stateblock_set_scissor_rect(ddraw->state, &rect);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ index 7acc8e0db0b..390d9a9040d 100644
|
||||
struct ddraw_surface *target, IUnknown *rt_iface, UINT version, IUnknown *outer_unknown)
|
||||
{
|
||||
static const struct wined3d_matrix ident =
|
||||
@@ -6979,6 +6979,7 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
|
||||
@@ -6974,6 +6974,7 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
|
||||
device->IUnknown_inner.lpVtbl = &d3d_device_inner_vtbl;
|
||||
device->ref = 1;
|
||||
device->version = version;
|
||||
@@ -111,7 +111,7 @@ index 7acc8e0db0b..390d9a9040d 100644
|
||||
|
||||
if (outer_unknown)
|
||||
device->outer_unknown = outer_unknown;
|
||||
@@ -7036,14 +7037,18 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
|
||||
@@ -7032,14 +7033,18 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ index 7acc8e0db0b..390d9a9040d 100644
|
||||
|
||||
if (!(target->surface_desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
|
||||
|| (target->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER))
|
||||
@@ -7066,7 +7071,7 @@ HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUn
|
||||
@@ -7062,7 +7067,7 @@ HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUn
|
||||
return DDERR_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ index 7acc8e0db0b..390d9a9040d 100644
|
||||
{
|
||||
WARN("Surface %p is not in video memory.\n", target);
|
||||
return D3DERR_SURFACENOTINVIDMEM;
|
||||
@@ -7084,7 +7089,7 @@ HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUn
|
||||
@@ -7080,7 +7085,7 @@ HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUn
|
||||
return DDERR_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ index 7acc8e0db0b..390d9a9040d 100644
|
||||
WARN("Failed to initialize device, hr %#x.\n", hr);
|
||||
heap_free(object);
|
||||
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
|
||||
index da8913c521c..8b40e7de4b8 100644
|
||||
index 85c1ef496..01522f515 100644
|
||||
--- a/dlls/ddraw/surface.c
|
||||
+++ b/dlls/ddraw/surface.c
|
||||
@@ -223,7 +223,7 @@ static HRESULT WINAPI ddraw_surface7_QueryInterface(IDirectDrawSurface7 *iface,
|
||||
@@ -164,7 +164,7 @@ index da8913c521c..8b40e7de4b8 100644
|
||||
1, &This->device1, (IUnknown *)&This->IDirectDrawSurface_iface)))
|
||||
{
|
||||
This->device1 = NULL;
|
||||
@@ -6201,7 +6201,42 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
|
||||
@@ -6192,7 +6192,42 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
|
||||
|
||||
if (desc->ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY)
|
||||
{
|
||||
@@ -196,7 +196,7 @@ index da8913c521c..8b40e7de4b8 100644
|
||||
+ * possible.
|
||||
+ */
|
||||
+ if (bind_flags
|
||||
+ && SUCCEEDED(hr = wined3d_check_device_format(ddraw->wined3d, WINED3DADAPTER_DEFAULT,
|
||||
+ && SUCCEEDED(hr = wined3d_check_device_format(ddraw->wined3d, ddraw->wined3d_adapter,
|
||||
+ WINED3D_DEVICE_TYPE_HAL, mode.format_id, 0,
|
||||
+ bind_flags, WINED3D_RTYPE_TEXTURE_2D, wined3d_desc.format)))
|
||||
+ {
|
||||
@@ -209,5 +209,5 @@ index da8913c521c..8b40e7de4b8 100644
|
||||
}
|
||||
else
|
||||
--
|
||||
2.25.0
|
||||
2.25.1
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 882c25ffe94d7e8869ed5a364120cf0c5f2ef241 Mon Sep 17 00:00:00 2001
|
||||
From a6f14f05fefc9510f673b47092cbc62a2366ccf9 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <gofmanp@gmail.com>
|
||||
Date: Thu, 4 Apr 2019 02:25:00 +0300
|
||||
Subject: [PATCH] ddraw: Allow setting texture without DDSCAPS_TEXTURE for
|
||||
@@ -6,26 +6,15 @@ Subject: [PATCH] ddraw: Allow setting texture without DDSCAPS_TEXTURE for
|
||||
|
||||
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
|
||||
---
|
||||
dlls/ddraw/device.c | 22 +++++--
|
||||
dlls/ddraw/device.c | 20 ++++--
|
||||
dlls/ddraw/tests/ddraw4.c | 128 +++++++++++++++++++++++++++++++++++++-
|
||||
2 files changed, 141 insertions(+), 9 deletions(-)
|
||||
2 files changed, 141 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
|
||||
index e2643e6589..a43bca7a14 100644
|
||||
index 11e60f80c..324475303 100644
|
||||
--- a/dlls/ddraw/device.c
|
||||
+++ b/dlls/ddraw/device.c
|
||||
@@ -2921,10 +2921,8 @@ static HRESULT WINAPI d3d_device3_SetLightState(IDirect3DDevice3 *iface,
|
||||
wined3d_mutex_unlock();
|
||||
return DDERR_INVALIDPARAMS;
|
||||
}
|
||||
-
|
||||
material_activate(m);
|
||||
}
|
||||
-
|
||||
device->material = value;
|
||||
}
|
||||
else if (state == D3DLIGHTSTATE_COLORMODEL)
|
||||
@@ -4807,7 +4805,8 @@ static HRESULT d3d_device7_SetTexture(IDirect3DDevice7 *iface,
|
||||
@@ -4798,7 +4798,8 @@ static HRESULT d3d_device7_SetTexture(IDirect3DDevice7 *iface,
|
||||
struct ddraw_surface *surf = unsafe_impl_from_IDirectDrawSurface7(texture);
|
||||
struct wined3d_texture *wined3d_texture = NULL;
|
||||
|
||||
@@ -35,7 +24,7 @@ index e2643e6589..a43bca7a14 100644
|
||||
|
||||
if (surf && (surf->surface_desc.ddsCaps.dwCaps & DDSCAPS_TEXTURE))
|
||||
wined3d_texture = surf->wined3d_texture;
|
||||
@@ -4845,19 +4844,30 @@ static HRESULT WINAPI d3d_device3_SetTexture(IDirect3DDevice3 *iface,
|
||||
@@ -4834,19 +4835,30 @@ static HRESULT WINAPI d3d_device3_SetTexture(IDirect3DDevice3 *iface,
|
||||
{
|
||||
struct d3d_device *device = impl_from_IDirect3DDevice3(iface);
|
||||
struct ddraw_surface *tex = unsafe_impl_from_IDirect3DTexture2(texture);
|
||||
@@ -58,7 +47,7 @@ index e2643e6589..a43bca7a14 100644
|
||||
+ wined3d_texture = NULL;
|
||||
+ }
|
||||
+
|
||||
+ wined3d_device_set_texture(device->wined3d_device, stage, wined3d_texture);
|
||||
+ wined3d_stateblock_set_texture(device->state, stage, wined3d_texture);
|
||||
|
||||
fixup_texture_alpha_op(device);
|
||||
|
||||
@@ -70,7 +59,7 @@ index e2643e6589..a43bca7a14 100644
|
||||
|
||||
static const struct tss_lookup
|
||||
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
|
||||
index e3146ca45d..8861244e05 100644
|
||||
index e1d5bac18..e18f3c638 100644
|
||||
--- a/dlls/ddraw/tests/ddraw4.c
|
||||
+++ b/dlls/ddraw/tests/ddraw4.c
|
||||
@@ -330,7 +330,7 @@ static IDirectDraw4 *create_ddraw(void)
|
||||
@@ -132,7 +121,7 @@ index e3146ca45d..8861244e05 100644
|
||||
static IDirect3DViewport3 *create_viewport(IDirect3DDevice3 *device, UINT x, UINT y, UINT w, UINT h)
|
||||
{
|
||||
IDirect3DViewport3 *viewport;
|
||||
@@ -16819,6 +16830,116 @@ static void test_surface_format_conversion_alpha(void)
|
||||
@@ -16980,6 +16991,116 @@ static void test_surface_format_conversion_alpha(void)
|
||||
DestroyWindow(window);
|
||||
}
|
||||
|
||||
@@ -249,7 +238,7 @@ index e3146ca45d..8861244e05 100644
|
||||
START_TEST(ddraw4)
|
||||
{
|
||||
DDDEVICEIDENTIFIER identifier;
|
||||
@@ -16951,6 +17072,7 @@ START_TEST(ddraw4)
|
||||
@@ -17112,6 +17233,7 @@ START_TEST(ddraw4)
|
||||
test_gdi_surface();
|
||||
test_alphatest();
|
||||
test_clipper_refcount();
|
||||
@@ -258,5 +247,5 @@ index e3146ca45d..8861244e05 100644
|
||||
test_d32_support();
|
||||
test_surface_format_conversion_alpha();
|
||||
--
|
||||
2.17.1
|
||||
2.25.1
|
||||
|
||||
|
@@ -1,45 +0,0 @@
|
||||
From 9ac9e58e5c76a02e3746c4e4bd16b43766b35066 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 2 Oct 2015 17:29:43 +0200
|
||||
Subject: ddraw: Remove const from ddraw1_vtbl and ddraw_surface1_vtbl.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Bad Mojo Redux tries to hook ddraw1 and expects both interfaces to be writable.
|
||||
|
||||
Signed-off-by: Michael Müller <michael@fds-team.de>
|
||||
---
|
||||
dlls/ddraw/ddraw.c | 2 +-
|
||||
dlls/ddraw/surface.c | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
|
||||
index c94bfee..bcb1608 100644
|
||||
--- a/dlls/ddraw/ddraw.c
|
||||
+++ b/dlls/ddraw/ddraw.c
|
||||
@@ -4494,7 +4494,7 @@ static const struct IDirectDraw2Vtbl ddraw2_vtbl =
|
||||
ddraw2_GetAvailableVidMem,
|
||||
};
|
||||
|
||||
-static const struct IDirectDrawVtbl ddraw1_vtbl =
|
||||
+static struct IDirectDrawVtbl ddraw1_vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
ddraw1_QueryInterface,
|
||||
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
|
||||
index 6b6ddb9..71bcba4 100644
|
||||
--- a/dlls/ddraw/surface.c
|
||||
+++ b/dlls/ddraw/surface.c
|
||||
@@ -5421,7 +5421,7 @@ static const struct IDirectDrawSurface2Vtbl ddraw_surface2_vtbl =
|
||||
ddraw_surface2_PageUnlock,
|
||||
};
|
||||
|
||||
-static const struct IDirectDrawSurfaceVtbl ddraw_surface1_vtbl =
|
||||
+static struct IDirectDrawSurfaceVtbl ddraw_surface1_vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
ddraw_surface1_QueryInterface,
|
||||
--
|
||||
2.5.1
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user