Making an MFC application Mac OS X aware

Ken Thomases ken at codeweavers.com
Mon Sep 24 13:23:47 CDT 2018


On Sep 24, 2018, at 10:52 AM, mrt303xx at aol.com wrote:
> 
> Is there any way to call functions in WINE to help an application act more natively on the Mac OS?

Do you mean you want to check if you're running on macOS and, if so, your own code will do things differently?  Or do you mean you want Wine to automatically behave more like a native Mac app?

For the former, Wine's ntdll exports a function, wine_get_host_version, which you can use to detect the host OS.  Use GetProcAddress() to obtain the function pointer.  The pointed-to function has the following signature:

void CDECL wine_get_host_version( const char **sysname, const char **release );

It is safe to pass NULL for either or both parameters.

The function is a wrapper around the uname() system function.  On macOS, if you provide sysname, it will store a pointer to the string "Darwin" to *sysname.


If you were asking about the latter, then Wine is already trying to behave as much like a native Mac app as it can while still being compatible with Windows apps.  What behavior are you looking to change?

-Ken




More information about the wine-devel mailing list