From: Brendan Shanks bshanks@codeweavers.com
--- dlls/ntdll/loader.c | 20 ++++++++++++++++++++ dlls/ntdll/ntdll.spec | 1 + 2 files changed, 21 insertions(+)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index c5c34935efd..d25696e5ad9 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -3405,6 +3405,26 @@ NTSTATUS WINAPI __wine_unix_spawnvp( char * const argv[], int wait ) }
+/*********************************************************************** + * __wine_mac_run_cfrunloop + */ +NTSTATUS WINAPI __wine_mac_run_cfrunloop(void) +{ + static const WCHAR nameW[] = L"wine_mac_main_thread"; + THREAD_NAME_INFORMATION info; + NTSTATUS status; + + info.ThreadName.Length = info.ThreadName.MaximumLength = lstrlenW( nameW ) * sizeof(WCHAR); + info.ThreadName.Buffer = (WCHAR *)nameW; + NtSetInformationThread( GetCurrentThread(), ThreadNameInformation, &info, sizeof(info) ); + + status = WINE_UNIX_CALL( unix_mac_run_cfrunloop, NULL ); /* Should never return, except on error. */ + + ERR("macOS main thread crashed with status %lx, exiting\n", status); + for (;;) NtTerminateProcess( GetCurrentProcess(), status ); +} + + /*********************************************************************** * wine_server_call */ diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 46cd1dccab5..38aa69de45b 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -1749,6 +1749,7 @@ # Unix interface @ stdcall __wine_unix_spawnvp(long ptr) @ stdcall __wine_ctrl_routine(ptr) +@ stdcall __wine_mac_run_cfrunloop() @ extern -private __wine_syscall_dispatcher @ extern -private __wine_unix_call_dispatcher @ extern -private -arch=arm64ec __wine_unix_call_dispatcher_arm64ec