Commit e54ff70e authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winebus.sys: Build with msvcrt.

parent b9a7e961
...@@ -2,7 +2,7 @@ MODULE = winebus.sys ...@@ -2,7 +2,7 @@ MODULE = winebus.sys
IMPORTS = ntoskrnl advapi32 IMPORTS = ntoskrnl advapi32
EXTRALIBS = $(IOKIT_LIBS) $(UDEV_LIBS) EXTRALIBS = $(IOKIT_LIBS) $(UDEV_LIBS)
EXTRAINCL = $(UDEV_CFLAGS) $(SDL2_CFLAGS) EXTRAINCL = $(UDEV_CFLAGS) $(SDL2_CFLAGS)
EXTRADLLFLAGS = -Wl,--subsystem,native EXTRADLLFLAGS = -mno-cygwin -Wl,--subsystem,native
C_SRCS = \ C_SRCS = \
bus_iohid.c \ bus_iohid.c \
......
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#if 0
#pragma makedep unix
#endif
#include "config.h" #include "config.h"
#include "wine/port.h" #include "wine/port.h"
...@@ -371,7 +375,7 @@ static void handle_RemovalCallback(void *context, IOReturn result, void *sender, ...@@ -371,7 +375,7 @@ static void handle_RemovalCallback(void *context, IOReturn result, void *sender,
else WARN("failed to find device for iohid device %p\n", IOHIDDevice); else WARN("failed to find device for iohid device %p\n", IOHIDDevice);
} }
NTSTATUS iohid_bus_init(void *args) NTSTATUS WINAPI iohid_bus_init(void *args)
{ {
TRACE("args %p\n", args); TRACE("args %p\n", args);
...@@ -392,7 +396,7 @@ NTSTATUS iohid_bus_init(void *args) ...@@ -392,7 +396,7 @@ NTSTATUS iohid_bus_init(void *args)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
NTSTATUS iohid_bus_wait(void *args) NTSTATUS WINAPI iohid_bus_wait(void *args)
{ {
struct bus_event *result = args; struct bus_event *result = args;
CFRunLoopRunResult ret; CFRunLoopRunResult ret;
...@@ -416,7 +420,7 @@ NTSTATUS iohid_bus_wait(void *args) ...@@ -416,7 +420,7 @@ NTSTATUS iohid_bus_wait(void *args)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
NTSTATUS iohid_bus_stop(void *args) NTSTATUS WINAPI iohid_bus_stop(void *args)
{ {
if (!run_loop) return STATUS_SUCCESS; if (!run_loop) return STATUS_SUCCESS;
...@@ -427,19 +431,19 @@ NTSTATUS iohid_bus_stop(void *args) ...@@ -427,19 +431,19 @@ NTSTATUS iohid_bus_stop(void *args)
#else #else
NTSTATUS iohid_bus_init(void *args) NTSTATUS WINAPI iohid_bus_init(void *args)
{ {
WARN("IOHID support not compiled in!\n"); WARN("IOHID support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED; return STATUS_NOT_IMPLEMENTED;
} }
NTSTATUS iohid_bus_wait(void *args) NTSTATUS WINAPI iohid_bus_wait(void *args)
{ {
WARN("IOHID support not compiled in!\n"); WARN("IOHID support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED; return STATUS_NOT_IMPLEMENTED;
} }
NTSTATUS iohid_bus_stop(void *args) NTSTATUS WINAPI iohid_bus_stop(void *args)
{ {
WARN("IOHID support not compiled in!\n"); WARN("IOHID support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED; return STATUS_NOT_IMPLEMENTED;
......
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#if 0
#pragma makedep unix
#endif
#include "config.h" #include "config.h"
#include "wine/port.h" #include "wine/port.h"
#include <errno.h> #include <errno.h>
...@@ -814,7 +818,7 @@ static void process_device_event(SDL_Event *event) ...@@ -814,7 +818,7 @@ static void process_device_event(SDL_Event *event)
RtlLeaveCriticalSection(&sdl_cs); RtlLeaveCriticalSection(&sdl_cs);
} }
NTSTATUS sdl_bus_init(void *args) NTSTATUS WINAPI sdl_bus_init(void *args)
{ {
const char *mapping; const char *mapping;
int i; int i;
...@@ -917,7 +921,7 @@ failed: ...@@ -917,7 +921,7 @@ failed:
return STATUS_UNSUCCESSFUL; return STATUS_UNSUCCESSFUL;
} }
NTSTATUS sdl_bus_wait(void *args) NTSTATUS WINAPI sdl_bus_wait(void *args)
{ {
struct bus_event *result = args; struct bus_event *result = args;
SDL_Event event; SDL_Event event;
...@@ -939,7 +943,7 @@ NTSTATUS sdl_bus_wait(void *args) ...@@ -939,7 +943,7 @@ NTSTATUS sdl_bus_wait(void *args)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
NTSTATUS sdl_bus_stop(void *args) NTSTATUS WINAPI sdl_bus_stop(void *args)
{ {
SDL_Event event; SDL_Event event;
...@@ -957,19 +961,19 @@ NTSTATUS sdl_bus_stop(void *args) ...@@ -957,19 +961,19 @@ NTSTATUS sdl_bus_stop(void *args)
#else #else
NTSTATUS sdl_bus_init(void *args) NTSTATUS WINAPI sdl_bus_init(void *args)
{ {
WARN("SDL support not compiled in!\n"); WARN("SDL support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED; return STATUS_NOT_IMPLEMENTED;
} }
NTSTATUS sdl_bus_wait(void *args) NTSTATUS WINAPI sdl_bus_wait(void *args)
{ {
WARN("SDL support not compiled in!\n"); WARN("SDL support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED; return STATUS_NOT_IMPLEMENTED;
} }
NTSTATUS sdl_bus_stop(void *args) NTSTATUS WINAPI sdl_bus_stop(void *args)
{ {
WARN("SDL support not compiled in!\n"); WARN("SDL support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED; return STATUS_NOT_IMPLEMENTED;
......
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#if 0
#pragma makedep unix
#endif
#include "config.h" #include "config.h"
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
...@@ -1184,7 +1188,7 @@ static void process_monitor_event(struct udev_monitor *monitor) ...@@ -1184,7 +1188,7 @@ static void process_monitor_event(struct udev_monitor *monitor)
udev_device_unref(dev); udev_device_unref(dev);
} }
NTSTATUS udev_bus_init(void *args) NTSTATUS WINAPI udev_bus_init(void *args)
{ {
int monitor_fd; int monitor_fd;
...@@ -1229,7 +1233,7 @@ error: ...@@ -1229,7 +1233,7 @@ error:
return STATUS_UNSUCCESSFUL; return STATUS_UNSUCCESSFUL;
} }
NTSTATUS udev_bus_wait(void *args) NTSTATUS WINAPI udev_bus_wait(void *args)
{ {
struct platform_private *device; struct platform_private *device;
struct bus_event *result = args; struct bus_event *result = args;
...@@ -1275,7 +1279,7 @@ NTSTATUS udev_bus_wait(void *args) ...@@ -1275,7 +1279,7 @@ NTSTATUS udev_bus_wait(void *args)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
NTSTATUS udev_bus_stop(void *args) NTSTATUS WINAPI udev_bus_stop(void *args)
{ {
if (!udev_context) return STATUS_SUCCESS; if (!udev_context) return STATUS_SUCCESS;
write(deviceloop_control[1], "q", 1); write(deviceloop_control[1], "q", 1);
...@@ -1284,19 +1288,19 @@ NTSTATUS udev_bus_stop(void *args) ...@@ -1284,19 +1288,19 @@ NTSTATUS udev_bus_stop(void *args)
#else #else
NTSTATUS udev_bus_init(void *args) NTSTATUS WINAPI udev_bus_init(void *args)
{ {
WARN("UDEV support not compiled in!\n"); WARN("UDEV support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED; return STATUS_NOT_IMPLEMENTED;
} }
NTSTATUS udev_bus_wait(void *args) NTSTATUS WINAPI udev_bus_wait(void *args)
{ {
WARN("UDEV support not compiled in!\n"); WARN("UDEV support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED; return STATUS_NOT_IMPLEMENTED;
} }
NTSTATUS udev_bus_stop(void *args) NTSTATUS WINAPI udev_bus_stop(void *args)
{ {
WARN("UDEV support not compiled in!\n"); WARN("UDEV support not compiled in!\n");
return STATUS_NOT_IMPLEMENTED; return STATUS_NOT_IMPLEMENTED;
......
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#if 0
#pragma makedep unix
#endif
#include <stdarg.h> #include <stdarg.h>
#include "ntstatus.h" #include "ntstatus.h"
......
...@@ -17,11 +17,14 @@ ...@@ -17,11 +17,14 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include <stdarg.h> #include <stdarg.h>
#include "ntstatus.h" #include "ntstatus.h"
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winternl.h" #include "winternl.h"
#include "winioctl.h" #include "winioctl.h"
#include "hidusage.h" #include "hidusage.h"
...@@ -30,7 +33,6 @@ ...@@ -30,7 +33,6 @@
#include "ddk/hidtypes.h" #include "ddk/hidtypes.h"
#include "wine/asm.h" #include "wine/asm.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
#include "wine/list.h" #include "wine/list.h"
#include "wine/unixlib.h" #include "wine/unixlib.h"
...@@ -109,9 +111,12 @@ static CRITICAL_SECTION device_list_cs = { &critsect_debug, -1, 0, 0, 0, 0 }; ...@@ -109,9 +111,12 @@ static CRITICAL_SECTION device_list_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
static struct list device_list = LIST_INIT(device_list); static struct list device_list = LIST_INIT(device_list);
static HMODULE instance;
static const unix_entry_point *unix_funcs;
static NTSTATUS winebus_call(unsigned int code, void *args) static NTSTATUS winebus_call(unsigned int code, void *args)
{ {
return __wine_unix_call_funcs[code]( args ); return unix_funcs[code]( args );
} }
static void unix_device_remove(DEVICE_OBJECT *device) static void unix_device_remove(DEVICE_OBJECT *device)
...@@ -193,11 +198,11 @@ static WCHAR *get_instance_id(DEVICE_OBJECT *device) ...@@ -193,11 +198,11 @@ static WCHAR *get_instance_id(DEVICE_OBJECT *device)
{ {
static const WCHAR formatW[] = {'%','i','&','%','s','&','%','x','&','%','i',0}; static const WCHAR formatW[] = {'%','i','&','%','s','&','%','x','&','%','i',0};
struct device_extension *ext = (struct device_extension *)device->DeviceExtension; struct device_extension *ext = (struct device_extension *)device->DeviceExtension;
DWORD len = strlenW(ext->serialnumber) + 33; DWORD len = wcslen(ext->serialnumber) + 33;
WCHAR *dst; WCHAR *dst;
if ((dst = ExAllocatePool(PagedPool, len * sizeof(WCHAR)))) if ((dst = ExAllocatePool(PagedPool, len * sizeof(WCHAR))))
sprintfW(dst, formatW, ext->desc.version, ext->serialnumber, ext->desc.uid, ext->index); swprintf(dst, len, formatW, ext->desc.version, ext->serialnumber, ext->desc.uid, ext->index);
return dst; return dst;
} }
...@@ -208,13 +213,13 @@ static WCHAR *get_device_id(DEVICE_OBJECT *device) ...@@ -208,13 +213,13 @@ static WCHAR *get_device_id(DEVICE_OBJECT *device)
static const WCHAR formatW[] = {'%','s','\\','v','i','d','_','%','0','4','x', static const WCHAR formatW[] = {'%','s','\\','v','i','d','_','%','0','4','x',
'&','p','i','d','_','%','0','4','x',0}; '&','p','i','d','_','%','0','4','x',0};
struct device_extension *ext = (struct device_extension *)device->DeviceExtension; struct device_extension *ext = (struct device_extension *)device->DeviceExtension;
DWORD len = strlenW(ext->desc.busid) + 34; DWORD pos = 0, len = wcslen(ext->desc.busid) + 34;
WCHAR *dst, *tmp; WCHAR *dst;
if ((dst = ExAllocatePool(PagedPool, len * sizeof(WCHAR)))) if ((dst = ExAllocatePool(PagedPool, len * sizeof(WCHAR))))
{ {
tmp = dst + sprintfW(dst, formatW, ext->desc.busid, ext->desc.vid, ext->desc.pid); pos += swprintf(dst + pos, len - pos, formatW, ext->desc.busid, ext->desc.vid, ext->desc.pid);
if (ext->desc.input != -1) sprintfW(tmp, input_formatW, ext->desc.input); if (ext->desc.input != -1) pos += swprintf(dst + pos, len - pos, input_formatW, ext->desc.input);
} }
return dst; return dst;
...@@ -225,10 +230,10 @@ static WCHAR *get_hardware_ids(DEVICE_OBJECT *device) ...@@ -225,10 +230,10 @@ static WCHAR *get_hardware_ids(DEVICE_OBJECT *device)
struct device_extension *ext = (struct device_extension *)device->DeviceExtension; struct device_extension *ext = (struct device_extension *)device->DeviceExtension;
WCHAR *dst; WCHAR *dst;
if ((dst = ExAllocatePool(PagedPool, (strlenW(ext->desc.busid) + 2) * sizeof(WCHAR)))) if ((dst = ExAllocatePool(PagedPool, (wcslen(ext->desc.busid) + 2) * sizeof(WCHAR))))
{ {
strcpyW(dst, ext->desc.busid); wcscpy(dst, ext->desc.busid);
dst[strlenW(dst) + 1] = 0; dst[wcslen(dst) + 1] = 0;
} }
return dst; return dst;
...@@ -285,7 +290,7 @@ static DEVICE_OBJECT *bus_create_hid_device(struct device_desc *desc, struct uni ...@@ -285,7 +290,7 @@ static DEVICE_OBJECT *bus_create_hid_device(struct device_desc *desc, struct uni
TRACE("desc %s, unix_device %p\n", debugstr_device_desc(desc), unix_device); TRACE("desc %s, unix_device %p\n", debugstr_device_desc(desc), unix_device);
sprintfW(dev_name, device_name_fmtW, desc->busid, unix_device); swprintf(dev_name, ARRAY_SIZE(dev_name), device_name_fmtW, desc->busid, unix_device);
RtlInitUnicodeString(&nameW, dev_name); RtlInitUnicodeString(&nameW, dev_name);
status = IoCreateDevice(driver_obj, sizeof(struct device_extension), &nameW, 0, 0, FALSE, &device); status = IoCreateDevice(driver_obj, sizeof(struct device_extension), &nameW, 0, 0, FALSE, &device);
if (status) if (status)
...@@ -900,17 +905,17 @@ static NTSTATUS hid_get_device_string(DEVICE_OBJECT *device, DWORD index, WCHAR ...@@ -900,17 +905,17 @@ static NTSTATUS hid_get_device_string(DEVICE_OBJECT *device, DWORD index, WCHAR
switch (index) switch (index)
{ {
case HID_STRING_ID_IMANUFACTURER: case HID_STRING_ID_IMANUFACTURER:
len = (strlenW(ext->manufacturer) + 1) * sizeof(WCHAR); len = (wcslen(ext->manufacturer) + 1) * sizeof(WCHAR);
if (len > buffer_len) return STATUS_BUFFER_TOO_SMALL; if (len > buffer_len) return STATUS_BUFFER_TOO_SMALL;
else memcpy(buffer, ext->manufacturer, len); else memcpy(buffer, ext->manufacturer, len);
return STATUS_SUCCESS; return STATUS_SUCCESS;
case HID_STRING_ID_IPRODUCT: case HID_STRING_ID_IPRODUCT:
len = (strlenW(ext->product) + 1) * sizeof(WCHAR); len = (wcslen(ext->product) + 1) * sizeof(WCHAR);
if (len > buffer_len) return STATUS_BUFFER_TOO_SMALL; if (len > buffer_len) return STATUS_BUFFER_TOO_SMALL;
else memcpy(buffer, ext->product, len); else memcpy(buffer, ext->product, len);
return STATUS_SUCCESS; return STATUS_SUCCESS;
case HID_STRING_ID_ISERIALNUMBER: case HID_STRING_ID_ISERIALNUMBER:
len = (strlenW(ext->serialnumber) + 1) * sizeof(WCHAR); len = (wcslen(ext->serialnumber) + 1) * sizeof(WCHAR);
if (len > buffer_len) return STATUS_BUFFER_TOO_SMALL; if (len > buffer_len) return STATUS_BUFFER_TOO_SMALL;
else memcpy(buffer, ext->serialnumber, len); else memcpy(buffer, ext->serialnumber, len);
return STATUS_SUCCESS; return STATUS_SUCCESS;
...@@ -1012,7 +1017,7 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp) ...@@ -1012,7 +1017,7 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
irp->IoStatus.Status = hid_get_device_string(device, index, (WCHAR *)irp->UserBuffer, buffer_len); irp->IoStatus.Status = hid_get_device_string(device, index, (WCHAR *)irp->UserBuffer, buffer_len);
if (irp->IoStatus.Status == STATUS_SUCCESS) if (irp->IoStatus.Status == STATUS_SUCCESS)
irp->IoStatus.Information = (strlenW((WCHAR *)irp->UserBuffer) + 1) * sizeof(WCHAR); irp->IoStatus.Information = (wcslen((WCHAR *)irp->UserBuffer) + 1) * sizeof(WCHAR);
break; break;
} }
case IOCTL_HID_GET_INPUT_REPORT: case IOCTL_HID_GET_INPUT_REPORT:
...@@ -1110,6 +1115,10 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) ...@@ -1110,6 +1115,10 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
TRACE( "(%p, %s)\n", driver, debugstr_w(path->Buffer) ); TRACE( "(%p, %s)\n", driver, debugstr_w(path->Buffer) );
RtlPcToFileHeader(&DriverEntry, (void *)&instance);
if ((ret = __wine_init_unix_lib(instance, DLL_PROCESS_ATTACH, NULL, &unix_funcs)))
return ret;
attr.Length = sizeof(attr); attr.Length = sizeof(attr);
attr.ObjectName = path; attr.ObjectName = path;
attr.Attributes = OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE; attr.Attributes = OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE;
......
...@@ -49,17 +49,17 @@ struct unix_device ...@@ -49,17 +49,17 @@ struct unix_device
extern void *unix_device_create(const struct unix_device_vtbl *vtbl, SIZE_T size) DECLSPEC_HIDDEN; extern void *unix_device_create(const struct unix_device_vtbl *vtbl, SIZE_T size) DECLSPEC_HIDDEN;
extern NTSTATUS sdl_bus_init(void *) DECLSPEC_HIDDEN; extern NTSTATUS WINAPI sdl_bus_init(void *) DECLSPEC_HIDDEN;
extern NTSTATUS sdl_bus_wait(void *) DECLSPEC_HIDDEN; extern NTSTATUS WINAPI sdl_bus_wait(void *) DECLSPEC_HIDDEN;
extern NTSTATUS sdl_bus_stop(void *) DECLSPEC_HIDDEN; extern NTSTATUS WINAPI sdl_bus_stop(void *) DECLSPEC_HIDDEN;
extern NTSTATUS udev_bus_init(void *) DECLSPEC_HIDDEN; extern NTSTATUS WINAPI udev_bus_init(void *) DECLSPEC_HIDDEN;
extern NTSTATUS udev_bus_wait(void *) DECLSPEC_HIDDEN; extern NTSTATUS WINAPI udev_bus_wait(void *) DECLSPEC_HIDDEN;
extern NTSTATUS udev_bus_stop(void *) DECLSPEC_HIDDEN; extern NTSTATUS WINAPI udev_bus_stop(void *) DECLSPEC_HIDDEN;
extern NTSTATUS iohid_bus_init(void *) DECLSPEC_HIDDEN; extern NTSTATUS WINAPI iohid_bus_init(void *) DECLSPEC_HIDDEN;
extern NTSTATUS iohid_bus_wait(void *) DECLSPEC_HIDDEN; extern NTSTATUS WINAPI iohid_bus_wait(void *) DECLSPEC_HIDDEN;
extern NTSTATUS iohid_bus_stop(void *) DECLSPEC_HIDDEN; extern NTSTATUS WINAPI iohid_bus_stop(void *) DECLSPEC_HIDDEN;
extern void bus_event_cleanup(struct bus_event *event) DECLSPEC_HIDDEN; extern void bus_event_cleanup(struct bus_event *event) DECLSPEC_HIDDEN;
extern void bus_event_queue_destroy(struct list *queue) DECLSPEC_HIDDEN; extern void bus_event_queue_destroy(struct list *queue) DECLSPEC_HIDDEN;
......
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#if 0
#pragma makedep unix
#endif
#include "config.h" #include "config.h"
#include <stdarg.h> #include <stdarg.h>
...@@ -143,7 +147,7 @@ static const struct device_desc mouse_device_desc = ...@@ -143,7 +147,7 @@ static const struct device_desc mouse_device_desc =
.serialnumber = {"0000"}, .serialnumber = {"0000"},
}; };
static NTSTATUS mouse_device_create(void *args) static NTSTATUS WINAPI mouse_device_create(void *args)
{ {
struct device_create_params *params = args; struct device_create_params *params = args;
params->desc = mouse_device_desc; params->desc = mouse_device_desc;
...@@ -241,7 +245,7 @@ static const struct device_desc keyboard_device_desc = ...@@ -241,7 +245,7 @@ static const struct device_desc keyboard_device_desc =
.serialnumber = {"0000"}, .serialnumber = {"0000"},
}; };
static NTSTATUS keyboard_device_create(void *args) static NTSTATUS WINAPI keyboard_device_create(void *args)
{ {
struct device_create_params *params = args; struct device_create_params *params = args;
params->desc = keyboard_device_desc; params->desc = keyboard_device_desc;
...@@ -274,7 +278,7 @@ static ULONG unix_device_incref(struct unix_device *iface) ...@@ -274,7 +278,7 @@ static ULONG unix_device_incref(struct unix_device *iface)
return InterlockedIncrement(&iface->ref); return InterlockedIncrement(&iface->ref);
} }
static NTSTATUS unix_device_remove(void *args) static NTSTATUS WINAPI unix_device_remove(void *args)
{ {
struct unix_device *iface = args; struct unix_device *iface = args;
iface->vtbl->stop(iface); iface->vtbl->stop(iface);
...@@ -282,20 +286,20 @@ static NTSTATUS unix_device_remove(void *args) ...@@ -282,20 +286,20 @@ static NTSTATUS unix_device_remove(void *args)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
static NTSTATUS unix_device_start(void *args) static NTSTATUS WINAPI unix_device_start(void *args)
{ {
struct unix_device *iface = args; struct unix_device *iface = args;
return iface->vtbl->start(iface); return iface->vtbl->start(iface);
} }
static NTSTATUS unix_device_get_report_descriptor(void *args) static NTSTATUS WINAPI unix_device_get_report_descriptor(void *args)
{ {
struct device_descriptor_params *params = args; struct device_descriptor_params *params = args;
struct unix_device *iface = params->iface; struct unix_device *iface = params->iface;
return iface->vtbl->get_report_descriptor(iface, params->buffer, params->length, params->out_length); return iface->vtbl->get_report_descriptor(iface, params->buffer, params->length, params->out_length);
} }
static NTSTATUS unix_device_set_output_report(void *args) static NTSTATUS WINAPI unix_device_set_output_report(void *args)
{ {
struct device_report_params *params = args; struct device_report_params *params = args;
struct unix_device *iface = params->iface; struct unix_device *iface = params->iface;
...@@ -303,7 +307,7 @@ static NTSTATUS unix_device_set_output_report(void *args) ...@@ -303,7 +307,7 @@ static NTSTATUS unix_device_set_output_report(void *args)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
static NTSTATUS unix_device_get_feature_report(void *args) static NTSTATUS WINAPI unix_device_get_feature_report(void *args)
{ {
struct device_report_params *params = args; struct device_report_params *params = args;
struct unix_device *iface = params->iface; struct unix_device *iface = params->iface;
...@@ -311,7 +315,7 @@ static NTSTATUS unix_device_get_feature_report(void *args) ...@@ -311,7 +315,7 @@ static NTSTATUS unix_device_get_feature_report(void *args)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
static NTSTATUS unix_device_set_feature_report(void *args) static NTSTATUS WINAPI unix_device_set_feature_report(void *args)
{ {
struct device_report_params *params = args; struct device_report_params *params = args;
struct unix_device *iface = params->iface; struct unix_device *iface = params->iface;
...@@ -319,7 +323,7 @@ static NTSTATUS unix_device_set_feature_report(void *args) ...@@ -319,7 +323,7 @@ static NTSTATUS unix_device_set_feature_report(void *args)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
const unixlib_entry_t __wine_unix_call_funcs[] = static const unix_entry_point unix_funcs[] =
{ {
sdl_bus_init, sdl_bus_init,
sdl_bus_wait, sdl_bus_wait,
...@@ -424,3 +428,10 @@ BOOL bus_event_queue_pop(struct list *queue, struct bus_event *event) ...@@ -424,3 +428,10 @@ BOOL bus_event_queue_pop(struct list *queue, struct bus_event *event)
return TRUE; return TRUE;
} }
NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out )
{
if (reason != DLL_PROCESS_ATTACH) return STATUS_SUCCESS;
*(const unix_entry_point **)ptr_out = unix_funcs;
return STATUS_SUCCESS;
}
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/list.h" #include "wine/list.h"
#include "wine/unixlib.h"
struct device_desc struct device_desc
{ {
...@@ -137,7 +136,7 @@ enum unix_funcs ...@@ -137,7 +136,7 @@ enum unix_funcs
device_set_feature_report, device_set_feature_report,
}; };
extern const unixlib_entry_t __wine_unix_call_funcs[] DECLSPEC_HIDDEN; typedef NTSTATUS (WINAPI *unix_entry_point)(void *);
static inline const char *debugstr_device_desc(struct device_desc *desc) static inline const char *debugstr_device_desc(struct device_desc *desc)
{ {
......
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