include: Add some new ProcThreadAttribute definitions.
[wine.git] / dlls / winebus.sys / unixlib.h
blob68d59ac0333d821b271bb93789c8163473e4c9ab
1 /*
2 * Copyright 2021 RĂ©mi Bernon for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINEBUS_UNIXLIB_H
20 #define __WINEBUS_UNIXLIB_H
22 #include <stdarg.h>
24 #include <windef.h>
25 #include <winbase.h>
26 #include <winternl.h>
27 #include <ddk/hidclass.h>
28 #include <hidusage.h>
30 #include "wine/debug.h"
31 #include "wine/list.h"
33 struct device_desc
35 UINT vid;
36 UINT pid;
37 UINT version;
38 UINT input;
39 UINT uid;
40 BOOL is_gamepad;
42 WCHAR manufacturer[MAX_PATH];
43 WCHAR product[MAX_PATH];
44 WCHAR serialnumber[MAX_PATH];
47 struct sdl_bus_options
49 BOOL split_controllers;
50 BOOL map_controllers;
51 /* freed after bus_init */
52 UINT mappings_count;
53 char **mappings;
56 struct udev_bus_options
58 BOOL disable_hidraw;
59 BOOL disable_input;
60 BOOL disable_udevd;
63 struct iohid_bus_options
67 enum bus_event_type
69 BUS_EVENT_TYPE_NONE,
70 BUS_EVENT_TYPE_DEVICE_REMOVED,
71 BUS_EVENT_TYPE_DEVICE_CREATED,
72 BUS_EVENT_TYPE_INPUT_REPORT,
75 struct bus_event
77 UINT type;
78 UINT64 device;
79 union
81 struct
83 struct device_desc desc;
84 } device_created;
86 struct
88 USHORT length;
89 BYTE buffer[1];
90 } input_report;
94 struct device_create_params
96 struct device_desc desc;
97 UINT64 device;
100 struct device_remove_params
102 UINT64 device;
105 struct device_start_params
107 UINT64 device;
110 struct device_descriptor_params
112 UINT64 device;
113 BYTE *buffer;
114 UINT length;
115 UINT *out_length;
118 struct device_report_params
120 UINT64 device;
121 HID_XFER_PACKET *packet;
122 IO_STATUS_BLOCK *io;
125 enum unix_funcs
127 sdl_init,
128 sdl_wait,
129 sdl_stop,
130 udev_init,
131 udev_wait,
132 udev_stop,
133 iohid_init,
134 iohid_wait,
135 iohid_stop,
136 mouse_create,
137 keyboard_create,
138 device_remove,
139 device_start,
140 device_get_report_descriptor,
141 device_set_output_report,
142 device_get_feature_report,
143 device_set_feature_report,
146 static inline const char *debugstr_device_desc(struct device_desc *desc)
148 if (!desc) return "(null)";
149 return wine_dbg_sprintf("{vid %04x, pid %04x, version %04x, input %d, uid %08x, is_gamepad %u}",
150 desc->vid, desc->pid, desc->version, desc->input, desc->uid, desc->is_gamepad);
153 #endif /* __WINEBUS_UNIXLIB_H */