Compare commits

..

45 Commits

Author SHA1 Message Date
Alistair Leslie-Hughes
dc3b4e6589 Release v9.2 2024-02-11 09:38:15 +11:00
Alistair Leslie-Hughes
75367a75f2 Added explorer-reverts patchset 2024-02-11 07:48:11 +11:00
Alistair Leslie-Hughes
b2ca294530 Updated vkd3d-latest patchset 2024-02-10 18:55:27 +11:00
Zebediah Figura
dd067c0b0d ntdll: Replace a MAX_PATH with PATH_MAX.
Related code uses PATH_MAX; this seems to have been an accident.

Spotted by Aida Jonikienė.
2024-02-09 13:30:01 -06:00
Zebediah Figura
aa9b8391c0 ntdll-Junction_Points: Replace another symlink() with symlinkat().
Evidently accidentally omitted in 769ddd9f00.

Spotted by Aida Jonikienė.
2024-02-09 13:27:47 -06:00
Zebediah Figura
ef52b15ad6 ntdll-Junction_Points: Move deletion reparse point logic from inode_destroy() to unlink_closed_fd().
Found by Aida Jonikienė.

Fixes: ef85449de2
2024-02-09 13:06:02 -06:00
Alistair Leslie-Hughes
ff18b9b26e Rebase against 8cb68e43dec6e6bb32fcdf82e03a6d4263dd2354. 2024-02-09 15:28:59 +11:00
Alistair Leslie-Hughes
40467ae481 updated vkd3d-latest patchset 2024-02-07 14:12:01 +11:00
Zebediah Figura
2ec2518486 krnl386.exe16-Invalid_Console_Handles: Remove patch set.
Despite Michael Müller's claim that all patches in wine-staging actually fix
something [1], I've come across several patch sets over the years that seem to
be related to some contemporaneous work but don't actually fix any application
themselves (e.g. wine-staging commits 5d8901ac21, ba9a7a6a74, probably most of
e353590528; I think there are plenty of other examples as well.)

This patch appears to fall into this category. The upstream commit it was
written in response to was bc68b30d20.

The application in question is buggy. It uses OpenFile(), but compares the
return value to 0 instead of -1. The open in question is the first in the
program's run. The problem occurs if the DOS handles are unassigned, in which
case the valid handle 0 will be returned, and the program will interpret it as
failure, hit some broken code path, and crash.

bc68b30d20 fixes this by ensuring that the DOS standard handles are always
valid, and therefore OpenFile() will always return at least 5. This seems to
match what happens on Windows. I can reproduce this fix; I didn't go to the
trouble of building its parent, but reverting that patch in current Wine does
make the program crash the exact same way (comparing to the +relay log helpfully
provided in the bug report).

Sebastian probably saw this commit, thought that "well, there's multiple ways
for a handle to be invalid", wrote this patch catching the additional ones, and
for some reason never submitted it upstream.

Thing is, these handles come from the server, and they're guaranteed to be
either valid or zero. As evidence cf. the duplicate_handle() calls in the
new_process request handler, which were present even at the time. Hence this
patch isn't doing anything, so remove it.

[1] https://www.winehq.org/mailman3/hyperkitty/list/wine-devel@winehq.org/message/YGKVQN2N537MXAVSMLHX5IV4XCEWKBVY/
2024-02-06 16:15:29 -06:00
Alistair Leslie-Hughes
0525ea8268 Rebase against 23f98e9663a1737c94f6bd6c7612baa8b4a47bc5. 2024-02-06 13:31:27 +11:00
Zebediah Figura
5058934ac1 d3dx9_36-D3DXDisassembleShader: Remove patch set. 2024-02-03 12:44:24 -06:00
Alistair Leslie-Hughes
be51ecf5c2 Updated vkd3d-latest patchset
Squash to release and add latest git.
2024-02-01 12:52:46 +11:00
Alistair Leslie-Hughes
bd28d7c328 Rebase against e607da943aa6869ba334611ccfd044f2ffe212c4. 2024-02-01 12:18:53 +11:00
Alistair Leslie-Hughes
c11c25e285 Rebase against fdd9e257e2913ecb53fa3c31bfa9ed1ec65fce3c. 2024-01-30 12:47:05 +11:00
Alistair Leslie-Hughes
ddfbad3af6 Updated ntdll-Junction_Points patchset
Changed header to add single structure and adjust code to use existing ddk/ntifs.h
2024-01-30 07:46:01 +11:00
Alistair Leslie-Hughes
71f018ba21 Removed unrequired patch
The compile fix was when a FIXME was in the #else, which is no longer there.

This patch is no longer required.
2024-01-29 19:50:37 +11:00
Alistair Leslie-Hughes
53c687fd47 Release v9.1 2024-01-27 17:30:38 +11:00
Alistair Leslie-Hughes
9c85f8e97a Updated vkd3d-latest patchset 2024-01-27 12:58:57 +11:00
Alistair Leslie-Hughes
a15917a85e Updated windows.networking.connectivity-new-dll patchset
Ran make_makefiles to update configure.ac
2024-01-27 12:32:15 +11:00
Alistair Leslie-Hughes
06139e25fa Updated fonts-Missing_Fonts patchset
run make_makefiles to fixup Makefile.in
2024-01-27 12:32:15 +11:00
Alistair Leslie-Hughes
e175b3e173 Updated vcomp_for_dynamic_init_i8 patchset
run make_specfiles to ensure all files are correct.
2024-01-27 12:32:15 +11:00
Zebediah Figura
1c14122a2d ddraw-version-check: Rebase and reënable.
Thanks to Aida Jonikienė for doing this rebase.
2024-01-26 18:27:53 -06:00
Zebediah Figura
92aa3c6389 wined3d-bindless-texture: Rebase and reënable.
Thanks to Aida Jonikienė for doing this rebase.
2024-01-26 17:58:34 -06:00
Zebediah Figura
72730e4340 user32-Mouse_Message_Hwnd: Rebase (mostly) and reënable.
The tests are left alone since they aren't particularly important and will need to be rewritten anyway.
They should probably be somewhere other than input.c, since they don't actually relate to input.
2024-01-26 17:41:53 -06:00
Zebediah Figura
065d60e3d7 Rebase against c963c4141a0d4f6601c37f11d79de186be0da6a9. 2024-01-26 17:31:02 -06:00
Zebediah Figura
fbae1b5a2c Rebase against eb5993a7c6fbc1cd9deac0dceabc8f1c76e14ba8. 2024-01-25 17:55:36 -06:00
Alistair Leslie-Hughes
4be0e7f2c6 Rebase against ab28825aceec92775fd570fc3a42c154366eceea. 2024-01-25 16:25:39 +11:00
Alistair Leslie-Hughes
e04949b586 Added scrrun_move_folder patchset 2024-01-24 13:42:41 +11:00
Alistair Leslie-Hughes
a878cd75dd Added msxml3-write_out_doc patchset 2024-01-24 13:13:27 +11:00
Alistair Leslie-Hughes
78b6fcffa8 Added msi-cabinet patchset 2024-01-24 13:12:34 +11:00
Alistair Leslie-Hughes
0419fcc658 Updated vkd3d-latest patchset 2024-01-24 12:28:57 +11:00
Alistair Leslie-Hughes
8928bbdbff Rebase against d81c4ce1ba700cca040afcf89c75c683b23e531d. 2024-01-24 10:55:59 +11:00
Zebediah Figura
034a07418d Rebase against 35ac0e7ac0511ef766f3f35220869565ce07906e. 2024-01-22 16:26:14 -06:00
Alistair Leslie-Hughes
e045af48e8 Updated vkd3d-latest patchset
Squashed afer release + rebased to latest (Added patch 0003).
2024-01-18 12:10:18 +11:00
Alistair Leslie-Hughes
19c6bb12cc Rebase against 1932c3a2516b181291ce430505dcfa8a82eb70bd. 2024-01-18 11:49:45 +11:00
Alistair Leslie-Hughes
cab93f47b8 Release v9.0 2024-01-17 08:47:35 +11:00
Alistair Leslie-Hughes
871a9455bb Updated vkd3d-latest patchset 2024-01-16 11:01:10 +11:00
Alistair Leslie-Hughes
15b6373d23 Fix warnings in various patchsets
Correct the warning thats issued when GetLastError wsa used for %u, changed to use the standard %lx format.
2024-01-14 09:17:25 +11:00
Zebediah Figura
f445af0deb xactengine-initial: Use SOURCES. 2024-01-13 13:33:54 -06:00
Zebediah Figura
3ee2f0e80c winedevice-Default_Drivers: Use SOURCES. 2024-01-13 13:33:45 -06:00
Zebediah Figura
b471290a81 odbc-remove-unixodbc: Use SOURCES. 2024-01-13 13:33:21 -06:00
Zebediah Figura
2e49ce0e85 cryptext-CryptExtOpenCER: Use SOURCES. 2024-01-13 13:33:10 -06:00
Alistair Leslie-Hughes
c26e42e521 Release v9.0-rc5 2024-01-13 14:00:42 +11:00
Alistair Leslie-Hughes
4f14df2caa Updated vkd3d-latest patchset 2024-01-13 12:21:42 +11:00
Alistair Leslie-Hughes
8a76fd6c73 Updated vkd3d-latest patchset 2024-01-10 07:41:15 +11:00
93 changed files with 22947 additions and 7511 deletions

View File

@@ -1,40 +0,0 @@
From eb21fcc668da85977bc86b6105f3830cb26c93e6 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 8 Jun 2021 08:56:40 +1000
Subject: [PATCH] bcrypt: Stop compile error when HAVE_GNUTLS_CIPHER_INIT not
defined
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In file included from dlls/bcrypt/gnutls.c:1916:
include/windef.h:112:24: error: unknown type name va_list
112 | # define __ms_va_list va_list
| ^~~~~~~
include/winbase.h:2076:84: note: in expansion of macro __ms_va_list
2076 | WINBASEAPI DWORD WINAPI FormatMessageA(DWORD,LPCVOID,DWORD,DWORD,LPSTR,DWORD,__ms_va_list*);
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/bcrypt/gnutls.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c
index d7b4499c692..11596d5f7ac 100644
--- a/dlls/bcrypt/gnutls.c
+++ b/dlls/bcrypt/gnutls.c
@@ -24,9 +24,10 @@
#include "config.h"
+#include <stdarg.h>
+
#ifdef HAVE_GNUTLS_CIPHER_INIT
-#include <stdarg.h>
#include <stdlib.h>
#include <assert.h>
#include <sys/types.h>
--
2.33.0

View File

@@ -1,4 +1,4 @@
From e6354103c243e13c177f6a534a9e786cfdcf7c92 Mon Sep 17 00:00:00 2001
From f48fa2ff628c3262245593301a141dee31118fd4 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 2 Oct 2014 19:44:31 +0200
Subject: [PATCH] ntdll: Print a warning message specifying the wine-staging
@@ -9,7 +9,7 @@ Subject: [PATCH] ntdll: Print a warning message specifying the wine-staging
1 file changed, 15 insertions(+)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 1a87f4d1f5e..31c0a3bae94 100644
index 021f7941969..68cb4b25d85 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -42,6 +42,7 @@ WINE_DECLARE_DEBUG_CHANNEL(relay);
@@ -20,7 +20,7 @@ index 1a87f4d1f5e..31c0a3bae94 100644
#ifdef _WIN64
#define DEFAULT_SECURITY_COOKIE_64 (((ULONGLONG)0x00002b99 << 32) | 0x2ddfa232)
@@ -3749,6 +3750,7 @@ void WINAPI LdrShutdownProcess(void)
@@ -3822,6 +3823,7 @@ void WINAPI LdrShutdownProcess(void)
process_detach();
}
@@ -28,7 +28,7 @@ index 1a87f4d1f5e..31c0a3bae94 100644
/******************************************************************
* RtlExitUserProcess (NTDLL.@)
@@ -4195,6 +4197,9 @@ static void release_address_space(void)
@@ -4244,6 +4246,9 @@ static void release_address_space(void)
*/
void loader_init( CONTEXT *context, void **entry )
{
@@ -37,8 +37,8 @@ index 1a87f4d1f5e..31c0a3bae94 100644
+ HANDLE staging_event;
static int attach_done;
NTSTATUS status;
ULONG_PTR cookie;
@@ -4274,6 +4279,16 @@ void loader_init( CONTEXT *context, void **entry )
ULONG_PTR cookie, port = 0;
@@ -4317,6 +4322,16 @@ void loader_init( CONTEXT *context, void **entry )
if (NtCurrentTeb()->WowTebOffset) init_wow64( context );
#endif
@@ -56,5 +56,5 @@ index 1a87f4d1f5e..31c0a3bae94 100644
InsertHeadList( &tls_links, &NtCurrentTeb()->TlsLinks );
RtlReleasePebLock();
--
2.42.0
2.43.0

View File

@@ -45,7 +45,7 @@ index 5c00298d41e..d04f5645345 100644
+
+ status = LsaOpenPolicy( &machine, &object_attributes, POLICY_LOOKUP_NAMES, &handle);
+ ok(status == RPC_NT_SERVER_UNAVAILABLE,
+ "LsaOpenPolicy(POLICY_LOOKUP_NAMES) for invalid machine returned 0x%08x\n", status);
+ "LsaOpenPolicy(POLICY_LOOKUP_NAMES) for invalid machine returned 0x%08lx\n", status);
+
status = LsaOpenPolicy( NULL, &object_attributes, POLICY_ALL_ACCESS, &handle);
ok(status == STATUS_SUCCESS || status == STATUS_ACCESS_DENIED,

View File

@@ -1,4 +1,4 @@
From eddc40dbf4048ceea1fda7f842adad340865723b Mon Sep 17 00:00:00 2001
From e6c1c1fe3fe2f4fe7d3e421b94d925c40063af22 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Fri, 5 Jul 2019 13:20:23 +0800
Subject: [PATCH] cryptext: Implement CryptExtOpenCER.
@@ -17,10 +17,10 @@ Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
create mode 100644 dlls/cryptext/tests/cryptext.c
diff --git a/configure b/configure
index 6425e4da5f8..c97671cdfc6 100755
index ca6e87d4740..7033499399f 100755
--- a/configure
+++ b/configure
@@ -21346,6 +21346,7 @@ wine_fn_config_makefile dlls/crypt32/tests enable_tests
@@ -21660,6 +21660,7 @@ wine_fn_config_makefile dlls/crypt32/tests enable_tests
wine_fn_config_makefile dlls/cryptdlg enable_cryptdlg
wine_fn_config_makefile dlls/cryptdll enable_cryptdll
wine_fn_config_makefile dlls/cryptext enable_cryptext
@@ -29,10 +29,10 @@ index 6425e4da5f8..c97671cdfc6 100755
wine_fn_config_makefile dlls/cryptnet/tests enable_tests
wine_fn_config_makefile dlls/cryptowinrt enable_cryptowinrt
diff --git a/configure.ac b/configure.ac
index b5a3b0069fb..73b1b1c8c2b 100644
index cba55126869..57064a05fe5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2450,6 +2450,7 @@ WINE_CONFIG_MAKEFILE(dlls/crypt32/tests)
@@ -2477,6 +2477,7 @@ WINE_CONFIG_MAKEFILE(dlls/crypt32/tests)
WINE_CONFIG_MAKEFILE(dlls/cryptdlg)
WINE_CONFIG_MAKEFILE(dlls/cryptdll)
WINE_CONFIG_MAKEFILE(dlls/cryptext)
@@ -41,7 +41,7 @@ index b5a3b0069fb..73b1b1c8c2b 100644
WINE_CONFIG_MAKEFILE(dlls/cryptnet/tests)
WINE_CONFIG_MAKEFILE(dlls/cryptowinrt)
diff --git a/dlls/cryptext/Makefile.in b/dlls/cryptext/Makefile.in
index 0ec2b8a2045..76accca43eb 100644
index 5598bfb78e0..acda4e4ac6d 100644
--- a/dlls/cryptext/Makefile.in
+++ b/dlls/cryptext/Makefile.in
@@ -1,4 +1,5 @@
@@ -151,13 +151,13 @@ index 537ba66cd3b..a4314518eac 100644
+}
diff --git a/dlls/cryptext/tests/Makefile.in b/dlls/cryptext/tests/Makefile.in
new file mode 100644
index 00000000000..522fc60a4af
index 00000000000..c3f4551fc00
--- /dev/null
+++ b/dlls/cryptext/tests/Makefile.in
@@ -0,0 +1,4 @@
+TESTDLL = cryptext.dll
+
+C_SRCS = \
+SOURCES = \
+ cryptext.c
diff --git a/dlls/cryptext/tests/cryptext.c b/dlls/cryptext/tests/cryptext.c
new file mode 100644
@@ -227,5 +227,5 @@ index 00000000000..ab1007dbd82
+ test_CryptExtOpenCER();
+}
--
2.35.1
2.43.0

View File

@@ -1,375 +0,0 @@
From 0ba05ea85f8f2de3c802083340eb3a9ee8df209e Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Sat, 13 Feb 2016 15:29:37 +0100
Subject: [PATCH] d3dx9_36: Implement D3DXDisassembleShader. (v2)
Changes in v2 (by Christian Costa):
* More generic code for D3DXDisassembleShader.
---
dlls/d3dx9_36/shader.c | 335 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 329 insertions(+), 6 deletions(-)
diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c
index 1aa75d64dc5..d98345e2288 100644
--- a/dlls/d3dx9_36/shader.c
+++ b/dlls/d3dx9_36/shader.c
@@ -1,6 +1,7 @@
/*
* Copyright 2008 Luis Busquets
* Copyright 2009 Matteo Bruni
+ * Copyright 2010, 2013, 2016 Christian Costa
* Copyright 2011 Travis Athougies
*
* This library is free software; you can redistribute it and/or
@@ -19,6 +20,7 @@
*/
#include <assert.h>
+#include <stdio.h>
#include "d3dx9_private.h"
#include "d3dcommon.h"
@@ -2347,13 +2349,334 @@ HRESULT WINAPI D3DXGetShaderSamplers(const DWORD *byte_code, const char **sample
return D3D_OK;
}
-HRESULT WINAPI D3DXDisassembleShader(const DWORD *shader, BOOL colorcode, const char *comments,
- ID3DXBuffer **buffer)
-{
- TRACE("shader %p, colorcode %d, comments %s, buffer %p.\n", shader, colorcode, debugstr_a(comments), buffer);
+static const char *decl_usage[] = { "position", "blendweight", "blendindices", "normal", "psize", "texcoord",
+ "tangent", "binormal", "tessfactor", "positiont", "color" };
- return D3DDisassemble(shader, D3DXGetShaderSize(shader), colorcode ? D3D_DISASM_ENABLE_COLOR_CODE : 0,
- comments, (ID3DBlob **)buffer);
+static const char *tex_type[] = { "", "1d", "2d", "cube", "volume" };
+
+static int add_modifier(char *buffer, DWORD param)
+{
+ char *buf = buffer;
+ DWORD dst_mod = param & D3DSP_DSTMOD_MASK;
+
+ if (dst_mod & D3DSPDM_SATURATE)
+ buf += sprintf(buf, "_sat");
+ if (dst_mod & D3DSPDM_PARTIALPRECISION)
+ buf += sprintf(buf, "_pp");
+ if (dst_mod & D3DSPDM_MSAMPCENTROID)
+ buf += sprintf(buf, "_centroid");
+
+ return buf - buffer;
+}
+
+static int add_register(char *buffer, DWORD param, BOOL dst, BOOL ps)
+{
+ char *buf = buffer;
+ DWORD reg_type = ((param & D3DSP_REGTYPE_MASK2) >> D3DSP_REGTYPE_SHIFT2)
+ | ((param & D3DSP_REGTYPE_MASK) >> D3DSP_REGTYPE_SHIFT);
+ DWORD reg_num = param & D3DSP_REGNUM_MASK;
+
+ if (reg_type == D3DSPR_INPUT)
+ buf += sprintf(buf, "v%d", reg_num);
+ else if (reg_type == D3DSPR_CONST)
+ buf += sprintf(buf, "c%d", reg_num);
+ else if (reg_type == D3DSPR_TEMP)
+ buf += sprintf(buf, "r%d", reg_num);
+ else if (reg_type == D3DSPR_ADDR)
+ buf += sprintf(buf, "%s%d", ps ? "t" : "a", reg_num);
+ else if (reg_type == D3DSPR_SAMPLER)
+ buf += sprintf(buf, "s%d", reg_num);
+ else if (reg_type == D3DSPR_RASTOUT)
+ buf += sprintf(buf, "oPos");
+ else if (reg_type == D3DSPR_COLOROUT)
+ buf += sprintf(buf, "oC%d", reg_num);
+ else if (reg_type == D3DSPR_TEXCRDOUT)
+ buf += sprintf(buf, "oT%d", reg_num);
+ else if (reg_type == D3DSPR_ATTROUT)
+ buf += sprintf(buf, "oD%d", reg_num);
+ else
+ buf += sprintf(buf, "? (%d)", reg_type);
+
+ if (dst)
+ {
+ if ((param & D3DSP_WRITEMASK_ALL) != D3DSP_WRITEMASK_ALL)
+ {
+ buf += sprintf(buf, ".%s%s%s%s", param & D3DSP_WRITEMASK_0 ? "x" : "",
+ param & D3DSP_WRITEMASK_1 ? "y" : "",
+ param & D3DSP_WRITEMASK_2 ? "z" : "",
+ param & D3DSP_WRITEMASK_3 ? "w" : "");
+ }
+ }
+ else
+ {
+ if ((param & D3DVS_SWIZZLE_MASK) != D3DVS_NOSWIZZLE)
+ {
+ if ( ((param & D3DSP_SWIZZLE_MASK) == (D3DVS_X_X | D3DVS_Y_X | D3DVS_Z_X | D3DVS_W_X)) ||
+ ((param & D3DSP_SWIZZLE_MASK) == (D3DVS_X_Y | D3DVS_Y_Y | D3DVS_Z_Y | D3DVS_W_Y)) ||
+ ((param & D3DSP_SWIZZLE_MASK) == (D3DVS_X_Z | D3DVS_Y_Z | D3DVS_Z_Z | D3DVS_W_Z)) ||
+ ((param & D3DSP_SWIZZLE_MASK) == (D3DVS_X_W | D3DVS_Y_W | D3DVS_Z_W | D3DVS_W_W)) )
+ buf += sprintf(buf, ".%c", 'w' + (((param >> D3DVS_SWIZZLE_SHIFT) + 1) & 0x3));
+ else
+ buf += sprintf(buf, ".%c%c%c%c", 'w' + (((param >> (D3DVS_SWIZZLE_SHIFT+0)) + 1) & 0x3),
+ 'w' + (((param >> (D3DVS_SWIZZLE_SHIFT+2)) + 1) & 0x3),
+ 'w' + (((param >> (D3DVS_SWIZZLE_SHIFT+4)) + 1) & 0x3),
+ 'w' + (((param >> (D3DVS_SWIZZLE_SHIFT+6)) + 1) & 0x3));
+ }
+ }
+
+ return buf - buffer;
+}
+
+struct instr_info
+{
+ DWORD opcode;
+ const char *name;
+ int length;
+ int (*function)(const struct instr_info *info, DWORD **ptr, char *buffer, BOOL ps);
+ WORD min_version;
+ WORD max_version;
+};
+
+static int instr_comment(const struct instr_info *info, DWORD **ptr, char *buffer, BOOL ps)
+{
+ *ptr += 1 + ((**ptr & D3DSI_COMMENTSIZE_MASK) >> D3DSI_COMMENTSIZE_SHIFT);
+ return 0;
+}
+
+static int instr_def(const struct instr_info *info, DWORD **ptr, char *buffer, BOOL ps)
+{
+ int len = sprintf(buffer, " def c%d, %g, %g, %g, %g\n", *(*ptr+1) & D3DSP_REGNUM_MASK,
+ (double)*(float*)(*ptr+2), (double)*(float*)(*ptr+3),
+ (double)*(float*)(*ptr+4), (double)*(float*)(*ptr+5));
+ *ptr += 6;
+ return len;
+}
+
+static int instr_dcl(const struct instr_info *info, DWORD **ptr, char *buffer, BOOL ps)
+{
+ DWORD param1 = *++*ptr;
+ DWORD param2 = *++*ptr;
+ DWORD usage = (param1 & D3DSP_DCL_USAGE_MASK) >> D3DSP_DCL_USAGE_SHIFT;
+ DWORD usage_index = (param1 & D3DSP_DCL_USAGEINDEX_MASK) >> D3DSP_DCL_USAGEINDEX_SHIFT;
+ char *buf = buffer;
+
+ buf += sprintf(buf, " dcl");
+ if (ps)
+ {
+ if (param1 & D3DSP_TEXTURETYPE_MASK)
+ buf += sprintf(buf, "_%s", (usage <= D3DSTT_VOLUME) ?
+ tex_type[(param1 & D3DSP_TEXTURETYPE_MASK) >> D3DSP_TEXTURETYPE_SHIFT] : "???");
+ }
+ else
+ {
+ buf += sprintf(buf, "_%s", (usage <= D3DDECLUSAGE_COLOR) ? decl_usage[usage] : "???");
+ if (usage_index)
+ buf += sprintf(buf, "%d", usage_index);
+ }
+
+ buf += add_modifier(buf, param2);
+ buf += sprintf(buf, " ");
+ buf += add_register(buf, param2, TRUE, TRUE);
+ buf += sprintf(buf, "\n");
+ (*ptr)++;
+ return buf - buffer;
+}
+
+static int instr_generic(const struct instr_info *info, DWORD **ptr, char *buffer, BOOL ps)
+{
+ char *buf = buffer;
+ int j;
+
+ buf += sprintf(buf, " %s", info->name);
+ (*ptr)++;
+
+ if (info->length)
+ {
+ buf += add_modifier(buf, **ptr);
+
+ for (j = 0; j < info->length; j++)
+ {
+ buf += sprintf(buf, "%s ", j ? "," : "");
+
+ if ((j != 0) && ((**ptr & D3DSP_SRCMOD_MASK) != D3DSPSM_NONE))
+ {
+ if ((**ptr & D3DSP_SRCMOD_MASK) == D3DSPSM_NEG)
+ buf += sprintf(buf, "-");
+ else
+ buf += sprintf(buf, "*");
+ }
+
+ buf += add_register(buf, **ptr, j == 0, ps);
+
+ if (*(*ptr)++ & D3DVS_ADDRESSMODE_MASK)
+ {
+ buf += sprintf(buf, "[");
+ buf += add_register(buf, **ptr, FALSE, FALSE);
+ buf += sprintf(buf, "]");
+ (*ptr)++;
+ }
+ }
+ }
+ buf += sprintf(buf, "\n");
+ return buf - buffer;
+}
+
+const struct instr_info instructions[] =
+{
+ { D3DSIO_NOP, "nop", 0, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_MOV, "mov", 2, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_ADD, "add", 3, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_SUB, "sub", 3, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_MAD, "mad", 4, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_MUL, "mul", 3, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_RCP, "rcp", 2, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_RSQ, "rsq", 2, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_DP3, "dp3", 3, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_DP4, "dp4", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 1.2 for PS */
+ { D3DSIO_MIN, "min", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_MAX, "max", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_SLT, "slt", 3, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_SGE, "sge", 3, instr_generic, 0x0100, 0xFFFF }, /* VS only */
+ { D3DSIO_EXP, "exp", 2, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_LOG, "log", 2, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_LIT, "lit", 2, instr_generic, 0x0100, 0xFFFF }, /* VS only */
+ { D3DSIO_DST, "dst", 3, instr_generic, 0x0100, 0xFFFF }, /* VS only */
+ { D3DSIO_LRP, "lrp", 4, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for VS */
+ { D3DSIO_FRC, "frc", 2, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_M4x4, "m4x4", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_M4x3, "m4x3", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_M3x4, "m3x4", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_M3x3, "m3x3", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_M3x2, "m3x2", 3, instr_generic, 0x0100, 0xFFFF }, /* >= 2.0 for PS */
+ { D3DSIO_CALL, "call", 1, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_CALLNZ, "callnz", 2, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_LOOP, "loop", 2, instr_generic, 0x0200, 0xFFFF }, /* >= 3.0 for PS */
+ { D3DSIO_RET, "ret", 0, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_ENDLOOP, "endloop", 1, instr_generic, 0x0200, 0xFFFF }, /* >= 3.0 for PS */
+ { D3DSIO_LABEL, "label", 1, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_DCL, "dcl", 1, instr_dcl, 0x0100, 0xFFFF },
+ { D3DSIO_POW, "pow", 3, instr_generic, 0x0200, 0xFFFF },
+ { D3DSIO_CRS, "crs", 3, instr_generic, 0x0200, 0xFFFF },
+ { D3DSIO_SGN, "sgn", 4, instr_generic, 0x0200, 0xFFFF }, /* VS only */
+ { D3DSIO_ABS, "abs", 2, instr_generic, 0x0200, 0xFFFF },
+ { D3DSIO_NRM, "nrm", 2, instr_generic, 0x0200, 0xFFFF },
+ { D3DSIO_SINCOS, "sincos", 4, instr_generic, 0x0200, 0x02FF },
+ { D3DSIO_SINCOS, "sincos", 2, instr_generic, 0x0300, 0xFFFF },
+ { D3DSIO_REP, "rep", 1, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_ENDREP, "endrep", 0, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_IF, "if", 1, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_IFC, "if_comp", 2, instr_generic, 0x0200, 0xFFFF },
+ { D3DSIO_ELSE, "else", 0, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_ENDIF, "endif", 0, instr_generic, 0x0200, 0xFFFF }, /* >= 2.a for PS */
+ { D3DSIO_BREAK, "break", 0, instr_generic, 0x0201, 0xFFFF },
+ { D3DSIO_BREAKC, "break_comp", 2, instr_generic, 0x0201, 0xFFFF },
+ { D3DSIO_MOVA, "mova", 2, instr_generic, 0x0200, 0xFFFF }, /* VS only */
+ { D3DSIO_DEFB, "defb", 2, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_DEFI, "defi", 2, instr_generic, 0x0100, 0xFFFF },
+ { D3DSIO_TEXCOORD, "texcoord", 1, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXCOORD, "texcrd", 2, instr_generic, 0x0104, 0x0104 }, /* PS only */
+ { D3DSIO_TEXKILL, "texkill", 1, instr_generic, 0x0100, 0xFFFF }, /* PS only */
+ { D3DSIO_TEX, "tex", 1, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEX, "texld", 2, instr_generic, 0x0104, 0x0104 }, /* PS only */
+ { D3DSIO_TEX, "texld", 3, instr_generic, 0x0200, 0xFFFF }, /* PS only */
+ { D3DSIO_TEXBEM, "texbem", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXBEML, "texbeml", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXREG2AR, "texreg2ar", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXREG2GB, "texreg2gb", 2, instr_generic, 0x0102, 0x0103 }, /* PS only */
+ { D3DSIO_TEXM3x2PAD, "texm3x2pad", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXM3x2TEX, "texm3x2tex", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXM3x3PAD, "texm3x3pad", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXM3x3TEX, "texm3x3tex", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXM3x3DIFF, "texm3x3diff", 2, instr_generic, 0x0100, 0xFFFF }, /* PS only - Not documented */
+ { D3DSIO_TEXM3x3SPEC, "texm3x3spec", 3, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_TEXM3x3VSPEC, "texm3x3vspec", 2, instr_generic, 0x0100, 0x0103 }, /* PS only */
+ { D3DSIO_EXPP, "expp", 2, instr_generic, 0x0100, 0xFFFF }, /* VS only */
+ { D3DSIO_LOGP, "logp", 2, instr_generic, 0x0100, 0xFFFF }, /* VS only */
+ { D3DSIO_CND, "cnd", 4, instr_generic, 0x0100, 0x0104 }, /* PS only */
+ { D3DSIO_DEF, "def", 5, instr_def, 0x0100, 0xFFFF },
+ { D3DSIO_TEXREG2RGB, "texreg2rgb", 2, instr_generic, 0x0102, 0x0103 }, /* PS only */
+ { D3DSIO_TEXDP3TEX, "texdp3tex", 2, instr_generic, 0x0102, 0x0103 }, /* PS only */
+ { D3DSIO_TEXM3x2DEPTH, "texm3x2depth", 2, instr_generic, 0x0103, 0x0103 }, /* PS only */
+ { D3DSIO_TEXDP3, "texdp3", 2, instr_generic, 0x0102, 0x0103 }, /* PS only */
+ { D3DSIO_TEXM3x3, "texm3x3", 2, instr_generic, 0x0102, 0x0103 }, /* PS only */
+ { D3DSIO_TEXDEPTH, "texdepth", 1, instr_generic, 0x0104, 0x0104 }, /* PS only */
+ { D3DSIO_CMP, "cmp", 4, instr_generic, 0x0102, 0xFFFF }, /* PS only */
+ { D3DSIO_BEM, "bem", 3, instr_generic, 0x0104, 0x0104 }, /* PS only */
+ { D3DSIO_DP2ADD, "dp2add", 4, instr_generic, 0x0200, 0xFFFF }, /* PS only */
+ { D3DSIO_DSX, "dsx", 2, instr_generic, 0x0201, 0xFFFF }, /* PS only */
+ { D3DSIO_DSY, "dsy", 2, instr_generic, 0x0201, 0xFFFF }, /* PS only */
+ { D3DSIO_TEXLDD, "texldd", 5, instr_generic, 0x0201, 0xFFFF }, /* PS only - not existing for 2.b */
+ { D3DSIO_SETP, "setp_comp", 3, instr_generic, 0x0201, 0xFFFF },
+ { D3DSIO_TEXLDL, "texldl", 3, instr_generic, 0x0300, 0xFFFF },
+ { D3DSIO_BREAKP, "breakp", 1, instr_generic, 0x0201, 0xFFFF },
+ { D3DSIO_PHASE, "phase", 0, instr_generic, 0x0104, 0x0104 }, /* PS only */
+ { D3DSIO_COMMENT, "", 0, instr_comment, 0x0100, 0xFFFF }
+};
+
+HRESULT WINAPI D3DXDisassembleShader(const DWORD *shader, BOOL colorcode, const char *comments,
+ ID3DXBuffer **disassembly)
+{
+ DWORD *ptr = (DWORD *)shader;
+ char *buffer, *buf;
+ UINT capacity = 4096;
+ BOOL ps;
+ WORD version;
+ HRESULT hr;
+
+ TRACE("%p %d %s %p\n", shader, colorcode, debugstr_a(comments), disassembly);
+
+ if (!shader || !disassembly)
+ return D3DERR_INVALIDCALL;
+
+ buf = buffer = HeapAlloc(GetProcessHeap(), 0, capacity);
+ if (!buffer)
+ return E_OUTOFMEMORY;
+
+ ps = (*ptr >> 16) & 1;
+ version = *ptr & 0xFFFF;
+ buf += sprintf(buf, " %s_%d_%d\n", ps ? "ps" : "vs", D3DSHADER_VERSION_MAJOR(*ptr), D3DSHADER_VERSION_MINOR(*ptr));
+ ptr++;
+
+ while (*ptr != D3DSIO_END)
+ {
+ DWORD index;
+
+ if ((buf - buffer + 128) > capacity)
+ {
+ UINT count = buf - buffer;
+ char *new_buffer = HeapReAlloc(GetProcessHeap(), 0, buffer, capacity * 2);
+ if (!new_buffer)
+ {
+ HeapFree(GetProcessHeap(), 0, buffer);
+ return E_OUTOFMEMORY;
+ }
+ capacity *= 2;
+ buffer = new_buffer;
+ buf = buffer + count;
+ }
+
+ for (index = 0; index < sizeof(instructions)/sizeof(instructions[0]); index++)
+ if (((*ptr & D3DSI_OPCODE_MASK) == instructions[index].opcode) &&
+ (version >= instructions[index].min_version) && (version <= instructions[index].max_version))
+ break;
+
+ if (index != sizeof(instructions)/sizeof(instructions[0]))
+ {
+ buf += instructions[index].function(&(instructions[index]), &ptr, buf, ps);
+ }
+ else
+ {
+ buf += sprintf(buf, " ??? (Unknown opcode %x)\n", *ptr);
+ while (*++ptr & (1u << 31));
+ }
+ }
+
+ hr = D3DXCreateBuffer(buf - buffer + 1 , disassembly);
+ if (SUCCEEDED(hr))
+ strcpy(ID3DXBuffer_GetBufferPointer(*disassembly), buffer);
+ HeapFree(GetProcessHeap(), 0, buffer);
+
+ return hr;
}
struct d3dx9_texture_shader
--
2.39.0

View File

@@ -1,74 +0,0 @@
From 63a4b93d73acaa55a2246a1b0d825e7950af042b Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 15 Feb 2016 08:25:58 +0100
Subject: [PATCH] d3dx9_36/tests: Add initial tests for D3DXDisassembleShader.
---
dlls/d3dx9_36/tests/shader.c | 46 ++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/dlls/d3dx9_36/tests/shader.c b/dlls/d3dx9_36/tests/shader.c
index e2925faad6..5edac61ae8 100644
--- a/dlls/d3dx9_36/tests/shader.c
+++ b/dlls/d3dx9_36/tests/shader.c
@@ -6623,6 +6623,51 @@ static void test_fragment_linker(void)
DestroyWindow(window);
}
+static void test_disassemble_shader(void)
+{
+ static const char disasm_vs[] = " vs_1_1\n"
+ " dcl_position v0\n"
+ " dp4 oPos.x, v0, c0\n"
+ " dp4 oPos.y, v0, c1\n"
+ " dp4 oPos.z, v0, c2\n"
+ " dp4 oPos.w, v0, c3\n";
+ static const char disasm_ps[] = " ps_1_1\n"
+ " def c1, 1, 0, 0, 0\n"
+ " tex t0\n"
+ " dp3 r0, c1, c0\n"
+ " mul r0, v0, r0\n"
+ " mul r0, t0, r0\n";
+ ID3DXBuffer *disassembly;
+ HRESULT ret;
+ char *ptr;
+
+ /* Check wrong parameters */
+ ret = D3DXDisassembleShader(NULL, FALSE, NULL, NULL);
+ ok(ret == D3DERR_INVALIDCALL, "Returned %#x, expected %#x\n", ret, D3DERR_INVALIDCALL);
+ ret = D3DXDisassembleShader(NULL, FALSE, NULL, &disassembly);
+ ok(ret == D3DERR_INVALIDCALL, "Returned %#x, expected %#x\n", ret, D3DERR_INVALIDCALL);
+ ret = D3DXDisassembleShader(simple_vs, FALSE, NULL, NULL);
+ ok(ret == D3DERR_INVALIDCALL, "Returned %#x, expected %#x\n", ret, D3DERR_INVALIDCALL);
+
+ /* Test with vertex shader */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(simple_vs, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_vs, sizeof(disasm_vs) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_vs);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test with pixel shader */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(simple_ps, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_ps, sizeof(disasm_ps) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_ps);
+ ID3DXBuffer_Release(disassembly);
+}
+
START_TEST(shader)
{
test_get_shader_size();
@@ -6638,4 +6683,5 @@ START_TEST(shader)
test_registerset_defaults();
test_shader_semantics();
test_fragment_linker();
+ test_disassemble_shader();
}
--
2.23.0

View File

@@ -1,200 +0,0 @@
From ce7f2989a9fc4d4d6a307131f08f6ed5570de680 Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Tue, 16 Feb 2016 12:11:45 +0100
Subject: [PATCH] d3dx9_36/tests: Add additional tests for special cases.
---
dlls/d3dx9_36/tests/shader.c | 163 +++++++++++++++++++++++++++++++++++
1 file changed, 163 insertions(+)
diff --git a/dlls/d3dx9_36/tests/shader.c b/dlls/d3dx9_36/tests/shader.c
index 5edac61ae8..0ae8f27b03 100644
--- a/dlls/d3dx9_36/tests/shader.c
+++ b/dlls/d3dx9_36/tests/shader.c
@@ -6623,6 +6623,60 @@ static void test_fragment_linker(void)
DestroyWindow(window);
}
+static const DWORD ps_tex[] = {
+ 0xffff0103, /* ps_1_3 */
+ 0x00000042, 0xb00f0000, /* tex t0 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
+static const DWORD ps_texld_1_4[] = {
+ 0xffff0104, /* ps_1_4 */
+ 0x00000042, 0xb00f0000, 0xa0e40000, /* texld t0, c0 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
+static const DWORD ps_texld_2_0[] = {
+ 0xffff0200, /* ps_2_0 */
+ 0x00000042, 0xb00f0000, 0xa0e40000, 0xa0e40001, /* texld t0, c0, c1 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
+static const DWORD ps_texcoord[] = {
+ 0xffff0103, /* ps_1_4 */
+ 0x00000040, 0xb00f0000, /* texcoord t0 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
+static const DWORD ps_texcrd[] = {
+ 0xffff0104, /* ps_2_0 */
+ 0x00000040, 0xb00f0000, 0xa0e40000, /* texcrd t0, c0 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
+static const DWORD ps_sincos_2_0[] = {
+ 0xffff0200, /* ps_2_0 */
+ 0x00000025, 0xb00f0000, 0xa0e40000, 0xa0e40001, 0xa0e40002, /* sincos t0, c0, c1, c2 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
+static const DWORD ps_sincos_3_0[] = {
+ 0xffff0300, /* ps_3_0 */
+ 0x00000025, 0xb00f0000, 0xa0e40000, /* sincos t0, c0 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
+static const DWORD vs_sincos_2_0[] = {
+ 0xfffe0200, /* vs_2_0 */
+ 0x00000025, 0xb00f0000, 0xa0e40000, 0xa0e40001, 0xa0e40002, /* sincos a0, c0, c1, c2 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
+static const DWORD vs_sincos_3_0[] = {
+ 0xfffe0300, /* vs_3_0 */
+ 0x00000025, 0xb00f0000, 0xa0e40000, /* sincos a0, c0 */
+ 0x00000000, /* nop */
+ 0x0000ffff};
+
static void test_disassemble_shader(void)
{
static const char disasm_vs[] = " vs_1_1\n"
@@ -6637,6 +6691,33 @@ static void test_disassemble_shader(void)
" dp3 r0, c1, c0\n"
" mul r0, v0, r0\n"
" mul r0, t0, r0\n";
+ static const char disasm_ps_tex[] = " ps_1_3\n"
+ " tex t0\n"
+ " nop\n";
+ static const char disasm_ps_texld_1_4[] = " ps_1_4\n"
+ " texld t0, c0\n"
+ " nop\n";
+ static const char disasm_ps_texld_2_0[] = " ps_2_0\n"
+ " texld t0, c0, c1\n"
+ " nop\n";
+ static const char disasm_ps_texcoord[] = " ps_1_3\n"
+ " texcoord t0\n"
+ " nop\n";
+ static const char disasm_ps_texcrd[] = " ps_1_4\n"
+ " texcrd t0, c0\n"
+ " nop\n";
+ static const char disasm_ps_sincos_2_0[] = " ps_2_0\n"
+ " sincos t0, c0, c1, c2\n"
+ " nop\n";
+ static const char disasm_ps_sincos_3_0[] = " ps_3_0\n"
+ " sincos t0, c0\n"
+ " nop\n";
+ static const char disasm_vs_sincos_2_0[] = " vs_2_0\n"
+ " sincos a0, c0, c1, c2\n"
+ " nop\n";
+ static const char disasm_vs_sincos_3_0[] = " vs_3_0\n"
+ " sincos a0, c0\n"
+ " nop\n";
ID3DXBuffer *disassembly;
HRESULT ret;
char *ptr;
@@ -6666,6 +6747,88 @@ static void test_disassemble_shader(void)
ok(!memcmp(ptr, disasm_ps, sizeof(disasm_ps) - 1), /* compare beginning */
"Returned '%s', expected '%s'\n", ptr, disasm_ps);
ID3DXBuffer_Release(disassembly);
+
+ /* Test tex instruction with pixel shader 1.3 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(ps_tex, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_ps_tex, sizeof(disasm_ps_tex) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_ps_tex);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test texld instruction with pixel shader 1.4 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(ps_texld_1_4, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_ps_texld_1_4, sizeof(disasm_ps_texld_1_4) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_ps_texld_1_4);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test texld instruction with pixel shader 2.0 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(ps_texld_2_0, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_ps_texld_2_0, sizeof(disasm_ps_texld_2_0) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_ps_texld_2_0);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test texcoord instruction with pixel shader 1.3 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(ps_texcoord, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_ps_texcoord, sizeof(disasm_ps_texcoord) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_ps_texcoord);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test texcrd instruction with pixel shader 1.4 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(ps_texcrd, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_ps_texcrd, sizeof(disasm_ps_texcrd) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_ps_texcrd);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test sincos instruction pixel shader 2.0 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(ps_sincos_2_0, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_ps_sincos_2_0, sizeof(disasm_ps_sincos_2_0) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_ps_sincos_2_0);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test sincos instruction with pixel shader 3.0 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(ps_sincos_3_0, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_ps_sincos_3_0, sizeof(disasm_ps_sincos_3_0) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_ps_sincos_3_0);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test sincos instruction with pixel shader 2.0 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(vs_sincos_2_0, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_vs_sincos_2_0, sizeof(disasm_vs_sincos_2_0) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_vs_sincos_2_0);
+ ID3DXBuffer_Release(disassembly);
+
+ /* Test sincos instruction with pixel shader 3.0 */
+ disassembly = (void *)0xdeadbeef;
+ ret = D3DXDisassembleShader(vs_sincos_3_0, FALSE, NULL, &disassembly);
+ ok(ret == D3D_OK, "Failed with %#x\n", ret);
+ ptr = ID3DXBuffer_GetBufferPointer(disassembly);
+ ok(!memcmp(ptr, disasm_vs_sincos_3_0, sizeof(disasm_vs_sincos_3_0) - 1), /* compare beginning */
+ "Returned '%s', expected '%s'\n", ptr, disasm_vs_sincos_3_0);
+ ID3DXBuffer_Release(disassembly);
+
}
START_TEST(shader)
--
2.23.0

View File

@@ -1 +0,0 @@
Fixes: [46649] Multiple applications need D3DXDisassembleShader() implementation (Tom Clancy's Rainbow Six: Vegas 2, The Void)

View File

@@ -39,7 +39,7 @@ index b81fb6863d3..75ee6d44a95 100644
+ FIXME("Skinning vertices with two position elements not supported\n");
+
+ if ((skin->fvf & D3DFVF_POSITION_MASK) != D3DFVF_XYZ) {
+ FIXME("Vertex type %#x not supported\n", skin->fvf & D3DFVF_POSITION_MASK);
+ FIXME("Vertex type %#lx not supported\n", skin->fvf & D3DFVF_POSITION_MASK);
+ return E_FAIL;
+ }
+

View File

@@ -1,4 +1,4 @@
From f1dba65707a5a8ef5ec2d9c8213134b01cd735e2 Mon Sep 17 00:00:00 2001
From 0a5214d0fe032778fa3ca4ee60c3d2ba64f8f4c0 Mon Sep 17 00:00:00 2001
From: Matthew Wong <itsmattkc@gmail.com>
Date: Fri, 18 Sep 2020 00:47:13 +0000
Subject: [PATCH] ddraw: Implement Pick() and GetPickRecords().
@@ -33,14 +33,14 @@ Signed-off-by: Myah Caron <qsniyg@protonmail.com>
dlls/ddraw/ddraw_private.h | 7 +-
dlls/ddraw/device.c | 67 ++++++++++++--
dlls/ddraw/executebuffer.c | 176 ++++++++++++++++++++++++++++++++++++-
dlls/ddraw/tests/ddraw1.c | 131 +++++++++++++++++++++++++++
4 files changed, 371 insertions(+), 10 deletions(-)
dlls/ddraw/tests/ddraw1.c | 133 ++++++++++++++++++++++++++++
4 files changed, 373 insertions(+), 10 deletions(-)
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h
index 01a9579651c..889a64219e5 100644
index 6fc93b91860..c90b894ea61 100644
--- a/dlls/ddraw/ddraw_private.h
+++ b/dlls/ddraw/ddraw_private.h
@@ -336,6 +336,11 @@ struct d3d_device
@@ -338,6 +338,11 @@ struct d3d_device
struct d3d_viewport *current_viewport;
D3DVIEWPORT7 active_viewport;
@@ -52,7 +52,7 @@ index 01a9579651c..889a64219e5 100644
/* Required to keep track which of two available texture blending modes in d3ddevice3 is used */
BOOL legacyTextureBlending;
D3DTEXTUREBLEND texture_map_blend;
@@ -569,7 +574,7 @@ struct d3d_execute_buffer *unsafe_impl_from_IDirect3DExecuteBuffer(IDirect3DExec
@@ -571,7 +576,7 @@ struct d3d_execute_buffer *unsafe_impl_from_IDirect3DExecuteBuffer(IDirect3DExec
/* The execute function */
HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *execute_buffer,
@@ -62,7 +62,7 @@ index 01a9579651c..889a64219e5 100644
/*****************************************************************************
* IDirect3DVertexBuffer
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 80556e96787..b3b63d7b361 100644
index bc1d91ee00b..82a813f9064 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -349,6 +349,9 @@ static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface)
@@ -172,7 +172,7 @@ index 80556e96787..b3b63d7b361 100644
return D3D_OK;
}
diff --git a/dlls/ddraw/executebuffer.c b/dlls/ddraw/executebuffer.c
index 13e639eda3f..bb050fe16b8 100644
index 320ce6649d4..84366dafd7d 100644
--- a/dlls/ddraw/executebuffer.c
+++ b/dlls/ddraw/executebuffer.c
@@ -45,15 +45,106 @@ static void _dump_D3DEXECUTEBUFFERDESC(const D3DEXECUTEBUFFERDESC *lpDesc) {
@@ -387,10 +387,10 @@ index 13e639eda3f..bb050fe16b8 100644
static inline struct d3d_execute_buffer *impl_from_IDirect3DExecuteBuffer(IDirect3DExecuteBuffer *iface)
{
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index f5fc7b04053..b6374e75632 100644
index d8fcb188c40..bacd9049d6e 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -15429,6 +15429,136 @@ static void test_enum_devices(void)
@@ -15467,6 +15467,137 @@ static void test_enum_devices(void)
ok(!refcount, "Device has %lu references left.\n", refcount);
}
@@ -521,13 +521,22 @@ index f5fc7b04053..b6374e75632 100644
+ IDirect3DExecuteBuffer_Release(execute_buffer);
+ IDirect3DDevice_Release(device);
+ IDirectDraw_Release(ddraw);
+
+ DestroyWindow(window);
+}
+
START_TEST(ddraw1)
{
DDDEVICEIDENTIFIER identifier;
@@ -15545,6 +15675,7 @@ START_TEST(ddraw1)
/* Emperor: Rise of the Middle Kingdom locks a sysmem surface and then accesses
* the pointer after unlocking it. This test roughly replicates the calls that
* it makes. */
@@ -15527,6 +15658,7 @@ static void test_pinned_sysmem(void)
IDirectDrawSurface_Release(surface);
refcount = IDirectDraw_Release(ddraw);
ok(!refcount, "Device has %lu references left.\n", refcount);
+
DestroyWindow(window);
}
@@ -15646,6 +15778,7 @@ START_TEST(ddraw1)
test_vtbl_protection();
test_window_position();
test_get_display_mode();
@@ -536,5 +545,5 @@ index f5fc7b04053..b6374e75632 100644
test_filling_convention();
test_enum_devices();
--
2.40.1
2.43.0

View File

@@ -1,18 +1,18 @@
From 16d001f5562c37ac293fa547feef19887e635363 Mon Sep 17 00:00:00 2001
From e4688a88901a1c13b2df67a0444c34e3ee02bbab Mon Sep 17 00:00:00 2001
From: Andrew D'Addesio <andrew@fatbag.net>
Date: Fri, 8 Feb 2019 18:48:33 -1000
Subject: [PATCH] ddraw: Return correct devices based off requested DirectX
version.
---
dlls/ddraw/ddraw.c | 231 +++++++++++++++++++++++++--------------------
1 file changed, 130 insertions(+), 101 deletions(-)
dlls/ddraw/ddraw.c | 232 +++++++++++++++++++++++++--------------------
1 file changed, 129 insertions(+), 103 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 83eeb33589e..324a149a425 100644
index 5887854556b..5ac95dc3043 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -47,37 +47,80 @@ static const DDDEVICEIDENTIFIER2 deviceidentifier =
@@ -44,37 +44,80 @@ static const DDDEVICEIDENTIFIER2 deviceidentifier =
0
};
@@ -28,7 +28,7 @@ index 83eeb33589e..324a149a425 100644
+ char device_desc[100];
char device_name[100];
const GUID *device_guid;
DWORD remove_caps;
DWORD unsupported_caps;
-} device_list7[] =
+} device_list[] =
{
@@ -38,7 +38,7 @@ index 83eeb33589e..324a149a425 100644
- "WINE Direct3D7 Hardware Transform and Lighting acceleration using WineD3D",
- "Wine D3D7 T&L HAL",
- &IID_IDirect3DTnLHalDevice,
+ D3D_VERSION(1)|D3D_VERSION(2),
+ D3D_VERSION(1) | D3D_VERSION(2),
+ "WineD3D Ramp Software Emulation",
+ "Ramp Emulation",
+ &IID_IDirect3DRampDevice,
@@ -49,20 +49,20 @@ index 83eeb33589e..324a149a425 100644
+ /* RGB Emulation (D3D 1-7) */
{
- "WINE Direct3D7 Hardware acceleration using WineD3D",
+ D3D_VERSION(1)|D3D_VERSION(2)|D3D_VERSION(3)|D3D_VERSION(7),
+ D3D_VERSION(1) | D3D_VERSION(2) | D3D_VERSION(3) | D3D_VERSION(7),
+ "WineD3D RGB Software Emulation",
+ "RGB Emulation",
+ &IID_IDirect3DRGBDevice,
+ D3DDEVCAPS_HWTRANSFORMANDLIGHT,
+ D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_DRAWPRIMITIVES2EX | D3DDEVCAPS_HWRASTERIZATION,
+ },
+
+ /* Direct3D HAL (D3D 1-7) */
+ {
+ D3D_VERSION(1)|D3D_VERSION(2)|D3D_VERSION(3)|D3D_VERSION(7),
+ D3D_VERSION(1) | D3D_VERSION(2) | D3D_VERSION(3) | D3D_VERSION(7),
+ "WineD3D Hardware Acceleration",
"Direct3D HAL",
&IID_IDirect3DHALDevice,
0,
D3DDEVCAPS_HWTRANSFORMANDLIGHT,
},
- /* RGB device */
@@ -71,13 +71,13 @@ index 83eeb33589e..324a149a425 100644
- "WINE Direct3D7 RGB Software Emulation using WineD3D",
- "Wine D3D7 RGB",
- &IID_IDirect3DRGBDevice,
- D3DDEVCAPS_HWTRANSFORMANDLIGHT,
- D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_DRAWPRIMITIVES2EX | D3DDEVCAPS_HWRASTERIZATION,
+ D3D_VERSION(2),
+ "WineD3D MMX Software Emulation",
+ "MMX Emulation",
+ &IID_IDirect3DMMXDevice,
+ 0,
+ },
},
+
+ /* Direct3D T&L HAL (D3D7 only) */
+ {
@@ -86,7 +86,7 @@ index 83eeb33589e..324a149a425 100644
+ "Direct3D T&L HAL",
+ &IID_IDirect3DTnLHalDevice,
+ 0,
},
+ },
+
+ /* In the future, we may wish to add the "Reference Rasterizer" and
+ * "Null device", which are only available in DX6-8 and must be explicitly
@@ -106,7 +106,7 @@ index 83eeb33589e..324a149a425 100644
};
static void STDMETHODCALLTYPE ddraw_null_wined3d_object_destroyed(void *parent) {}
@@ -1389,15 +1432,6 @@ HRESULT ddraw_get_d3dcaps(const struct ddraw *ddraw, D3DDEVICEDESC7 *caps)
@@ -1415,15 +1458,6 @@ HRESULT ddraw_get_d3dcaps(const struct ddraw *ddraw, D3DDEVICEDESC7 *caps)
D3DPTADDRESSCAPS_WRAP | D3DPTADDRESSCAPS_MIRROR | D3DPTADDRESSCAPS_CLAMP |
D3DPTADDRESSCAPS_BORDER | D3DPTADDRESSCAPS_INDEPENDENTUV);
@@ -122,7 +122,7 @@ index 83eeb33589e..324a149a425 100644
/* Fill the missing members, and do some fixup */
caps->dpcLineCaps.dwSize = sizeof(caps->dpcLineCaps);
caps->dpcLineCaps.dwTextureBlendCaps = D3DPTBLENDCAPS_ADD
@@ -3713,8 +3747,7 @@ static HRESULT WINAPI ddraw1_DuplicateSurface(IDirectDraw *iface, IDirectDrawSur
@@ -3746,8 +3780,7 @@ static HRESULT WINAPI ddraw1_DuplicateSurface(IDirectDraw *iface, IDirectDrawSur
/*****************************************************************************
* IDirect3D7::EnumDevices
*
@@ -132,8 +132,8 @@ index 83eeb33589e..324a149a425 100644
*
* Params:
* callback: Function to call for each enumerated device
@@ -3747,14 +3780,17 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
@@ -3779,13 +3812,16 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
}
dev_caps = device_desc7.dwDevCaps;
- for (i = 0; i < ARRAY_SIZE(device_list7); i++)
@@ -142,19 +142,18 @@ index 83eeb33589e..324a149a425 100644
HRESULT ret;
- device_desc7.deviceGUID = *device_list7[i].device_guid;
- device_desc7.dwDevCaps = dev_caps & ~device_list7[i].remove_caps;
- device_desc7.dwDevCaps = dev_caps & ~device_list7[i].unsupported_caps;
- ret = callback(device_list7[i].interface_name, device_list7[i].device_name, &device_desc7, context);
+ if (!(device_list[i].version_mask & D3D_VERSION(ddraw->d3dversion)))
+ continue;
+
+ device_desc7.deviceGUID = *device_list[i].device_guid;
+ device_desc7.dwDevCaps = dev_caps & ~device_list[i].remove_caps;
- ret = callback(device_list7[i].interface_name, device_list7[i].device_name, &device_desc7, context);
+ device_desc7.dwDevCaps = dev_caps & ~device_list[i].unsupported_caps;
+ ret = callback(device_list[i].device_name, device_list[i].device_name, &device_desc7, context);
if (ret != DDENUMRET_OK)
{
TRACE("Application cancelled the enumeration.\n");
@@ -3770,11 +3806,21 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
@@ -3801,11 +3837,21 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
return D3D_OK;
}
@@ -178,7 +177,7 @@ index 83eeb33589e..324a149a425 100644
*
* Versions 1, 2 and 3
*
@@ -3789,18 +3835,18 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
@@ -3820,18 +3866,18 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
*****************************************************************************/
static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBACK callback, void *context)
{
@@ -206,7 +205,7 @@ index 83eeb33589e..324a149a425 100644
TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
@@ -3809,52 +3855,58 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA
@@ -3840,55 +3886,60 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA
wined3d_mutex_lock();
@@ -246,9 +245,15 @@ index 83eeb33589e..324a149a425 100644
- * flag set. This way it refuses the emulation device, and HAL devices
- * never have POW2 unset in d3d7 on windows. */
- if (ddraw->d3dversion != 1)
- {
+ clear_device_desc(&empty_desc1);
+ empty_desc1.dwSize = desc_size;
+
+ for (i = 0; i < ARRAY_SIZE(device_list); i++)
{
- static CHAR reference_description[] = "RGB Direct3D emulation";
-
+ if (!(device_list[i].version_mask & D3D_VERSION(ddraw->d3dversion)))
+ continue;
- TRACE("Enumerating WineD3D D3DDevice interface.\n");
- hal_desc = device_desc1;
- hel_desc = device_desc1;
@@ -261,22 +266,16 @@ index 83eeb33589e..324a149a425 100644
- hal_desc.dcmColorModel = 0;
- /* RGB, RAMP and MMX devices cannot report HAL hardware flags */
- hal_desc.dwFlags = 0;
-
- hr = callback((GUID *)&IID_IDirect3DRGBDevice, reference_description,
- device_name, &hal_desc, &hel_desc, context);
- if (hr != D3DENUMRET_OK)
+ clear_device_desc(&empty_desc1);
+ empty_desc1.dwSize = desc_size;
+
+ for (i = 0; i < ARRAY_SIZE(device_list); i++)
+ {
+ if (!(device_list[i].version_mask & D3D_VERSION(ddraw->d3dversion)))
+ continue;
+
- /* RGB, REF, RAMP and MMX devices don't report hardware transform and lighting capability */
- hal_desc.dwDevCaps &= ~(D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_DRAWPRIMITIVES2EX | D3DDEVCAPS_HWRASTERIZATION);
- hel_desc.dwDevCaps &= ~(D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_DRAWPRIMITIVES2EX | D3DDEVCAPS_HWRASTERIZATION);
+ if (IsEqualGUID(&IID_IDirect3DHALDevice, device_list[i].device_guid))
+ {
+ hal_desc = device_desc1;
+
- hr = callback((GUID *)&IID_IDirect3DRGBDevice, reference_description,
- device_name, &hal_desc, &hel_desc, context);
- if (hr != D3DENUMRET_OK)
+ /* The HAL device's hel_desc is almost empty -- but not completely */
+ hel_desc = empty_desc1;
+ hel_desc.dwFlags = D3DDD_COLORMODEL | D3DDD_DEVCAPS | D3DDD_TRANSFORMCAPS
@@ -296,6 +295,8 @@ index 83eeb33589e..324a149a425 100644
+ /* Ramp device supports grayscale only */
+ if (IsEqualGUID(&IID_IDirect3DRampDevice, device_list[i].device_guid))
+ hel_desc.dcmColorModel = D3DCOLOR_MONO;
+ /* RGB, REF, RAMP and MMX devices don't report hardware transform and lighting capability */
+ hel_desc.dwDevCaps &= ~(D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_DRAWPRIMITIVES2EX | D3DDEVCAPS_HWRASTERIZATION);
+ }
+
+ hr = callback((GUID *)device_list[i].device_guid, device_list[i].device_desc,
@@ -304,7 +305,7 @@ index 83eeb33589e..324a149a425 100644
{
TRACE("Application cancelled the enumeration.\n");
wined3d_mutex_unlock();
@@ -3862,29 +3914,6 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA
@@ -3896,31 +3947,6 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA
}
}
@@ -321,6 +322,8 @@ index 83eeb33589e..324a149a425 100644
- | D3DPTEXTURECAPS_NONPOW2CONDITIONAL | D3DPTEXTURECAPS_PERSPECTIVE);
- /* HAL devices have a HEL dcmColorModel of 0 */
- hel_desc.dcmColorModel = 0;
- /* HAL devices report hardware transform and lighting capability, but not in hel */
- hel_desc.dwDevCaps &= ~(D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_DRAWPRIMITIVES2EX);
-
- hr = callback((GUID *)&IID_IDirect3DHALDevice, wined3d_description,
- device_name, &hal_desc, &hel_desc, context);
@@ -335,5 +338,5 @@ index 83eeb33589e..324a149a425 100644
wined3d_mutex_unlock();
--
2.20.1
2.43.0

View File

@@ -8,4 +8,3 @@
# The Sims Online
Fixes: [19153] Resident Evil 1 fails to start (needs IDirect3D3::EnumDevices() to return a device named "RGB Emulation")
Depends: ddraw-Device_Caps
Disabled: True

View File

@@ -1,4 +1,4 @@
From ca6a89f3bfb6aa5d7ac05bb0c469b527ae1a9d9d Mon Sep 17 00:00:00 2001
From 1cf7540fcddc9fbaa7411f3293f115555a6dd0ab Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 6 Jul 2020 16:11:23 -0500
Subject: [PATCH] server, ntdll: Implement message waits.
@@ -10,10 +10,10 @@ Subject: [PATCH] server, ntdll: Implement message waits.
3 files changed, 75 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c
index 2ae334d8417..608c318c1c7 100644
index 399930c444b..06d7d8babc6 100644
--- a/dlls/ntdll/unix/esync.c
+++ b/dlls/ntdll/unix/esync.c
@@ -475,12 +475,13 @@ static void update_grabbed_object( struct esync *obj )
@@ -474,12 +474,13 @@ static void update_grabbed_object( struct esync *obj )
/* A value of STATUS_NOT_IMPLEMENTED returned from this function means that we
* need to delegate to server_select(). */
@@ -28,7 +28,7 @@ index 2ae334d8417..608c318c1c7 100644
LONGLONG timeleft;
LARGE_INTEGER now;
ULONGLONG end;
@@ -508,6 +509,9 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
@@ -507,6 +508,9 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
return ret;
}
@@ -38,7 +38,7 @@ index 2ae334d8417..608c318c1c7 100644
if (has_esync && has_server)
FIXME("Can't wait on esync and server objects at the same time!\n");
else if (has_server)
@@ -519,6 +523,9 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
@@ -518,6 +522,9 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
for (i = 0; i < count; i++)
TRACE(" %p", handles[i]);
@@ -48,7 +48,7 @@ index 2ae334d8417..608c318c1c7 100644
if (!timeout)
TRACE(", timeout = INFINITE.\n");
else
@@ -558,7 +565,9 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
@@ -557,7 +564,9 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
int64_t value;
ssize_t size;
@@ -59,7 +59,7 @@ index 2ae334d8417..608c318c1c7 100644
{
/* Don't grab the object, just check if it's signaled. */
if (fds[i].revents & POLLIN)
@@ -603,6 +612,44 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
@@ -602,6 +611,44 @@ NTSTATUS esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_an
}
}
@@ -105,10 +105,10 @@ index 2ae334d8417..608c318c1c7 100644
{
struct stat st;
diff --git a/server/protocol.def b/server/protocol.def
index 5cf63cbac21..f837944574e 100644
index 915332ece6f..dd5e996cbc7 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3797,3 +3797,8 @@ enum esync_type
@@ -3921,3 +3921,8 @@ enum esync_type
int type;
unsigned int shm_idx;
@END
@@ -118,10 +118,10 @@ index 5cf63cbac21..f837944574e 100644
+ int in_msgwait; /* are we in a message wait? */
+@END
diff --git a/server/queue.c b/server/queue.c
index 1702acb8480..9593ae532d4 100644
index 3d5da326400..80731383401 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -144,6 +144,7 @@ struct msg_queue
@@ -146,6 +146,7 @@ struct msg_queue
int keystate_lock; /* owns an input keystate lock */
unsigned int ignore_post_msg; /* ignore post messages newer than this unique id */
int esync_fd; /* esync file descriptor (signalled on message) */
@@ -129,7 +129,7 @@ index 1702acb8480..9593ae532d4 100644
};
struct hotkey
@@ -317,6 +318,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
@@ -319,6 +320,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
queue->keystate_lock = 0;
queue->ignore_post_msg = 0;
queue->esync_fd = -1;
@@ -137,7 +137,7 @@ index 1702acb8480..9593ae532d4 100644
list_init( &queue->send_result );
list_init( &queue->callback_result );
list_init( &queue->pending_timers );
@@ -1001,6 +1003,10 @@ static int is_queue_hung( struct msg_queue *queue )
@@ -1106,6 +1108,10 @@ static int is_queue_hung( struct msg_queue *queue )
if (get_wait_queue_thread(entry)->queue == queue)
return 0; /* thread is waiting on queue -> not hung */
}
@@ -148,9 +148,9 @@ index 1702acb8480..9593ae532d4 100644
return 1;
}
@@ -3456,3 +3462,18 @@ DECL_HANDLER(update_rawinput_devices)
process->rawinput_mouse = find_rawinput_device( process, 1, 2 );
process->rawinput_kbd = find_rawinput_device( process, 1, 6 );
@@ -3568,3 +3574,18 @@ DECL_HANDLER(update_rawinput_devices)
process->rawinput_mouse = find_rawinput_device( process, MAKELONG(HID_USAGE_GENERIC_MOUSE, HID_USAGE_PAGE_GENERIC) );
process->rawinput_kbd = find_rawinput_device( process, MAKELONG(HID_USAGE_GENERIC_KEYBOARD, HID_USAGE_PAGE_GENERIC) );
}
+
+DECL_HANDLER(esync_msgwait)
@@ -168,5 +168,5 @@ index 1702acb8480..9593ae532d4 100644
+ set_fd_events( queue->fd, req->in_msgwait ? POLLIN : 0 );
+}
--
2.35.1
2.43.0

View File

@@ -24,7 +24,7 @@ index 30a79368c94..fc2069c389a 100644
+ /* System\CurrentControlSet\Control\Video should be non-volatile */
+ ret = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Control\\Video\\Wine",
+ 0, NULL, 0, KEY_NOTIFY, NULL, &hkey1, NULL);
+ ok(ret == ERROR_SUCCESS, "RegCreateKeyExA failed with error %d\n", ret);
+ ok(ret == ERROR_SUCCESS, "RegCreateKeyExA failed with error %lx\n", ret);
+ RegDeleteKeyA(hkey1, "");
+ RegCloseKey(hkey1);
+

View File

@@ -0,0 +1,43 @@
From 3121022dbf17c32503ed18be302c0cee219b394c Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Sat, 10 Feb 2024 13:06:22 +1100
Subject: [PATCH 1/2] Revert "explorer: Set layered style on systray icons only
when it's actually layered."
This reverts commit b5c57b9a62c396068d18237bd6e82b37c169fdc5.
---
programs/explorer/systray.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c
index c76ebdd0c92..74e5c3b6b48 100644
--- a/programs/explorer/systray.c
+++ b/programs/explorer/systray.c
@@ -624,7 +624,6 @@ static BOOL show_icon(struct icon *icon)
{
icon->display = ICON_DISPLAY_DOCKED;
icon->layered = TRUE;
- SetWindowLongW( icon->window, GWL_EXSTYLE, GetWindowLongW( icon->window, GWL_EXSTYLE ) | WS_EX_LAYERED );
SendMessageW( icon->window, WM_SIZE, SIZE_RESTORED, MAKELONG( icon_cx, icon_cy ) );
}
systray_add_icon( icon );
@@ -646,7 +645,6 @@ static BOOL hide_icon(struct icon *icon)
{
icon->display = ICON_DISPLAY_HIDDEN;
icon->layered = FALSE;
- SetWindowLongW( icon->window, GWL_EXSTYLE, GetWindowLongW( icon->window, GWL_EXSTYLE ) & ~WS_EX_LAYERED );
}
ShowWindow( icon->window, SW_HIDE );
systray_remove_icon( icon );
@@ -734,7 +732,7 @@ static BOOL add_icon(NOTIFYICONDATAW *nid)
icon->owner = nid->hWnd;
icon->display = ICON_DISPLAY_HIDDEN;
- CreateWindowExW( 0, tray_icon_class.lpszClassName, NULL, WS_CLIPSIBLINGS | WS_POPUP,
+ CreateWindowExW( WS_EX_LAYERED, tray_icon_class.lpszClassName, NULL, WS_CLIPSIBLINGS | WS_POPUP,
0, 0, icon_cx, icon_cy, 0, NULL, NULL, icon );
if (!icon->window) ERR( "Failed to create systray icon window\n" );
--
2.43.0

View File

@@ -0,0 +1,45 @@
From 57bf893be6bae301dbc1099615096d2f3644119b Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Sat, 10 Feb 2024 13:06:23 +1100
Subject: [PATCH 2/2] Revert "explorer: Don't activate the systray icon when
showing it."
This reverts commit 5e7a8f4db045d456913f9bd7075191ad14053375.
---
programs/explorer/systray.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c
index 74e5c3b6b48..43187db30b5 100644
--- a/programs/explorer/systray.c
+++ b/programs/explorer/systray.c
@@ -543,15 +543,6 @@ static LRESULT WINAPI tray_icon_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPA
break;
}
- case WM_WINDOWPOSCHANGING:
- if (icon->display == ICON_DISPLAY_HIDDEN)
- {
- /* Changing the icon's parent via SetParent would activate it, stealing the focus. */
- WINDOWPOS *wp = (WINDOWPOS*)lparam;
- wp->flags |= SWP_NOACTIVATE;
- }
- break;
-
case WM_WINDOWPOSCHANGED:
update_systray_balloon_position();
break;
@@ -575,9 +566,9 @@ static void systray_add_icon( struct icon *icon )
if (icon->display != ICON_DISPLAY_HIDDEN) return; /* already added */
+ icon->display = nb_displayed++;
SetWindowLongW( icon->window, GWL_STYLE, GetWindowLongW( icon->window, GWL_STYLE ) | WS_CHILD );
SetParent( icon->window, tray_window );
- icon->display = nb_displayed++;
pos = get_icon_pos( icon );
SetWindowPos( icon->window, 0, pos.x, pos.y, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_SHOWWINDOW );
--
2.43.0

View File

@@ -0,0 +1,4 @@
# These are causing a regression with Steam
# Close stream to cause it to minimize as an icon, fails to show icon.
# Debian using XFCE

View File

@@ -1,4 +1,4 @@
From 2533bbf747689e8326bb7795e890e7716144cb11 Mon Sep 17 00:00:00 2001
From b451aabaccbfb289853b8ddae8cb95e77af33f17 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 3 Sep 2015 01:25:14 +0200
Subject: [PATCH] fonts: Add Liberation Serif as an Times New Roman
@@ -13,14 +13,15 @@ Subject: [PATCH] fonts: Add Liberation Serif as an Times New Roman
create mode 100644 fonts/times.ttf
diff --git a/fonts/Makefile.in b/fonts/Makefile.in
index fb2cd83c4e6..9251153705d 100644
index ab80e7b70f7..94763601824 100644
--- a/fonts/Makefile.in
+++ b/fonts/Makefile.in
@@ -12,4 +12,5 @@ FONT_SRCS = \
@@ -11,5 +11,6 @@ SOURCES = \
system.sfd \
tahoma.sfd \
tahomabd.sfd \
webdings.sfd \
+ times.sfd \
webdings.sfd \
wingding.sfd
diff --git a/fonts/times.sfd b/fonts/times.sfd
new file mode 100644
@@ -99112,5 +99113,5 @@ literal 0
HcmV?d00001
--
2.27.0
2.43.0

View File

@@ -1,70 +0,0 @@
From 190e36c5ea8047e42b10d8c626bb221b4f3d5b02 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 26 Feb 2016 21:35:52 +0100
Subject: krnl386.exe16: Really translate all invalid console handles into
usable DOS handles.
---
dlls/krnl386.exe16/file.c | 33 ++++++++++++++++++++-------------
1 file changed, 20 insertions(+), 13 deletions(-)
diff --git a/dlls/krnl386.exe16/file.c b/dlls/krnl386.exe16/file.c
index b66b753..e6b1233 100644
--- a/dlls/krnl386.exe16/file.c
+++ b/dlls/krnl386.exe16/file.c
@@ -45,6 +45,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(file);
static HANDLE dos_handles[DOS_TABLE_SIZE];
+static void set_standard_handle(HANDLE *out, HANDLE null, HANDLE in)
+{
+ if (!in || in == INVALID_HANDLE_VALUE ||
+ !DuplicateHandle(GetCurrentProcess(), in, GetCurrentProcess(),
+ out, 0, TRUE, DUPLICATE_SAME_ACCESS))
+ {
+ DuplicateHandle(GetCurrentProcess(), null, GetCurrentProcess(),
+ out, 0, TRUE, DUPLICATE_SAME_ACCESS);
+ }
+}
+
/***********************************************************************
* FILE_InitProcessDosHandles
*
@@ -53,25 +64,21 @@ static HANDLE dos_handles[DOS_TABLE_SIZE];
*/
static void FILE_InitProcessDosHandles( void )
{
- HANDLE hStdInput, hStdOutput, hStdError, hNull;
+ HANDLE hNull;
static BOOL init_done /* = FALSE */;
- HANDLE cp = GetCurrentProcess();
if (init_done) return;
init_done = TRUE;
- hStdInput = GetStdHandle(STD_INPUT_HANDLE);
- hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
- hStdError = GetStdHandle(STD_ERROR_HANDLE);
+
hNull = CreateFileA("NUL", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0);
+
/* Invalid console handles need to translate to real DOS handles in a new process */
- if (!hStdInput) hStdInput = hNull;
- if (!hStdOutput) hStdOutput = hNull;
- if (!hStdError) hStdError = hNull;
- DuplicateHandle(cp, hStdInput, cp, &dos_handles[0], 0, TRUE, DUPLICATE_SAME_ACCESS);
- DuplicateHandle(cp, hStdOutput, cp, &dos_handles[1], 0, TRUE, DUPLICATE_SAME_ACCESS);
- DuplicateHandle(cp, hStdError, cp, &dos_handles[2], 0, TRUE, DUPLICATE_SAME_ACCESS);
- DuplicateHandle(cp, hStdError, cp, &dos_handles[3], 0, TRUE, DUPLICATE_SAME_ACCESS);
- DuplicateHandle(cp, hStdError, cp, &dos_handles[4], 0, TRUE, DUPLICATE_SAME_ACCESS);
+ set_standard_handle(&dos_handles[0], hNull, GetStdHandle(STD_INPUT_HANDLE));
+ set_standard_handle(&dos_handles[1], hNull, GetStdHandle(STD_OUTPUT_HANDLE));
+ set_standard_handle(&dos_handles[2], hNull, GetStdHandle(STD_ERROR_HANDLE));
+ set_standard_handle(&dos_handles[3], hNull, GetStdHandle(STD_ERROR_HANDLE));
+ set_standard_handle(&dos_handles[4], hNull, GetStdHandle(STD_ERROR_HANDLE));
+
CloseHandle(hNull);
}
--
2.7.1

View File

@@ -1 +0,0 @@
Fixes: [7106] Translate all invalid console handles into usable DOS handles

Some files were not shown because too many files have changed in this diff Show More