mirror of
https://github.com/reactos/wine.git
synced 2025-02-12 15:38:29 +00:00
winemac: Fail gracefully and early when run from a non-GUI session.
This commit is contained in:
parent
7b21da56ec
commit
c76f0beeab
@ -1,6 +1,6 @@
|
||||
MODULE = winemac.drv
|
||||
IMPORTS = user32 gdi32 advapi32
|
||||
EXTRALIBS = -framework AppKit -framework Carbon
|
||||
EXTRALIBS = -framework AppKit -framework Carbon -framework Security
|
||||
|
||||
C_SRCS = \
|
||||
display.c \
|
||||
|
@ -21,6 +21,8 @@
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#include <Security/AuthSession.h>
|
||||
|
||||
#include "macdrv.h"
|
||||
#include "wine/server.h"
|
||||
|
||||
@ -69,8 +71,15 @@ const char* debugstr_cf(CFTypeRef t)
|
||||
*/
|
||||
static BOOL process_attach(void)
|
||||
{
|
||||
SessionAttributeBits attributes;
|
||||
OSStatus status;
|
||||
|
||||
assert(NUM_EVENT_TYPES <= sizeof(macdrv_event_mask) * 8);
|
||||
|
||||
status = SessionGetInfo(callerSecuritySession, NULL, &attributes);
|
||||
if (status != noErr || !(attributes & sessionHasGraphicAccess))
|
||||
return FALSE;
|
||||
|
||||
if ((thread_data_tls_index = TlsAlloc()) == TLS_OUT_OF_INDEXES) return FALSE;
|
||||
|
||||
macdrv_err_on = ERR_ON(macdrv);
|
||||
|
Loading…
x
Reference in New Issue
Block a user