Commit f1549e7f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winemac: Move driver implementation to unixlib.

parent 22342300
EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = winemac.drv
UNIXLIB = winemac.so
IMPORTS = uuid rpcrt4 user32 gdi32 win32u
DELAYIMPORTS = ole32 shell32 imm32
EXTRALIBS = -framework AppKit -framework Carbon -framework Security -framework OpenGL -framework IOKit -framework CoreVideo -framework QuartzCore $(METAL_LIBS)
EXTRALIBS = -lwin32u -framework AppKit -framework Carbon -framework Security -framework OpenGL -framework IOKit -framework CoreVideo -framework QuartzCore $(METAL_LIBS)
EXTRADLLFLAGS = -mcygwin
......
......@@ -22,6 +22,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include "ntstatus.h"
......
......@@ -19,6 +19,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include "macdrv.h"
......@@ -992,7 +996,7 @@ better:
}
else if (flags & (CDS_TEST | CDS_NORESET))
ret = DISP_CHANGE_SUCCESSFUL;
else if (lstrcmpiW(primary_adapter, devname))
else if (wcsicmp(primary_adapter, devname))
{
FIXME("Changing non-primary adapter settings is currently unsupported.\n");
ret = DISP_CHANGE_SUCCESSFUL;
......
......@@ -28,6 +28,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(macdrv);
HMODULE macdrv_module = 0;
static unixlib_handle_t macdrv_handle;
NTSTATUS (CDECL *macdrv_unix_call)(enum macdrv_funcs code, void *params);
struct quit_info {
HWND *wins;
......@@ -405,15 +407,21 @@ static BOOL process_attach(void)
{ .id = 0 }
};
if (NtQueryVirtualMemory(GetCurrentProcess(), macdrv_module, MemoryWineUnixFuncs,
&macdrv_handle, sizeof(macdrv_handle), NULL))
return FALSE;
for (str = strings; str->id; str++)
str->len = LoadStringW(macdrv_module, str->id, (WCHAR *)&str->str, 0);
params.strings = strings;
if (MACDRV_CALL(init, &params)) return FALSE;
params.pNtWaitForMultipleObjects = NtWaitForMultipleObjects;
if (__wine_unix_call(macdrv_handle, unix_init, &params)) return FALSE;
callback_table = NtCurrentTeb()->Peb->KernelCallbackTable;
memcpy( callback_table + NtUserDriverCallbackFirst, kernel_callbacks, sizeof(kernel_callbacks) );
macdrv_unix_call = params.unix_call;
return TRUE;
}
......
......@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include "macdrv.h"
......@@ -521,8 +525,8 @@ NTSTATUS macdrv_MsgWaitForMultipleObjectsEx(DWORD count, const HANDLE *handles,
if (!data)
{
if (!count && timeout && !timeout->QuadPart) return WAIT_TIMEOUT;
return NtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL),
!!(flags & MWMO_ALERTABLE), timeout );
return pNtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL),
!!(flags & MWMO_ALERTABLE), timeout );
}
if (data->current_event && data->current_event->type != QUERY_EVENT &&
......@@ -534,8 +538,8 @@ NTSTATUS macdrv_MsgWaitForMultipleObjectsEx(DWORD count, const HANDLE *handles,
if (process_events(data->queue, event_mask)) ret = count - 1;
else if (count || !timeout || timeout->QuadPart)
{
ret = NtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL),
!!(flags & MWMO_ALERTABLE), timeout );
ret = pNtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL),
!!(flags & MWMO_ALERTABLE), timeout );
if (ret == count - 1) process_events(data->queue, event_mask);
}
else ret = WAIT_TIMEOUT;
......
......@@ -19,6 +19,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include "macdrv.h"
......
......@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include "macdrv.h"
......
......@@ -24,6 +24,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include "macdrv.h"
......
......@@ -43,6 +43,8 @@ extern BOOL allow_software_rendering DECLSPEC_HIDDEN;
extern BOOL disable_window_decorations DECLSPEC_HIDDEN;
extern HMODULE macdrv_module DECLSPEC_HIDDEN;
extern NTSTATUS (WINAPI *pNtWaitForMultipleObjects)(ULONG,const HANDLE*,BOOLEAN,
BOOLEAN,const LARGE_INTEGER*) DECLSPEC_HIDDEN;
extern const char* debugstr_cf(CFTypeRef t) DECLSPEC_HIDDEN;
......@@ -273,7 +275,6 @@ extern void macdrv_status_item_mouse_move(const macdrv_event *event) DECLSPEC_HI
extern void check_retina_status(void) DECLSPEC_HIDDEN;
extern void macdrv_init_display_devices(BOOL force) DECLSPEC_HIDDEN;
extern void init_user_driver(void) DECLSPEC_HIDDEN;
extern NTSTATUS macdrv_init(void *arg) DECLSPEC_HIDDEN;
/**************************************************************************
* Mac IME driver
......@@ -372,10 +373,4 @@ static inline UINT asciiz_to_unicode(WCHAR *dst, const char *src)
return (p - dst) * sizeof(WCHAR);
}
/* FIXME: remove once we use unixlib */
#define wcsicmp strcmpiW
#define wcsnicmp strncmpiW
#define wcsrchr strrchrW
#define wcstol strtolW
#endif /* __WINE_MACDRV_H */
......@@ -19,6 +19,11 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include <Security/AuthSession.h>
......@@ -67,6 +72,8 @@ int enable_app_nap = FALSE;
CFDictionaryRef localized_strings;
NTSTATUS (WINAPI *pNtWaitForMultipleObjects)(ULONG,const HANDLE*,BOOLEAN,
BOOLEAN,const LARGE_INTEGER*);
/**************************************************************************
* debugstr_cf
......@@ -313,9 +320,9 @@ static void setup_options(void)
{
static const WCHAR noneW[] = {'n','o','n','e',0};
static const WCHAR allW[] = {'a','l','l',0};
if (!lstrcmpW(buffer, noneW))
if (!wcscmp(buffer, noneW))
topmost_float_inactive = TOPMOST_FLOAT_INACTIVE_NONE;
else if (!lstrcmpW(buffer, allW))
else if (!wcscmp(buffer, allW))
topmost_float_inactive = TOPMOST_FLOAT_INACTIVE_ALL;
else
topmost_float_inactive = TOPMOST_FLOAT_INACTIVE_NONFULLSCREEN;
......@@ -371,9 +378,9 @@ static void setup_options(void)
{
static const WCHAR transparentW[] = {'t','r','a','n','s','p','a','r','e','n','t',0};
static const WCHAR behindW[] = {'b','e','h','i','n','d',0};
if (!lstrcmpW(buffer, transparentW))
if (!wcscmp(buffer, transparentW))
gl_surface_mode = GL_SURFACE_IN_FRONT_TRANSPARENT;
else if (!lstrcmpW(buffer, behindW))
else if (!wcscmp(buffer, behindW))
gl_surface_mode = GL_SURFACE_BEHIND;
else
gl_surface_mode = GL_SURFACE_IN_FRONT_OPAQUE;
......@@ -427,10 +434,13 @@ static void load_strings(struct localized_string *str)
}
static NTSTATUS CDECL unix_call( enum macdrv_funcs code, void *params );
/***********************************************************************
* macdrv_init
*/
NTSTATUS macdrv_init(void *arg)
static NTSTATUS macdrv_init(void *arg)
{
struct init_params *params = arg;
SessionAttributeBits attributes;
......@@ -454,6 +464,8 @@ NTSTATUS macdrv_init(void *arg)
init_user_driver();
macdrv_init_display_devices(FALSE);
pNtWaitForMultipleObjects = params->pNtWaitForMultipleObjects;
params->unix_call = unix_call;
return STATUS_SUCCESS;
}
......@@ -609,9 +621,9 @@ BOOL macdrv_SystemParametersInfo( UINT action, UINT int_param, void *ptr_param,
NTSTATUS macdrv_client_func(enum macdrv_client_funcs id, const void *params, ULONG size)
{
/* FIXME: use KeUserModeCallback instead */
NTSTATUS (WINAPI *func)(const void *, ULONG) = ((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[id];
return func(params, size);
void *ret_ptr;
ULONG ret_len;
return KeUserModeCallback(id, params, size, &ret_ptr, &ret_len);
}
......@@ -655,7 +667,7 @@ C_ASSERT( ARRAYSIZE(__wine_unix_call_funcs) == unix_funcs_count );
/* FIXME: Use __wine_unix_call instead */
NTSTATUS unix_call(enum macdrv_funcs code, void *params)
static NTSTATUS CDECL unix_call(enum macdrv_funcs code, void *params)
{
return __wine_unix_call_funcs[code]( params );
}
......@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#define OEMRESOURCE
......
......@@ -19,6 +19,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include "macdrv.h"
......
......@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include "macdrv.h"
......
......@@ -21,6 +21,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include "macdrv.h"
......
......@@ -36,8 +36,8 @@ enum macdrv_funcs
};
/* FIXME: Use __wine_unix_call when the rest of the stack is ready */
extern NTSTATUS unix_call(enum macdrv_funcs code, void *params) DECLSPEC_HIDDEN;
#define MACDRV_CALL(func, params) unix_call( unix_ ## func, params )
extern NTSTATUS (CDECL *macdrv_unix_call)(enum macdrv_funcs code, void *params) DECLSPEC_HIDDEN;
#define MACDRV_CALL(func, params) macdrv_unix_call(unix_ ## func, params)
/* macdrv_dnd_get_data params */
struct dnd_get_data_params
......@@ -83,7 +83,9 @@ struct localized_string
struct init_params
{
NTSTATUS (WINAPI *pNtWaitForMultipleObjects)(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
struct localized_string *strings;
NTSTATUS (CDECL *unix_call)(enum macdrv_funcs code, void *params);
};
/* macdrv_notify_icon params */
......
......@@ -21,6 +21,10 @@
/* NOTE: If making changes here, consider whether they should be reflected in
* the other drivers. */
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include <stdarg.h>
......
......@@ -21,6 +21,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include <IOKit/pwr_mgt/IOPMLib.h>
......
......@@ -1506,6 +1506,8 @@ static void parse_file( struct makefile *make, struct incl_file *source, int src
source->files_count = 0;
source->files_size = file->deps_count;
source->files = xmalloc( source->files_size * sizeof(*source->files) );
if (strendswith( file->name, ".m" )) file->flags |= FLAG_C_UNIX;
if (file->flags & FLAG_C_UNIX) source->use_msvcrt = 0;
else if (file->flags & FLAG_C_IMPLIB) source->use_msvcrt = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment