From 8e8bd5e9018aee51f75b86312a00387715622491 Mon Sep 17 00:00:00 2001 From: Josh <36625023+JoshuaBrest@users.noreply.github.com> Date: Mon, 24 Jun 2024 22:17:25 -0400 Subject: [PATCH 1/3] Deprecated function stopped working in 32-bit --- dlls/winemac.drv/cocoa_app.m | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m index b58318cebd4b..61136e4cf525 100644 --- a/dlls/winemac.drv/cocoa_app.m +++ b/dlls/winemac.drv/cocoa_app.m @@ -391,6 +391,7 @@ - (void) transformProcessToForeground:(BOOL)activateIfTransformed /* Whisky hack #9 */ // Set application name NSString* appName = [NSString stringWithFormat:kAppNameText, self.applicationName]; + NSLog(@"Setting process name to %@", appName); bool success = [self setProcessName:appName]; if (!success) NSLog(@"Failed to set process name to %@", appName); @@ -905,7 +906,6 @@ typedef OSStatus (*LSSetApplicationInformationItemType)( NSLog(@"setProcessName: Failed to get _LSSetApplicationInformationItem in LaunchServices"); return false; } - // Get the display name key const CFStringRef* displayNameKey = (const CFStringRef*)( CFBundleGetDataPointerForName(launchServicesBundle, CFSTR("_kLSDisplayNameKey")) @@ -915,10 +915,8 @@ typedef OSStatus (*LSSetApplicationInformationItemType)( NSLog(@"setProcessName: Failed to get _kLSDisplayNameKey in LaunchServices"); return false; } - // Force symbols to be loaded in the LaunchServices framework - ProcessSerialNumber psn = {0, kCurrentProcess}; - GetCurrentProcess(&psn); + ColorSyncCMMGetTypeID(); } // If any of the function pointers are NULL, we can't continue From 9cca249ed30e772319e5115542eeb311da1fd075 Mon Sep 17 00:00:00 2001 From: Josh <36625023+JoshuaBrest@users.noreply.github.com> Date: Mon, 24 Jun 2024 22:18:30 -0400 Subject: [PATCH 2/3] Formatting --- dlls/winemac.drv/cocoa_app.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m index 61136e4cf525..a726e0d44ac8 100644 --- a/dlls/winemac.drv/cocoa_app.m +++ b/dlls/winemac.drv/cocoa_app.m @@ -906,6 +906,7 @@ typedef OSStatus (*LSSetApplicationInformationItemType)( NSLog(@"setProcessName: Failed to get _LSSetApplicationInformationItem in LaunchServices"); return false; } + // Get the display name key const CFStringRef* displayNameKey = (const CFStringRef*)( CFBundleGetDataPointerForName(launchServicesBundle, CFSTR("_kLSDisplayNameKey")) @@ -915,6 +916,7 @@ typedef OSStatus (*LSSetApplicationInformationItemType)( NSLog(@"setProcessName: Failed to get _kLSDisplayNameKey in LaunchServices"); return false; } + // Force symbols to be loaded in the LaunchServices framework ColorSyncCMMGetTypeID(); } From 257d4754b9b3b75d38b19092c9d60cfab596f6ab Mon Sep 17 00:00:00 2001 From: Josh <36625023+JoshuaBrest@users.noreply.github.com> Date: Tue, 23 Jul 2024 09:31:18 -0400 Subject: [PATCH 3/3] Fix: Double free causes crash. --- dlls/winemac.drv/cocoa_app.m | 1 - 1 file changed, 1 deletion(-) diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m index a726e0d44ac8..e9a0ada6270d 100644 --- a/dlls/winemac.drv/cocoa_app.m +++ b/dlls/winemac.drv/cocoa_app.m @@ -395,7 +395,6 @@ - (void) transformProcessToForeground:(BOOL)activateIfTransformed bool success = [self setProcessName:appName]; if (!success) NSLog(@"Failed to set process name to %@", appName); - [appName release]; } }