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
72 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
3f8edce509 | ||
|
56174c3307 | ||
|
a36ea2ace3 | ||
|
8f56ffcf57 | ||
|
d0190e3ade | ||
|
72a13348de | ||
|
a8556b9c25 | ||
|
52a77f6b00 | ||
|
be0910e9a9 | ||
|
270b403c6d | ||
|
4ea094eddb | ||
|
0e7183639d | ||
|
ac1bb98de4 | ||
|
bfdd49203c | ||
|
1773e25340 | ||
|
553986fdfb | ||
|
8ce5fe8929 | ||
|
8b930aea2f | ||
|
e20fec1c52 | ||
|
6f3a3b40aa | ||
|
1184d64c71 | ||
|
e2c7fb5bb6 | ||
|
85ba5095c8 | ||
|
cf0a72b3aa | ||
|
f7bee23139 | ||
|
7ba10a3ef2 | ||
|
8f51d290fd | ||
|
271835fcdd | ||
|
a02caca06d | ||
|
0d4d90ee80 | ||
|
d963a250c9 | ||
|
d82dea3b21 | ||
|
055e049821 | ||
|
5ffc00de0a | ||
|
8e6af31b99 | ||
|
18e878bc40 | ||
|
4c19e3f8e1 | ||
|
b6787bc221 | ||
|
6c37563f92 | ||
|
65e6bb8111 | ||
|
3d9797093d | ||
|
993b6c9c83 | ||
|
d866f07818 | ||
|
3d08d08fda | ||
|
01adefa75c | ||
|
6260ab9bce | ||
|
3a1bf0a033 | ||
|
06fbe73760 | ||
|
c043d43772 | ||
|
d3067e60ff | ||
|
923434cd32 | ||
|
f419a53698 | ||
|
5e8beb5ff2 | ||
|
37de066533 | ||
|
e108b600b5 | ||
|
06ad40cfd0 | ||
|
bd8f790f9b | ||
|
4a23a62b5d | ||
|
e6cfe1ccd8 | ||
|
b50c875c39 | ||
|
b02bd9c446 | ||
|
7c1618b197 | ||
|
733fa5c485 | ||
|
b74293fbfe | ||
|
38aa047cad | ||
|
778998c66e | ||
|
d12fcebb0e | ||
|
7937739028 | ||
|
13b580a0c8 | ||
|
b3c99ebf4b | ||
|
87578b4c82 | ||
|
be81b6245c |
@@ -1,23 +1,23 @@
|
||||
From f23512417cb3d149a8be4f757282d17cc1f99f9a Mon Sep 17 00:00:00 2001
|
||||
From fa73044dd60bae90b9a5ec850205a07579d4db17 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Thu, 29 May 2014 23:43:45 +0200
|
||||
Subject: loader: Add commandline option --patches to show the patch list.
|
||||
Subject: [PATCH] loader: Add commandline option --patches to show the patch
|
||||
list.
|
||||
|
||||
---
|
||||
dlls/ntdll/misc.c | 8 ++++++++
|
||||
dlls/ntdll/ntdll.spec | 1 +
|
||||
include/wine/library.h | 1 +
|
||||
libs/wine/config.c | 6 ++++++
|
||||
libs/wine/wine.def | 1 +
|
||||
libs/wine/wine.map | 1 +
|
||||
loader/main.c | 42 +++++++++++++++++++++++++++++++++++++++++-
|
||||
7 files changed, 59 insertions(+), 1 deletion(-)
|
||||
6 files changed, 58 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/misc.c b/dlls/ntdll/misc.c
|
||||
index ad1b43b..1f985e7 100644
|
||||
index bb75d9c..21e2db6 100644
|
||||
--- a/dlls/ntdll/misc.c
|
||||
+++ b/dlls/ntdll/misc.c
|
||||
@@ -55,6 +55,14 @@ const char * CDECL NTDLL_wine_get_version(void)
|
||||
@@ -61,6 +61,14 @@ const char * CDECL NTDLL_wine_get_version(void)
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
@@ -33,10 +33,10 @@ index ad1b43b..1f985e7 100644
|
||||
*/
|
||||
const char * CDECL NTDLL_wine_get_build_id(void)
|
||||
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
|
||||
index 51de6e7..ee4ed49 100644
|
||||
index 292b0f6..fb45a94 100644
|
||||
--- a/dlls/ntdll/ntdll.spec
|
||||
+++ b/dlls/ntdll/ntdll.spec
|
||||
@@ -1421,6 +1421,7 @@
|
||||
@@ -1516,6 +1516,7 @@
|
||||
|
||||
# Version
|
||||
@ cdecl wine_get_version() NTDLL_wine_get_version
|
||||
@@ -57,10 +57,10 @@ index 242bb69..fae73fe 100644
|
||||
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 a273502..5262c76 100644
|
||||
index 3c9110b..5da6263 100644
|
||||
--- a/libs/wine/config.c
|
||||
+++ b/libs/wine/config.c
|
||||
@@ -478,6 +478,12 @@ const char *wine_get_version(void)
|
||||
@@ -522,6 +522,12 @@ const char *wine_get_version(void)
|
||||
return PACKAGE_VERSION;
|
||||
}
|
||||
|
||||
@@ -73,18 +73,6 @@ index a273502..5262c76 100644
|
||||
/* return the build id string */
|
||||
const char *wine_get_build_id(void)
|
||||
{
|
||||
diff --git a/libs/wine/wine.def b/libs/wine/wine.def
|
||||
index ed315bd..5b42029 100644
|
||||
--- a/libs/wine/wine.def
|
||||
+++ b/libs/wine/wine.def
|
||||
@@ -83,6 +83,7 @@ EXPORTS
|
||||
wine_get_sortkey
|
||||
wine_get_user_name
|
||||
wine_get_version
|
||||
+ wine_get_patches
|
||||
wine_init
|
||||
wine_init_argv0_path
|
||||
wine_is_dbcs_leadbyte
|
||||
diff --git a/libs/wine/wine.map b/libs/wine/wine.map
|
||||
index 2159fac..7cb2918 100644
|
||||
--- a/libs/wine/wine.map
|
||||
@@ -98,10 +86,10 @@ index 2159fac..7cb2918 100644
|
||||
wine_init_argv0_path;
|
||||
wine_is_dbcs_leadbyte;
|
||||
diff --git a/loader/main.c b/loader/main.c
|
||||
index ce21173..4794e51 100644
|
||||
index f197cf8..f662912 100644
|
||||
--- a/loader/main.c
|
||||
+++ b/loader/main.c
|
||||
@@ -89,7 +89,8 @@ static void check_command_line( int argc, char *argv[] )
|
||||
@@ -54,7 +54,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"
|
||||
@@ -111,7 +99,7 @@ index ce21173..4794e51 100644
|
||||
|
||||
if (argc <= 1)
|
||||
{
|
||||
@@ -106,6 +107,45 @@ static void check_command_line( int argc, char *argv[] )
|
||||
@@ -71,6 +72,45 @@ static void check_command_line( int argc, char *argv[] )
|
||||
printf( "%s\n", wine_get_build_id() );
|
||||
exit(0);
|
||||
}
|
||||
@@ -158,5 +146,5 @@ index ce21173..4794e51 100644
|
||||
|
||||
|
||||
--
|
||||
2.2.1
|
||||
1.9.1
|
||||
|
||||
|
@@ -1,16 +1,15 @@
|
||||
From 41863fd8fdf3a885efa93359a538e4e74258fb30 Mon Sep 17 00:00:00 2001
|
||||
From 9618572cf2eace39198fb83b747a70d1865015e3 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: loader: Add commandline option --check-libs.
|
||||
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.def | 2 +
|
||||
libs/wine/wine.map | 2 +
|
||||
loader/main.c | 50 +++++++++++++++++++-
|
||||
6 files changed, 215 insertions(+), 1 deletion(-)
|
||||
5 files changed, 213 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/wine/library.h b/include/wine/library.h
|
||||
index fae73fe..7395a11 100644
|
||||
@@ -33,10 +32,10 @@ index fae73fe..7395a11 100644
|
||||
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 12f4a67..be9f401 100644
|
||||
index 5da6263..6cedfb7 100644
|
||||
--- a/libs/wine/config.c
|
||||
+++ b/libs/wine/config.c
|
||||
@@ -443,6 +443,130 @@ const char *wine_get_build_dir(void)
|
||||
@@ -488,6 +488,130 @@ const char *wine_get_build_dir(void)
|
||||
return build_dir;
|
||||
}
|
||||
|
||||
@@ -168,10 +167,10 @@ index 12f4a67..be9f401 100644
|
||||
const char *wine_get_server_dir(void)
|
||||
{
|
||||
diff --git a/libs/wine/loader.c b/libs/wine/loader.c
|
||||
index b5b32cc..1453a82 100644
|
||||
index 649aa22..367dde3 100644
|
||||
--- a/libs/wine/loader.c
|
||||
+++ b/libs/wine/loader.c
|
||||
@@ -1041,6 +1041,42 @@ void *wine_dlopen( const char *filename, int flag, char *error, size_t errorsize
|
||||
@@ -1064,6 +1064,42 @@ void *wine_dlopen( const char *filename, int flag, char *error, size_t errorsize
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -214,26 +213,6 @@ index b5b32cc..1453a82 100644
|
||||
* wine_dlsym
|
||||
*/
|
||||
void *wine_dlsym( void *handle, const char *symbol, char *error, size_t errorsize )
|
||||
diff --git a/libs/wine/wine.def b/libs/wine/wine.def
|
||||
index 5b42029..6acf329 100644
|
||||
--- a/libs/wine/wine.def
|
||||
+++ b/libs/wine/wine.def
|
||||
@@ -64,6 +64,7 @@ EXPORTS
|
||||
wine_dbg_sprintf
|
||||
wine_dbgstr_an
|
||||
wine_dbgstr_wn
|
||||
+ wine_dladdr
|
||||
wine_dlclose
|
||||
wine_dll_enum_load_path
|
||||
wine_dll_get_owner
|
||||
@@ -79,6 +80,7 @@ EXPORTS
|
||||
wine_get_build_id
|
||||
wine_get_config_dir
|
||||
wine_get_data_dir
|
||||
+ wine_get_libs
|
||||
wine_get_server_dir
|
||||
wine_get_sortkey
|
||||
wine_get_user_name
|
||||
diff --git a/libs/wine/wine.map b/libs/wine/wine.map
|
||||
index 7cb2918..72ffed8 100644
|
||||
--- a/libs/wine/wine.map
|
||||
@@ -255,7 +234,7 @@ index 7cb2918..72ffed8 100644
|
||||
wine_get_sortkey;
|
||||
wine_get_ss;
|
||||
diff --git a/loader/main.c b/loader/main.c
|
||||
index 343ea26..44804e1 100644
|
||||
index f662912..a2dc40c 100644
|
||||
--- a/loader/main.c
|
||||
+++ b/loader/main.c
|
||||
@@ -36,6 +36,12 @@
|
||||
@@ -271,7 +250,7 @@ index 343ea26..44804e1 100644
|
||||
#include <pthread.h>
|
||||
|
||||
#include "wine/library.h"
|
||||
@@ -90,7 +96,8 @@ static void check_command_line( int argc, char *argv[] )
|
||||
@@ -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"
|
||||
@@ -281,7 +260,7 @@ index 343ea26..44804e1 100644
|
||||
|
||||
if (argc <= 1)
|
||||
{
|
||||
@@ -146,6 +153,47 @@ static void check_command_line( int argc, char *argv[] )
|
||||
@@ -111,6 +118,47 @@ static void check_command_line( int argc, char *argv[] )
|
||||
|
||||
exit(0);
|
||||
}
|
||||
@@ -330,5 +309,5 @@ index 343ea26..44804e1 100644
|
||||
|
||||
|
||||
--
|
||||
2.7.1
|
||||
1.9.1
|
||||
|
||||
|
@@ -1,36 +0,0 @@
|
||||
From 22a49dfa50cda9b1f5a5c64eabed2d17b0033896 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 4 Aug 2017 02:52:50 +0200
|
||||
Subject: server: Correctly validate SID length in sd_is_valid.
|
||||
|
||||
---
|
||||
server/token.c | 6 ++----
|
||||
1 file changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/server/token.c b/server/token.c
|
||||
index acd7a4dedb5..7ab0f634c05 100644
|
||||
--- a/server/token.c
|
||||
+++ b/server/token.c
|
||||
@@ -332,8 +332,7 @@ int sd_is_valid( const struct security_descriptor *sd, data_size_t size )
|
||||
owner = sd_get_owner( sd );
|
||||
if (owner)
|
||||
{
|
||||
- size_t needed_size = security_sid_len( owner );
|
||||
- if ((sd->owner_len < sizeof(SID)) || (needed_size > sd->owner_len))
|
||||
+ if ((sd->owner_len < sizeof(SID)) || (security_sid_len( owner ) > sd->owner_len))
|
||||
return FALSE;
|
||||
}
|
||||
offset += sd->owner_len;
|
||||
@@ -344,8 +343,7 @@ int sd_is_valid( const struct security_descriptor *sd, data_size_t size )
|
||||
group = sd_get_group( sd );
|
||||
if (group)
|
||||
{
|
||||
- size_t needed_size = security_sid_len( group );
|
||||
- if ((sd->group_len < sizeof(SID)) || (needed_size > sd->group_len))
|
||||
+ if ((sd->group_len < sizeof(SID)) || (security_sid_len( group ) > sd->group_len))
|
||||
return FALSE;
|
||||
}
|
||||
offset += sd->group_len;
|
||||
--
|
||||
2.13.1
|
||||
|
@@ -1,125 +0,0 @@
|
||||
From 2b29014573fcb38388dd82e33fa16f67b1a43a8c Mon Sep 17 00:00:00 2001
|
||||
From: Austin English <austinenglish@gmail.com>
|
||||
Date: Sun, 23 Oct 2016 16:15:45 -0500
|
||||
Subject: [PATCH] advapi32: Add RegLoadAppKeyA/RegLoadAppKeyW stubs
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=41591
|
||||
Signed-off-by: Austin English <austinenglish@gmail.com>
|
||||
---
|
||||
dlls/advapi32/advapi32.spec | 4 ++--
|
||||
dlls/advapi32/registry.c | 24 ++++++++++++++++++++++
|
||||
.../api-ms-win-core-registry-l1-1-0.spec | 4 ++--
|
||||
.../api-ms-win-downlevel-advapi32-l1-1-0.spec | 4 ++--
|
||||
dlls/kernelbase/kernelbase.spec | 4 ++--
|
||||
include/winreg.h | 3 +++
|
||||
6 files changed, 35 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec
|
||||
index e870a5d..042a523 100644
|
||||
--- a/dlls/advapi32/advapi32.spec
|
||||
+++ b/dlls/advapi32/advapi32.spec
|
||||
@@ -648,8 +648,8 @@
|
||||
@ stdcall RegGetKeySecurity(long long ptr ptr)
|
||||
@ stdcall RegGetValueA(long str str long ptr ptr ptr)
|
||||
@ stdcall RegGetValueW(long wstr wstr long ptr ptr ptr)
|
||||
-# @ stub RegLoadAppKeyA
|
||||
-# @ stub RegLoadAppKeyW
|
||||
+@ stdcall RegLoadAppKeyA(str ptr long long long)
|
||||
+@ stdcall RegLoadAppKeyW(wstr ptr long long long)
|
||||
@ stdcall RegLoadKeyA(long str str)
|
||||
@ stdcall RegLoadKeyW(long wstr wstr)
|
||||
@ stdcall RegLoadMUIStringA(long str str long ptr long str)
|
||||
diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
|
||||
index 3018372..55df6de 100644
|
||||
--- a/dlls/advapi32/registry.c
|
||||
+++ b/dlls/advapi32/registry.c
|
||||
@@ -3513,3 +3513,27 @@ LONG WINAPI RegDisableReflectionKey(HKEY base)
|
||||
FIXME("%p: stub\n", base);
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
+
|
||||
+/******************************************************************************
|
||||
+ * RegLoadAppKeyA [ADVAPI32.@]
|
||||
+ *
|
||||
+ */
|
||||
+LSTATUS WINAPI RegLoadAppKeyA(const char *file, HKEY *result, REGSAM sam, DWORD options, DWORD reserved)
|
||||
+{
|
||||
+ FIXME("%s %p %u %u %u: stub\n", wine_dbgstr_a(file), result, sam, options, reserved);
|
||||
+
|
||||
+ *result = (HKEY)0xbeefcafe;
|
||||
+ return ERROR_SUCCESS;
|
||||
+}
|
||||
+
|
||||
+/******************************************************************************
|
||||
+ * RegLoadAppKeyW [ADVAPI32.@]
|
||||
+ *
|
||||
+ */
|
||||
+LSTATUS WINAPI RegLoadAppKeyW(const WCHAR *file, HKEY *result, REGSAM sam, DWORD options, DWORD reserved)
|
||||
+{
|
||||
+ FIXME("%s %p %u %u %u: stub\n", wine_dbgstr_w(file), result, sam, options, reserved);
|
||||
+
|
||||
+ *result = (HKEY)0xbeefcafe;
|
||||
+ return ERROR_SUCCESS;
|
||||
+}
|
||||
diff --git a/dlls/api-ms-win-core-registry-l1-1-0/api-ms-win-core-registry-l1-1-0.spec b/dlls/api-ms-win-core-registry-l1-1-0/api-ms-win-core-registry-l1-1-0.spec
|
||||
index 7a48e3b..f81f027 100644
|
||||
--- a/dlls/api-ms-win-core-registry-l1-1-0/api-ms-win-core-registry-l1-1-0.spec
|
||||
+++ b/dlls/api-ms-win-core-registry-l1-1-0/api-ms-win-core-registry-l1-1-0.spec
|
||||
@@ -17,8 +17,8 @@
|
||||
@ stdcall RegGetKeySecurity(long long ptr ptr) advapi32.RegGetKeySecurity
|
||||
@ stdcall RegGetValueA(long str str long ptr ptr ptr) advapi32.RegGetValueA
|
||||
@ stdcall RegGetValueW(long wstr wstr long ptr ptr ptr) advapi32.RegGetValueW
|
||||
-@ stub RegLoadAppKeyA
|
||||
-@ stub RegLoadAppKeyW
|
||||
+@ stdcall RegLoadAppKeyA(str ptr long long long) advapi32.RegLoadAppKeyA
|
||||
+@ stdcall RegLoadAppKeyW(wstr ptr long long long) advapi32.RegLoadAppKeyW
|
||||
@ stdcall RegLoadKeyA(long str str) advapi32.RegLoadKeyA
|
||||
@ stdcall RegLoadKeyW(long wstr wstr) advapi32.RegLoadKeyW
|
||||
@ stdcall RegLoadMUIStringA(long str str long ptr long str) advapi32.RegLoadMUIStringA
|
||||
diff --git a/dlls/api-ms-win-downlevel-advapi32-l1-1-0/api-ms-win-downlevel-advapi32-l1-1-0.spec b/dlls/api-ms-win-downlevel-advapi32-l1-1-0/api-ms-win-downlevel-advapi32-l1-1-0.spec
|
||||
index 5bdad41..b2dcc17 100644
|
||||
--- a/dlls/api-ms-win-downlevel-advapi32-l1-1-0/api-ms-win-downlevel-advapi32-l1-1-0.spec
|
||||
+++ b/dlls/api-ms-win-downlevel-advapi32-l1-1-0/api-ms-win-downlevel-advapi32-l1-1-0.spec
|
||||
@@ -102,8 +102,8 @@
|
||||
@ stdcall RegGetKeySecurity(long long ptr ptr) advapi32.RegGetKeySecurity
|
||||
@ stdcall RegGetValueA(long str str long ptr ptr ptr) advapi32.RegGetValueA
|
||||
@ stdcall RegGetValueW(long wstr wstr long ptr ptr ptr) advapi32.RegGetValueW
|
||||
-@ stub RegLoadAppKeyA
|
||||
-@ stub RegLoadAppKeyW
|
||||
+@ stdcall RegLoadAppKeyA(str ptr long long long) advapi32.RegLoadAppKeyA
|
||||
+@ stdcall RegLoadAppKeyW(wstr ptr long long long) advapi32.RegLoadAppKeyW
|
||||
@ stdcall RegLoadKeyA(long str str) advapi32.RegLoadKeyA
|
||||
@ stdcall RegLoadKeyW(long wstr wstr) advapi32.RegLoadKeyW
|
||||
@ stdcall RegLoadMUIStringA(long str str long ptr long str) advapi32.RegLoadMUIStringA
|
||||
diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec
|
||||
index 286dae0..c114622 100644
|
||||
--- a/dlls/kernelbase/kernelbase.spec
|
||||
+++ b/dlls/kernelbase/kernelbase.spec
|
||||
@@ -1288,8 +1288,8 @@
|
||||
# @ stub RegKrnResetAppKeyLoaded
|
||||
# @ stub RegKrnSetDllHasThreadStateGlobal
|
||||
# @ stub RegKrnSetTermsrvRegistryExtensionFlags
|
||||
-# @ stub RegLoadAppKeyA
|
||||
-# @ stub RegLoadAppKeyW
|
||||
+@ stdcall RegLoadAppKeyA(str ptr long long long) advapi32.RegLoadAppKeyA
|
||||
+@ stdcall RegLoadAppKeyW(wstr ptr long long long) advapi32.RegLoadAppKeyW
|
||||
@ stdcall -private RegLoadKeyA(long str str) kernel32.RegLoadKeyA
|
||||
@ stdcall -private RegLoadKeyW(long wstr wstr) kernel32.RegLoadKeyW
|
||||
@ stdcall -private RegLoadMUIStringA(long str str long ptr long str) kernel32.RegLoadMUIStringA
|
||||
diff --git a/include/winreg.h b/include/winreg.h
|
||||
index 51e9f02..5656eec 100644
|
||||
--- a/include/winreg.h
|
||||
+++ b/include/winreg.h
|
||||
@@ -133,6 +133,9 @@ WINADVAPI LSTATUS WINAPI RegGetKeySecurity(HKEY,SECURITY_INFORMATION,PSECURITY
|
||||
WINADVAPI LSTATUS WINAPI RegGetValueA(HKEY,LPCSTR,LPCSTR,DWORD,LPDWORD,PVOID,LPDWORD);
|
||||
WINADVAPI LSTATUS WINAPI RegGetValueW(HKEY,LPCWSTR,LPCWSTR,DWORD,LPDWORD,PVOID,LPDWORD);
|
||||
#define RegGetValue WINELIB_NAME_AW(RegGetValue)
|
||||
+WINADVAPI LSTATUS WINAPI RegLoadAppKeyA(const char*,HKEY*,REGSAM,DWORD,DWORD);
|
||||
+WINADVAPI LSTATUS WINAPI RegLoadAppKeyW(const WCHAR*,HKEY*,REGSAM,DWORD,DWORD);
|
||||
+#define RegLoadAppKey WINELIB_NAME_AW(RegLoadAppKey)
|
||||
WINADVAPI LSTATUS WINAPI RegLoadKeyA(HKEY,LPCSTR,LPCSTR);
|
||||
WINADVAPI LSTATUS WINAPI RegLoadKeyW(HKEY,LPCWSTR,LPCWSTR);
|
||||
#define RegLoadKey WINELIB_NAME_AW(RegLoadKey)
|
||||
--
|
||||
1.9.1
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: [41591] advapi32: Add RegLoadAppKeyA/RegLoadAppKeyW stubs
|
@@ -0,0 +1,35 @@
|
||||
From 37c7da9a71e327dfe86c0c550cabc50968abd04d Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Shadura <bugzilla@tut.by>
|
||||
Date: Fri, 1 Feb 2019 08:38:10 +1100
|
||||
Subject: [PATCH] comctl32: Fixed rebar behaviour when there's capture and no
|
||||
drag
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=14750
|
||||
---
|
||||
dlls/comctl32/rebar.c | 10 +++++++++-
|
||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c
|
||||
index aaa1047..29fc854 100644
|
||||
--- a/dlls/comctl32/rebar.c
|
||||
+++ b/dlls/comctl32/rebar.c
|
||||
@@ -3119,7 +3119,15 @@ REBAR_MouseMove (REBAR_INFO *infoPtr, LPARAM lParam)
|
||||
int yPtMove = (infoPtr->dwStyle & CCS_VERT ? ptMove.x : ptMove.y);
|
||||
|
||||
if (GetCapture() != infoPtr->hwndSelf)
|
||||
- ERR("We are dragging but haven't got capture?!?\n");
|
||||
+ {
|
||||
+ if (infoPtr->fStatus & BEGIN_DRAG_ISSUED)
|
||||
+ {
|
||||
+ REBAR_Notify_NMREBAR (infoPtr, infoPtr->iGrabbedBand, RBN_ENDDRAG);
|
||||
+ infoPtr->fStatus &= ~BEGIN_DRAG_ISSUED;
|
||||
+ }
|
||||
+ infoPtr->iGrabbedBand = -1;
|
||||
+ return 0;
|
||||
+ }
|
||||
|
||||
band = REBAR_GetBand(infoPtr, infoPtr->iGrabbedBand);
|
||||
|
||||
--
|
||||
1.9.1
|
||||
|
1
patches/comctrl-rebar-capture/definition
Normal file
1
patches/comctrl-rebar-capture/definition
Normal file
@@ -0,0 +1 @@
|
||||
Fixes: [14750] comctl32: Fixed rebar behaviour when there's capture and no drag.
|
@@ -1,140 +0,0 @@
|
||||
From a26d43a10fb5de70732970b20a29ce4437b33076 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 14 Jan 2017 07:54:39 +0100
|
||||
Subject: [PATCH] d3d8: Improve ValidatePixelShader stub.
|
||||
|
||||
---
|
||||
dlls/d3d8/d3d8_main.c | 37 +++++++++++++++++--------------------
|
||||
dlls/d3d8/tests/device.c | 34 ++++++++++++++++++++--------------
|
||||
2 files changed, 37 insertions(+), 34 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d8/d3d8_main.c b/dlls/d3d8/d3d8_main.c
|
||||
index 17f35c90..7b28bdf1 100644
|
||||
--- a/dlls/d3d8/d3d8_main.c
|
||||
+++ b/dlls/d3d8/d3d8_main.c
|
||||
@@ -105,39 +105,36 @@ done:
|
||||
|
||||
/***********************************************************************
|
||||
* ValidatePixelShader (D3D8.@)
|
||||
- *
|
||||
- * PARAMS
|
||||
- * toto result?
|
||||
*/
|
||||
-HRESULT WINAPI ValidatePixelShader(DWORD* pixelshader, DWORD* reserved1, BOOL boolean, DWORD* toto)
|
||||
+HRESULT WINAPI ValidatePixelShader(DWORD *pixelshader, DWORD *reserved1, BOOL return_error, char **errors)
|
||||
{
|
||||
- HRESULT ret;
|
||||
- static BOOL warned;
|
||||
-
|
||||
- if (TRACE_ON(d3d8) || !warned) {
|
||||
- FIXME("(%p %p %d %p): stub\n", pixelshader, reserved1, boolean, toto);
|
||||
- warned = TRUE;
|
||||
- }
|
||||
+ const char *message = "";
|
||||
+ HRESULT hr = E_FAIL;
|
||||
|
||||
- if (!pixelshader)
|
||||
- return E_FAIL;
|
||||
+ TRACE("(%p %p %d %p): semi-stub\n", pixelshader, reserved1, return_error, errors);
|
||||
|
||||
- if (reserved1)
|
||||
- return E_FAIL;
|
||||
+ if (!pixelshader)
|
||||
+ return E_FAIL;
|
||||
|
||||
- switch(*pixelshader) {
|
||||
+ switch (*pixelshader)
|
||||
+ {
|
||||
case 0xFFFF0100:
|
||||
case 0xFFFF0101:
|
||||
case 0xFFFF0102:
|
||||
case 0xFFFF0103:
|
||||
case 0xFFFF0104:
|
||||
- ret=S_OK;
|
||||
+ hr = S_OK;
|
||||
break;
|
||||
default:
|
||||
WARN("Invalid shader version token %#x.\n", *pixelshader);
|
||||
- ret=E_FAIL;
|
||||
- }
|
||||
- return ret;
|
||||
+ message = "(Global Validation Error) Version Token: Unsupported pixel shader version.\n";
|
||||
+ }
|
||||
+
|
||||
+ if (!return_error) message = "";
|
||||
+ if (errors && (*errors = HeapAlloc(GetProcessHeap(), 0, strlen(message) + 1)))
|
||||
+ strcpy(*errors, message);
|
||||
+
|
||||
+ return hr;
|
||||
}
|
||||
|
||||
void d3d8_resource_cleanup(struct d3d8_resource *resource)
|
||||
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
|
||||
index 315640d3..6f8354f4 100644
|
||||
--- a/dlls/d3d8/tests/device.c
|
||||
+++ b/dlls/d3d8/tests/device.c
|
||||
@@ -53,7 +53,7 @@ struct device_desc
|
||||
static DEVMODEW registry_mode;
|
||||
|
||||
static HRESULT (WINAPI *ValidateVertexShader)(const DWORD *, const DWORD *, const D3DCAPS8 *, BOOL, char **);
|
||||
-static HRESULT (WINAPI *ValidatePixelShader)(DWORD *, DWORD *, int, DWORD *);
|
||||
+static HRESULT (WINAPI *ValidatePixelShader)(DWORD *, DWORD *, BOOL, char **);
|
||||
|
||||
static BOOL (WINAPI *pGetCursorInfo)(PCURSORINFO);
|
||||
|
||||
@@ -4474,33 +4474,39 @@ static void test_validate_ps(void)
|
||||
0x00000005, 0x800f0000, 0xb0e40000, 0x80e40000, /* mul r0, t0, r0 */
|
||||
0x0000ffff, /* end */
|
||||
};
|
||||
+ char *errors;
|
||||
HRESULT hr;
|
||||
|
||||
hr = ValidatePixelShader(0, 0, 0, 0);
|
||||
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
hr = ValidatePixelShader(0, 0, 1, 0);
|
||||
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ errors = (void *)0xdeadbeef;
|
||||
+ hr = ValidatePixelShader(0, 0, 1, &errors);
|
||||
+ ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
+ ok(errors == (void *)0xdeadbeef, "Expected 0xdeadbeef, got %p.\n", errors);
|
||||
+
|
||||
hr = ValidatePixelShader(ps, 0, 0, 0);
|
||||
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
-
|
||||
hr = ValidatePixelShader(ps, 0, 1, 0);
|
||||
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
- /* Seems to do some version checking. */
|
||||
+
|
||||
*ps = 0xffff0105; /* bogus version */
|
||||
hr = ValidatePixelShader(ps, 0, 1, 0);
|
||||
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
- /* I've seen that applications always pass the 2nd parameter as 0.
|
||||
- * Simple test with a non-zero parameter. */
|
||||
- *ps = 0xffff0101; /* ps_1_1 */
|
||||
- hr = ValidatePixelShader(ps, ps, 1, 0);
|
||||
+
|
||||
+ errors = (void *)0xdeadbeef;
|
||||
+ hr = ValidatePixelShader(ps, 0, 0, &errors);
|
||||
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
- /* I've seen the 3rd parameter always passed as either 0 or 1, but passing
|
||||
- * other values doesn't seem to hurt. */
|
||||
- hr = ValidatePixelShader(ps, 0, 12345, 0);
|
||||
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
- /* What is the 4th parameter? The following seems to work ok. */
|
||||
- hr = ValidatePixelShader(ps, 0, 1, ps);
|
||||
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ ok(!strcmp(errors, ""), "Got unexpected string '%s'.\n", errors);
|
||||
+ HeapFree(GetProcessHeap(), 0, errors);
|
||||
+
|
||||
+ errors = (void *)0xdeadbeef;
|
||||
+ hr = ValidatePixelShader(ps, 0, 1, &errors);
|
||||
+ ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
|
||||
+ ok(strstr(errors, "Validation Error") != NULL, "Got unexpected string '%s'.\n", errors);
|
||||
+ HeapFree(GetProcessHeap(), 0, errors);
|
||||
}
|
||||
|
||||
static void test_volume_get_container(void)
|
||||
--
|
||||
2.20.1
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: [40036] Improve stubs for Validate{Vertex,Pixel}Shader
|
@@ -0,0 +1,42 @@
|
||||
From b2bae3c7d8f8b6dfc7587b7a7a3147f5650096a7 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Costa <titan.costa@gmail.com>
|
||||
Date: Sun, 30 Jul 2017 23:50:18 +0200
|
||||
Subject: d3dx9: Return D3DFMT_A8R8G8B8 in D3DXGetImageInfoFromFileInMemory for
|
||||
32 bpp BMP with alpha.
|
||||
|
||||
---
|
||||
dlls/d3dx9_36/surface.c | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
|
||||
index c82c22289..abb1c0e5c 100644
|
||||
--- a/dlls/d3dx9_36/surface.c
|
||||
+++ b/dlls/d3dx9_36/surface.c
|
||||
@@ -954,6 +954,24 @@ HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(const void *data, UINT datasize,
|
||||
}
|
||||
}
|
||||
|
||||
+ /* For 32 bpp BMP, windowscodecs.dll never returns a format with alpha while
|
||||
+ * d3dx9_xx.dll returns one if at least 1 pixel has a non zero alpha component */
|
||||
+ if (SUCCEEDED(hr) && (info->Format == D3DFMT_X8R8G8B8) && (info->ImageFileFormat == D3DXIFF_BMP)) {
|
||||
+ DWORD size = sizeof(DWORD) * info->Width * info->Height;
|
||||
+ BYTE *buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
+ hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, sizeof(DWORD) * info->Width, size, buffer);
|
||||
+ if (SUCCEEDED(hr)) {
|
||||
+ DWORD i;
|
||||
+ for (i = 0; i < info->Width * info->Height; i++) {
|
||||
+ if (buffer[i*4+3]) {
|
||||
+ info->Format = D3DFMT_A8R8G8B8;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ HeapFree(GetProcessHeap(), 0, buffer);
|
||||
+ }
|
||||
+
|
||||
if (frame)
|
||||
IWICBitmapFrameDecode_Release(frame);
|
||||
|
||||
--
|
||||
2.20.1
|
||||
|
@@ -1,87 +0,0 @@
|
||||
From 6c77d9cea2889d1cacbe8d774f07aef887dee3fa Mon Sep 17 00:00:00 2001
|
||||
From: Christian Costa <titan.costa@gmail.com>
|
||||
Date: Sun, 30 Jul 2017 23:50:18 +0200
|
||||
Subject: d3dx9: Return D3DFMT_A8R8G8B8 in D3DXGetImageInfoFromFileInMemory for
|
||||
32 bpp BMP with alpha.
|
||||
|
||||
---
|
||||
dlls/d3dx9_36/surface.c | 18 ++++++++++++++++++
|
||||
dlls/d3dx9_36/tests/surface.c | 26 ++++++++++++++++++++++++++
|
||||
2 files changed, 44 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
|
||||
index 958805a8cc6..87a41255050 100644
|
||||
--- a/dlls/d3dx9_36/surface.c
|
||||
+++ b/dlls/d3dx9_36/surface.c
|
||||
@@ -973,6 +973,24 @@ HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(const void *data, UINT datasize,
|
||||
}
|
||||
}
|
||||
|
||||
+ /* For 32 bpp BMP, windowscodecs.dll never returns a format with alpha while
|
||||
+ * d3dx9_xx.dll returns one if at least 1 pixel has a non zero alpha component */
|
||||
+ if (SUCCEEDED(hr) && (info->Format == D3DFMT_X8R8G8B8) && (info->ImageFileFormat == D3DXIFF_BMP)) {
|
||||
+ DWORD size = sizeof(DWORD) * info->Width * info->Height;
|
||||
+ BYTE *buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
+ hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, sizeof(DWORD) * info->Width, size, buffer);
|
||||
+ if (SUCCEEDED(hr)) {
|
||||
+ DWORD i;
|
||||
+ for (i = 0; i < info->Width * info->Height; i++) {
|
||||
+ if (buffer[i*4+3]) {
|
||||
+ info->Format = D3DFMT_A8R8G8B8;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ HeapFree(GetProcessHeap(), 0, buffer);
|
||||
+ }
|
||||
+
|
||||
if (frame)
|
||||
IWICBitmapFrameDecode_Release(frame);
|
||||
|
||||
diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c
|
||||
index 2be48dfddab..e45ee36e69c 100644
|
||||
--- a/dlls/d3dx9_36/tests/surface.c
|
||||
+++ b/dlls/d3dx9_36/tests/surface.c
|
||||
@@ -67,6 +67,24 @@ static const unsigned char bmp_8bpp[] = {
|
||||
0x00,0x00
|
||||
};
|
||||
|
||||
+/* 2x2 bmp (32 bpp XRGB) */
|
||||
+static const unsigned char bmp_32bpp_xrgb[] = {
|
||||
+0x42,0x4d,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x00,0x00,0x00,0x28,0x00,
|
||||
+0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x20,0x00,0x00,0x00,
|
||||
+0x00,0x00,0x10,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x00,0x00,
|
||||
+0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0xb0,0xc0,0x00,0xa1,0xb1,0xc1,0x00,0xa2,0xb2,
|
||||
+0xc2,0x00,0xa3,0xb3,0xc3,0x00
|
||||
+};
|
||||
+
|
||||
+/* 2x2 bmp (32 bpp ARGB) */
|
||||
+static const unsigned char bmp_32bpp_argb[] = {
|
||||
+0x42,0x4d,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x00,0x00,0x00,0x28,0x00,
|
||||
+0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x20,0x00,0x00,0x00,
|
||||
+0x00,0x00,0x10,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x00,0x00,
|
||||
+0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0xb0,0xc0,0x00,0xa1,0xb1,0xc1,0x00,0xa2,0xb2,
|
||||
+0xc2,0x00,0xa3,0xb3,0xc3,0x01
|
||||
+};
|
||||
+
|
||||
static const unsigned char png_grayscale[] =
|
||||
{
|
||||
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49,
|
||||
@@ -559,6 +577,14 @@ static void test_D3DXGetImageInfo(void)
|
||||
ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK);
|
||||
ok(info.Depth == 1, "Got depth %u, expected 1\n", info.Depth);
|
||||
ok(info.Format == D3DFMT_P8, "Got format %u, expected %u\n", info.Format, D3DFMT_P8);
|
||||
+ hr = D3DXGetImageInfoFromFileInMemory(bmp_32bpp_xrgb, sizeof(bmp_32bpp_xrgb), &info);
|
||||
+ ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK);
|
||||
+ ok(info.Depth == 1, "Got depth %u, expected 1\n", info.Depth);
|
||||
+ ok(info.Format == D3DFMT_X8R8G8B8, "Got format %u, expected %u\n", info.Format, D3DFMT_X8R8G8B8);
|
||||
+ hr = D3DXGetImageInfoFromFileInMemory(bmp_32bpp_argb, sizeof(bmp_32bpp_argb), &info);
|
||||
+ ok(hr == D3D_OK, "D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK);
|
||||
+ ok(info.Depth == 1, "Got depth %u, expected 1\n", info.Depth);
|
||||
+ ok(info.Format == D3DFMT_A8R8G8B8, "Got format %u, expected %u\n", info.Format, D3DFMT_A8R8G8B8);
|
||||
|
||||
/* Grayscale PNG */
|
||||
hr = D3DXGetImageInfoFromFileInMemory(png_grayscale, sizeof(png_grayscale), &info);
|
||||
--
|
||||
2.13.1
|
||||
|
@@ -17,7 +17,7 @@ index 87eaf86..fd4635e 100644
|
||||
|
||||
- return E_NOTIMPL;
|
||||
+ iface->lpVtbl->AddRef(iface);
|
||||
+ *effect = iface;
|
||||
+ *new_effect = iface;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
|
@@ -180,7 +180,7 @@ index 5522dea..916ce4c 100644
|
||||
+ DeleteObject(This->bitmap);
|
||||
+ }
|
||||
+
|
||||
+ hr = D3DXCreateTexture(This->device, This->tex_width, This->tex_height, 1, 0,
|
||||
+ hr = D3DXCreateTexture(This->device, This->tex_width, This->tex_height, 1, D3DUSAGE_DYNAMIC,
|
||||
+ D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &This->texture);
|
||||
+ if (FAILED(hr))
|
||||
+ {
|
||||
|
@@ -1,81 +0,0 @@
|
||||
From c20687718ab550c2f8b481ebad484986cdd588e4 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 28 Jul 2015 17:26:09 +0200
|
||||
Subject: d3dx9_36: Return dummy skininfo interface in D3DXLoadSkinMeshFromXof
|
||||
when skin information is unavailable.
|
||||
|
||||
---
|
||||
dlls/d3dx9_36/d3dx9_private.h | 2 ++
|
||||
dlls/d3dx9_36/mesh.c | 7 +++++++
|
||||
dlls/d3dx9_36/skin.c | 22 +++++++++++++++++++++-
|
||||
3 files changed, 30 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h
|
||||
index 9c1a6b23a49..f07173cda23 100644
|
||||
--- a/dlls/d3dx9_36/d3dx9_private.h
|
||||
+++ b/dlls/d3dx9_36/d3dx9_private.h
|
||||
@@ -367,4 +367,6 @@ struct ctab_constant {
|
||||
const struct ctab_constant *d3dx_shader_get_ctab_constant(ID3DXConstantTable *iface,
|
||||
D3DXHANDLE constant) DECLSPEC_HIDDEN;
|
||||
|
||||
+HRESULT create_dummy_skin(ID3DXSkinInfo **iface) DECLSPEC_HIDDEN;
|
||||
+
|
||||
#endif /* __WINE_D3DX9_PRIVATE_H */
|
||||
diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c
|
||||
index 1ddb4c300cb..1d41b775c1b 100644
|
||||
--- a/dlls/d3dx9_36/mesh.c
|
||||
+++ b/dlls/d3dx9_36/mesh.c
|
||||
@@ -3332,6 +3332,13 @@ static HRESULT parse_mesh(ID3DXFileData *filedata, struct mesh_data *mesh_data,
|
||||
goto end;
|
||||
}
|
||||
|
||||
+ if ((provide_flags & PROVIDE_SKININFO) && !mesh_data->skin_info)
|
||||
+ {
|
||||
+ hr = create_dummy_skin(&mesh_data->skin_info);
|
||||
+ if (FAILED(hr))
|
||||
+ goto end;
|
||||
+ }
|
||||
+
|
||||
hr = D3D_OK;
|
||||
|
||||
end:
|
||||
diff --git a/dlls/d3dx9_36/skin.c b/dlls/d3dx9_36/skin.c
|
||||
index f197d33582a..bed4b9f49d2 100644
|
||||
--- a/dlls/d3dx9_36/skin.c
|
||||
+++ b/dlls/d3dx9_36/skin.c
|
||||
@@ -94,7 +94,7 @@ static ULONG WINAPI d3dx9_skin_info_Release(ID3DXSkinInfo *iface)
|
||||
HeapFree(GetProcessHeap(), 0, skin->bones[i].vertices);
|
||||
HeapFree(GetProcessHeap(), 0, skin->bones[i].weights);
|
||||
}
|
||||
- HeapFree(GetProcessHeap(), 0, skin->bones);
|
||||
+ if (skin->bones) HeapFree(GetProcessHeap(), 0, skin->bones);
|
||||
HeapFree(GetProcessHeap(), 0, skin);
|
||||
}
|
||||
|
||||
@@ -495,3 +495,23 @@ HRESULT WINAPI D3DXCreateSkinInfoFVF(DWORD num_vertices, DWORD fvf, DWORD num_bo
|
||||
|
||||
return D3DXCreateSkinInfo(num_vertices, declaration, num_bones, skin_info);
|
||||
}
|
||||
+
|
||||
+HRESULT create_dummy_skin(ID3DXSkinInfo **iface)
|
||||
+{
|
||||
+ static const D3DVERTEXELEMENT9 empty_declaration = D3DDECL_END();
|
||||
+ struct d3dx9_skin_info *object = NULL;
|
||||
+
|
||||
+ object = HeapAlloc(GetProcessHeap(), 0, sizeof(*object));
|
||||
+ if (!object) return E_OUTOFMEMORY;
|
||||
+
|
||||
+ object->ID3DXSkinInfo_iface.lpVtbl = &d3dx9_skin_info_vtbl;
|
||||
+ object->ref = 1;
|
||||
+ object->num_vertices = 0;
|
||||
+ object->num_bones = 0;
|
||||
+ object->vertex_declaration[0] = empty_declaration;
|
||||
+ object->fvf = 0;
|
||||
+ object->bones = NULL;
|
||||
+
|
||||
+ *iface = &object->ID3DXSkinInfo_iface;
|
||||
+ return D3D_OK;
|
||||
+}
|
||||
--
|
||||
2.13.1
|
||||
|
@@ -1,164 +0,0 @@
|
||||
From 2c16649c78bb8d3751b3fb8ac52c497380d1918b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 28 Jul 2015 17:34:40 +0200
|
||||
Subject: d3dx9_36/tests: Add initial tests for dummy skininfo interface.
|
||||
|
||||
---
|
||||
dlls/d3dx9_36/tests/mesh.c | 127 +++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 127 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
|
||||
index 0243a61..7f86d89 100644
|
||||
--- a/dlls/d3dx9_36/tests/mesh.c
|
||||
+++ b/dlls/d3dx9_36/tests/mesh.c
|
||||
@@ -25,6 +25,9 @@
|
||||
#include <limits.h>
|
||||
#include "wine/test.h"
|
||||
#include "d3dx9.h"
|
||||
+#include "initguid.h"
|
||||
+#include "rmxftmpl.h"
|
||||
+#include "rmxfguid.h"
|
||||
|
||||
#ifndef NAN
|
||||
/* From wine/port.h */
|
||||
@@ -2374,6 +2377,129 @@ static void D3DXLoadMeshTest(void)
|
||||
free_test_context(test_context);
|
||||
}
|
||||
|
||||
+static ID3DXFileData *get_mesh_data(const char *memory, SIZE_T length)
|
||||
+{
|
||||
+ D3DXF_FILELOADMEMORY source;
|
||||
+ ID3DXFileEnumObject *enumobj = NULL;
|
||||
+ ID3DXFileData *filedata = NULL;
|
||||
+ ID3DXFileData *ret = NULL;
|
||||
+ ID3DXFile *d3dxfile = NULL;
|
||||
+ SIZE_T i, nb_children;
|
||||
+ HRESULT hr;
|
||||
+ GUID guid;
|
||||
+
|
||||
+ hr = D3DXFileCreate(&d3dxfile);
|
||||
+ if (FAILED(hr)) return NULL;
|
||||
+
|
||||
+ hr = d3dxfile->lpVtbl->RegisterTemplates(d3dxfile, D3DRM_XTEMPLATES, D3DRM_XTEMPLATE_BYTES);
|
||||
+ if (FAILED(hr)) goto cleanup;
|
||||
+
|
||||
+ source.lpMemory = (void *)memory;
|
||||
+ source.dSize = length;
|
||||
+
|
||||
+ hr = d3dxfile->lpVtbl->CreateEnumObject(d3dxfile, &source, D3DXF_FILELOAD_FROMMEMORY, &enumobj);
|
||||
+ if (FAILED(hr)) goto cleanup;
|
||||
+
|
||||
+ hr = enumobj->lpVtbl->GetChildren(enumobj, &nb_children);
|
||||
+ if (FAILED(hr)) goto cleanup;
|
||||
+
|
||||
+ for (i = 0; i < nb_children; i++)
|
||||
+ {
|
||||
+ hr = enumobj->lpVtbl->GetChild(enumobj, i, &filedata);
|
||||
+ if (FAILED(hr)) goto cleanup;
|
||||
+
|
||||
+ hr = filedata->lpVtbl->GetType(filedata, &guid);
|
||||
+ if (SUCCEEDED(hr) && IsEqualGUID(&guid, &TID_D3DRMMesh))
|
||||
+ {
|
||||
+ ret = filedata;
|
||||
+ break;
|
||||
+ }
|
||||
+ else
|
||||
+ filedata->lpVtbl->Release(filedata);
|
||||
+ }
|
||||
+
|
||||
+cleanup:
|
||||
+ if (enumobj) enumobj->lpVtbl->Release(enumobj);
|
||||
+ if (d3dxfile) d3dxfile->lpVtbl->Release(d3dxfile);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static void D3DXLoadSkinMeshFromXofTest(void)
|
||||
+{
|
||||
+ static const char simple_xfile[] =
|
||||
+ "xof 0303txt 0032"
|
||||
+ "Mesh {"
|
||||
+ "3;"
|
||||
+ "0.0; 0.0; 0.0;,"
|
||||
+ "0.0; 1.0; 0.0;,"
|
||||
+ "1.0; 1.0; 0.0;;"
|
||||
+ "1;"
|
||||
+ "3; 0, 1, 2;;"
|
||||
+ "}";
|
||||
+ ID3DXBuffer *adjacency, *materials, *effects;
|
||||
+ D3DPRESENT_PARAMETERS d3dpp;
|
||||
+ IDirect3DDevice9 *device;
|
||||
+ ID3DXFileData *filedata;
|
||||
+ ID3DXSkinInfo *skininfo;
|
||||
+ ID3DXMesh *mesh;
|
||||
+ IDirect3D9 *d3d;
|
||||
+ DWORD mat_count;
|
||||
+ HRESULT hr;
|
||||
+ HWND hwnd;
|
||||
+
|
||||
+ if (!(hwnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0,
|
||||
+ 640, 480, NULL, NULL, NULL, NULL)))
|
||||
+ {
|
||||
+ skip("Couldn't create application window\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ d3d = Direct3DCreate9(D3D_SDK_VERSION);
|
||||
+ if (!d3d)
|
||||
+ {
|
||||
+ skip("Couldn't create IDirect3D9 object\n");
|
||||
+ DestroyWindow(hwnd);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ ZeroMemory(&d3dpp, sizeof(d3dpp));
|
||||
+ d3dpp.Windowed = TRUE;
|
||||
+ d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
|
||||
+
|
||||
+ hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device);
|
||||
+ IDirect3D9_Release(d3d);
|
||||
+ if (FAILED(hr))
|
||||
+ {
|
||||
+ skip("Failed to create IDirect3DDevice9 object %#x\n", hr);
|
||||
+ DestroyWindow(hwnd);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ filedata = get_mesh_data(simple_xfile, sizeof(simple_xfile) - 1);
|
||||
+ ok(filedata != NULL, "Failed to load mesh data\n");
|
||||
+
|
||||
+ adjacency = materials = effects = NULL;
|
||||
+ skininfo = NULL;
|
||||
+ mesh = NULL;
|
||||
+
|
||||
+ hr = D3DXLoadSkinMeshFromXof(filedata, 0, device, &adjacency, &materials, &effects, &mat_count, &skininfo, &mesh);
|
||||
+ ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr);
|
||||
+ ok(skininfo != NULL, "Expected non-null skininfo\n");
|
||||
+
|
||||
+ /* FIXME: Add additional tests for skininfo interface. */
|
||||
+
|
||||
+ if (adjacency) adjacency->lpVtbl->Release(adjacency);
|
||||
+ if (materials) materials->lpVtbl->Release(materials);
|
||||
+ if (effects) effects->lpVtbl->Release(effects);
|
||||
+ if (skininfo) skininfo->lpVtbl->Release(skininfo);
|
||||
+ if (mesh) mesh->lpVtbl->Release(mesh);
|
||||
+
|
||||
+ filedata->lpVtbl->Release(filedata);
|
||||
+ IDirect3DDevice9_Release(device);
|
||||
+ DestroyWindow(hwnd);
|
||||
+}
|
||||
+
|
||||
static BOOL compute_box(struct mesh *mesh, float width, float height, float depth)
|
||||
{
|
||||
unsigned int i, face;
|
||||
@@ -10955,6 +11081,7 @@ START_TEST(mesh)
|
||||
D3DXCreateMeshTest();
|
||||
D3DXCreateMeshFVFTest();
|
||||
D3DXLoadMeshTest();
|
||||
+ D3DXLoadSkinMeshFromXofTest();
|
||||
D3DXCreateBoxTest();
|
||||
D3DXCreatePolygonTest();
|
||||
D3DXCreateSphereTest();
|
||||
--
|
||||
2.5.0
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: [33904] Return dummy ID3DXSkinInfo interface when skinning info not present
|
@@ -1,4 +1,4 @@
|
||||
From 599d50340aaf37f2eb39a789a4034e677d52e92c Mon Sep 17 00:00:00 2001
|
||||
From 51e513935e94ddd1113ad016be7eb4100829ddc6 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, 53 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
|
||||
index 6b2abe3..dfd52a0 100644
|
||||
index 8467fbf4c..b9e13a49b 100644
|
||||
--- a/dlls/ddraw/ddraw.c
|
||||
+++ b/dlls/ddraw/ddraw.c
|
||||
@@ -4209,7 +4209,7 @@ static HRESULT WINAPI d3d7_CreateDevice(IDirect3D7 *iface, REFCLSID riid,
|
||||
@@ -4235,7 +4235,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 6b2abe3..dfd52a0 100644
|
||||
{
|
||||
*device = &object->IDirect3DDevice7_iface;
|
||||
}
|
||||
@@ -4238,7 +4238,7 @@ static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid,
|
||||
@@ -4264,7 +4264,7 @@ static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid,
|
||||
return CLASS_E_NOAGGREGATION;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
@@ -33,7 +33,7 @@ index 6b2abe3..dfd52a0 100644
|
||||
{
|
||||
*device = &device_impl->IDirect3DDevice3_iface;
|
||||
}
|
||||
@@ -4264,7 +4264,7 @@ static HRESULT WINAPI d3d2_CreateDevice(IDirect3D2 *iface, REFCLSID riid,
|
||||
@@ -4290,7 +4290,7 @@ static HRESULT WINAPI d3d2_CreateDevice(IDirect3D2 *iface, REFCLSID riid,
|
||||
iface, debugstr_guid(riid), surface, device);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
@@ -43,10 +43,10 @@ index 6b2abe3..dfd52a0 100644
|
||||
*device = &device_impl->IDirect3DDevice2_iface;
|
||||
}
|
||||
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h
|
||||
index b035a7e..699f719 100644
|
||||
index 19f21a892..e2fe323b6 100644
|
||||
--- a/dlls/ddraw/ddraw_private.h
|
||||
+++ b/dlls/ddraw/ddraw_private.h
|
||||
@@ -303,6 +303,7 @@ struct d3d_device
|
||||
@@ -304,6 +304,7 @@ struct d3d_device
|
||||
IUnknown IUnknown_inner;
|
||||
LONG ref;
|
||||
UINT version;
|
||||
@@ -54,8 +54,8 @@ index b035a7e..699f719 100644
|
||||
|
||||
IUnknown *outer_unknown;
|
||||
struct wined3d_device *wined3d_device;
|
||||
@@ -347,7 +348,7 @@ struct d3d_device
|
||||
struct wined3d_vec4 user_clip_planes[D3DMAXUSERCLIPPLANES];
|
||||
@@ -350,7 +351,7 @@ struct d3d_device
|
||||
BOOL recording;
|
||||
};
|
||||
|
||||
-HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUnknown *rt_iface,
|
||||
@@ -64,10 +64,10 @@ index b035a7e..699f719 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 0d48c7d..2bef17d 100644
|
||||
index 003ce1d2e..c5e303ee0 100644
|
||||
--- a/dlls/ddraw/device.c
|
||||
+++ b/dlls/ddraw/device.c
|
||||
@@ -1854,7 +1854,7 @@ static HRESULT d3d_device7_SetRenderTarget(IDirect3DDevice7 *iface,
|
||||
@@ -1850,7 +1850,7 @@ static HRESULT d3d_device7_SetRenderTarget(IDirect3DDevice7 *iface,
|
||||
return DDERR_INVALIDCAPS;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ index 0d48c7d..2bef17d 100644
|
||||
{
|
||||
WARN("Surface %p is not in video memory.\n", target_impl);
|
||||
wined3d_mutex_unlock();
|
||||
@@ -1930,7 +1930,7 @@ static HRESULT WINAPI d3d_device3_SetRenderTarget(IDirect3DDevice3 *iface,
|
||||
@@ -1926,7 +1926,7 @@ static HRESULT WINAPI d3d_device3_SetRenderTarget(IDirect3DDevice3 *iface,
|
||||
return DDERR_INVALIDPIXELFORMAT;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ index 0d48c7d..2bef17d 100644
|
||||
{
|
||||
WARN("Surface %p is not in video memory.\n", target_impl);
|
||||
IDirectDrawSurface4_AddRef(target);
|
||||
@@ -1979,7 +1979,7 @@ static HRESULT WINAPI d3d_device2_SetRenderTarget(IDirect3DDevice2 *iface,
|
||||
@@ -1975,7 +1975,7 @@ static HRESULT WINAPI d3d_device2_SetRenderTarget(IDirect3DDevice2 *iface,
|
||||
return DDERR_INVALIDPIXELFORMAT;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ index 0d48c7d..2bef17d 100644
|
||||
{
|
||||
WARN("Surface %p is not in video memory.\n", target_impl);
|
||||
IDirectDrawSurface_AddRef(target);
|
||||
@@ -6891,7 +6891,7 @@ enum wined3d_depth_buffer_type d3d_device_update_depth_stencil(struct d3d_device
|
||||
@@ -6963,7 +6963,7 @@ enum wined3d_depth_buffer_type d3d_device_update_depth_stencil(struct d3d_device
|
||||
return WINED3D_ZB_TRUE;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ index 0d48c7d..2bef17d 100644
|
||||
struct ddraw_surface *target, IUnknown *rt_iface, UINT version, IUnknown *outer_unknown)
|
||||
{
|
||||
static const D3DMATRIX ident =
|
||||
@@ -6914,6 +6914,7 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
|
||||
@@ -6986,6 +6986,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 0d48c7d..2bef17d 100644
|
||||
|
||||
if (outer_unknown)
|
||||
device->outer_unknown = outer_unknown;
|
||||
@@ -6964,14 +6965,18 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
|
||||
@@ -7036,14 +7037,18 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ index 0d48c7d..2bef17d 100644
|
||||
|
||||
if (!(target->surface_desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
|
||||
|| (target->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER))
|
||||
@@ -6994,7 +6999,7 @@ HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUn
|
||||
@@ -7066,7 +7071,7 @@ HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUn
|
||||
return DDERR_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ index 0d48c7d..2bef17d 100644
|
||||
{
|
||||
WARN("Surface %p is not in video memory.\n", target);
|
||||
return D3DERR_SURFACENOTINVIDMEM;
|
||||
@@ -7012,7 +7017,7 @@ HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUn
|
||||
@@ -7084,7 +7089,7 @@ HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUn
|
||||
return DDERR_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ index 0d48c7d..2bef17d 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 8190442..c73981b 100644
|
||||
index 4e2faef86..03b97f0d6 100644
|
||||
--- a/dlls/ddraw/surface.c
|
||||
+++ b/dlls/ddraw/surface.c
|
||||
@@ -226,7 +226,7 @@ static HRESULT WINAPI ddraw_surface7_QueryInterface(IDirectDrawSurface7 *iface,
|
||||
@@ -164,7 +164,7 @@ index 8190442..c73981b 100644
|
||||
1, &This->device1, (IUnknown *)&This->IDirectDrawSurface_iface)))
|
||||
{
|
||||
This->device1 = NULL;
|
||||
@@ -6162,7 +6162,39 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
|
||||
@@ -6166,7 +6166,39 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
|
||||
|
||||
if (desc->ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY)
|
||||
{
|
||||
@@ -192,10 +192,10 @@ index 8190442..c73981b 100644
|
||||
+ * specified location and try to create rendering targets in video memory if
|
||||
+ * possible.
|
||||
+ */
|
||||
+ if ((desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE) &&
|
||||
+ SUCCEEDED(hr = wined3d_check_device_format(ddraw->wined3d, WINED3DADAPTER_DEFAULT,
|
||||
+ WINED3D_DEVICE_TYPE_HAL, mode.format_id, 0,
|
||||
+ bind_flags, WINED3D_RTYPE_TEXTURE_2D, wined3d_desc.format)))
|
||||
+ if (bind_flags
|
||||
+ && SUCCEEDED(hr = wined3d_check_device_format(ddraw->wined3d, WINED3DADAPTER_DEFAULT,
|
||||
+ WINED3D_DEVICE_TYPE_HAL, mode.format_id, 0,
|
||||
+ bind_flags, WINED3D_RTYPE_TEXTURE_2D, wined3d_desc.format)))
|
||||
+ {
|
||||
+ FIXME("Application wants to create rendering target in system memory, using video memory instead\n");
|
||||
+ wined3d_desc.bind_flags = bind_flags;
|
||||
@@ -206,5 +206,5 @@ index 8190442..c73981b 100644
|
||||
}
|
||||
else
|
||||
--
|
||||
1.9.1
|
||||
2.20.1
|
||||
|
||||
|
@@ -0,0 +1,265 @@
|
||||
From 1b4c479e85db593612a550cac2f3f9b562a3ac6c 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
|
||||
software device.
|
||||
|
||||
Signed-off-by: Paul Gofman <gofmanp@gmail.com>
|
||||
---
|
||||
dlls/ddraw/device.c | 22 +++++--
|
||||
dlls/ddraw/tests/ddraw4.c | 128 +++++++++++++++++++++++++++++++++++++-
|
||||
2 files changed, 141 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
|
||||
index 9c2de58cac..c0bb93794d 100644
|
||||
--- a/dlls/ddraw/device.c
|
||||
+++ b/dlls/ddraw/device.c
|
||||
@@ -2946,10 +2946,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)
|
||||
@@ -4820,7 +4818,8 @@ static HRESULT d3d_device7_SetTexture(IDirect3DDevice7 *iface,
|
||||
struct ddraw_surface *surf = unsafe_impl_from_IDirectDrawSurface7(texture);
|
||||
struct wined3d_texture *wined3d_texture = NULL;
|
||||
|
||||
- TRACE("iface %p, stage %u, texture %p.\n", iface, stage, texture);
|
||||
+ TRACE("iface %p, stage %u, texture %p, surf %p, surf->surface_desc.ddsCaps.dwCaps %#x.\n",
|
||||
+ iface, stage, texture, surf, surf ? surf->surface_desc.ddsCaps.dwCaps : 0);
|
||||
|
||||
if (surf && (surf->surface_desc.ddsCaps.dwCaps & DDSCAPS_TEXTURE))
|
||||
wined3d_texture = surf->wined3d_texture;
|
||||
@@ -4856,8 +4855,8 @@ 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);
|
||||
+ struct wined3d_texture *wined3d_texture;
|
||||
DWORD texmapblend;
|
||||
- HRESULT hr;
|
||||
|
||||
TRACE("iface %p, stage %u, texture %p.\n", iface, stage, texture);
|
||||
|
||||
@@ -4866,7 +4865,18 @@ static HRESULT WINAPI d3d_device3_SetTexture(IDirect3DDevice3 *iface,
|
||||
if (device->legacyTextureBlending)
|
||||
IDirect3DDevice3_GetRenderState(iface, D3DRENDERSTATE_TEXTUREMAPBLEND, &texmapblend);
|
||||
|
||||
- hr = IDirect3DDevice7_SetTexture(&device->IDirect3DDevice7_iface, stage, &tex->IDirectDrawSurface7_iface);
|
||||
+ if (tex && ((tex->surface_desc.ddsCaps.dwCaps & DDSCAPS_TEXTURE) || !device->hw))
|
||||
+ {
|
||||
+ if (!(tex->surface_desc.ddsCaps.dwCaps & DDSCAPS_TEXTURE))
|
||||
+ WARN("Setting texture without DDSCAPS_TEXTURE.\n");
|
||||
+ wined3d_texture = tex->wined3d_texture;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ wined3d_texture = NULL;
|
||||
+ }
|
||||
+
|
||||
+ wined3d_device_set_texture(device->wined3d_device, stage, wined3d_texture);
|
||||
|
||||
if (device->legacyTextureBlending && texmapblend == D3DTBLEND_MODULATE)
|
||||
{
|
||||
@@ -4898,7 +4908,7 @@ static HRESULT WINAPI d3d_device3_SetTexture(IDirect3DDevice3 *iface,
|
||||
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
- return hr;
|
||||
+ return D3D_OK;
|
||||
}
|
||||
|
||||
static const struct tss_lookup
|
||||
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
|
||||
index abf745aecb..26a021b429 100644
|
||||
--- a/dlls/ddraw/tests/ddraw4.c
|
||||
+++ b/dlls/ddraw/tests/ddraw4.c
|
||||
@@ -329,7 +329,7 @@ static IDirectDraw4 *create_ddraw(void)
|
||||
return ddraw4;
|
||||
}
|
||||
|
||||
-static IDirect3DDevice3 *create_device(HWND window, DWORD coop_level)
|
||||
+static IDirect3DDevice3 *create_device_ex(HWND window, DWORD coop_level, BOOL software)
|
||||
{
|
||||
IDirectDrawSurface4 *surface, *ds;
|
||||
IDirect3DDevice3 *device = NULL;
|
||||
@@ -349,6 +349,8 @@ static IDirect3DDevice3 *create_device(HWND window, DWORD coop_level)
|
||||
surface_desc.dwSize = sizeof(surface_desc);
|
||||
surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
|
||||
surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
|
||||
+ if (software)
|
||||
+ surface_desc.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY;
|
||||
surface_desc.dwWidth = 640;
|
||||
surface_desc.dwHeight = 480;
|
||||
|
||||
@@ -377,7 +379,8 @@ static IDirect3DDevice3 *create_device(HWND window, DWORD coop_level)
|
||||
}
|
||||
|
||||
memset(&z_fmt, 0, sizeof(z_fmt));
|
||||
- hr = IDirect3D3_EnumZBufferFormats(d3d3, &IID_IDirect3DHALDevice, enum_z_fmt, &z_fmt);
|
||||
+ hr = IDirect3D3_EnumZBufferFormats(d3d3, software ? &IID_IDirect3DRGBDevice
|
||||
+ : &IID_IDirect3DHALDevice, enum_z_fmt, &z_fmt);
|
||||
if (FAILED(hr) || !z_fmt.dwSize)
|
||||
{
|
||||
IDirect3D3_Release(d3d3);
|
||||
@@ -389,6 +392,8 @@ static IDirect3DDevice3 *create_device(HWND window, DWORD coop_level)
|
||||
surface_desc.dwSize = sizeof(surface_desc);
|
||||
surface_desc.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT;
|
||||
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
|
||||
+ if (software)
|
||||
+ surface_desc.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY;
|
||||
U4(surface_desc).ddpfPixelFormat = z_fmt;
|
||||
surface_desc.dwWidth = 640;
|
||||
surface_desc.dwHeight = 480;
|
||||
@@ -411,7 +416,8 @@ static IDirect3DDevice3 *create_device(HWND window, DWORD coop_level)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- hr = IDirect3D3_CreateDevice(d3d3, &IID_IDirect3DHALDevice, surface, &device, NULL);
|
||||
+ hr = IDirect3D3_CreateDevice(d3d3, software ? &IID_IDirect3DRGBDevice
|
||||
+ : &IID_IDirect3DHALDevice, surface, &device, NULL);
|
||||
IDirect3D3_Release(d3d3);
|
||||
IDirectDrawSurface4_Release(surface);
|
||||
if (FAILED(hr))
|
||||
@@ -420,6 +426,11 @@ static IDirect3DDevice3 *create_device(HWND window, DWORD coop_level)
|
||||
return device;
|
||||
}
|
||||
|
||||
+static IDirect3DDevice3 *create_device(HWND window, DWORD coop_level)
|
||||
+{
|
||||
+ return create_device_ex(window, coop_level, FALSE);
|
||||
+}
|
||||
+
|
||||
static IDirect3DViewport3 *create_viewport(IDirect3DDevice3 *device, UINT x, UINT y, UINT w, UINT h)
|
||||
{
|
||||
IDirect3DViewport3 *viewport;
|
||||
@@ -16023,6 +16034,116 @@ static void test_caps(void)
|
||||
IDirectDraw4_Release(ddraw);
|
||||
}
|
||||
|
||||
+static void test_texture_wrong_caps_(BOOL software)
|
||||
+{
|
||||
+ static struct
|
||||
+ {
|
||||
+ struct vec3 position;
|
||||
+ struct vec2 texcoord;
|
||||
+ }
|
||||
+ quad[] =
|
||||
+ {
|
||||
+ {{-1.0f, -1.0f, 0.0f}, {0.0f, 1.0f}},
|
||||
+ {{-1.0f, 1.0f, 0.0f}, {0.0f, 0.0f}},
|
||||
+ {{ 1.0f, -1.0f, 0.0f}, {1.0f, 1.0f}},
|
||||
+ {{ 1.0f, 1.0f, 0.0f}, {1.0f, 0.0f}},
|
||||
+ };
|
||||
+ static DDPIXELFORMAT fmt =
|
||||
+ {
|
||||
+ sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS, 0,
|
||||
+ {32}, {0x00ff0000}, {0x0000ff00}, {0x000000ff}, {0xff000000}
|
||||
+ };
|
||||
+ D3DRECT clear_rect = {{0}, {0}, {640}, {480}};
|
||||
+ IDirectDrawSurface4 *surface, *rt;
|
||||
+ D3DCOLOR color, expected_color;
|
||||
+ IDirect3DViewport3 *viewport;
|
||||
+ IDirect3DTexture2 *texture;
|
||||
+ IDirect3DDevice3 *device;
|
||||
+ IDirectDraw4 *ddraw;
|
||||
+ DDSURFACEDESC2 ddsd;
|
||||
+ IDirect3D3 *d3d;
|
||||
+ ULONG refcount;
|
||||
+ HWND window;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ window = create_window();
|
||||
+ if (!(device = create_device_ex(window, DDSCL_NORMAL, software)))
|
||||
+ {
|
||||
+ skip("Failed to create a 3D device, skipping test.\n");
|
||||
+ DestroyWindow(window);
|
||||
+ return;
|
||||
+ }
|
||||
+ hr = IDirect3DDevice3_GetDirect3D(device, &d3d);
|
||||
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw);
|
||||
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice3_GetRenderTarget(device, &rt);
|
||||
+ ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ viewport = create_viewport(device, 0, 0, 640, 480);
|
||||
+ hr = IDirect3DDevice3_SetCurrentViewport(device, viewport);
|
||||
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ memset(&ddsd, 0, sizeof(ddsd));
|
||||
+ ddsd.dwSize = sizeof(ddsd);
|
||||
+ ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT;
|
||||
+ ddsd.dwHeight = 16;
|
||||
+ ddsd.dwWidth = 16;
|
||||
+ ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
|
||||
+ U4(ddsd).ddpfPixelFormat = fmt;
|
||||
+ hr = IDirectDraw4_CreateSurface(ddraw, &ddsd, &surface, NULL);
|
||||
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ hr = IDirectDrawSurface4_QueryInterface(surface, &IID_IDirect3DTexture2, (void **)&texture);
|
||||
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ fill_surface(surface, 0xff00ff00);
|
||||
+
|
||||
+ hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE);
|
||||
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
|
||||
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
|
||||
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
|
||||
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
|
||||
+
|
||||
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice3_SetTexture(device, 0, texture);
|
||||
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0x000000ff, 0.0f, 0);
|
||||
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice3_BeginScene(device);
|
||||
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP,
|
||||
+ D3DFVF_XYZ | D3DFVF_TEX1, quad, 4, 0);
|
||||
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+ hr = IDirect3DDevice3_EndScene(device);
|
||||
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
|
||||
+
|
||||
+ expected_color = software ? 0x0000ff00 : 0x00ffffff;
|
||||
+ color = get_surface_color(rt, 320, 240);
|
||||
+ ok(color == expected_color, "Got color 0x%08x, expected 0x%08x.\n", color, expected_color);
|
||||
+
|
||||
+ IDirect3DTexture2_Release(texture);
|
||||
+ IDirectDrawSurface4_Release(surface);
|
||||
+ IDirectDraw4_Release(ddraw);
|
||||
+ IDirect3D3_Release(d3d);
|
||||
+ refcount = IDirect3DDevice3_Release(device);
|
||||
+ ok(!refcount, "Device has %u references left.\n", refcount);
|
||||
+ DestroyWindow(window);
|
||||
+}
|
||||
+
|
||||
+static void test_texture_wrong_caps()
|
||||
+{
|
||||
+ trace("Hardware device.\n");
|
||||
+ test_texture_wrong_caps_(FALSE);
|
||||
+
|
||||
+ trace("Software device.\n");
|
||||
+ test_texture_wrong_caps_(TRUE);
|
||||
+}
|
||||
+
|
||||
START_TEST(ddraw4)
|
||||
{
|
||||
DDDEVICEIDENTIFIER identifier;
|
||||
@@ -16156,4 +16277,5 @@ START_TEST(ddraw4)
|
||||
test_gdi_surface();
|
||||
test_alphatest();
|
||||
test_clipper_refcount();
|
||||
+ test_texture_wrong_caps();
|
||||
}
|
||||
--
|
||||
2.20.1
|
||||
|
3
patches/ddraw-Texture_Wrong_Caps/definition
Normal file
3
patches/ddraw-Texture_Wrong_Caps/definition
Normal file
@@ -0,0 +1,3 @@
|
||||
Fixes: [46948] Allow setting texture without DDSCAPS_TEXTURE for software device
|
||||
Depends: ddraw-Rendering_Targets
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user