<pre style='margin:0'>
Perry E. Metzger (pmetzger) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/0460e296cfa30a1c1252f4a2bb06ac654eccdbb2">https://github.com/macports/macports-ports/commit/0460e296cfa30a1c1252f4a2bb06ac654eccdbb2</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 0460e296cfa wine-devel,wine-staging: Update to 9.13
</span>0460e296cfa is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 0460e296cfa30a1c1252f4a2bb06ac654eccdbb2
</span>Author: Dean M Greer <38226388+Gcenx@users.noreply.github.com>
AuthorDate: Thu Jul 18 10:06:15 2024 -0400
<span style='display:block; white-space:pre;color:#404040;'> wine-devel,wine-staging: Update to 9.13
</span>---
emulators/wine-devel/Portfile | 14 +-
emulators/wine-devel/files/1001-msync.diff | 166 ++++++++---------
emulators/wine-devel/files/macos_hacks.diff | 275 ++++++++++++++++++++--------
3 files changed, 293 insertions(+), 162 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/emulators/wine-devel/Portfile b/emulators/wine-devel/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 517f3c025ce..7e14080ea03 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/emulators/wine-devel/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/emulators/wine-devel/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -7,7 +7,7 @@ PortGroup muniversal 1.1
</span>
# Keep the wine-stable, wine-devel and wine-crossover portfiles as similar as possible.
<span style='display:block; white-space:pre;background:#ffe0e0;'>-github.setup wine-mirror wine 9.12 wine-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+github.setup wine-mirror wine 9.13 wine-
</span> github.tarball_from archive
name wine-devel
conflicts wine-stable wine-staging wine-crossover
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -37,9 +37,9 @@ long_description \
</span>
checksums \
${distname}${extract.suffix} \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- rmd160 dc60e454fb2023e69ab8369a58b6eb1367b7036e \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sha256 2df47b244aaa2878ba4631f05197670bc4f1f5d102bd7145feff7bfac2b87107 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size 49501104
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rmd160 8f0fda05a096f4450898fdfee1a4616a4fdc8f14 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 aa421ae384f3fee6c1f33421113e0bad6a133b38055cd80b119fbc447c8ba472 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size 49612340
</span>
depends_build \
port:bison \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -140,9 +140,9 @@ subport wine-staging {
</span>
checksums-append \
${wine_staging_distfile} \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- rmd160 1d02cf1d20d567142370ef586db20e6c0a871d5b \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sha256 f6f1b701ae071e98807dbde425726c2d1c934dc951e7d8414e1746fa57039f3b \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size 9456608
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rmd160 140025d60fd1f5800552356b69828df8af8ed15b \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 c61708f06caf2a6ad4b373624347ae0e74ecb9d8e78675f0fee289a67f993a00 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size 9486868
</span>
depends_patch-append port:autoconf
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/emulators/wine-devel/files/1001-msync.diff b/emulators/wine-devel/files/1001-msync.diff
</span><span style='display:block; white-space:pre;color:#808080;'>index b4cc9640c88..786a3bc7df3 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/emulators/wine-devel/files/1001-msync.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/emulators/wine-devel/files/1001-msync.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,5 +1,5 @@
</span> diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 4629457a2ec..f169525fbff 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 78b3fdf94aa..061c730bf63 100644
</span> --- a/dlls/ntdll/Makefile.in
+++ b/dlls/ntdll/Makefile.in
@@ -50,6 +50,7 @@ SOURCES = \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -11,10 +11,10 @@ index 4629457a2ec..f169525fbff 100644
</span> unix/loadorder.c \
unix/process.c \
diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index edfeb03864d..71ebf6e9442 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 85d3db0cb8c..b63a386ee96 100644
</span> --- a/dlls/ntdll/unix/esync.c
+++ b/dlls/ntdll/unix/esync.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -49,6 +49,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -51,6 +51,7 @@
</span>
#include "unix_private.h"
#include "esync.h"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -22,7 +22,7 @@ index edfeb03864d..71ebf6e9442 100644
</span>
WINE_DEFAULT_DEBUG_CHANNEL(esync);
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -58,13 +59,16 @@ int do_esync(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -60,13 +61,16 @@ int do_esync(void)
</span> static int do_esync_cached = -1;
if (do_esync_cached == -1)
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -41,7 +41,7 @@ index edfeb03864d..71ebf6e9442 100644
</span> return 0;
#endif
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -569,6 +573,9 @@ NTSTATUS esync_reset_event( HANDLE handle )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -571,6 +575,9 @@ NTSTATUS esync_reset_event( HANDLE handle )
</span> if ((ret = get_object( handle, &obj ))) return ret;
event = obj->shm;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -51,7 +51,7 @@ index edfeb03864d..71ebf6e9442 100644
</span> if (obj->type == ESYNC_MANUAL_EVENT)
{
/* Acquire the spinlock. */
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -859,7 +866,7 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -861,7 +868,7 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA
</span> return ret;
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -60,7 +60,7 @@ index edfeb03864d..71ebf6e9442 100644
</span> msgwait = TRUE;
if (has_esync && has_server)
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -888,7 +895,7 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -890,7 +897,7 @@ static NTSTATUS __esync_wait_objects( DWORD count, const HANDLE *handles, BOOLEA
</span> }
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -70,7 +70,7 @@ index edfeb03864d..71ebf6e9442 100644
</span> /* Try to check objects now, so we can obviate poll() at least. */
for (i = 0; i < count; i++)
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 1f91b789c69..46680f61353 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index ae7e2e8e6ec..a7175b35ae6 100644
</span> --- a/dlls/ntdll/unix/loader.c
+++ b/dlls/ntdll/unix/loader.c
@@ -89,6 +89,7 @@ extern char **environ;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -81,7 +81,7 @@ index 1f91b789c69..46680f61353 100644
</span> #include "wine/list.h"
#include "ntsyscalls.h"
#include "wine/debug.h"
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1867,6 +1868,7 @@ static void start_main_thread(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1896,6 +1897,7 @@ static void start_main_thread(void)
</span> signal_alloc_thread( teb );
dbg_init();
startup_info_size = server_init_process();
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1835,7 +1835,7 @@ index 77aa995326c..f45db2f3090 100644
</span> esync_close( handle );
diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 1ddb9247fb1..641665b5ed2 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index a52327841d2..4d4644f9c8c 100644
</span> --- a/dlls/ntdll/unix/sync.c
+++ b/dlls/ntdll/unix/sync.c
@@ -67,6 +67,7 @@
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1846,7 +1846,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span>
WINE_DEFAULT_DEBUG_CHANNEL(sync);
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -119,7 +120,7 @@ static inline int futex_wait( const LONG *addr, int val, struct timespec *timeou
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -120,7 +121,7 @@ static inline int futex_wait( const LONG *addr, int val, struct timespec *timeou
</span> long tv_nsec;
} timeout32 = { timeout->tv_sec, timeout->tv_nsec };
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1855,7 +1855,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> }
#endif
return syscall( __NR_futex, addr, FUTEX_WAIT_PRIVATE, val, timeout, 0, 0 );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -256,6 +257,9 @@ NTSTATUS WINAPI NtCreateSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJ
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -320,6 +321,9 @@ NTSTATUS WINAPI NtCreateSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJ
</span> if (max <= 0 || initial < 0 || initial > max) return STATUS_INVALID_PARAMETER;
if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1865,7 +1865,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> if (do_esync())
return esync_create_semaphore( handle, access, attr, initial, max );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -284,6 +288,9 @@ NTSTATUS WINAPI NtOpenSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJEC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -348,6 +352,9 @@ NTSTATUS WINAPI NtOpenSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJEC
</span>
*handle = 0;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1875,7 +1875,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> if (do_esync())
return esync_open_semaphore( handle, access, attr );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -323,6 +330,9 @@ NTSTATUS WINAPI NtQuerySemaphore( HANDLE handle, SEMAPHORE_INFORMATION_CLASS cla
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -387,6 +394,9 @@ NTSTATUS WINAPI NtQuerySemaphore( HANDLE handle, SEMAPHORE_INFORMATION_CLASS cla
</span>
if (len != sizeof(SEMAPHORE_BASIC_INFORMATION)) return STATUS_INFO_LENGTH_MISMATCH;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1885,7 +1885,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> if (do_esync())
return esync_query_semaphore( handle, info, ret_len );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -348,6 +358,9 @@ NTSTATUS WINAPI NtReleaseSemaphore( HANDLE handle, ULONG count, ULONG *previous
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -412,6 +422,9 @@ NTSTATUS WINAPI NtReleaseSemaphore( HANDLE handle, ULONG count, ULONG *previous
</span> {
unsigned int ret;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1895,7 +1895,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> if (do_esync())
return esync_release_semaphore( handle, count, previous );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -378,6 +391,9 @@ NTSTATUS WINAPI NtCreateEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -442,6 +455,9 @@ NTSTATUS WINAPI NtCreateEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_
</span> *handle = 0;
if (type != NotificationEvent && type != SynchronizationEvent) return STATUS_INVALID_PARAMETER;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1905,7 +1905,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> if (do_esync())
return esync_create_event( handle, access, attr, type, state );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -409,6 +425,9 @@ NTSTATUS WINAPI NtOpenEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_AT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -473,6 +489,9 @@ NTSTATUS WINAPI NtOpenEvent( HANDLE *handle, ACCESS_MASK access, const OBJECT_AT
</span> *handle = 0;
if ((ret = validate_open_object_attributes( attr ))) return ret;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1915,7 +1915,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> if (do_esync())
return esync_open_event( handle, access, attr );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -435,6 +454,9 @@ NTSTATUS WINAPI NtSetEvent( HANDLE handle, LONG *prev_state )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -499,6 +518,9 @@ NTSTATUS WINAPI NtSetEvent( HANDLE handle, LONG *prev_state )
</span> /* This comment is a dummy to make sure this patch applies in the right place. */
unsigned int ret;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1925,7 +1925,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> if (do_esync())
return esync_set_event( handle );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -458,6 +480,9 @@ NTSTATUS WINAPI NtResetEvent( HANDLE handle, LONG *prev_state )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -522,6 +544,9 @@ NTSTATUS WINAPI NtResetEvent( HANDLE handle, LONG *prev_state )
</span> /* This comment is a dummy to make sure this patch applies in the right place. */
unsigned int ret;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1935,7 +1935,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> if (do_esync())
return esync_reset_event( handle );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -491,6 +516,9 @@ NTSTATUS WINAPI NtPulseEvent( HANDLE handle, LONG *prev_state )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -555,6 +580,9 @@ NTSTATUS WINAPI NtPulseEvent( HANDLE handle, LONG *prev_state )
</span> {
unsigned int ret;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1945,7 +1945,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> if (do_esync())
return esync_pulse_event( handle );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -525,6 +553,9 @@ NTSTATUS WINAPI NtQueryEvent( HANDLE handle, EVENT_INFORMATION_CLASS class,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -589,6 +617,9 @@ NTSTATUS WINAPI NtQueryEvent( HANDLE handle, EVENT_INFORMATION_CLASS class,
</span>
if (len != sizeof(EVENT_BASIC_INFORMATION)) return STATUS_INFO_LENGTH_MISMATCH;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1955,7 +1955,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> if (do_esync())
return esync_query_event( handle, info, ret_len );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -555,6 +586,9 @@ NTSTATUS WINAPI NtCreateMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -619,6 +650,9 @@ NTSTATUS WINAPI NtCreateMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT
</span>
*handle = 0;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1965,7 +1965,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> if (do_esync())
return esync_create_mutex( handle, access, attr, owned );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -585,6 +619,9 @@ NTSTATUS WINAPI NtOpenMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT_A
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -649,6 +683,9 @@ NTSTATUS WINAPI NtOpenMutant( HANDLE *handle, ACCESS_MASK access, const OBJECT_A
</span> *handle = 0;
if ((ret = validate_open_object_attributes( attr ))) return ret;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1975,7 +1975,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> if (do_esync())
return esync_open_mutex( handle, access, attr );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -610,6 +647,9 @@ NTSTATUS WINAPI NtReleaseMutant( HANDLE handle, LONG *prev_count )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -674,6 +711,9 @@ NTSTATUS WINAPI NtReleaseMutant( HANDLE handle, LONG *prev_count )
</span> {
unsigned int ret;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1985,7 +1985,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> if (do_esync())
return esync_release_mutex( handle, prev_count );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -643,6 +683,9 @@ NTSTATUS WINAPI NtQueryMutant( HANDLE handle, MUTANT_INFORMATION_CLASS class,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -707,6 +747,9 @@ NTSTATUS WINAPI NtQueryMutant( HANDLE handle, MUTANT_INFORMATION_CLASS class,
</span>
if (len != sizeof(MUTANT_BASIC_INFORMATION)) return STATUS_INFO_LENGTH_MISMATCH;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1995,7 +1995,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> if (do_esync())
return esync_query_mutex( handle, info, ret_len );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1566,6 +1609,13 @@ NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles, BO
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1630,6 +1673,13 @@ NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles, BO
</span>
if (!count || count > MAXIMUM_WAIT_OBJECTS) return STATUS_INVALID_PARAMETER_1;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2009,7 +2009,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> if (do_esync())
{
NTSTATUS ret = esync_wait_objects( count, handles, wait_any, alertable, timeout );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1598,6 +1648,9 @@ NTSTATUS WINAPI NtSignalAndWaitForSingleObject( HANDLE signal, HANDLE wait,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1662,6 +1712,9 @@ NTSTATUS WINAPI NtSignalAndWaitForSingleObject( HANDLE signal, HANDLE wait,
</span> select_op_t select_op;
UINT flags = SELECT_INTERRUPTIBLE;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2019,7 +2019,7 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> if (do_esync())
return esync_signal_and_wait( signal, wait, alertable, timeout );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1641,7 +1694,24 @@ NTSTATUS WINAPI NtYieldExecution(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1705,7 +1758,24 @@ NTSTATUS WINAPI NtYieldExecution(void)
</span> NTSTATUS WINAPI NtDelayExecution( BOOLEAN alertable, const LARGE_INTEGER *timeout )
{
/* if alertable, we need to query the server */
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2046,10 +2046,10 @@ index 1ddb9247fb1..641665b5ed2 100644
</span> if (!timeout || timeout->QuadPart == TIMEOUT_INFINITE) /* sleep forever */
{
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index c3a2ac11521..6734df89f7a 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 791b7b88c62..dc194eb09ac 100644
</span> --- a/dlls/ntdll/unix/unix_private.h
+++ b/dlls/ntdll/unix/unix_private.h
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -94,6 +94,8 @@ struct ntdll_thread_data
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -104,6 +104,8 @@ struct ntdll_thread_data
</span> void *cpu_data[16]; /* reserved for CPU-specific data */
void *kernel_stack; /* stack for thread startup and kernel syscalls */
int esync_apc_fd; /* fd to wait on for user APCs */
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2059,10 +2059,10 @@ index c3a2ac11521..6734df89f7a 100644
</span> int reply_fd; /* fd for receiving server replies */
int wait_fd[2]; /* fd for sleeping server requests */
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 7e386a41858..f6163e51734 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index efccfac76d0..8247b82852d 100644
</span> --- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -3693,6 +3693,8 @@ static TEB *init_teb( void *ptr, BOOL is_wow )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -3737,6 +3737,8 @@ static TEB *init_teb( void *ptr, BOOL is_wow )
</span> teb->StaticUnicodeString.MaximumLength = sizeof(teb->StaticUnicodeBuffer);
thread_data = (struct ntdll_thread_data *)&teb->GdiTebBatch;
thread_data->esync_apc_fd = -1;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2072,10 +2072,10 @@ index 7e386a41858..f6163e51734 100644
</span> thread_data->reply_fd = -1;
thread_data->wait_fd[0] = -1;
diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 8bedd7d2bbe..a26d6ce6ef7 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index d3399268d00..c38120548ab 100644
</span> --- a/include/wine/server_protocol.h
+++ b/include/wine/server_protocol.h
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -5781,6 +5781,92 @@ struct get_esync_apc_fd_reply
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -5828,6 +5828,92 @@ struct get_esync_apc_fd_reply
</span> struct reply_header __header;
};
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2168,7 +2168,7 @@ index 8bedd7d2bbe..a26d6ce6ef7 100644
</span>
enum request
{
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -6076,6 +6162,11 @@ enum request
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -6123,6 +6209,11 @@ enum request
</span> REQ_esync_msgwait,
REQ_set_keyboard_repeat,
REQ_get_esync_apc_fd,
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2180,7 +2180,7 @@ index 8bedd7d2bbe..a26d6ce6ef7 100644
</span> REQ_NB_REQUESTS
};
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -6375,6 +6466,11 @@ union generic_request
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -6422,6 +6513,11 @@ union generic_request
</span> struct esync_msgwait_request esync_msgwait_request;
struct set_keyboard_repeat_request set_keyboard_repeat_request;
struct get_esync_apc_fd_request get_esync_apc_fd_request;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2192,7 +2192,7 @@ index 8bedd7d2bbe..a26d6ce6ef7 100644
</span> };
union generic_reply
{
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -6672,11 +6768,16 @@ union generic_reply
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -6719,11 +6815,16 @@ union generic_reply
</span> struct esync_msgwait_reply esync_msgwait_reply;
struct set_keyboard_repeat_reply set_keyboard_repeat_reply;
struct get_esync_apc_fd_reply get_esync_apc_fd_reply;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2205,13 +2205,13 @@ index 8bedd7d2bbe..a26d6ce6ef7 100644
</span>
/* ### protocol_version begin ### */
<span style='display:block; white-space:pre;background:#ffe0e0;'>--#define SERVER_PROTOCOL_VERSION 820
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define SERVER_PROTOCOL_VERSION 821
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#define SERVER_PROTOCOL_VERSION 831
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define SERVER_PROTOCOL_VERSION 832
</span>
/* ### protocol_version end ### */
diff --git a/server/Makefile.in b/server/Makefile.in
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index b164193ef20..937f8b14953 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 87103cb2002..85b7b8f6693 100644
</span> --- a/server/Makefile.in
+++ b/server/Makefile.in
@@ -15,6 +15,7 @@ SOURCES = \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2574,7 +2574,7 @@ index c45d0102a56..93e22bbd78a 100644
</span> esync_clear( manager->esync_fd );
}
diff --git a/server/directory.c b/server/directory.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index f2b4b409ef6..4d910998cd3 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 1c44ded4606..962daee2045 100644
</span> --- a/server/directory.c
+++ b/server/directory.c
@@ -70,6 +70,7 @@ static const struct object_ops object_type_ops =
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2884,7 +2884,7 @@ index 828a21c08c6..017c89bf025 100644
</span> no_signal, /* signal */
file_get_fd, /* get_fd */
diff --git a/server/file.h b/server/file.h
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index abad355679f..fed41271832 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 0a81d7c4a3d..2654cb15ed7 100644
</span> --- a/server/file.h
+++ b/server/file.h
@@ -109,6 +109,7 @@ extern void get_nt_name( struct fd *fd, struct unicode_str *name );
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2908,10 +2908,10 @@ index 7fc24d12a34..0d3e1f74655 100644
</span> no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/hook.c b/server/hook.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 260d59fa8d2..b17813c4df6 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index ab4d0e9dd31..0bbdcc5aa88 100644
</span> --- a/server/hook.c
+++ b/server/hook.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -81,6 +81,7 @@ static const struct object_ops hook_table_ops =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -82,6 +82,7 @@ static const struct object_ops hook_table_ops =
</span> NULL, /* remove_queue */
NULL, /* signaled */
NULL, /* get_esync_fd */
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2984,7 +2984,7 @@ index 5062d0999fa..d5a8c05cb86 100644
</span> set_current_time();
init_scheduler();
diff --git a/server/mapping.c b/server/mapping.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 2681475173b..b2c5a2b4196 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index bdb9ee5d840..597416130f1 100644
</span> --- a/server/mapping.c
+++ b/server/mapping.c
@@ -68,6 +68,7 @@ static const struct object_ops ranges_ops =
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4108,7 +4108,7 @@ index a90ec606226..d8d17fa95f7 100644
</span> no_signal, /* signal */
named_pipe_device_file_get_fd, /* get_fd */
diff --git a/server/object.h b/server/object.h
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 6f4bca834d2..3e535d01344 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index a6e9af93664..a59eb135501 100644
</span> --- a/server/object.h
+++ b/server/object.h
@@ -80,6 +80,8 @@ struct object_ops
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4217,10 +4217,10 @@ index bedd8bb4586..24276142a63 100644
</span>
/* process functions */
diff --git a/server/protocol.def b/server/protocol.def
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 44f0751e77a..4f26c6bbad5 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 1e4171c56ef..7ad9129f5d4 100644
</span> --- a/server/protocol.def
+++ b/server/protocol.def
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -3972,3 +3972,57 @@ enum esync_type
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -4022,3 +4022,57 @@ enum esync_type
</span> /* Retrieve the fd to wait on for user APCs. */
@REQ(get_esync_apc_fd)
@END
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4279,7 +4279,7 @@ index 44f0751e77a..4f26c6bbad5 100644
</span> + unsigned int shm_idx;
+@END
diff --git a/server/queue.c b/server/queue.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index a220baa1f92..6c62d9076db 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 109610b3d31..2c1f8053102 100644
</span> --- a/server/queue.c
+++ b/server/queue.c
@@ -45,6 +45,7 @@
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4290,7 +4290,7 @@ index a220baa1f92..6c62d9076db 100644
</span>
#define WM_NCMOUSEFIRST WM_NCMOUSEMOVE
#define WM_NCMOUSELAST (WM_NCMOUSEFIRST+(WM_MOUSELAST-WM_MOUSEFIRST))
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -150,6 +151,8 @@ struct msg_queue
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -139,6 +140,8 @@ struct msg_queue
</span> unsigned int ignore_post_msg; /* ignore post messages newer than this unique id */
int esync_fd; /* esync file descriptor (signalled on message) */
int esync_in_msgwait; /* our thread is currently waiting on us */
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4299,7 +4299,7 @@ index a220baa1f92..6c62d9076db 100644
</span> };
struct hotkey
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -167,6 +170,7 @@ static int msg_queue_add_queue( struct object *obj, struct wait_queue_entry *ent
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -156,6 +159,7 @@ static int msg_queue_add_queue( struct object *obj, struct wait_queue_entry *ent
</span> static void msg_queue_remove_queue( struct object *obj, struct wait_queue_entry *entry );
static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entry );
static int msg_queue_get_esync_fd( struct object *obj, enum esync_type *type );
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4307,7 +4307,7 @@ index a220baa1f92..6c62d9076db 100644
</span> static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry );
static void msg_queue_destroy( struct object *obj );
static void msg_queue_poll_event( struct fd *fd, int event );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -183,6 +187,7 @@ static const struct object_ops msg_queue_ops =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -172,6 +176,7 @@ static const struct object_ops msg_queue_ops =
</span> msg_queue_remove_queue, /* remove_queue */
msg_queue_signaled, /* signaled */
msg_queue_get_esync_fd, /* get_esync_fd */
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4315,7 +4315,7 @@ index a220baa1f92..6c62d9076db 100644
</span> msg_queue_satisfied, /* satisfied */
no_signal, /* signal */
no_get_fd, /* get_fd */
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -221,6 +226,7 @@ static const struct object_ops thread_input_ops =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -210,6 +215,7 @@ static const struct object_ops thread_input_ops =
</span> NULL, /* remove_queue */
NULL, /* signaled */
NULL, /* get_esync_fd */
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4332,7 +4332,7 @@ index a220baa1f92..6c62d9076db 100644
</span> list_init( &queue->send_result );
list_init( &queue->callback_result );
list_init( &queue->pending_timers );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -333,6 +341,9 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -349,6 +357,9 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
</span> if (do_esync())
queue->esync_fd = esync_create_fd( 0, 0 );
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4340,9 +4340,9 @@ index a220baa1f92..6c62d9076db 100644
</span> + queue->msync_idx = msync_alloc_shm( 0, 0 );
+
thread->queue = queue;
<span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (new_input) release_object( new_input );
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -627,6 +638,9 @@ static inline void clear_queue_bits( struct msg_queue *queue, unsigned int bits
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((desktop = get_thread_desktop( thread, 0 )))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -737,6 +748,9 @@ static inline void clear_queue_bits( struct msg_queue *queue, unsigned int bits
</span> queue->keystate_lock = 0;
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4352,7 +4352,7 @@ index a220baa1f92..6c62d9076db 100644
</span> if (do_esync() && !is_signaled( queue ))
esync_clear( queue->esync_fd );
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1118,6 +1132,9 @@ static int is_queue_hung( struct msg_queue *queue )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1228,6 +1242,9 @@ static int is_queue_hung( struct msg_queue *queue )
</span> return 0; /* thread is waiting on queue -> not hung */
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4362,7 +4362,7 @@ index a220baa1f92..6c62d9076db 100644
</span> if (do_esync() && queue->esync_in_msgwait)
return 0; /* thread is waiting on queue in absentia -> not hung */
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1181,6 +1198,13 @@ static int msg_queue_get_esync_fd( struct object *obj, enum esync_type *type )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1292,6 +1309,13 @@ static int msg_queue_get_esync_fd( struct object *obj, enum esync_type *type )
</span> return queue->esync_fd;
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4376,17 +4376,17 @@ index a220baa1f92..6c62d9076db 100644
</span> static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry )
{
struct msg_queue *queue = (struct msg_queue *)obj;
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1226,6 +1250,8 @@ static void msg_queue_destroy( struct object *obj )
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (queue->hooks) release_object( queue->hooks );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1349,6 +1373,8 @@ static void msg_queue_destroy( struct object *obj )
</span> if (queue->fd) release_object( queue->fd );
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (queue->shared) free_shared_object( queue->shared );
</span> if (do_esync()) close( queue->esync_fd );
+ if (do_msync())
+ msync_destroy_semaphore( queue->msync_idx );
}
static void msg_queue_poll_event( struct fd *fd, int event )
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -2905,6 +2931,8 @@ DECL_HANDLER(set_queue_mask)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (req->skip_wait) queue->wake_mask = queue->changed_mask = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -3121,6 +3147,8 @@ DECL_HANDLER(set_queue_mask)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> else wake_up( &queue->obj, 0 );
}
+ if (do_msync() && !is_signaled( queue ))
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4394,9 +4394,9 @@ index a220baa1f92..6c62d9076db 100644
</span>
if (do_esync() && !is_signaled( queue ))
esync_clear( queue->esync_fd );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -2922,6 +2950,9 @@ DECL_HANDLER(get_queue_status)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- reply->changed_bits = queue->changed_bits;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- queue->changed_bits &= ~req->clear_bits;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -3145,6 +3173,9 @@ DECL_HANDLER(get_queue_status)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ SHARED_WRITE_END;
</span>
+ if (do_msync() && !is_signaled( queue ))
+ msync_clear( &queue->obj );
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4404,8 +4404,8 @@ index a220baa1f92..6c62d9076db 100644
</span> if (do_esync() && !is_signaled( queue ))
esync_clear( queue->esync_fd );
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -3179,6 +3210,9 @@ DECL_HANDLER(get_message)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- queue->changed_mask = req->changed_mask;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -3416,6 +3447,9 @@ DECL_HANDLER(get_message)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> set_error( STATUS_PENDING ); /* FIXME */
+ if (do_msync() && !is_signaled( queue ))
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4414,18 +4414,20 @@ index a220baa1f92..6c62d9076db 100644
</span> if (do_esync() && !is_signaled( queue ))
esync_clear( queue->esync_fd );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -3950,6 +3984,21 @@ DECL_HANDLER(esync_msgwait)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -4220,6 +4254,23 @@ DECL_HANDLER(esync_msgwait)
</span> set_fd_events( queue->fd, req->in_msgwait ? POLLIN : 0 );
}
+DECL_HANDLER(msync_msgwait)
+{
+ struct msg_queue *queue = get_current_queue();
<span style='display:block; white-space:pre;background:#e0ffe0;'>++ const queue_shm_t *queue_shm;
</span> +
+ if (!queue) return;
<span style='display:block; white-space:pre;background:#e0ffe0;'>++ queue_shm = queue->shared;
</span> + queue->msync_in_msgwait = req->in_msgwait;
+
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (current->process->idle_event && !(queue->wake_mask & QS_SMRESULT))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (current->process->idle_event && !(queue_shm->wake_mask & QS_SMRESULT))
</span> + set_event( current->process->idle_event );
+
+ /* and start/stop waiting on the driver */
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4461,7 +4463,7 @@ index 8e7d88a0d4c..3287b16170d 100644
</span> no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/request.h b/server/request.h
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 8df304f9a8f..2261a2bbfca 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index a68983ef6dc..32fd61d7903 100644
</span> --- a/server/request.h
+++ b/server/request.h
@@ -411,6 +411,11 @@ DECL_HANDLER(get_esync_fd);
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4488,7 +4490,7 @@ index 8df304f9a8f..2261a2bbfca 100644
</span> };
C_ASSERT( sizeof(abstime_t) == 8 );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -2394,6 +2404,34 @@ C_ASSERT( sizeof(struct set_keyboard_repeat_request) == 24 );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2386,6 +2396,34 @@ C_ASSERT( sizeof(struct set_keyboard_repeat_request) == 24 );
</span> C_ASSERT( FIELD_OFFSET(struct set_keyboard_repeat_reply, enable) == 8 );
C_ASSERT( sizeof(struct set_keyboard_repeat_reply) == 16 );
C_ASSERT( sizeof(struct get_esync_apc_fd_request) == 16 );
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4536,10 +4538,10 @@ index e3889f24601..8d3c325c0b3 100644
</span> semaphore_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/serial.c b/server/serial.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index ecb19936281..3dd44bd7322 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 0d49a996c2a..9c28c78cf28 100644
</span> --- a/server/serial.c
+++ b/server/serial.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -94,6 +94,7 @@ static const struct object_ops serial_ops =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -92,6 +92,7 @@ static const struct object_ops serial_ops =
</span> remove_queue, /* remove_queue */
default_fd_signaled, /* signaled */
NULL, /* get_esync_fd */
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4842,10 +4844,10 @@ index e40ba10f9aa..1101c7224b9 100644
</span> no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/trace.c b/server/trace.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 574a971b24e..42e89eed4a3 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 89e9c0b3aa1..f692e86a878 100644
</span> --- a/server/trace.c
+++ b/server/trace.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -4713,6 +4713,63 @@ static void dump_get_esync_apc_fd_request( const struct get_esync_apc_fd_request
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -4712,6 +4712,63 @@ static void dump_get_esync_apc_fd_request( const struct get_esync_apc_fd_request
</span> {
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4909,7 +4911,7 @@ index 574a971b24e..42e89eed4a3 100644
</span> static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(dump_func)dump_new_process_request,
(dump_func)dump_get_new_process_info_request,
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -5006,6 +5063,11 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -5005,6 +5062,11 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
</span> (dump_func)dump_esync_msgwait_request,
(dump_func)dump_set_keyboard_repeat_request,
(dump_func)dump_get_esync_apc_fd_request,
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4921,7 +4923,7 @@ index 574a971b24e..42e89eed4a3 100644
</span> };
static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -5301,6 +5363,11 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -5300,6 +5362,11 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
</span> NULL,
(dump_func)dump_set_keyboard_repeat_reply,
NULL,
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4933,7 +4935,7 @@ index 574a971b24e..42e89eed4a3 100644
</span> };
static const char * const req_names[REQ_NB_REQUESTS] = {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -5596,6 +5663,11 @@ static const char * const req_names[REQ_NB_REQUESTS] = {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -5595,6 +5662,11 @@ static const char * const req_names[REQ_NB_REQUESTS] = {
</span> "esync_msgwait",
"set_keyboard_repeat",
"get_esync_apc_fd",
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4946,10 +4948,10 @@ index 574a971b24e..42e89eed4a3 100644
</span>
static const struct
diff --git a/server/window.c b/server/window.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index bfde133fe9b..4ab444bbdbe 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 13318b75fe2..85ee8d8f9b2 100644
</span> --- a/server/window.c
+++ b/server/window.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -108,6 +108,7 @@ static const struct object_ops window_ops =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -107,6 +107,7 @@ static const struct object_ops window_ops =
</span> NULL, /* remove_queue */
NULL, /* signaled */
NULL, /* get_esync_fd */
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4958,7 +4960,7 @@ index bfde133fe9b..4ab444bbdbe 100644
</span> no_signal, /* signal */
no_get_fd, /* get_fd */
diff --git a/server/winstation.c b/server/winstation.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index d3d4995949d..fd60a44953c 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 5cd235c528e..c1dfbc85272 100644
</span> --- a/server/winstation.c
+++ b/server/winstation.c
@@ -77,6 +77,7 @@ static const struct object_ops winstation_ops =
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/emulators/wine-devel/files/macos_hacks.diff b/emulators/wine-devel/files/macos_hacks.diff
</span><span style='display:block; white-space:pre;color:#808080;'>index 779423e5bdb..ff67ced71a4 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/emulators/wine-devel/files/macos_hacks.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/emulators/wine-devel/files/macos_hacks.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -79,7 +79,7 @@ index 2d08481cd35..9972781a183 100644
</span>
if (flags & (IDLE_PRIORITY_CLASS | HIGH_PRIORITY_CLASS | REALTIME_PRIORITY_CLASS |
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 5c59d102dd9..08df8328080 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index bad1492e138..a1bf38216fd 100644
</span> --- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -2712,6 +2712,331 @@ static WINE_MODREF *find_existing_module( HMODULE module )
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -414,7 +414,7 @@ index 5c59d102dd9..08df8328080 100644
</span>
/******************************************************************************
* load_native_dll (internal)
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -3293,6 +3618,10 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, DWORD fl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -3285,6 +3610,10 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, DWORD fl
</span>
case STATUS_SUCCESS: /* valid PE file */
nts = load_native_dll( load_path, &nt_name, mapping, &image_info, &id, flags, system, pwm );
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -425,7 +425,7 @@ index 5c59d102dd9..08df8328080 100644
</span> break;
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -4282,6 +4611,18 @@ static void release_address_space(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -4309,6 +4638,18 @@ static void release_address_space(void)
</span> #endif
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -444,10 +444,11 @@ index 5c59d102dd9..08df8328080 100644
</span> /******************************************************************
* loader_init
*
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -4357,6 +4698,24 @@ void loader_init( CONTEXT *context, void **entry )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -4388,6 +4729,25 @@ void loader_init( CONTEXT *context, void **entry )
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- else wm = get_modref( NtCurrentTeb()->Peb->ImageBaseAddress );
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span> +#ifdef __x86_64__
+ if (is_macos() && !NtCurrentTeb()->WowTebOffset)
+ {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -467,7 +468,7 @@ index 5c59d102dd9..08df8328080 100644
</span> +#endif
+
#ifdef _WIN64
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if (NtCurrentTeb()->WowTebOffset) init_wow64( context );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (NtCurrentTeb()->WowTebOffset) init_wow64( context );
</span> #endif
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
index 19fbfb2b68c..0411738ff19 100644
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -796,7 +797,7 @@ index 3d151e7b2b8..03d1516fc03 100644
</span> }
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index 3981905bcd3..e7e766582ce 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 0d88315164a..0a19f1aed7b 100644
</span> --- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -62,6 +62,7 @@
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -868,7 +869,7 @@ index 3981905bcd3..e7e766582ce 100644
</span> return STATUS_SUCCESS;
switch (errno)
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -3904,7 +3941,7 @@ void virtual_map_user_shared_data(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -3911,7 +3948,7 @@ void virtual_map_user_shared_data(void)
</span> exit(1);
}
if ((res = server_get_unix_fd( section, 0, &fd, &needs_close, NULL, NULL )) ||
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -877,7 +878,7 @@ index 3981905bcd3..e7e766582ce 100644
</span> {
ERR( "failed to remap the process USD: %d\n", res );
exit(1);
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -5924,6 +5961,56 @@ NTSTATUS WINAPI NtReadVirtualMemory( HANDLE process, const void *addr, void *buf
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -6045,6 +6082,56 @@ NTSTATUS WINAPI NtReadVirtualMemory( HANDLE process, const void *addr, void *buf
</span> return status;
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -934,7 +935,7 @@ index 3981905bcd3..e7e766582ce 100644
</span>
/***********************************************************************
* NtWriteVirtualMemory (NTDLL.@)
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -5944,6 +6031,10 @@ NTSTATUS WINAPI NtWriteVirtualMemory( HANDLE process, void *addr, const void *bu
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -6065,6 +6152,10 @@ NTSTATUS WINAPI NtWriteVirtualMemory( HANDLE process, void *addr, const void *bu
</span> if ((status = wine_server_call( req ))) size = 0;
}
SERVER_END_REQ;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -946,13 +947,20 @@ index 3981905bcd3..e7e766582ce 100644
</span> else
{
diff --git a/dlls/wow64cpu/cpu.c b/dlls/wow64cpu/cpu.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-index c574315ec7d..a13df489733 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 6c6b2352bb6..2edac50a51c 100644
</span> --- a/dlls/wow64cpu/cpu.c
+++ b/dlls/wow64cpu/cpu.c
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -39,6 +39,15 @@ struct thunk_32to64
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- DWORD op;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -40,10 +40,35 @@ struct thunk_32to64
</span> DWORD addr;
WORD cs;
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++struct thunk_32to64_rosetta2_workaround
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ BYTE lcall; /* call far, absolute indirect */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ BYTE modrm; /* address=disp32, opcode=3 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ DWORD op;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ DWORD addr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ WORD cs;
</span> +
+ BYTE add;
+ BYTE add_modrm;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -962,38 +970,80 @@ index c574315ec7d..a13df489733 100644
</span> + BYTE jmp_modrm;
+ DWORD jmp_op;
+ ULONG64 jmp_addr;
<span style='display:block; white-space:pre;background:#ffe0e0;'>- };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++};
</span> struct thunk_opcodes
{
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -211,7 +220,18 @@ __ASM_GLOBAL_FUNC( syscall_32to64,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- struct thunk_32to64 syscall_thunk;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- struct thunk_32to64 unix_thunk;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ union
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct thunk_32to64 syscall_thunk;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct thunk_32to64_rosetta2_workaround syscall_thunk_rosetta;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ union
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct thunk_32to64 unix_thunk;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ struct thunk_32to64_rosetta2_workaround unix_thunk_rosetta;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "poppack.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -55,6 +80,19 @@ static USHORT fs32_sel;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void **__wine_unix_call_dispatcher = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++BOOL use_rosetta2_workaround;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static BOOL is_rosetta2(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ char buffer[64];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ NTSTATUS status = NtQuerySystemInformation( SystemProcessorBrandString, buffer, sizeof(buffer), NULL );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (status || !strstr( buffer, "VirtualApple" ))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return FALSE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return TRUE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (reason == DLL_PROCESS_ATTACH) LdrDisableThreadCalloutsForDll( inst );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -206,7 +244,21 @@ __ASM_GLOBAL_FUNC( syscall_32to64,
</span> "movl %edx,4(%rsp)\n\t"
"movl 0xc4(%r13),%r14d\n\t" /* context->Esp */
"xchgq %r14,%rsp\n\t"
- "ljmp *(%r14)\n"
+
+ /* CW HACK 20760:
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Use lretq rather than ljmp to work around a Rosetta SIGUSR1 race condition.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * When running under Rosetta 2, use lretq instead of ljmp to work around a SIGUSR1 race condition.
</span> + */
<span style='display:block; white-space:pre;background:#e0ffe0;'>++ "cmpl $0, " __ASM_NAME("use_rosetta2_workaround") "\n\t"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "jne syscall_32to64_rosetta2_workaround\n\t"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "ljmp *(%r14)\n\t"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "syscall_32to64_rosetta2_workaround:\n\t"
</span> + "subq $0x10,%rsp\n\t"
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "movl 4(%r14),%ebx\n\t"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "movq %rbx,0x8(%rsp)\n\t"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "movl 0(%r14),%ebx\n\t"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "movq %rbx,(%rsp)\n\t"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ "movl 0xa4(%r13),%ebx\n\t" /* context->Ebx */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "movl 4(%r14),%edx\n\t"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "movq %rdx,0x8(%rsp)\n\t"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "movl 0(%r14),%edx\n\t"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "movq %rdx,(%rsp)\n\t"
</span> + "lretq\n"
+
".Lsyscall_32to64_return:\n\t"
"movq %rsp,%r14\n\t"
"movl 0xa8(%r13),%edx\n\t" /* context->Edx */
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -268,7 +288,16 @@ __ASM_GLOBAL_FUNC( unix_call_32to64,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -263,7 +315,20 @@ __ASM_GLOBAL_FUNC( unix_call_32to64,
</span> "movl %edx,4(%rsp)\n\t"
"movl 0xc4(%r13),%r14d\n\t" /* context->Esp */
"xchgq %r14,%rsp\n\t"
- "ljmp *(%r14)" )
+
+ /* CW HACK 20760:
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Use lretq rather than ljmp to work around a Rosetta SIGUSR1 race condition.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * When running under Rosetta 2, use lretq instead of ljmp to work around a SIGUSR1 race condition.
</span> + */
<span style='display:block; white-space:pre;background:#e0ffe0;'>++ "cmpl $0, " __ASM_NAME("use_rosetta2_workaround") "\n\t"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "jne unix_call_32to64_rosetta2_workaround\n\t"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "ljmp *(%r14)\n\t"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "unix_call_32to64_rosetta2_workaround:\n\t"
</span> + "subq $0x10,%rsp\n\t"
+ "movl 4(%r14),%edx\n\t"
+ "movq %rdx,0x8(%rsp)\n\t"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1003,63 +1053,142 @@ index c574315ec7d..a13df489733 100644
</span>
/**********************************************************************
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -322,22 +351,53 @@ NTSTATUS WINAPI BTCpuProcessInit(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -309,6 +374,8 @@ NTSTATUS WINAPI BTCpuProcessInit(void)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ wow64info->CpuFlags |= WOW64_CPUFLAGS_MSFT64;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ use_rosetta2_workaround = is_rosetta2();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ LdrGetDllHandle( NULL, 0, &str, &module );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ p__wine_unix_call_dispatcher = RtlFindExportedRoutineByName( module, "__wine_unix_call_dispatcher" );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ __wine_unix_call_dispatcher = *p__wine_unix_call_dispatcher;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -318,17 +385,65 @@ NTSTATUS WINAPI BTCpuProcessInit(void)
</span> ds64_sel = context.SegDs;
fs32_sel = context.SegFs;
- thunk->syscall_thunk.ljmp = 0xff;
- thunk->syscall_thunk.modrm = 0x2d;
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* CW HACK 20760:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Use lcall rather than ljmp to work around a Rosetta SIGUSR1 race condition.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->syscall_thunk.ljmp = 0xff; /* call far, absolute indirect */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->syscall_thunk.modrm = 0x1d; /* address=disp32, opcode=3 */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- thunk->syscall_thunk.op = PtrToUlong( &thunk->syscall_thunk.addr );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- thunk->syscall_thunk.op = PtrToUlong( &thunk->syscall_thunk.addr );
</span> - thunk->syscall_thunk.addr = PtrToUlong( syscall_32to64 );
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->syscall_thunk.addr = PtrToUlong( &thunk->syscall_thunk.add );
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- thunk->syscall_thunk.cs = cs64_sel;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* We are now in 64-bit. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* add $0x08,%esp to remove the addr/segment pushed on the stack by the lcall */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->syscall_thunk.add = 0x83;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->syscall_thunk.add_modrm = 0xc4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->syscall_thunk.add_op = 0x08;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* jmp to syscall_32to64 */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->syscall_thunk.jmp = 0xff;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->syscall_thunk.jmp_modrm = 0x25;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->syscall_thunk.jmp_op = 0x00;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->syscall_thunk.jmp_addr = PtrToUlong( syscall_32to64 );
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- thunk->syscall_thunk.cs = cs64_sel;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- thunk->unix_thunk.ljmp = 0xff;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- thunk->unix_thunk.modrm = 0x2d;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- thunk->unix_thunk.op = PtrToUlong( &thunk->unix_thunk.addr );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- thunk->unix_thunk.addr = PtrToUlong( unix_call_32to64 );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- thunk->unix_thunk.cs = cs64_sel;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* CW HACK 20760 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (use_rosetta2_workaround)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->syscall_thunk_rosetta.lcall = 0xff;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->syscall_thunk_rosetta.modrm = 0x1d;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->syscall_thunk_rosetta.op = PtrToUlong( &thunk->syscall_thunk_rosetta.addr );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->syscall_thunk_rosetta.addr = PtrToUlong( &thunk->syscall_thunk_rosetta.add );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->syscall_thunk_rosetta.cs = cs64_sel;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* We are now in 64-bit. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* add $0x08,%esp to remove the addr/segment pushed on the stack by the lcall */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->syscall_thunk_rosetta.add = 0x83;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->syscall_thunk_rosetta.add_modrm = 0xc4;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->syscall_thunk_rosetta.add_op = 0x08;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* jmp to syscall_32to64 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->syscall_thunk_rosetta.jmp = 0xff;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->syscall_thunk_rosetta.jmp_modrm = 0x25;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->syscall_thunk_rosetta.jmp_op = 0x00;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->syscall_thunk_rosetta.jmp_addr = PtrToUlong( syscall_32to64 );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->syscall_thunk.ljmp = 0xff;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->syscall_thunk.modrm = 0x2d;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->syscall_thunk.op = PtrToUlong( &thunk->syscall_thunk.addr );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->syscall_thunk.addr = PtrToUlong( syscall_32to64 );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->syscall_thunk.cs = cs64_sel;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span> +
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* CW HACK 20760:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ * Use lcall rather than ljmp to work around a Rosetta SIGUSR1 race condition.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- thunk->unix_thunk.pushl = 0x68;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- thunk->unix_thunk.dispatcher_high = (ULONG_PTR)*p__wine_unix_call_dispatcher >> 32;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- thunk->unix_thunk.pushl2 = 0x68;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- thunk->unix_thunk.dispatcher_low = (ULONG_PTR)*p__wine_unix_call_dispatcher;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- thunk->unix_thunk.t.ljmp = 0xff;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- thunk->unix_thunk.t.modrm = 0x2d;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->unix_thunk.t.ljmp = 0xff; /* call far, absolute indirect */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->unix_thunk.t.modrm = 0x1d; /* address=disp32, opcode=3 */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- thunk->unix_thunk.t.op = PtrToUlong( &thunk->unix_thunk.t.addr );
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- thunk->unix_thunk.t.addr = PtrToUlong( unix_call_32to64 );
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->unix_thunk.t.addr = PtrToUlong( &thunk->unix_thunk.t.add );
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- thunk->unix_thunk.t.cs = cs64_sel;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* CW HACK 20760 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (use_rosetta2_workaround)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->unix_thunk_rosetta.lcall = 0xff;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->unix_thunk_rosetta.modrm = 0x1d;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->unix_thunk_rosetta.op = PtrToUlong( &thunk->unix_thunk_rosetta.addr );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->unix_thunk_rosetta.addr = PtrToUlong( &thunk->unix_thunk_rosetta.add );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->unix_thunk_rosetta.cs = cs64_sel;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* We are now in 64-bit. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* add $0x08,%esp to remove the addr/segment pushed on the stack by the lcall */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->unix_thunk_rosetta.add = 0x83;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->unix_thunk_rosetta.add_modrm = 0xc4;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->unix_thunk_rosetta.add_op = 0x08;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* jmp to unix_call_32to64 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->unix_thunk_rosetta.jmp = 0xff;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->unix_thunk_rosetta.jmp_modrm = 0x25;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->unix_thunk_rosetta.jmp_op = 0x00;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->unix_thunk_rosetta.jmp_addr = PtrToUlong( unix_call_32to64 );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->unix_thunk.ljmp = 0xff;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->unix_thunk.modrm = 0x2d;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->unix_thunk.op = PtrToUlong( &thunk->unix_thunk.addr );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->unix_thunk.addr = PtrToUlong( unix_call_32to64 );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ thunk->unix_thunk.cs = cs64_sel;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* We are now in 64-bit. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* add $0x08,%esp to remove the addr/segment pushed on the stack by the lcall */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->unix_thunk.t.add = 0x83;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->unix_thunk.t.add_modrm = 0xc4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->unix_thunk.t.add_op = 0x08;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* jmp to unix_call_32to64 */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->unix_thunk.t.jmp = 0xff;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->unix_thunk.t.jmp_modrm = 0x25;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->unix_thunk.t.jmp_op = 0x00;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ thunk->unix_thunk.t.jmp_addr = PtrToUlong( unix_call_32to64 );
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span> NtProtectVirtualMemory( GetCurrentProcess(), (void **)&thunk, &size, PAGE_EXECUTE_READ, &old_prot );
return STATUS_SUCCESS;
<span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/server/mach.c b/server/mach.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 86ff7eac382..c659857884f 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- a/server/mach.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ b/server/mach.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -48,6 +48,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <mach/thread_act.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <mach/mach_vm.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <servers/bootstrap.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <sys/sysctl.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static mach_port_t server_mach_port;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -172,6 +173,26 @@ void init_thread_context( struct thread *thread )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span> }
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* CX HACK 21217 */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static int is_apple_silicon( void )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ static int apple_silicon_status, did_check = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!did_check)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* returns 0 for native process or on error, 1 for translated */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ret = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ size_t size = sizeof(ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (sysctlbyname( "sysctl.proc_translated", &ret, &size, NULL, 0 ) == -1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ apple_silicon_status = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ apple_silicon_status = ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ did_check = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return apple_silicon_status;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* retrieve the thread x86 registers */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ void get_thread_context( struct thread *thread, context_t *context, unsigned int flags )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -251,6 +272,13 @@ void get_thread_context( struct thread *thread, context_t *context, unsigned int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ context->flags |= SERVER_CTX_DEBUG_REGISTERS;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if (is_apple_silicon())
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* CX HACK 21217: Fake debug registers on Apple Silicon */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fprintf( stderr, "%04x: thread_get_state failed on Apple Silicon - faking zero debug registers\n", thread->id );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ memset( &context->debug, 0, sizeof(context->debug) );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ context->flags |= SERVER_CTX_DEBUG_REGISTERS;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ mach_set_error( ret );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ done:
</span></pre><pre style='margin:0'>
</pre>