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
59 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
27b121f293 | ||
|
ab9df8f932 | ||
|
4127a50f6b | ||
|
deb7042324 | ||
|
21a71e43b2 | ||
|
fdd5079133 | ||
|
acfbb64262 | ||
|
041773cac4 | ||
|
f43640039b | ||
|
8999a04fd6 | ||
|
3c0ae5d07c | ||
|
294e058f4b | ||
|
edbcee8c11 | ||
|
6c5cb54635 | ||
|
03b53697da | ||
|
c901884ac0 | ||
|
5fad8dd101 | ||
|
ae46f56f2c | ||
|
5eeb4b76d6 | ||
|
b9a08f8300 | ||
|
41367bc540 | ||
|
e780e2e62d | ||
|
a90554bb04 | ||
|
7104b9b6ba | ||
|
51d8ac0717 | ||
|
4af1f11315 | ||
|
cd2cce28cc | ||
|
761b7f72d0 | ||
|
92374493ee | ||
|
a713da9181 | ||
|
75f3eede59 | ||
|
a7f29f1236 | ||
|
1143543d4a | ||
|
4cfe8f056a | ||
|
c23ee1bf3b | ||
|
d2636c432f | ||
|
7624463e7c | ||
|
06d80381a4 | ||
|
a59a98678f | ||
|
db14a7bed3 | ||
|
6883402dec | ||
|
b98458cadc | ||
|
37551c99a2 | ||
|
bdc041f704 | ||
|
d4f4b330b8 | ||
|
9b107c62cb | ||
|
9eb00790f0 | ||
|
82ccf59f15 | ||
|
2c482721e3 | ||
|
215e6efd27 | ||
|
05d08d31c0 | ||
|
73441d6d9b | ||
|
39ad9d8625 | ||
|
fe62b910f5 | ||
|
1d529ee294 | ||
|
67a860f344 | ||
|
6bab3a7617 | ||
|
3c0f797ca6 | ||
|
577974c563 |
2
.github/workflows/macOS.yml
vendored
2
.github/workflows/macOS.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
||||
mkdir $GITHUB_WORKSPACE/wine
|
||||
cd wine
|
||||
git init
|
||||
git fetch git://source.winehq.org/git/wine.git $($GITHUB_WORKSPACE/staging/patchinstall.py --upstream-commit) --depth=1
|
||||
git fetch https://gitlab.winehq.org/wine/wine.git $($GITHUB_WORKSPACE/staging/patchinstall.py --upstream-commit) --depth=1
|
||||
git checkout $($GITHUB_WORKSPACE/staging/patchinstall.py --upstream-commit)
|
||||
|
||||
- name: Run patchinstall.py --all
|
||||
|
@@ -1,15 +1,15 @@
|
||||
From 6a4be6a3089d37ff825853d2644d826d80d59e4f Mon Sep 17 00:00:00 2001
|
||||
From 601da0ae0c6b22f37d20e6e0f10558093277eca9 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
|
||||
branch name and version.
|
||||
|
||||
---
|
||||
dlls/ntdll/loader.c | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
dlls/ntdll/loader.c | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index bad1492e138..6f80e7b3a28 100644
|
||||
index 5f84ca7e23b..fabf394fbe5 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -43,6 +43,7 @@ WINE_DECLARE_DEBUG_CHANNEL(relay);
|
||||
@@ -20,7 +20,7 @@ index bad1492e138..6f80e7b3a28 100644
|
||||
|
||||
#ifdef _WIN64
|
||||
#define DEFAULT_SECURITY_COOKIE_64 (((ULONGLONG)0x00002b99 << 32) | 0x2ddfa232)
|
||||
@@ -3823,6 +3824,7 @@ void WINAPI LdrShutdownProcess(void)
|
||||
@@ -3828,6 +3829,7 @@ void WINAPI LdrShutdownProcess(void)
|
||||
process_detach();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ index bad1492e138..6f80e7b3a28 100644
|
||||
|
||||
/******************************************************************
|
||||
* RtlExitUserProcess (NTDLL.@)
|
||||
@@ -4317,6 +4319,9 @@ static void release_address_space(void)
|
||||
@@ -4322,6 +4324,9 @@ static void release_address_space(void)
|
||||
*/
|
||||
void loader_init( CONTEXT *context, void **entry )
|
||||
{
|
||||
@@ -38,10 +38,13 @@ index bad1492e138..6f80e7b3a28 100644
|
||||
static int attach_done;
|
||||
NTSTATUS status;
|
||||
ULONG_PTR cookie, port = 0;
|
||||
@@ -4397,6 +4402,16 @@ void loader_init( CONTEXT *context, void **entry )
|
||||
@@ -4407,7 +4412,18 @@ void loader_init( CONTEXT *context, void **entry )
|
||||
arm64ec_thread_init();
|
||||
#endif
|
||||
wm = get_modref( NtCurrentTeb()->Peb->ImageBaseAddress );
|
||||
+ /* This hunk occasionally applies in the wrong place;
|
||||
+ * add a comment here to try to prevent that. */
|
||||
}
|
||||
|
||||
+ RtlInitUnicodeString( &staging_event_string, L"\\__wine_staging_warn_event" );
|
||||
+ InitializeObjectAttributes( &staging_event_attr, &staging_event_string, OBJ_OPENIF, NULL, NULL );
|
||||
+ if (NtCreateEvent( &staging_event, EVENT_ALL_ACCESS, &staging_event_attr, NotificationEvent, FALSE ) == STATUS_SUCCESS)
|
||||
@@ -51,10 +54,9 @@ index bad1492e138..6f80e7b3a28 100644
|
||||
+ }
|
||||
+ else
|
||||
+ WARN_(winediag)("wine-staging %s is a testing version containing experimental patches.\n", wine_get_version());
|
||||
+
|
||||
RtlAcquirePebLock();
|
||||
InsertHeadList( &tls_links, &NtCurrentTeb()->TlsLinks );
|
||||
RtlReleasePebLock();
|
||||
|
||||
NtCurrentTeb()->FlsSlots = fls_alloc_data();
|
||||
|
||||
--
|
||||
2.43.0
|
||||
2.45.2
|
||||
|
||||
|
@@ -1,197 +0,0 @@
|
||||
From 0173ca4b3352506b76801619ae5a05f338d6ff6e Mon Sep 17 00:00:00 2001
|
||||
From: Jason Edmeades <us@edmeades.me.uk>
|
||||
Date: Tue, 16 Jul 2019 13:49:18 +1000
|
||||
Subject: [PATCH] cmd: Support for launching programs based on file association
|
||||
|
||||
cmd already handles exe, cmd, bat etc but if you run a file with another extension,
|
||||
then use the associations set in the registry (for example via ftype / assoc) to
|
||||
launch a program. This enables you to run test.txt and notepad to pop up, or
|
||||
fred.msi for msiexec to be launched.
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=18154
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36646
|
||||
---
|
||||
programs/cmd/wcmdmain.c | 139 +++++++++++++++++++++++++++++-----------
|
||||
1 file changed, 102 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
|
||||
index ce48b16d7ec..2d20ee299fa 100644
|
||||
--- a/programs/cmd/wcmdmain.c
|
||||
+++ b/programs/cmd/wcmdmain.c
|
||||
@@ -1541,8 +1541,10 @@ void WCMD_run_program (WCHAR *command, BOOL called)
|
||||
|
||||
/* 1. If extension supplied, see if that file exists */
|
||||
if (extensionsupplied) {
|
||||
- if (GetFileAttributesW(thisDir) != INVALID_FILE_ATTRIBUTES) {
|
||||
+ DWORD attribs = GetFileAttributesW(thisDir);
|
||||
+ if (attribs != INVALID_FILE_ATTRIBUTES && !(attribs&FILE_ATTRIBUTE_DIRECTORY)) {
|
||||
found = TRUE;
|
||||
+ WINE_TRACE("Found as file with extension as '%s'\n", wine_dbgstr_w(thisDir));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1572,6 +1574,7 @@ void WCMD_run_program (WCHAR *command, BOOL called)
|
||||
}
|
||||
|
||||
if (GetFileAttributesW(thisDir) != INVALID_FILE_ATTRIBUTES) {
|
||||
+ WINE_TRACE("Found via search and pathext as '%s'\n", wine_dbgstr_w(thisDir));
|
||||
found = TRUE;
|
||||
thisExt = NULL;
|
||||
}
|
||||
@@ -1595,6 +1598,7 @@ void WCMD_run_program (WCHAR *command, BOOL called)
|
||||
RETURN_CODE return_code;
|
||||
BOOL oldinteractive = interactive;
|
||||
|
||||
+ WINE_TRACE("Calling batch program\n");
|
||||
interactive = FALSE;
|
||||
return_code = WCMD_batch(thisDir, command, NULL, INVALID_HANDLE_VALUE);
|
||||
interactive = oldinteractive;
|
||||
@@ -1605,48 +1609,109 @@ void WCMD_run_program (WCHAR *command, BOOL called)
|
||||
if (return_code != RETURN_CODE_ABORTED && return_code != RETURN_CODE_OLD_CHAINING)
|
||||
errorlevel = return_code;
|
||||
return;
|
||||
- } else {
|
||||
- DWORD exit_code;
|
||||
- /* thisDir contains the file to be launched, but with what?
|
||||
- eg. a.exe will require a.exe to be launched, a.html may be iexplore */
|
||||
- hinst = FindExecutableW (thisDir, NULL, temp);
|
||||
- if ((INT_PTR)hinst < 32)
|
||||
- console = 0;
|
||||
- else
|
||||
- console = SHGetFileInfoW(temp, 0, &psfi, sizeof(psfi), SHGFI_EXETYPE);
|
||||
-
|
||||
- ZeroMemory (&st, sizeof(STARTUPINFOW));
|
||||
- st.cb = sizeof(STARTUPINFOW);
|
||||
- init_msvcrt_io_block(&st);
|
||||
-
|
||||
- /* Launch the process and if a CUI wait on it to complete
|
||||
- Note: Launching internal wine processes cannot specify a full path to exe */
|
||||
- status = CreateProcessW(thisDir,
|
||||
- command, NULL, NULL, TRUE, 0, NULL, NULL, &st, &pe);
|
||||
- free(st.lpReserved2);
|
||||
- if ((opt_c || opt_k) && !opt_s && !status
|
||||
- && GetLastError()==ERROR_FILE_NOT_FOUND && command[0]=='\"') {
|
||||
- /* strip first and last quote WCHARacters and try again */
|
||||
- WCMD_strip_quotes(command);
|
||||
- opt_s = TRUE;
|
||||
- WCMD_run_program(command, called);
|
||||
+ }
|
||||
+
|
||||
+ /* Calculate what program will be launched, and whether it is a
|
||||
+ console application or not. Note the program may be different
|
||||
+ from the parameter (eg running a .txt file will launch notepad.exe) */
|
||||
+ hinst = FindExecutableW (thisDir, NULL, temp);
|
||||
+ if ((INT_PTR)hinst < 32)
|
||||
+ console = 0; /* Assume not console app by default */
|
||||
+ else
|
||||
+ console = SHGetFileInfoW(temp, 0, &psfi, sizeof(psfi), SHGFI_EXETYPE);
|
||||
+
|
||||
+
|
||||
+ /* If it is not a .com or .exe, try to launch through ShellExecuteExW
|
||||
+ which takes into account the association for the extension. */
|
||||
+ if (ext && (wcsicmp(ext, L".exe") && wcsicmp(ext, L".com"))) {
|
||||
+
|
||||
+ SHELLEXECUTEINFOW shexw;
|
||||
+ BOOL rc;
|
||||
+ WCHAR *rawarg;
|
||||
+
|
||||
+ WCMD_parameter(command, 1, &rawarg, FALSE, TRUE);
|
||||
+ WINE_TRACE("Launching via ShellExecuteEx\n");
|
||||
+ memset(&shexw, 0x00, sizeof(shexw));
|
||||
+ shexw.cbSize = sizeof(SHELLEXECUTEINFOW);
|
||||
+ shexw.fMask = SEE_MASK_NO_CONSOLE | /* Run in same console as currently using */
|
||||
+ SEE_MASK_NOCLOSEPROCESS; /* We need a process handle to possibly wait on */
|
||||
+ shexw.lpFile = thisDir;
|
||||
+ shexw.lpParameters = rawarg;
|
||||
+ shexw.nShow = SW_SHOWNORMAL;
|
||||
+
|
||||
+ /* Try to launch the binary or its associated program */
|
||||
+ rc = ShellExecuteExW(&shexw);
|
||||
+
|
||||
+ if (rc && (INT_PTR)shexw.hInstApp >= 32) {
|
||||
+
|
||||
+ WINE_TRACE("Successfully launched\n");
|
||||
+
|
||||
+ /* It worked... Always wait when non-interactive (cmd /c or in
|
||||
+ batch program), or for console applications */
|
||||
+ if (!interactive || (console && !HIWORD(console))) {
|
||||
+ WINE_TRACE("Waiting for process to end\n");
|
||||
+ WaitForSingleObject (shexw.hProcess, INFINITE);
|
||||
+ }
|
||||
+
|
||||
+ GetExitCodeProcess (shexw.hProcess, &errorlevel);
|
||||
+ if (errorlevel == STILL_ACTIVE) {
|
||||
+ WINE_TRACE("Process still running, but returning anyway\n");
|
||||
+ errorlevel = 0;
|
||||
+ } else {
|
||||
+ WINE_TRACE("Process ended, errorlevel %ld\n", errorlevel);
|
||||
+ }
|
||||
+
|
||||
+ CloseHandle(pe.hProcess);
|
||||
return;
|
||||
+
|
||||
}
|
||||
+ }
|
||||
|
||||
- if (!status)
|
||||
- break;
|
||||
+ /* If its a .exe or .com or the shellexecute failed due to no association,
|
||||
+ CreateProcess directly */
|
||||
+ ZeroMemory (&st, sizeof(STARTUPINFOW));
|
||||
+ st.cb = sizeof(STARTUPINFOW);
|
||||
+ init_msvcrt_io_block(&st);
|
||||
+
|
||||
+ /* Launch the process and if a CUI wait on it to complete
|
||||
+ Note: Launching internal wine processes cannot specify a full path to exe */
|
||||
+ WINE_TRACE("Launching via CreateProcess\n");
|
||||
+ status = CreateProcessW(thisDir,
|
||||
+ command, NULL, NULL, TRUE, 0, NULL, NULL, &st, &pe);
|
||||
+ free(st.lpReserved2);
|
||||
+ if ((opt_c || opt_k) && !opt_s && !status
|
||||
+ && GetLastError()==ERROR_FILE_NOT_FOUND && command[0]=='\"') {
|
||||
+ /* strip first and last quote WCHARacters and try again */
|
||||
+ WCMD_strip_quotes(command);
|
||||
+ opt_s = TRUE;
|
||||
+ WCMD_run_program(command, called);
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
- /* Always wait when non-interactive (cmd /c or in batch program),
|
||||
- or for console applications */
|
||||
- if (!interactive || (console && !HIWORD(console)))
|
||||
- WaitForSingleObject (pe.hProcess, INFINITE);
|
||||
- GetExitCodeProcess (pe.hProcess, &exit_code);
|
||||
- errorlevel = (exit_code == STILL_ACTIVE) ? NO_ERROR : exit_code;
|
||||
+ if (!status) {
|
||||
+ WINE_TRACE("Failed to launch via CreateProcess, rc %d (%ld)\n",
|
||||
+ status, GetLastError());
|
||||
+ break;
|
||||
+ }
|
||||
|
||||
- CloseHandle(pe.hProcess);
|
||||
- CloseHandle(pe.hThread);
|
||||
- return;
|
||||
+ /* Always wait when non-interactive (cmd /c or in batch program),
|
||||
+ or for console applications */
|
||||
+ if (!interactive || (console && !HIWORD(console))) {
|
||||
+ WINE_TRACE("Waiting for process to end\n");
|
||||
+ WaitForSingleObject (pe.hProcess, INFINITE);
|
||||
}
|
||||
+
|
||||
+ GetExitCodeProcess (pe.hProcess, &errorlevel);
|
||||
+ if (errorlevel == STILL_ACTIVE) {
|
||||
+ WINE_TRACE("Process still running, but returning anyway\n");
|
||||
+ errorlevel = 0;
|
||||
+ } else {
|
||||
+ WINE_TRACE("Process ended, errorlevel %ld\n", errorlevel);
|
||||
+ }
|
||||
+
|
||||
+ CloseHandle(pe.hProcess);
|
||||
+ CloseHandle(pe.hThread);
|
||||
+ return;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.45.2
|
||||
|
@@ -1,79 +0,0 @@
|
||||
From 2f9fa2d492521d297eb87e4b6709d8349818b9c6 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Edmeades <us@edmeades.me.uk>
|
||||
Date: Tue, 16 Jul 2019 13:51:58 +1000
|
||||
Subject: [PATCH] cmd: ftype failed to clear file associations
|
||||
|
||||
If a file association was set (e.g. ftype fred=xxx), ftype fred= needs to clear it,
|
||||
but previously it failed to do so.
|
||||
---
|
||||
programs/cmd/builtins.c | 6 +++---
|
||||
programs/cmd/tests/test_builtins.cmd | 9 +++++++++
|
||||
programs/cmd/tests/test_builtins.cmd.exp | 5 ++++-
|
||||
3 files changed, 16 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
|
||||
index 1c39c35ca78..f23f9ef2046 100644
|
||||
--- a/programs/cmd/builtins.c
|
||||
+++ b/programs/cmd/builtins.c
|
||||
@@ -4101,11 +4101,11 @@ void WCMD_assoc (const WCHAR *args, BOOL assoc) {
|
||||
/* If nothing after '=' then clear value - only valid for ASSOC */
|
||||
if (*newValue == 0x00) {
|
||||
|
||||
- if (assoc) rc = RegDeleteKeyW(key, args);
|
||||
- if (assoc && rc == ERROR_SUCCESS) {
|
||||
+ rc = RegDeleteTreeW(key, args);
|
||||
+ if (rc == ERROR_SUCCESS) {
|
||||
WINE_TRACE("HKCR Key '%s' deleted\n", wine_dbgstr_w(args));
|
||||
|
||||
- } else if (assoc && rc != ERROR_FILE_NOT_FOUND) {
|
||||
+ } else if (rc != ERROR_FILE_NOT_FOUND) {
|
||||
WCMD_print_error();
|
||||
errorlevel = ERROR_FILE_NOT_FOUND;
|
||||
|
||||
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
|
||||
index d5397560bc6..14666c85cac 100644
|
||||
--- a/programs/cmd/tests/test_builtins.cmd
|
||||
+++ b/programs/cmd/tests/test_builtins.cmd
|
||||
@@ -2670,6 +2670,12 @@ echo echo +++>> tmp.cmd
|
||||
echo ftype footype>> tmp.cmd
|
||||
cmd /c tmp.cmd
|
||||
|
||||
+echo --- testing association
|
||||
+ftype footype=cmd.exe /c "echo '%%1'"
|
||||
+echo dummy>test.foo
|
||||
+test.foo
|
||||
+del test.foo
|
||||
+
|
||||
echo --- resetting association
|
||||
assoc .foo=
|
||||
|
||||
@@ -2701,6 +2707,9 @@ echo .foo=footype
|
||||
echo footype=foo_opencmd
|
||||
echo +++
|
||||
echo footype=foo_opencmd
|
||||
+echo --- testing association
|
||||
+echo footype=cmd.exe /c "echo '%%1'"
|
||||
+echo Skipped as not enough permissions
|
||||
echo --- resetting association
|
||||
echo original value
|
||||
|
||||
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
|
||||
index 0102c3bcbc5..a6d97bc8248 100644
|
||||
--- a/programs/cmd/tests/test_builtins.cmd.exp
|
||||
+++ b/programs/cmd/tests/test_builtins.cmd.exp
|
||||
@@ -1549,8 +1549,11 @@ footype=foo_opencmd
|
||||
footype=foo_opencmd
|
||||
+++
|
||||
footype=foo_opencmd
|
||||
+--- testing association
|
||||
+footype=cmd.exe /c "echo '%1'"
|
||||
+'@drive@@path@foobar\test.foo'@or_broken@Skipped as not enough permissions
|
||||
--- resetting association
|
||||
-@todo_wine@original value@or_broken@buggyXP@or_broken@!WINE_FOO!
|
||||
+original value@or_broken@buggyXP@or_broken@!WINE_FOO!
|
||||
------------ Testing CALL ------------
|
||||
--- external script
|
||||
foo@space@
|
||||
--
|
||||
2.43.0
|
||||
|
@@ -1,55 +0,0 @@
|
||||
From 5d1a7ff33160080ad2aca22f689c5b4b446837d8 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 18 Jun 2024 09:14:56 +1000
|
||||
Subject: [PATCH] cmd: Changed errorlevel type to DWORD
|
||||
|
||||
This stop the invalid type being passed to GetExitCodeProcess which is being reported
|
||||
as an error with clang/mingw in the latest version.
|
||||
---
|
||||
programs/cmd/builtins.c | 2 +-
|
||||
programs/cmd/wcmd.h | 2 +-
|
||||
programs/cmd/wcmdmain.c | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
|
||||
index 1e92e88d191..9b8cfd389b9 100644
|
||||
--- a/programs/cmd/builtins.c
|
||||
+++ b/programs/cmd/builtins.c
|
||||
@@ -442,7 +442,7 @@ RETURN_CODE WCMD_choice (const WCHAR * args)
|
||||
SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), oldmode);
|
||||
|
||||
errorlevel = (ptr - opt_c) + 1;
|
||||
- TRACE("answer: %d\n", errorlevel);
|
||||
+ TRACE("answer: %ld\n", errorlevel);
|
||||
free(my_command);
|
||||
return errorlevel;
|
||||
}
|
||||
diff --git a/programs/cmd/wcmd.h b/programs/cmd/wcmd.h
|
||||
index 6c76070338c..d750aca5572 100644
|
||||
--- a/programs/cmd/wcmd.h
|
||||
+++ b/programs/cmd/wcmd.h
|
||||
@@ -336,7 +336,7 @@ void WCMD_set_for_loop_variable(int var_idx, const WCHAR *value);
|
||||
* variables and batch parameters substitution already done.
|
||||
*/
|
||||
extern WCHAR quals[MAXSTRING], param1[MAXSTRING], param2[MAXSTRING];
|
||||
-extern int errorlevel;
|
||||
+extern DWORD errorlevel;
|
||||
extern BATCH_CONTEXT *context;
|
||||
extern FOR_CONTEXT *forloopcontext;
|
||||
extern BOOL delayedsubst;
|
||||
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
|
||||
index 2df0d7c53d3..095be784f2c 100644
|
||||
--- a/programs/cmd/wcmdmain.c
|
||||
+++ b/programs/cmd/wcmdmain.c
|
||||
@@ -36,7 +36,7 @@ extern const WCHAR inbuilt[][10];
|
||||
extern struct env_stack *pushd_directories;
|
||||
|
||||
BATCH_CONTEXT *context = NULL;
|
||||
-int errorlevel;
|
||||
+DWORD errorlevel;
|
||||
WCHAR quals[MAXSTRING], param1[MAXSTRING], param2[MAXSTRING];
|
||||
BOOL interactive;
|
||||
FOR_CONTEXT *forloopcontext; /* The 'for' loop context */
|
||||
--
|
||||
2.43.0
|
||||
|
@@ -1,2 +0,0 @@
|
||||
Fixes: [18154] cmd: Support for launching programs based on file association
|
||||
Disabled: True
|
@@ -1 +1,2 @@
|
||||
Fixes: [26898] Support for DDS file format in D3DXSaveTextureToFileInMemory
|
||||
Disabled: True
|
||||
|
@@ -0,0 +1,175 @@
|
||||
From 77a518b61884ef4e06f4fe8b94dd5c855c5e8daf Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Fri, 23 Aug 2024 08:49:13 +0200
|
||||
Subject: [PATCH] dinput: Factor keyboard initialization and enumeration loops.
|
||||
|
||||
---
|
||||
dlls/dinput/keyboard.c | 129 +++++++++++++++++++++++------------------
|
||||
1 file changed, 72 insertions(+), 57 deletions(-)
|
||||
|
||||
diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c
|
||||
index 8ec9dd47150..d1fa242574e 100644
|
||||
--- a/dlls/dinput/keyboard.c
|
||||
+++ b/dlls/dinput/keyboard.c
|
||||
@@ -185,12 +185,79 @@ HRESULT keyboard_enum_device( DWORD type, DWORD flags, DIDEVICEINSTANCEW *instan
|
||||
return DI_OK;
|
||||
}
|
||||
|
||||
+static BOOL enum_object( struct keyboard *impl, const DIPROPHEADER *filter, DWORD flags, enum_object_callback callback,
|
||||
+ UINT index, DIDEVICEOBJECTINSTANCEW *instance, void *data )
|
||||
+{
|
||||
+ if (flags != DIDFT_ALL && !(flags & DIDFT_GETTYPE( instance->dwType ))) return DIENUM_CONTINUE;
|
||||
+
|
||||
+ switch (filter->dwHow)
|
||||
+ {
|
||||
+ case DIPH_DEVICE:
|
||||
+ return callback( &impl->base, index, NULL, instance, data );
|
||||
+ case DIPH_BYOFFSET:
|
||||
+ if (filter->dwObj != instance->dwOfs) return DIENUM_CONTINUE;
|
||||
+ return callback( &impl->base, index, NULL, instance, data );
|
||||
+ case DIPH_BYID:
|
||||
+ if ((filter->dwObj & 0x00ffffff) != (instance->dwType & 0x00ffffff)) return DIENUM_CONTINUE;
|
||||
+ return callback( &impl->base, index, NULL, instance, data );
|
||||
+ }
|
||||
+
|
||||
+ return DIENUM_CONTINUE;
|
||||
+}
|
||||
+
|
||||
+static HRESULT enum_objects( struct keyboard *impl, const DIPROPHEADER *filter,
|
||||
+ DWORD flags, enum_object_callback callback, void *data )
|
||||
+{
|
||||
+ BYTE subtype = GET_DIDEVICE_SUBTYPE( impl->base.instance.dwDevType );
|
||||
+ DIDEVICEOBJECTINSTANCEW instance =
|
||||
+ {
|
||||
+ .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
|
||||
+ .guidType = GUID_Key,
|
||||
+ .dwOfs = DIK_ESCAPE,
|
||||
+ .dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( DIK_ESCAPE ),
|
||||
+ };
|
||||
+ DWORD index, i, dik;
|
||||
+ BOOL ret;
|
||||
+
|
||||
+ for (i = 0, index = 0; i < 512; ++i)
|
||||
+ {
|
||||
+ if (!GetKeyNameTextW( i << 16, instance.tszName, ARRAY_SIZE(instance.tszName) )) continue;
|
||||
+ if (!(dik = map_dik_code( i, 0, subtype, impl->base.dinput->dwVersion ))) continue;
|
||||
+ instance.dwOfs = dik;
|
||||
+ instance.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( dik );
|
||||
+ ret = enum_object( impl, filter, flags, callback, index++, &instance, data );
|
||||
+ if (ret != DIENUM_CONTINUE) return DIENUM_STOP;
|
||||
+ }
|
||||
+
|
||||
+ return DIENUM_CONTINUE;
|
||||
+}
|
||||
+
|
||||
+static BOOL init_object_properties( struct dinput_device *device, UINT index, struct hid_value_caps *caps,
|
||||
+ const DIDEVICEOBJECTINSTANCEW *instance, void *data )
|
||||
+{
|
||||
+ struct object_properties *properties;
|
||||
+ UINT dik = instance->dwOfs;
|
||||
+
|
||||
+ if (index == -1) return DIENUM_STOP;
|
||||
+ properties = device->object_properties + index;
|
||||
+
|
||||
+ if (dik == DIK_NUMLOCK) properties->scan_code = 0x451de1;
|
||||
+ else if (dik == DIK_PAUSE) properties->scan_code = 0x45;
|
||||
+ else if (dik < 0x80) properties->scan_code = dik;
|
||||
+ else properties->scan_code = (dik - 0x80) << 8 | 0x00e0;
|
||||
+
|
||||
+ return DIENUM_CONTINUE;
|
||||
+}
|
||||
+
|
||||
HRESULT keyboard_create_device( struct dinput *dinput, const GUID *guid, IDirectInputDevice8W **out )
|
||||
{
|
||||
- DIDEVICEOBJECTINSTANCEW instance;
|
||||
+ static const DIPROPHEADER filter =
|
||||
+ {
|
||||
+ .dwSize = sizeof(filter),
|
||||
+ .dwHeaderSize = sizeof(filter),
|
||||
+ .dwHow = DIPH_DEVICE,
|
||||
+ };
|
||||
struct keyboard *impl;
|
||||
- DWORD i, index, dik;
|
||||
- BYTE subtype;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE( "dinput %p, guid %s, out %p.\n", dinput, debugstr_guid( guid ), out );
|
||||
@@ -207,20 +274,9 @@ HRESULT keyboard_create_device( struct dinput *dinput, const GUID *guid, IDirect
|
||||
impl->base.caps.dwFirmwareRevision = 100;
|
||||
impl->base.caps.dwHardwareRevision = 100;
|
||||
if (dinput->dwVersion >= 0x0800) impl->base.use_raw_input = TRUE;
|
||||
- subtype = GET_DIDEVICE_SUBTYPE( impl->base.instance.dwDevType );
|
||||
|
||||
if (FAILED(hr = dinput_device_init_device_format( &impl->base.IDirectInputDevice8W_iface ))) goto failed;
|
||||
-
|
||||
- for (i = 0, index = 0; i < 512; ++i)
|
||||
- {
|
||||
- if (!GetKeyNameTextW( i << 16, instance.tszName, ARRAY_SIZE(instance.tszName) )) continue;
|
||||
- if (!(dik = map_dik_code( i, 0, subtype, impl->base.dinput->dwVersion ))) continue;
|
||||
-
|
||||
- if (dik == DIK_NUMLOCK) impl->base.object_properties[index++].scan_code = 0x451de1;
|
||||
- else if (dik == DIK_PAUSE) impl->base.object_properties[index++].scan_code = 0x45;
|
||||
- else if (dik < 0x80) impl->base.object_properties[index++].scan_code = dik;
|
||||
- else impl->base.object_properties[index++].scan_code = (dik - 0x80) << 8 | 0x00e0;
|
||||
- }
|
||||
+ enum_objects( impl, &filter, DIDFT_BUTTON, init_object_properties, NULL );
|
||||
|
||||
*out = &impl->base.IDirectInputDevice8W_iface;
|
||||
return DI_OK;
|
||||
@@ -248,52 +304,11 @@ static HRESULT keyboard_unacquire( IDirectInputDevice8W *iface )
|
||||
return DI_OK;
|
||||
}
|
||||
|
||||
-static BOOL try_enum_object( struct dinput_device *impl, const DIPROPHEADER *filter, DWORD flags, enum_object_callback callback,
|
||||
- UINT index, DIDEVICEOBJECTINSTANCEW *instance, void *data )
|
||||
-{
|
||||
- if (flags != DIDFT_ALL && !(flags & DIDFT_GETTYPE( instance->dwType ))) return DIENUM_CONTINUE;
|
||||
-
|
||||
- switch (filter->dwHow)
|
||||
- {
|
||||
- case DIPH_DEVICE:
|
||||
- return callback( impl, index, NULL, instance, data );
|
||||
- case DIPH_BYOFFSET:
|
||||
- if (filter->dwObj != instance->dwOfs) return DIENUM_CONTINUE;
|
||||
- return callback( impl, index, NULL, instance, data );
|
||||
- case DIPH_BYID:
|
||||
- if ((filter->dwObj & 0x00ffffff) != (instance->dwType & 0x00ffffff)) return DIENUM_CONTINUE;
|
||||
- return callback( impl, index, NULL, instance, data );
|
||||
- }
|
||||
-
|
||||
- return DIENUM_CONTINUE;
|
||||
-}
|
||||
-
|
||||
static HRESULT keyboard_enum_objects( IDirectInputDevice8W *iface, const DIPROPHEADER *filter,
|
||||
DWORD flags, enum_object_callback callback, void *context )
|
||||
{
|
||||
struct keyboard *impl = impl_from_IDirectInputDevice8W( iface );
|
||||
- BYTE subtype = GET_DIDEVICE_SUBTYPE( impl->base.instance.dwDevType );
|
||||
- DIDEVICEOBJECTINSTANCEW instance =
|
||||
- {
|
||||
- .dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
|
||||
- .guidType = GUID_Key,
|
||||
- .dwOfs = DIK_ESCAPE,
|
||||
- .dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( DIK_ESCAPE ),
|
||||
- };
|
||||
- DWORD index, i, dik;
|
||||
- BOOL ret;
|
||||
-
|
||||
- for (i = 0, index = 0; i < 512; ++i)
|
||||
- {
|
||||
- if (!GetKeyNameTextW( i << 16, instance.tszName, ARRAY_SIZE(instance.tszName) )) continue;
|
||||
- if (!(dik = map_dik_code( i, 0, subtype, impl->base.dinput->dwVersion ))) continue;
|
||||
- instance.dwOfs = dik;
|
||||
- instance.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( dik );
|
||||
- ret = try_enum_object( &impl->base, filter, flags, callback, index++, &instance, context );
|
||||
- if (ret != DIENUM_CONTINUE) return DIENUM_STOP;
|
||||
- }
|
||||
-
|
||||
- return DIENUM_CONTINUE;
|
||||
+ return enum_objects( impl, filter, flags, callback, context );
|
||||
}
|
||||
|
||||
static HRESULT keyboard_get_property( IDirectInputDevice8W *iface, DWORD property,
|
||||
--
|
||||
2.43.0
|
||||
|
@@ -1,6 +1,6 @@
|
||||
From b2764b3d21a64c3c194b29b9cb71379456e03b06 Mon Sep 17 00:00:00 2001
|
||||
From b9f850d5ba2d36ae39a2e88b31a687e2d9745c6e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Fri, 7 Jul 2023 12:44:26 +0200
|
||||
Date: Fri, 23 Aug 2024 08:51:44 +0200
|
||||
Subject: [PATCH] dinput: Avoid duplicated objects in keyboard devices.
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55205
|
||||
@@ -9,10 +9,10 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55205
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c
|
||||
index cbcbf94f0f6..3fd75bb10e6 100644
|
||||
index d1fa242574e..d9c73cd7367 100644
|
||||
--- a/dlls/dinput/keyboard.c
|
||||
+++ b/dlls/dinput/keyboard.c
|
||||
@@ -265,13 +265,15 @@ static HRESULT keyboard_enum_objects( IDirectInputDevice8W *iface, const DIPROPH
|
||||
@@ -216,13 +216,15 @@ static HRESULT enum_objects( struct keyboard *impl, const DIPROPHEADER *filter,
|
||||
.dwOfs = DIK_ESCAPE,
|
||||
.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( DIK_ESCAPE ),
|
||||
};
|
||||
@@ -28,7 +28,7 @@ index cbcbf94f0f6..3fd75bb10e6 100644
|
||||
+ mapped[dik] = TRUE;
|
||||
instance.dwOfs = dik;
|
||||
instance.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( dik );
|
||||
ret = try_enum_object( &impl->base, filter, flags, callback, index++, &instance, context );
|
||||
ret = enum_object( impl, filter, flags, callback, index++, &instance, data );
|
||||
--
|
||||
2.40.1
|
||||
2.43.0
|
||||
|
@@ -1,6 +1,6 @@
|
||||
From bdf952bf0711a7cf22fee840197234bd413ae611 Mon Sep 17 00:00:00 2001
|
||||
From c133a17f33a7cce87df6a56c7e265b1553726134 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Fri, 7 Jul 2023 12:45:04 +0200
|
||||
Date: Fri, 23 Aug 2024 08:52:34 +0200
|
||||
Subject: [PATCH] dinput: Enumerate lower keyboard scancodes values first.
|
||||
|
||||
Windows usually doesn't have scancodes higher than 0x7f, or extended
|
||||
@@ -16,18 +16,18 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55205
|
||||
1 file changed, 14 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c
|
||||
index 3fd75bb10e6..1f1db883b80 100644
|
||||
index d9c73cd7367..407634967de 100644
|
||||
--- a/dlls/dinput/keyboard.c
|
||||
+++ b/dlls/dinput/keyboard.c
|
||||
@@ -256,6 +256,7 @@ static BOOL try_enum_object( struct dinput_device *impl, const DIPROPHEADER *fil
|
||||
static HRESULT keyboard_enum_objects( IDirectInputDevice8W *iface, const DIPROPHEADER *filter,
|
||||
DWORD flags, enum_object_callback callback, void *context )
|
||||
@@ -208,6 +208,7 @@ static BOOL enum_object( struct keyboard *impl, const DIPROPHEADER *filter, DWOR
|
||||
static HRESULT enum_objects( struct keyboard *impl, const DIPROPHEADER *filter,
|
||||
DWORD flags, enum_object_callback callback, void *data )
|
||||
{
|
||||
+ static const UINT vsc_base[] = {0, 0x100, 0x80, 0x180};
|
||||
struct keyboard *impl = impl_from_IDirectInputDevice8W( iface );
|
||||
BYTE subtype = GET_DIDEVICE_SUBTYPE( impl->base.instance.dwDevType );
|
||||
DIDEVICEOBJECTINSTANCEW instance =
|
||||
@@ -266,18 +267,21 @@ static HRESULT keyboard_enum_objects( IDirectInputDevice8W *iface, const DIPROPH
|
||||
{
|
||||
@@ -217,18 +218,21 @@ static HRESULT enum_objects( struct keyboard *impl, const DIPROPHEADER *filter,
|
||||
.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( DIK_ESCAPE ),
|
||||
};
|
||||
BOOL ret, mapped[0x100] = {0};
|
||||
@@ -43,7 +43,7 @@ index 3fd75bb10e6..1f1db883b80 100644
|
||||
- mapped[dik] = TRUE;
|
||||
- instance.dwOfs = dik;
|
||||
- instance.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( dik );
|
||||
- ret = try_enum_object( &impl->base, filter, flags, callback, index++, &instance, context );
|
||||
- ret = enum_object( impl, filter, flags, callback, index++, &instance, data );
|
||||
- if (ret != DIENUM_CONTINUE) return DIENUM_STOP;
|
||||
+ for (vsc = vsc_base[i]; vsc < vsc_base[i] + 0x80; vsc++)
|
||||
+ {
|
||||
@@ -53,12 +53,12 @@ index 3fd75bb10e6..1f1db883b80 100644
|
||||
+ mapped[dik] = TRUE;
|
||||
+ instance.dwOfs = dik;
|
||||
+ instance.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( dik );
|
||||
+ ret = try_enum_object( &impl->base, filter, flags, callback, index++, &instance, context );
|
||||
+ ret = enum_object( impl, filter, flags, callback, index++, &instance, data );
|
||||
+ if (ret != DIENUM_CONTINUE) return DIENUM_STOP;
|
||||
+ }
|
||||
}
|
||||
|
||||
return DIENUM_CONTINUE;
|
||||
--
|
||||
2.40.1
|
||||
2.43.0
|
||||
|
@@ -0,0 +1,125 @@
|
||||
From e31146d5dd91ef05298ae98f7db4868e73011865 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Thu, 23 May 2024 14:25:57 +1000
|
||||
Subject: [PATCH] dxgi: Semi-stub IDXGISwapChain::GetFrameStatistics.
|
||||
|
||||
Not completely correct but does allow improved framerates. Mileage will vary.
|
||||
---
|
||||
dlls/dxgi/swapchain.c | 89 +++++++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 85 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c
|
||||
index 4797fcecd8d..4111a488407 100644
|
||||
--- a/dlls/dxgi/swapchain.c
|
||||
+++ b/dlls/dxgi/swapchain.c
|
||||
@@ -587,12 +587,66 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetContainingOutput(IDXGISwapCh
|
||||
return dxgi_get_output_from_window(swapchain->factory, window, output);
|
||||
}
|
||||
|
||||
+static int get_display_frequency(void)
|
||||
+{
|
||||
+ DEVMODEW mode;
|
||||
+ BOOL ret;
|
||||
+
|
||||
+ memset(&mode, 0, sizeof(mode));
|
||||
+ mode.dmSize = sizeof(mode);
|
||||
+ ret = EnumDisplaySettingsExW(NULL, ENUM_CURRENT_SETTINGS, &mode, 0);
|
||||
+ if (ret && mode.dmFields & DM_DISPLAYFREQUENCY && mode.dmDisplayFrequency)
|
||||
+ {
|
||||
+ return mode.dmDisplayFrequency;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ WARN("Failed to query display frequency, returning a fallback value.\n");
|
||||
+ return 60;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static LARGE_INTEGER get_perf_req(void)
|
||||
+{
|
||||
+ LARGE_INTEGER performance_frequency;
|
||||
+
|
||||
+ QueryPerformanceFrequency(&performance_frequency);
|
||||
+ return performance_frequency;
|
||||
+}
|
||||
+
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFrameStatistics(IDXGISwapChain4 *iface,
|
||||
DXGI_FRAME_STATISTICS *stats)
|
||||
{
|
||||
- FIXME("iface %p, stats %p stub!\n", iface, stats);
|
||||
+ struct d3d11_swapchain *swapchain = d3d11_swapchain_from_IDXGISwapChain4(iface);
|
||||
+ HRESULT hr = S_OK;
|
||||
+ static BOOL once = 0;
|
||||
+ const LARGE_INTEGER performance_frequency = get_perf_req();
|
||||
+ int display_frequency = get_display_frequency();
|
||||
|
||||
- return E_NOTIMPL;
|
||||
+ LARGE_INTEGER count;
|
||||
+ TRACE("iface %p, stats %p Semi-stub\n", iface, stats);
|
||||
+
|
||||
+ if (!stats)
|
||||
+ return E_INVALIDARG;
|
||||
+
|
||||
+ QueryPerformanceCounter(&count);
|
||||
+
|
||||
+ stats->PresentCount = swapchain->present_count;
|
||||
+ stats->PresentRefreshCount = 0;
|
||||
+ stats->SyncRefreshCount = 0;
|
||||
+ stats->SyncQPCTime.QuadPart = count.QuadPart;
|
||||
+ stats->SyncGPUTime.QuadPart = 0;
|
||||
+
|
||||
+ stats->PresentRefreshCount = performance_frequency.QuadPart / display_frequency;
|
||||
+ stats->SyncRefreshCount = display_frequency;
|
||||
+
|
||||
+ if(!once)
|
||||
+ {
|
||||
+ once++;
|
||||
+ hr = DXGI_ERROR_FRAME_STATISTICS_DISJOINT;
|
||||
+ }
|
||||
+
|
||||
+ return hr;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetLastPresentCount(IDXGISwapChain4 *iface,
|
||||
@@ -2704,9 +2758,36 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetContainingOutput(IDXGISwapCh
|
||||
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetFrameStatistics(IDXGISwapChain4 *iface,
|
||||
DXGI_FRAME_STATISTICS *stats)
|
||||
{
|
||||
- FIXME("iface %p, stats %p stub!\n", iface, stats);
|
||||
+ struct d3d12_swapchain *swapchain = d3d12_swapchain_from_IDXGISwapChain4(iface);
|
||||
+ HRESULT hr = S_OK;
|
||||
+ static BOOL once = 0;
|
||||
+ const LARGE_INTEGER performance_frequency = get_perf_req();
|
||||
+ int display_frequency = get_display_frequency();
|
||||
|
||||
- return E_NOTIMPL;
|
||||
+ LARGE_INTEGER count;
|
||||
+ TRACE("iface %p, stats %p Semi-stub\n", iface, stats);
|
||||
+
|
||||
+ if (!stats)
|
||||
+ return E_INVALIDARG;
|
||||
+
|
||||
+ QueryPerformanceCounter(&count);
|
||||
+
|
||||
+ stats->PresentCount = swapchain->frame_number;
|
||||
+ stats->PresentRefreshCount = 0;
|
||||
+ stats->SyncRefreshCount = 0;
|
||||
+ stats->SyncQPCTime.QuadPart = count.QuadPart;
|
||||
+ stats->SyncGPUTime.QuadPart = 0;
|
||||
+
|
||||
+ stats->PresentRefreshCount = performance_frequency.QuadPart / display_frequency;
|
||||
+ stats->SyncRefreshCount = display_frequency;
|
||||
+
|
||||
+ if(!once)
|
||||
+ {
|
||||
+ once++;
|
||||
+ hr = DXGI_ERROR_FRAME_STATISTICS_DISJOINT;
|
||||
+ }
|
||||
+
|
||||
+ return hr;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetLastPresentCount(IDXGISwapChain4 *iface,
|
||||
--
|
||||
2.43.0
|
||||
|
1
patches/dxgi_getFrameStatistics/definition
Normal file
1
patches/dxgi_getFrameStatistics/definition
Normal file
@@ -0,0 +1 @@
|
||||
Fixes: [53696] d3d11: Semi-stub IDXGISwapChain::GetFrameStatistics.
|
@@ -1,4 +1,4 @@
|
||||
From d3262875b2ce7d2a6746f2139ca00e3d0f13fb33 Mon Sep 17 00:00:00 2001
|
||||
From 3b9e832890ad710eecf08f7901d708cfebb3520c Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Wed, 13 Jun 2018 10:44:49 -0500
|
||||
Subject: [PATCH] configure: Check for sys/eventfd.h, ppoll(), and shm_open().
|
||||
@@ -12,10 +12,10 @@ Although perhaps we shouldn't since the server doesn't do this.
|
||||
2 files changed, 17 insertions(+)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 3be31e40cf6..0a2cdc0dfcd 100644
|
||||
index 4314be5553c..920d8343925 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -453,6 +453,7 @@ AC_CHECK_HEADERS(\
|
||||
@@ -407,6 +407,7 @@ AC_CHECK_HEADERS(\
|
||||
sys/cdio.h \
|
||||
sys/epoll.h \
|
||||
sys/event.h \
|
||||
@@ -23,15 +23,15 @@ index 3be31e40cf6..0a2cdc0dfcd 100644
|
||||
sys/extattr.h \
|
||||
sys/filio.h \
|
||||
sys/ipc.h \
|
||||
@@ -2024,6 +2025,7 @@ AC_CHECK_FUNCS(\
|
||||
@@ -2076,6 +2077,7 @@ AC_CHECK_FUNCS(\
|
||||
port_create \
|
||||
posix_fadvise \
|
||||
posix_fallocate \
|
||||
+ ppoll \
|
||||
prctl \
|
||||
proc_pidinfo \
|
||||
sched_yield \
|
||||
@@ -2049,6 +2051,12 @@ case $host_os in
|
||||
renameat \
|
||||
@@ -2100,6 +2102,12 @@ case $host_os in
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -45,10 +45,10 @@ index 3be31e40cf6..0a2cdc0dfcd 100644
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM(
|
||||
[[#include <sched.h>]], [[sched_setaffinity(0, 0, 0);]])],[wine_cv_have_sched_setaffinity=yes],[wine_cv_have_sched_setaffinity=no]))
|
||||
diff --git a/include/config.h.in b/include/config.h.in
|
||||
index fe2fc36a914..8e8c57d711c 100644
|
||||
index 096ecdf94ec..303fb7f2b69 100644
|
||||
--- a/include/config.h.in
|
||||
+++ b/include/config.h.in
|
||||
@@ -309,6 +309,9 @@
|
||||
@@ -312,6 +312,9 @@
|
||||
/* Define to 1 if you have the `posix_fallocate' function. */
|
||||
#undef HAVE_POSIX_FALLOCATE
|
||||
|
||||
@@ -58,7 +58,7 @@ index fe2fc36a914..8e8c57d711c 100644
|
||||
/* Define to 1 if you have the `prctl' function. */
|
||||
#undef HAVE_PRCTL
|
||||
|
||||
@@ -375,6 +378,9 @@
|
||||
@@ -369,6 +372,9 @@
|
||||
/* Define to 1 if `interface_id' is a member of `sg_io_hdr_t'. */
|
||||
#undef HAVE_SG_IO_HDR_T_INTERFACE_ID
|
||||
|
||||
@@ -68,7 +68,7 @@ index fe2fc36a914..8e8c57d711c 100644
|
||||
/* Define to 1 if `si_fd' is a member of `siginfo_t'. */
|
||||
#undef HAVE_SIGINFO_T_SI_FD
|
||||
|
||||
@@ -510,6 +516,9 @@
|
||||
@@ -498,6 +504,9 @@
|
||||
/* Define to 1 if you have the <sys/epoll.h> header file. */
|
||||
#undef HAVE_SYS_EPOLL_H
|
||||
|
||||
@@ -79,5 +79,5 @@ index fe2fc36a914..8e8c57d711c 100644
|
||||
#undef HAVE_SYS_EVENT_H
|
||||
|
||||
--
|
||||
2.39.0
|
||||
2.45.2
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From f0ff0cdc5472deafb8c75f3d0d6456ddb4164878 Mon Sep 17 00:00:00 2001
|
||||
From 4865ed639a87ee06ffcf6a7a74b6c97ef448e7ab Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <zfigura@codeweavers.com>
|
||||
Date: Mon, 6 Jul 2020 12:34:42 -0500
|
||||
Subject: [PATCH] ntdll: Implement NtWaitForMultipleObjects().
|
||||
@@ -10,20 +10,20 @@ Subject: [PATCH] ntdll: Implement NtWaitForMultipleObjects().
|
||||
3 files changed, 182 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c
|
||||
index e031e9cb94f..f383221194c 100644
|
||||
index e031e9cb94f..85db837f16b 100644
|
||||
--- a/dlls/ntdll/unix/esync.c
|
||||
+++ b/dlls/ntdll/unix/esync.c
|
||||
@@ -22,6 +22,10 @@
|
||||
#pragma makedep unix
|
||||
#endif
|
||||
@@ -24,6 +24,10 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
+#ifndef _GNU_SOURCE
|
||||
+#define _GNU_SOURCE
|
||||
+#endif
|
||||
+
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
@@ -34,6 +38,12 @@
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
# include <sys/stat.h>
|
||||
@@ -221,10 +221,10 @@ index c63491dcaad..92b609ebd27 100644
|
||||
/* We have to synchronize on the fd cache mutex so that our calls to receive_fd
|
||||
* don't race with theirs. It looks weird, I know.
|
||||
diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c
|
||||
index 76da038649f..1c60cd11f77 100644
|
||||
index dd938c95873..4361813e628 100644
|
||||
--- a/dlls/ntdll/unix/sync.c
|
||||
+++ b/dlls/ntdll/unix/sync.c
|
||||
@@ -1524,6 +1524,13 @@ NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles, BO
|
||||
@@ -1588,6 +1588,13 @@ NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles, BO
|
||||
|
||||
if (!count || count > MAXIMUM_WAIT_OBJECTS) return STATUS_INVALID_PARAMETER_1;
|
||||
|
||||
|
@@ -0,0 +1,126 @@
|
||||
From fed04f8ef69b829fa2cf3c7051160a6f822912dd Mon Sep 17 00:00:00 2001
|
||||
From: Elizabeth Figura <zfigura@codeweavers.com>
|
||||
Date: Mon, 12 Aug 2024 16:54:44 -0500
|
||||
Subject: [PATCH] ntdll: Compile warning fixes for esync.
|
||||
|
||||
---
|
||||
dlls/ntdll/unix/esync.c | 26 +++++++++++++-------------
|
||||
dlls/ntdll/unix/esync.h | 4 ++--
|
||||
2 files changed, 15 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c
|
||||
index f4748e405ef..86809b610c7 100644
|
||||
--- a/dlls/ntdll/unix/esync.c
|
||||
+++ b/dlls/ntdll/unix/esync.c
|
||||
@@ -73,29 +73,29 @@ int do_esync(void)
|
||||
|
||||
struct esync
|
||||
{
|
||||
- enum esync_type type;
|
||||
+ LONG type;
|
||||
int fd;
|
||||
void *shm;
|
||||
};
|
||||
|
||||
struct semaphore
|
||||
{
|
||||
- int max;
|
||||
- int count;
|
||||
+ LONG max;
|
||||
+ LONG count;
|
||||
};
|
||||
C_ASSERT(sizeof(struct semaphore) == 8);
|
||||
|
||||
struct mutex
|
||||
{
|
||||
- DWORD tid;
|
||||
- int count; /* recursion count */
|
||||
+ LONG tid;
|
||||
+ LONG count; /* recursion count */
|
||||
};
|
||||
C_ASSERT(sizeof(struct mutex) == 8);
|
||||
|
||||
struct event
|
||||
{
|
||||
- int signaled;
|
||||
- int locked;
|
||||
+ LONG signaled;
|
||||
+ LONG locked;
|
||||
};
|
||||
C_ASSERT(sizeof(struct event) == 8);
|
||||
|
||||
@@ -182,7 +182,7 @@ static struct esync *add_to_list( HANDLE handle, enum esync_type type, int fd, v
|
||||
}
|
||||
}
|
||||
|
||||
- if (!InterlockedCompareExchange( (int *)&esync_list[entry][idx].type, type, 0 ))
|
||||
+ if (!InterlockedCompareExchange( &esync_list[entry][idx].type, type, 0 ))
|
||||
{
|
||||
esync_list[entry][idx].fd = fd;
|
||||
esync_list[entry][idx].shm = shm;
|
||||
@@ -206,7 +206,7 @@ static struct esync *get_cached_object( HANDLE handle )
|
||||
* message queue, etc.) */
|
||||
static NTSTATUS get_object( HANDLE handle, struct esync **obj )
|
||||
{
|
||||
- NTSTATUS ret = STATUS_SUCCESS;
|
||||
+ int ret = STATUS_SUCCESS;
|
||||
enum esync_type type = 0;
|
||||
unsigned int shm_idx = 0;
|
||||
obj_handle_t fd_handle;
|
||||
@@ -274,7 +274,7 @@ NTSTATUS esync_close( HANDLE handle )
|
||||
|
||||
if (entry < ESYNC_LIST_ENTRIES && esync_list[entry])
|
||||
{
|
||||
- if (InterlockedExchange((int *)&esync_list[entry][idx].type, 0))
|
||||
+ if (InterlockedExchange(&esync_list[entry][idx].type, 0))
|
||||
{
|
||||
close( esync_list[entry][idx].fd );
|
||||
return STATUS_SUCCESS;
|
||||
@@ -370,7 +370,7 @@ static NTSTATUS open_esync( enum esync_type type, HANDLE *handle,
|
||||
}
|
||||
|
||||
extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access,
|
||||
- const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max)
|
||||
+ const OBJECT_ATTRIBUTES *attr, int initial, int max)
|
||||
{
|
||||
TRACE("name %s, initial %d, max %d.\n",
|
||||
attr ? debugstr_us(attr->ObjectName) : "<no name>", initial, max);
|
||||
@@ -386,7 +386,7 @@ NTSTATUS esync_open_semaphore( HANDLE *handle, ACCESS_MASK access,
|
||||
return open_esync( ESYNC_SEMAPHORE, handle, access, attr );
|
||||
}
|
||||
|
||||
-NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev )
|
||||
+NTSTATUS esync_release_semaphore( HANDLE handle, unsigned int count, ULONG *prev )
|
||||
{
|
||||
struct esync *obj;
|
||||
struct semaphore *semaphore;
|
||||
@@ -800,7 +800,7 @@ static BOOL 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(). */
|
||||
-static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEAN wait_any,
|
||||
+static NTSTATUS __esync_wait_objects( unsigned int count, const HANDLE *handles, BOOLEAN wait_any,
|
||||
BOOLEAN alertable, const LARGE_INTEGER *timeout )
|
||||
{
|
||||
static const LARGE_INTEGER zero;
|
||||
diff --git a/dlls/ntdll/unix/esync.h b/dlls/ntdll/unix/esync.h
|
||||
index 59f8809fc1a..9102cf911aa 100644
|
||||
--- a/dlls/ntdll/unix/esync.h
|
||||
+++ b/dlls/ntdll/unix/esync.h
|
||||
@@ -23,11 +23,11 @@ extern void esync_init(void);
|
||||
extern NTSTATUS esync_close( HANDLE handle );
|
||||
|
||||
extern NTSTATUS esync_create_semaphore(HANDLE *handle, ACCESS_MASK access,
|
||||
- const OBJECT_ATTRIBUTES *attr, LONG initial, LONG max);
|
||||
+ const OBJECT_ATTRIBUTES *attr, int initial, int max);
|
||||
extern NTSTATUS esync_open_semaphore( HANDLE *handle, ACCESS_MASK access,
|
||||
const OBJECT_ATTRIBUTES *attr );
|
||||
extern NTSTATUS esync_query_semaphore( HANDLE handle, void *info, ULONG *ret_len );
|
||||
-extern NTSTATUS esync_release_semaphore( HANDLE handle, ULONG count, ULONG *prev );
|
||||
+extern NTSTATUS esync_release_semaphore( HANDLE handle, unsigned int count, ULONG *prev );
|
||||
|
||||
extern NTSTATUS esync_create_event( HANDLE *handle, ACCESS_MASK access,
|
||||
const OBJECT_ATTRIBUTES *attr, EVENT_TYPE type, BOOLEAN initial );
|
||||
--
|
||||
2.45.2
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 7b59a735bf21a4db50669c360666191493767909 Mon Sep 17 00:00:00 2001
|
||||
From ee26472916e2196456c0c59fb8ca04ee362f148a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Mon, 3 Apr 2017 05:30:27 +0200
|
||||
Subject: [PATCH] ntdll: Implement HashLinks field in LDR module data.
|
||||
@@ -9,7 +9,7 @@ Subject: [PATCH] ntdll: Implement HashLinks field in LDR module data.
|
||||
2 files changed, 117 insertions(+)
|
||||
|
||||
diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c
|
||||
index 8f418ef09a9..30f089bd64f 100644
|
||||
index 8b332e479e6..08cb3d3f8ce 100644
|
||||
--- a/dlls/kernel32/tests/loader.c
|
||||
+++ b/dlls/kernel32/tests/loader.c
|
||||
@@ -28,6 +28,7 @@
|
||||
@@ -20,7 +20,7 @@ index 8f418ef09a9..30f089bd64f 100644
|
||||
#include "wine/test.h"
|
||||
#include "delayloadhandler.h"
|
||||
|
||||
@@ -4205,6 +4206,79 @@ static void test_Wow64Transition(void)
|
||||
@@ -4641,6 +4642,79 @@ static void test_Wow64Transition(void)
|
||||
debugstr_wn(name->SectionFileName.Buffer, name->SectionFileName.Length / sizeof(WCHAR)));
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ index 8f418ef09a9..30f089bd64f 100644
|
||||
START_TEST(loader)
|
||||
{
|
||||
int argc;
|
||||
@@ -4286,6 +4360,7 @@ START_TEST(loader)
|
||||
@@ -4723,6 +4797,7 @@ START_TEST(loader)
|
||||
test_InMemoryOrderModuleList();
|
||||
test_LoadPackagedLibrary();
|
||||
test_wow64_redirection();
|
||||
@@ -109,10 +109,10 @@ index 8f418ef09a9..30f089bd64f 100644
|
||||
test_dll_file( "kernel32.dll" );
|
||||
test_dll_file( "advapi32.dll" );
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index 714d3f17ff0..415fcbb1aa6 100644
|
||||
index 5f84ca7e23b..4da48a82d74 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -133,6 +133,9 @@ struct file_id
|
||||
@@ -128,6 +128,9 @@ struct file_id
|
||||
BYTE ObjectId[16];
|
||||
};
|
||||
|
||||
@@ -122,7 +122,7 @@ index 714d3f17ff0..415fcbb1aa6 100644
|
||||
/* internal representation of loaded modules */
|
||||
typedef struct _wine_modref
|
||||
{
|
||||
@@ -548,6 +551,33 @@ static void call_ldr_notifications( ULONG reason, LDR_DATA_TABLE_ENTRY *module )
|
||||
@@ -556,6 +559,33 @@ static void call_ldr_notifications( ULONG reason, LDR_DATA_TABLE_ENTRY *module )
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ index 714d3f17ff0..415fcbb1aa6 100644
|
||||
/*************************************************************************
|
||||
* get_modref
|
||||
*
|
||||
@@ -1528,7 +1558,12 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name
|
||||
@@ -1557,7 +1587,12 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name
|
||||
&wm->ldr.InLoadOrderLinks);
|
||||
InsertTailList(&NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList,
|
||||
&wm->ldr.InMemoryOrderLinks);
|
||||
@@ -169,7 +169,7 @@ index 714d3f17ff0..415fcbb1aa6 100644
|
||||
|
||||
if (!(nt->OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT))
|
||||
{
|
||||
@@ -2226,6 +2261,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name,
|
||||
@@ -2253,6 +2288,7 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name,
|
||||
/* the module has only be inserted in the load & memory order lists */
|
||||
RemoveEntryList(&wm->ldr.InLoadOrderLinks);
|
||||
RemoveEntryList(&wm->ldr.InMemoryOrderLinks);
|
||||
@@ -177,7 +177,7 @@ index 714d3f17ff0..415fcbb1aa6 100644
|
||||
|
||||
/* FIXME: there are several more dangling references
|
||||
* left. Including dlls loaded by this dll before the
|
||||
@@ -3908,6 +3944,7 @@ static void free_modref( WINE_MODREF *wm )
|
||||
@@ -3916,6 +3952,7 @@ static void free_modref( WINE_MODREF *wm )
|
||||
|
||||
RemoveEntryList(&wm->ldr.InLoadOrderLinks);
|
||||
RemoveEntryList(&wm->ldr.InMemoryOrderLinks);
|
||||
@@ -185,7 +185,7 @@ index 714d3f17ff0..415fcbb1aa6 100644
|
||||
if (wm->ldr.InInitializationOrderLinks.Flink)
|
||||
RemoveEntryList(&wm->ldr.InInitializationOrderLinks);
|
||||
|
||||
@@ -4263,6 +4300,7 @@ void loader_init( CONTEXT *context, void **entry )
|
||||
@@ -4336,6 +4373,7 @@ void loader_init( CONTEXT *context, void **entry )
|
||||
ANSI_STRING ctrl_routine = RTL_CONSTANT_STRING( "CtrlRoutine" );
|
||||
WINE_MODREF *kernel32;
|
||||
PEB *peb = NtCurrentTeb()->Peb;
|
||||
@@ -193,9 +193,9 @@ index 714d3f17ff0..415fcbb1aa6 100644
|
||||
|
||||
peb->LdrData = &ldr;
|
||||
peb->FastPebLock = &peb_lock;
|
||||
@@ -4278,6 +4316,10 @@ void loader_init( CONTEXT *context, void **entry )
|
||||
RtlSetBits( peb->TlsBitmap, 0, NtCurrentTeb()->WowTebOffset ? WOW64_TLS_MAX_NUMBER : 1 );
|
||||
RtlSetBits( peb->TlsBitmap, NTDLL_TLS_ERRNO, 1 );
|
||||
@@ -4354,6 +4392,10 @@ void loader_init( CONTEXT *context, void **entry )
|
||||
if (!(tls_dirs = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, tls_module_count * sizeof(*tls_dirs) )))
|
||||
NtTerminateProcess( GetCurrentProcess(), STATUS_NO_MEMORY );
|
||||
|
||||
+ /* initialize hash table */
|
||||
+ for (i = 0; i < HASH_MAP_SIZE; i++)
|
||||
@@ -205,5 +205,5 @@ index 714d3f17ff0..415fcbb1aa6 100644
|
||||
load_global_options();
|
||||
version_init();
|
||||
--
|
||||
2.43.0
|
||||
2.45.2
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 4bc218280bf7e0d697b2386ea2f71d5562bc8867 Mon Sep 17 00:00:00 2001
|
||||
From bdbc1c90697424373a5248cf6c2bda589785bd37 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 16 Jan 2014 20:56:49 -0700
|
||||
Subject: [PATCH] ntdll: Add support for creating reparse points.
|
||||
@@ -13,12 +13,12 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
5 files changed, 451 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 89bc831bb94..0138b5d3b9a 100644
|
||||
index d380c66ff40..4314be5553c 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -2087,6 +2087,8 @@ AC_CHECK_FUNCS(\
|
||||
@@ -2078,6 +2078,8 @@ AC_CHECK_FUNCS(\
|
||||
posix_fallocate \
|
||||
prctl \
|
||||
proc_pidinfo \
|
||||
sched_yield \
|
||||
+ renameat \
|
||||
+ renameat2 \
|
||||
@@ -26,7 +26,7 @@ index 89bc831bb94..0138b5d3b9a 100644
|
||||
setprogname \
|
||||
sigprocmask \
|
||||
diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in
|
||||
index e17e3f72b92..66cdf11423c 100644
|
||||
index 37bd6c86e31..f9a15d28ed2 100644
|
||||
--- a/dlls/ntdll/Makefile.in
|
||||
+++ b/dlls/ntdll/Makefile.in
|
||||
@@ -4,7 +4,7 @@ UNIXLIB = ntdll.so
|
||||
@@ -231,7 +231,7 @@ index 7d3618a3804..148b6058cee 100644
|
||||
+ test_mailslot_name();
|
||||
}
|
||||
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
|
||||
index b8fb4f19e13..c52377264fe 100644
|
||||
index ca95dd347eb..ac4de149455 100644
|
||||
--- a/dlls/ntdll/unix/file.c
|
||||
+++ b/dlls/ntdll/unix/file.c
|
||||
@@ -36,6 +36,8 @@
|
||||
@@ -389,7 +389,7 @@ index b8fb4f19e13..c52377264fe 100644
|
||||
static BOOL fd_is_mount_point( int fd, const struct stat *st )
|
||||
{
|
||||
struct stat parent;
|
||||
@@ -3420,6 +3540,181 @@ done:
|
||||
@@ -3418,6 +3538,181 @@ done:
|
||||
}
|
||||
|
||||
|
||||
@@ -571,7 +571,7 @@ index b8fb4f19e13..c52377264fe 100644
|
||||
/******************************************************************************
|
||||
* lookup_unix_name
|
||||
*
|
||||
@@ -6266,6 +6561,13 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
|
||||
@@ -6249,6 +6544,13 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -602,5 +602,5 @@ index 980235abdc9..90248b4897c 100644
|
||||
{
|
||||
UCHAR DataBuffer[1];
|
||||
--
|
||||
2.43.0
|
||||
2.45.2
|
||||
|
||||
|
@@ -0,0 +1,63 @@
|
||||
From 96831bd0bda656192510397cd18cb2c4bff5d8f4 Mon Sep 17 00:00:00 2001
|
||||
From: Elizabeth Figura <zfigura@codeweavers.com>
|
||||
Date: Thu, 22 Aug 2024 18:42:33 -0500
|
||||
Subject: [PATCH 03/10] ntdll: Install signal handlers a bit earlier.
|
||||
|
||||
The wine-staging WRITECOPY implementation needs to be able to handle write faults while relocating builtin modules loaded during process initialization.
|
||||
|
||||
Note that the comment about debug events isn't relevant anymore because these exceptions all happen on the Unix stack anyway.
|
||||
|
||||
Probably there's a better solution involving simply not write-protecting these pages until we get to PE code, but that's not worth writing when this whole patch set is moribund anyway.
|
||||
---
|
||||
dlls/ntdll/unix/loader.c | 1 +
|
||||
dlls/ntdll/unix/server.c | 5 -----
|
||||
dlls/ntdll/unix/signal_i386.c | 5 ++++-
|
||||
3 files changed, 5 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
|
||||
index 92f2e2eb3a3..a6ea16bb7bb 100644
|
||||
--- a/dlls/ntdll/unix/loader.c
|
||||
+++ b/dlls/ntdll/unix/loader.c
|
||||
@@ -1866,6 +1866,7 @@ static void start_main_thread(void)
|
||||
set_load_order_app_name( main_wargv[0] );
|
||||
init_thread_stack( teb, 0, 0, 0 );
|
||||
NtCreateKeyedEvent( &keyed_event, GENERIC_READ | GENERIC_WRITE, NULL, 0 );
|
||||
+ signal_init_process();
|
||||
load_ntdll();
|
||||
load_wow64_ntdll( main_image_info.Machine );
|
||||
load_apiset_dll();
|
||||
diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c
|
||||
index 27dbf1331aa..80504e3459c 100644
|
||||
--- a/dlls/ntdll/unix/server.c
|
||||
+++ b/dlls/ntdll/unix/server.c
|
||||
@@ -1674,11 +1674,6 @@ void server_init_process_done(void)
|
||||
send_server_task_port();
|
||||
#endif
|
||||
|
||||
- /* Install signal handlers; this cannot be done earlier, since we cannot
|
||||
- * send exceptions to the debugger before the create process event that
|
||||
- * is sent by init_process_done */
|
||||
- signal_init_process();
|
||||
-
|
||||
/* always send the native TEB */
|
||||
if (!(teb = NtCurrentTeb64())) teb = NtCurrentTeb();
|
||||
|
||||
diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c
|
||||
index 61d41ec3589..b838a7a8669 100644
|
||||
--- a/dlls/ntdll/unix/signal_i386.c
|
||||
+++ b/dlls/ntdll/unix/signal_i386.c
|
||||
@@ -719,7 +719,10 @@ static inline void *init_handler( const ucontext_t *sigcontext )
|
||||
{
|
||||
struct x86_thread_data *thread_data = (struct x86_thread_data *)&teb->GdiTebBatch;
|
||||
set_fs( thread_data->fs );
|
||||
- set_gs( thread_data->gs );
|
||||
+ /* FIXME ZF: This is a bit of a hack, but it doesn't matter,
|
||||
+ * since this patch set goes in the wrong direction anyway. */
|
||||
+ if (thread_data->gs)
|
||||
+ set_gs( thread_data->gs );
|
||||
}
|
||||
#endif
|
||||
|
||||
--
|
||||
2.45.2
|
||||
|
@@ -1,178 +0,0 @@
|
||||
From c9d4a9c3a65b1ff1a0c4b4042394f2fab3b2019a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 4 Oct 2014 02:53:22 +0200
|
||||
Subject: [PATCH] ntdll: Setup a temporary signal handler during process
|
||||
startup to handle page faults. (v2)
|
||||
|
||||
---
|
||||
dlls/ntdll/unix/loader.c | 2 ++
|
||||
dlls/ntdll/unix/signal_arm.c | 6 ++++
|
||||
dlls/ntdll/unix/signal_arm64.c | 6 ++++
|
||||
dlls/ntdll/unix/signal_i386.c | 52 +++++++++++++++++++++++++++++++++
|
||||
dlls/ntdll/unix/signal_x86_64.c | 6 ++++
|
||||
dlls/ntdll/unix/unix_private.h | 1 +
|
||||
dlls/ntdll/unix/virtual.c | 2 +-
|
||||
7 files changed, 74 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
|
||||
index fa1a943fd51..5a8b0f57e42 100644
|
||||
--- a/dlls/ntdll/unix/loader.c
|
||||
+++ b/dlls/ntdll/unix/loader.c
|
||||
@@ -2142,6 +2142,8 @@ DECLSPEC_EXPORT void __wine_main( int argc, char *argv[], char *envp[] )
|
||||
#endif
|
||||
|
||||
virtual_init();
|
||||
+ signal_init_early();
|
||||
+
|
||||
init_environment();
|
||||
|
||||
#ifdef __APPLE__
|
||||
diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c
|
||||
index 5115fa7ec3a..8e23007e936 100644
|
||||
--- a/dlls/ntdll/unix/signal_arm.c
|
||||
+++ b/dlls/ntdll/unix/signal_arm.c
|
||||
@@ -1615,6 +1615,12 @@ void signal_init_process(void)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
+/**********************************************************************
|
||||
+ * signal_init_early
|
||||
+ */
|
||||
+void signal_init_early(void)
|
||||
+{
|
||||
+}
|
||||
|
||||
/***********************************************************************
|
||||
* call_init_thunk
|
||||
diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c
|
||||
index f96ec330796..eaecf988c54 100644
|
||||
--- a/dlls/ntdll/unix/signal_arm64.c
|
||||
+++ b/dlls/ntdll/unix/signal_arm64.c
|
||||
@@ -1623,6 +1623,12 @@ void signal_init_process(void)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
+/**********************************************************************
|
||||
+ * signal_init_early
|
||||
+ */
|
||||
+void signal_init_early(void)
|
||||
+{
|
||||
+}
|
||||
|
||||
/***********************************************************************
|
||||
* syscall_dispatcher_return_slowpath
|
||||
diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c
|
||||
index c64a8b1efe2..cc1eff1f40b 100644
|
||||
--- a/dlls/ntdll/unix/signal_i386.c
|
||||
+++ b/dlls/ntdll/unix/signal_i386.c
|
||||
@@ -1895,6 +1895,30 @@ static BOOL handle_syscall_trap( ucontext_t *sigcontext )
|
||||
}
|
||||
|
||||
|
||||
+/**********************************************************************
|
||||
+ * segv_handler_early
|
||||
+ *
|
||||
+ * Handler for SIGSEGV and related errors. Used only during the initialization
|
||||
+ * of the process to handle virtual faults.
|
||||
+ */
|
||||
+static void segv_handler_early( int signal, siginfo_t *siginfo, void *sigcontext )
|
||||
+{
|
||||
+ ucontext_t *ucontext = sigcontext;
|
||||
+
|
||||
+ switch (TRAP_sig(ucontext))
|
||||
+ {
|
||||
+ case TRAP_x86_PAGEFLT: /* Page fault */
|
||||
+ if (!virtual_handle_fault( siginfo->si_addr, (ERROR_sig(ucontext) >> 1) & 0x09,
|
||||
+ NULL))
|
||||
+ return;
|
||||
+ /* fall-through */
|
||||
+ default:
|
||||
+ WINE_ERR( "Got unexpected trap %d during process initialization\n", TRAP_sig(ucontext) );
|
||||
+ abort_thread(1);
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/**********************************************************************
|
||||
* segv_handler
|
||||
*
|
||||
@@ -2465,6 +2489,34 @@ void signal_init_process(void)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
+/**********************************************************************
|
||||
+ * signal_init_early
|
||||
+ */
|
||||
+void signal_init_early(void)
|
||||
+{
|
||||
+ struct sigaction sig_act;
|
||||
+
|
||||
+ sig_act.sa_mask = server_block_set;
|
||||
+ sig_act.sa_flags = SA_SIGINFO | SA_RESTART;
|
||||
+#ifdef SA_ONSTACK
|
||||
+ sig_act.sa_flags |= SA_ONSTACK;
|
||||
+#endif
|
||||
+#ifdef __ANDROID__
|
||||
+ sig_act.sa_flags |= SA_RESTORER;
|
||||
+ sig_act.sa_restorer = rt_sigreturn;
|
||||
+#endif
|
||||
+ sig_act.sa_sigaction = segv_handler_early;
|
||||
+ if (sigaction( SIGSEGV, &sig_act, NULL ) == -1) goto error;
|
||||
+ if (sigaction( SIGILL, &sig_act, NULL ) == -1) goto error;
|
||||
+#ifdef SIGBUS
|
||||
+ if (sigaction( SIGBUS, &sig_act, NULL ) == -1) goto error;
|
||||
+#endif
|
||||
+ return;
|
||||
+
|
||||
+error:
|
||||
+ perror("sigaction");
|
||||
+ exit(1);
|
||||
+}
|
||||
|
||||
/***********************************************************************
|
||||
* call_init_thunk
|
||||
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c
|
||||
index a28762915be..d22515ab921 100644
|
||||
--- a/dlls/ntdll/unix/signal_x86_64.c
|
||||
+++ b/dlls/ntdll/unix/signal_x86_64.c
|
||||
@@ -2659,6 +2659,12 @@ void signal_init_process(void)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
+/**********************************************************************
|
||||
+ * signal_init_early
|
||||
+ */
|
||||
+void signal_init_early(void)
|
||||
+{
|
||||
+}
|
||||
|
||||
/***********************************************************************
|
||||
* call_init_thunk
|
||||
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
|
||||
index fadad6ae824..d8eaabef781 100644
|
||||
--- a/dlls/ntdll/unix/unix_private.h
|
||||
+++ b/dlls/ntdll/unix/unix_private.h
|
||||
@@ -277,6 +277,7 @@ extern void signal_init_threading(void);
|
||||
extern NTSTATUS signal_alloc_thread( TEB *teb );
|
||||
extern void signal_free_thread( TEB *teb );
|
||||
extern void signal_init_process(void);
|
||||
+extern void signal_init_early(void);
|
||||
extern void DECLSPEC_NORETURN signal_start_thread( PRTL_THREAD_START_ROUTINE entry, void *arg,
|
||||
BOOL suspend, TEB *teb );
|
||||
extern SYSTEM_SERVICE_TABLE KeServiceDescriptorTable[4];
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index e0099f1a5c2..fd0b382b368 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -3961,7 +3961,7 @@ NTSTATUS virtual_handle_fault( void *addr, DWORD err, void *stack )
|
||||
}
|
||||
#endif
|
||||
|
||||
- if (!is_inside_signal_stack( stack ) && (vprot & VPROT_GUARD))
|
||||
+ if (stack && !is_inside_signal_stack( stack ) && (vprot & VPROT_GUARD))
|
||||
{
|
||||
struct thread_stack_info stack_info;
|
||||
if (!is_inside_thread_stack( page, &stack_info ))
|
||||
--
|
||||
2.43.0
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 4a297f731112822e51086826f975bf5db9178e52 Mon Sep 17 00:00:00 2001
|
||||
From 8ec23a75cf45f9b2841b76504c827d368682c126 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 4 Oct 2014 03:22:09 +0200
|
||||
Subject: [PATCH] ntdll: Properly handle PAGE_WRITECOPY protection. (try 5)
|
||||
@@ -9,10 +9,10 @@ For now, only enable it when a special environment variable is set.
|
||||
1 file changed, 39 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
|
||||
index cf0c1598720..ff585c647bc 100644
|
||||
index b108e49ad4d..70211bbfa3d 100644
|
||||
--- a/dlls/ntdll/unix/virtual.c
|
||||
+++ b/dlls/ntdll/unix/virtual.c
|
||||
@@ -495,6 +495,21 @@ static void reserve_area( void *addr, void *end )
|
||||
@@ -506,6 +506,21 @@ static void reserve_area( void *addr, void *end )
|
||||
#endif /* __APPLE__ */
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ index cf0c1598720..ff585c647bc 100644
|
||||
|
||||
static void mmap_init( const struct preload_info *preload_info )
|
||||
{
|
||||
@@ -852,8 +867,19 @@ static int get_unix_prot( BYTE vprot )
|
||||
@@ -1136,8 +1151,19 @@ static int get_unix_prot( BYTE vprot )
|
||||
{
|
||||
if (vprot & VPROT_READ) prot |= PROT_READ;
|
||||
if (vprot & VPROT_WRITE) prot |= PROT_WRITE | PROT_READ;
|
||||
@@ -55,7 +55,7 @@ index cf0c1598720..ff585c647bc 100644
|
||||
if (vprot & VPROT_WRITEWATCH) prot &= ~PROT_WRITE;
|
||||
}
|
||||
if (!prot) prot = PROT_NONE;
|
||||
@@ -1457,7 +1483,7 @@ static void update_write_watches( void *base, size_t size, size_t accessed_size
|
||||
@@ -1817,7 +1843,7 @@ static void update_write_watches( void *base, size_t size, size_t accessed_size
|
||||
{
|
||||
TRACE( "updating watch %p-%p-%p\n", base, (char *)base + accessed_size, (char *)base + size );
|
||||
/* clear write watch flag on accessed pages */
|
||||
@@ -64,9 +64,9 @@ index cf0c1598720..ff585c647bc 100644
|
||||
/* restore page protections on the entire range */
|
||||
mprotect_range( base, size, 0, 0 );
|
||||
}
|
||||
@@ -2985,12 +3011,13 @@ NTSTATUS virtual_handle_fault( void *addr, DWORD err, void *stack )
|
||||
set_page_vprot_bits( page, page_size, 0, VPROT_WRITEWATCH );
|
||||
mprotect_range( page, page_size, 0, 0 );
|
||||
@@ -4065,12 +4091,13 @@ NTSTATUS virtual_handle_fault( EXCEPTION_RECORD *rec, void *stack )
|
||||
mprotect_range( page, page_size, 0, 0 );
|
||||
}
|
||||
}
|
||||
- /* ignore fault if page is writable now */
|
||||
- if (get_unix_prot( get_page_vprot( page )) & PROT_WRITE)
|
||||
@@ -81,8 +81,8 @@ index cf0c1598720..ff585c647bc 100644
|
||||
+ if (get_unix_prot( get_page_vprot( page ) ) & PROT_WRITE) ret = STATUS_SUCCESS;
|
||||
}
|
||||
mutex_unlock( &virtual_mutex );
|
||||
return ret;
|
||||
@@ -3067,11 +3094,16 @@ static NTSTATUS check_write_access( void *base, size_t size, BOOL *has_write_wat
|
||||
rec->ExceptionCode = ret;
|
||||
@@ -4144,11 +4171,16 @@ static NTSTATUS check_write_access( void *base, size_t size, BOOL *has_write_wat
|
||||
{
|
||||
BYTE vprot = get_page_vprot( addr + i );
|
||||
if (vprot & VPROT_WRITEWATCH) *has_write_watch = TRUE;
|
||||
@@ -101,5 +101,5 @@ index cf0c1598720..ff585c647bc 100644
|
||||
}
|
||||
|
||||
--
|
||||
2.28.0
|
||||
2.45.2
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user