forked from Mirrors/wine-wine
winemac: Fail gracefully and early when run from a non-GUI session.
parent
7b21da56ec
commit
c76f0beeab
|
@ -1,6 +1,6 @@
|
||||||
MODULE = winemac.drv
|
MODULE = winemac.drv
|
||||||
IMPORTS = user32 gdi32 advapi32
|
IMPORTS = user32 gdi32 advapi32
|
||||||
EXTRALIBS = -framework AppKit -framework Carbon
|
EXTRALIBS = -framework AppKit -framework Carbon -framework Security
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
display.c \
|
display.c \
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
*/
|
*/
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <Security/AuthSession.h>
|
||||||
|
|
||||||
#include "macdrv.h"
|
#include "macdrv.h"
|
||||||
#include "wine/server.h"
|
#include "wine/server.h"
|
||||||
|
|
||||||
|
@ -69,8 +71,15 @@ const char* debugstr_cf(CFTypeRef t)
|
||||||
*/
|
*/
|
||||||
static BOOL process_attach(void)
|
static BOOL process_attach(void)
|
||||||
{
|
{
|
||||||
|
SessionAttributeBits attributes;
|
||||||
|
OSStatus status;
|
||||||
|
|
||||||
assert(NUM_EVENT_TYPES <= sizeof(macdrv_event_mask) * 8);
|
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;
|
if ((thread_data_tls_index = TlsAlloc()) == TLS_OUT_OF_INDEXES) return FALSE;
|
||||||
|
|
||||||
macdrv_err_on = ERR_ON(macdrv);
|
macdrv_err_on = ERR_ON(macdrv);
|
||||||
|
|
Loading…
Reference in New Issue