From ecf16a36330b6565e13e2a97fc421d5a3b03de3b Mon Sep 17 00:00:00 2001 From: Sergey Popov Date: Thu, 8 Jun 2017 16:10:31 +0300 Subject: [PATCH] Drop obsolete ebuilds of app-emulation/wine --- app-emulation/wine/Manifest | 8 - .../disable-dynamic-vertex-buffers.patch | 24 - .../wine/files/wine-1.1.15-winegcc.patch | 55 - .../files/wine-1.4_rc2-multilib-portage.patch | 40 - .../wine/files/wine-raw_input_mod.patch | 2828 ----------------- .../wine-remove-support-for-GL_ARB_sync.patch | 25 - app-emulation/wine/metadata.xml | 22 - app-emulation/wine/wine-1.5.2-r9999.ebuild | 238 -- app-emulation/wine/wine-1.5.9-r9999.ebuild | 251 -- 9 files changed, 3491 deletions(-) delete mode 100644 app-emulation/wine/Manifest delete mode 100644 app-emulation/wine/files/disable-dynamic-vertex-buffers.patch delete mode 100644 app-emulation/wine/files/wine-1.1.15-winegcc.patch delete mode 100644 app-emulation/wine/files/wine-1.4_rc2-multilib-portage.patch delete mode 100644 app-emulation/wine/files/wine-raw_input_mod.patch delete mode 100644 app-emulation/wine/files/wine-remove-support-for-GL_ARB_sync.patch delete mode 100644 app-emulation/wine/metadata.xml delete mode 100644 app-emulation/wine/wine-1.5.2-r9999.ebuild delete mode 100644 app-emulation/wine/wine-1.5.9-r9999.ebuild diff --git a/app-emulation/wine/Manifest b/app-emulation/wine/Manifest deleted file mode 100644 index 704c437..0000000 --- a/app-emulation/wine/Manifest +++ /dev/null @@ -1,8 +0,0 @@ -DIST wine-1.5.2.tar.bz2 20104652 SHA256 8ee6fdaf716b5a1c7ccf9be9dc6d9b7546944e79351c4806b2fa596da418342f SHA512 da949f1943a1af1f4f9d75d41d35b5a968b4bb792f25c5d3202de5be944a04deac7116261d70b5b90f233e9fb526ae8d073e2cdd03304ac0f736926108fec7d7 WHIRLPOOL 947bff2ccda47e548e6eec4a1b7cc738b943fbbdf000e5686aa440c9d45962b5dee47e7060e93895cc398c2c82d7dce06c370091859bd46a6d09864c191d357c -DIST wine-1.5.9.tar.bz2 20413229 SHA256 7bc25e7d0d8fec11a41fec89994dd65265b8fd1052ee82d5648232e646899cd3 SHA512 245b3819f6ca17f50ffedbac44e55a367cff16e3c0c3b28f701511e79c2c20d596e0ae7d4a4094c7203589915cf048e023dedbba9439e1e81bcc7681176dd33b WHIRLPOOL b10bb0606bb013f1a84e8bcfee184eb860d3df8be10b27ef7208d2eb73ed5b1a233be7be3831b61967cac11aa5ad76ab01e1638af860e6426347aec6c45d7c83 -DIST wine-mono-0.0.4.msi 44408320 SHA256 15d8a612cdeca4eff3137353f29fdeb7a99e055cd633844c91cd00e0186b8882 SHA512 a7a3d5a564bab68ec6f3b96dff53c7b1491ce6d53b9fa3c2f5770e3ada69ffdefcbdde340697e9916d8c487f748db22aae97803b21bd63e461149be1eac096e4 WHIRLPOOL dc3bfafb8768cbda124870fceb1389e34a7d8ff0b1bad3df7e05923ce2695a2b037467bfddd90e1726f3f64f79bfa9f64bf65054ae3355a69039026fabf1eb4a -DIST wine_gecko-1.5-x86.msi 15950848 SHA256 2e372a1b87ff2a22ad5127400ece4b09e55591d9f84e00bb562d294898a49b5c SHA512 da4c2173569b62f2f6a195f81d919c95cab282d5cc8f2644a0d58eacb9520f6e58ca5bd6ae86cda36d01ffb13fdfd120fda171e061cc0a2377246c57715e0cf3 WHIRLPOOL 61af9ab8b5960e8caf3b7faf7b5a2d5f7fc24ca5180740e3263fafcbacdfd0d4a973ba931f38edb7ab281d3f2357db280dd8f6a89824a8a9a07777bad946c181 -DIST wine_gecko-1.5-x86_64.msi 16345088 SHA256 762e80b41e6922849b28299dc5810a28634d484fe73fb7ca52804460588a1730 -DIST wine_gecko-1.6-x86.msi 16802816 SHA256 1f2c201b970c2ec3dbfd35c29530edf4aaf1e82d45843f531fc43a03d7615e5d SHA512 29ad26bc37563d7dfe99b2c5b403a35f9d69787e456e9797596cea48c074f44dc38c2339ff208c7a53f30d0b4014a7ed27bffd13ccb1e0482540bbab689edc29 WHIRLPOOL d259fd4db5d452427bda31371dcd4211e21da4efdf3fb07200253fee14f9b6115836a666738613f1b5a7b1b5e4c5d8f0078aafdc1663f265e823c968e8884ed5 -DIST wine_gecko-1.6-x86_64.msi 17251328 SHA256 9f27fd2f67a10e01f9960707cbe365e795003050529af63fc68bc1192580801b SHA512 be49b579ed881fcf21980fa76e7be7891ebdfb6dd452646f8b7a8204e1b2ca1995e5d745252686fb4ccc25213e2aaf02a0d8a13b32e773095fbffba3878227df WHIRLPOOL 9ee867e2a6e25e3f90618a2cee7c32be639743454bf89429ed831aee04bdda6bb14cd3c5772bad1a3e8b9ac7758da9745cdf4f2470e859691b0f8fb0f76b367d -DIST winepulse-2012.06.15.patch 100596 SHA256 f6baf816e6170c406607d81e298fea2d175452ca822ee4cd2748fe4381ecd4dc SHA512 cd14a3407820d5d7b64a1ea19e41ae816a6a06888d57314cd7314192744574885501c98fa9e9f0fb102d3427d9f7bcc4f1a5ac532947b89db52ef731e071cb69 WHIRLPOOL 2dbb40afb633f5b1238d8849825b4711de865033ebb5c8f04c8e930a2974b8a5f4958fe87b5c1a9ccb1417ab1f4fbd2ed37feec11d2212efa01a6e05171a06a6 diff --git a/app-emulation/wine/files/disable-dynamic-vertex-buffers.patch b/app-emulation/wine/files/disable-dynamic-vertex-buffers.patch deleted file mode 100644 index 55de24c..0000000 --- a/app-emulation/wine/files/disable-dynamic-vertex-buffers.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 6dff990e13322cf472797128809c312a3ee6170b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 3 Aug 2011 23:47:11 +0200 -Subject: [PATCH 3/3] wined3d: disable dynamic vertex buffers - ---- - dlls/wined3d/buffer.c | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index ae04138..2eedca0 100644 ---- a/dlls/wined3d/buffer.c -+++ b/dlls/wined3d/buffer.c -@@ -1211,6 +1211,7 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device - debug_d3dformat(buffer->resource.format->id), buffer->resource.allocatedMemory, buffer); - - dynamic_buffer_ok = gl_info->supported[APPLE_FLUSH_BUFFER_RANGE] || gl_info->supported[ARB_MAP_BUFFER_RANGE]; -+ dynamic_buffer_ok = dynamic_buffer_ok && (bind_hint == GL_ELEMENT_ARRAY_BUFFER_ARB); - - /* Observations show that drawStridedSlow is faster on dynamic VBs than converting + - * drawStridedFast (half-life 2 and others). --- -1.7.3.4 - diff --git a/app-emulation/wine/files/wine-1.1.15-winegcc.patch b/app-emulation/wine/files/wine-1.1.15-winegcc.patch deleted file mode 100644 index a1cd890..0000000 --- a/app-emulation/wine/files/wine-1.1.15-winegcc.patch +++ /dev/null @@ -1,55 +0,0 @@ -http://bugs.gentoo.org/260726 - ---- wine-1.1.15/tools/winegcc/winegcc.c -+++ wine-1.1.15/tools/winegcc/winegcc.c -@@ -215,10 +215,13 @@ - strarray* files; - }; - -+#undef FORCE_POINTER_SIZE - #ifdef __i386__ - static const enum target_cpu build_cpu = CPU_x86; -+#define FORCE_POINTER_SIZE - #elif defined(__x86_64__) - static const enum target_cpu build_cpu = CPU_x86_64; -+#define FORCE_POINTER_SIZE - #elif defined(__sparc__) - static const enum target_cpu build_cpu = CPU_SPARC; - #elif defined(__ALPHA__) -@@ -968,6 +971,9 @@ - opts.linker_args = strarray_alloc(); - opts.compiler_args = strarray_alloc(); - opts.winebuild_args = strarray_alloc(); -+#ifdef FORCE_POINTER_SIZE -+ opts.force_pointer_size = sizeof(size_t); -+#endif - - /* determine the processor type */ - if (strendswith(argv[0], "winecpp")) opts.processor = proc_cpp; ---- wine-1.1.15/tools/winebuild/main.c -+++ wine-1.1.15/tools/winebuild/main.c -@@ -50,10 +50,13 @@ - int link_ext_symbols = 0; - int force_pointer_size = 0; - -+#undef FORCE_POINTER_SIZE - #ifdef __i386__ - enum target_cpu target_cpu = CPU_x86; -+#define FORCE_POINTER_SIZE - #elif defined(__x86_64__) - enum target_cpu target_cpu = CPU_x86_64; -+#define FORCE_POINTER_SIZE - #elif defined(__sparc__) - enum target_cpu target_cpu = CPU_SPARC; - #elif defined(__ALPHA__) -@@ -574,6 +577,10 @@ - signal( SIGTERM, exit_on_signal ); - signal( SIGINT, exit_on_signal ); - -+#ifdef FORCE_POINTER_SIZE -+ force_pointer_size = sizeof(size_t); -+#endif -+ - output_file = stdout; - argv = parse_options( argc, argv, spec ); - diff --git a/app-emulation/wine/files/wine-1.4_rc2-multilib-portage.patch b/app-emulation/wine/files/wine-1.4_rc2-multilib-portage.patch deleted file mode 100644 index be6ffc5..0000000 --- a/app-emulation/wine/files/wine-1.4_rc2-multilib-portage.patch +++ /dev/null @@ -1,40 +0,0 @@ -https://bugs.gentoo.org/show_bug.cgi?id=395615 - -Explicitly add the required -m32/m64 to *FLAGS; this overrides any -arch-specific -m* flags that may have been appended by multilib-portage. - -Even though -m32/m64 is now added to *FLAGS, -m32/m64 still has to be -explicitly added to CC and CXX due to wine's build system. For example, -winegcc saves the build-time value of CC and uses it at runtime. - ---- a/configure.ac -+++ b/configure.ac -@@ -133,12 +133,18 @@ - then - CC="$CC -m64" - CXX="$CXX -m64" -+ CFLAGS="$CFLAGS -m64" -+ LDFLAGS="$LDFLAGS -m64" -+ CXXFLAGS="$CXXFLAGS -m64" - host_cpu="x86_64" - notice_platform="64-bit " - AC_SUBST(TARGETFLAGS,"-m64") - else - CC="$CC -m32" - CXX="$CXX -m32" -+ CFLAGS="$CFLAGS -m32" -+ LDFLAGS="$LDFLAGS -m32" -+ CXXFLAGS="$CXXFLAGS -m32" - host_cpu="i386" - notice_platform="32-bit " - AC_SUBST(TARGETFLAGS,"-m32") -@@ -150,6 +156,9 @@ - then - CC="$CC -m32" - CXX="$CXX -m32" -+ CFLAGS="$CFLAGS -m32" -+ LDFLAGS="$LDFLAGS -m32" -+ CXXFLAGS="$CXXFLAGS -m32" - AC_MSG_CHECKING([whether $CC works]) - AC_LINK_IFELSE([AC_LANG_PROGRAM()],AC_MSG_RESULT([yes]), - [AC_MSG_RESULT([no]) diff --git a/app-emulation/wine/files/wine-raw_input_mod.patch b/app-emulation/wine/files/wine-raw_input_mod.patch deleted file mode 100644 index 2c4be4d..0000000 --- a/app-emulation/wine/files/wine-raw_input_mod.patch +++ /dev/null @@ -1,2828 +0,0 @@ -commit 51e1810634de2c212e6515fbfb2ea92a3e2409ad -Author: Vincas Miliūnas -Date: Wed Feb 22 21:48:26 2012 +0200 - - RAW - -diff --git a/dlls/user32/input.c b/dlls/user32/input.c -index 050fb2b..23ad6f7 100644 ---- a/dlls/user32/input.c -+++ b/dlls/user32/input.c -@@ -474,46 +474,325 @@ BOOL WINAPI GetLastInputInfo(PLASTINPUTINFO plii) - */ - UINT WINAPI GetRawInputDeviceList(PRAWINPUTDEVICELIST pRawInputDeviceList, PUINT puiNumDevices, UINT cbSize) - { -- FIXME("(pRawInputDeviceList=%p, puiNumDevices=%p, cbSize=%d) stub!\n", pRawInputDeviceList, puiNumDevices, cbSize); -+ BOOL ret = FALSE; -+ UINT result; - -- if(pRawInputDeviceList) -- memset(pRawInputDeviceList, 0, sizeof *pRawInputDeviceList); -- *puiNumDevices = 0; -- return 0; -+ TRACE("(pRawInputDeviceList=%p, puiNumDevices=%p, cbSize=%d)\n", pRawInputDeviceList, puiNumDevices, cbSize); -+ -+ if (cbSize != sizeof( RAWINPUTDEVICELIST )) -+ { -+ SetLastError( ERROR_INVALID_PARAMETER ); -+ return (UINT)-1; -+ } -+ if (puiNumDevices == NULL) -+ { -+ SetLastError( ERROR_NOACCESS ); -+ return (UINT)-1; -+ } -+ -+ SERVER_START_REQ( get_raw_input_device_list ) -+ { -+ req->report_size_only = pRawInputDeviceList == NULL; -+ if (pRawInputDeviceList != NULL) -+ wine_server_set_reply( req, pRawInputDeviceList, *puiNumDevices * sizeof( RAWINPUTDEVICELIST ) ); -+ ret = !wine_server_call_err( req ); -+ if (!ret || pRawInputDeviceList == NULL) -+ { -+ *puiNumDevices = reply->num_devices; -+ result = 0; -+ } -+ else -+ result = reply->num_devices; -+ } -+ SERVER_END_REQ; -+ -+ return ret ? result : (UINT)-1; - } - -+#define HID_USAGE_PAGE_GENERIC ((unsigned short)0x01) -+#define HID_USAGE_GENERIC_MOUSE ((unsigned short)0x02) -+#define HID_USAGE_GENERIC_KEYBOARD ((unsigned short)0x06) - - /****************************************************************** - * RegisterRawInputDevices (USER32.@) - */ - BOOL WINAPI DECLSPEC_HOTPATCH RegisterRawInputDevices(PRAWINPUTDEVICE pRawInputDevices, UINT uiNumDevices, UINT cbSize) - { -- FIXME("(pRawInputDevices=%p, uiNumDevices=%d, cbSize=%d) stub!\n", pRawInputDevices, uiNumDevices, cbSize); -+ BOOL result = TRUE; -+ UINT i, registrations_size = uiNumDevices * sizeof( struct raw_input_device_registration ); -+ struct raw_input_device_registration *registrations; - -- return TRUE; --} -+ TRACE("(pRawInputDevices=%p, uiNumDevices=%d, cbSize=%d)\n", pRawInputDevices, uiNumDevices, cbSize); -+ -+ if (pRawInputDevices == NULL || uiNumDevices == 0 || cbSize != sizeof( RAWINPUTDEVICE )) -+ { -+ SetLastError( ERROR_INVALID_PARAMETER ); -+ return FALSE; -+ } -+ -+ registrations = HeapAlloc( GetProcessHeap(), 0, registrations_size ); -+ if (!registrations) -+ { -+ SetLastError( ERROR_NOT_ENOUGH_MEMORY ); -+ return FALSE; -+ } -+ -+ /* Construct and validate registration data */ -+ for (i = 0; i < uiNumDevices; i++) -+ { -+ RAWINPUTDEVICE *device = &pRawInputDevices[i]; -+ BOOL is_mouse = device->usUsagePage == HID_USAGE_PAGE_GENERIC && -+ device->usUsage == HID_USAGE_GENERIC_MOUSE; -+ BOOL is_keyboard = device->usUsagePage == HID_USAGE_PAGE_GENERIC && -+ device->usUsage == HID_USAGE_GENERIC_KEYBOARD; -+ UINT device_flags = device->dwFlags, registration_flags = 0; -+ -+ if (device->usUsagePage == 0) -+ { -+ SetLastError( ERROR_INVALID_PARAMETER ); -+ result = FALSE; -+ break; -+ } -+ -+ /* RIDEV_* values can overlap, therefore we need to remove confirmed cases */ -+ -+ if ((device_flags & RIDEV_REMOVE) == RIDEV_REMOVE) -+ { -+ if (device->hwndTarget != NULL) -+ { -+ SetLastError( ERROR_INVALID_PARAMETER ); -+ result = FALSE; -+ break; -+ } -+ device_flags &= ~RIDEV_REMOVE; -+ registration_flags |= RAW_INPUT_DEVICE_FLAG_REMOVE; -+ } -+ -+ if ((device_flags & RIDEV_NOHOTKEYS) == RIDEV_NOHOTKEYS && is_keyboard) -+ { -+ FIXME("RIDEV_NOHOTKEYS support is not implemented\n"); -+ device_flags &= ~RIDEV_NOHOTKEYS; -+ registration_flags |= RAW_INPUT_DEVICE_FLAG_NOHOTKEYS; -+ } -+ -+ if ((device_flags & RIDEV_NOLEGACY) == RIDEV_NOLEGACY && !is_mouse && !is_keyboard) -+ { -+ SetLastError( ERROR_INVALID_PARAMETER ); -+ result = FALSE; -+ break; -+ } -+ else if ((device_flags & RIDEV_NOLEGACY) == RIDEV_NOLEGACY) -+ { -+ device_flags &= ~RIDEV_NOLEGACY; -+ registration_flags |= RAW_INPUT_DEVICE_FLAG_NOLEGACY; -+ -+ if ((device_flags & RIDEV_CAPTUREMOUSE) == RIDEV_CAPTUREMOUSE && is_mouse) -+ { -+ FIXME("RIDEV_CAPTUREMOUSE support is not implemented\n"); -+ if (device->hwndTarget == NULL) -+ { -+ SetLastError( ERROR_INVALID_FLAGS ); -+ result = FALSE; -+ break; -+ } -+ device_flags &= ~RIDEV_CAPTUREMOUSE; -+ registration_flags |= RAW_INPUT_DEVICE_FLAG_CAPTUREMOUSE; -+ } -+ /* RIDEV_CAPTUREMOUSE && is_keyboard is not possible, because -+ RIDEV_CAPTUREMOUSE == RIDEV_NOHOTKEYS */ -+ -+ if ((device_flags & RIDEV_APPKEYS) == RIDEV_APPKEYS && is_keyboard) -+ { -+ FIXME("RIDEV_APPKEYS support is not implemented\n"); -+ device_flags &= ~RIDEV_APPKEYS; -+ registration_flags |= RAW_INPUT_DEVICE_FLAG_APPKEYS; -+ } -+ else if ((device_flags & RIDEV_APPKEYS) == RIDEV_APPKEYS && is_mouse) -+ { -+ SetLastError( ERROR_INVALID_FLAGS ); -+ result = FALSE; -+ break; -+ } -+ } -+ else if ((device_flags & RIDEV_CAPTUREMOUSE) == RIDEV_CAPTUREMOUSE || -+ (device_flags & RIDEV_APPKEYS) == RIDEV_APPKEYS) -+ { -+ SetLastError( ERROR_INVALID_FLAGS ); -+ result = FALSE; -+ break; -+ } -+ -+ if ((device_flags & RIDEV_PAGEONLY) == RIDEV_PAGEONLY && device->usUsage == 0) -+ { -+ device_flags &= ~RIDEV_PAGEONLY; -+ registration_flags |= RAW_INPUT_DEVICE_FLAG_PAGEONLY; -+ } -+ else if (((device_flags & RIDEV_PAGEONLY) == RIDEV_PAGEONLY && device->usUsage != 0) || -+ ((device_flags & RIDEV_PAGEONLY) != RIDEV_PAGEONLY && device->usUsage == 0)) -+ { -+ SetLastError( ERROR_INVALID_PARAMETER ); -+ result = FALSE; -+ break; -+ } -+ -+ if ((device_flags & RIDEV_EXCLUDE) == RIDEV_EXCLUDE) -+ { -+ if (device->hwndTarget != NULL) -+ { -+ SetLastError( ERROR_INVALID_PARAMETER ); -+ result = FALSE; -+ break; -+ } -+ device_flags &= ~RIDEV_EXCLUDE; -+ registration_flags |= RAW_INPUT_DEVICE_FLAG_EXCLUDE; -+ } -+ -+ if ((device_flags & RIDEV_INPUTSINK) == RIDEV_INPUTSINK) -+ { -+ FIXME("RIDEV_INPUTSINK support is not implemented\n"); -+ if (device->hwndTarget == NULL) -+ { -+ SetLastError( ERROR_INVALID_PARAMETER ); -+ result = FALSE; -+ break; -+ } -+ device_flags &= ~RIDEV_INPUTSINK; -+ registration_flags |= RAW_INPUT_DEVICE_FLAG_INPUTSINK; -+ } -+ -+ if ((device_flags & RIDEV_EXINPUTSINK) == RIDEV_EXINPUTSINK) -+ { -+ FIXME("RIDEV_EXINPUTSINK support is not implemented\n"); -+ if (device->hwndTarget == NULL) -+ { -+ SetLastError( ERROR_INVALID_PARAMETER ); -+ result = FALSE; -+ break; -+ } -+ device_flags &= ~RIDEV_EXINPUTSINK; -+ registration_flags |= RAW_INPUT_DEVICE_FLAG_EXINPUTSINK; -+ } -+ -+ if ((device_flags & RIDEV_DEVNOTIFY) == RIDEV_DEVNOTIFY) -+ { -+ FIXME("RIDEV_DEVNOTIFY support is not implemented\n"); -+ device_flags &= ~RIDEV_DEVNOTIFY; -+ registration_flags |= RAW_INPUT_DEVICE_FLAG_DEVNOTIFY; -+ } -+ -+ /* If anything is left, it's invalid */ -+ if (device_flags) -+ { -+ SetLastError( ERROR_INVALID_FLAGS ); -+ result = FALSE; -+ break; -+ } -+ -+ registrations[i].usage_page = device->usUsagePage; -+ registrations[i].usage = device->usUsage; -+ registrations[i].flags = registration_flags; -+ registrations[i].target_window = wine_server_user_handle( device->hwndTarget ); -+ } -+ -+ if (result) -+ { -+ BOOL ret; - -+ SERVER_START_REQ( register_raw_input_devices ) -+ { -+ req->count = uiNumDevices; -+ wine_server_add_data( req, registrations, registrations_size ); -+ ret = !wine_server_call_err( req ); -+ } -+ SERVER_END_REQ; -+ -+ result = ret; -+ } -+ -+ HeapFree( GetProcessHeap(), 0, registrations ); -+ -+ return result; -+} - - /****************************************************************** - * GetRawInputData (USER32.@) - */ - UINT WINAPI GetRawInputData(HRAWINPUT hRawInput, UINT uiCommand, LPVOID pData, PUINT pcbSize, UINT cbSizeHeader) - { -- FIXME("(hRawInput=%p, uiCommand=%d, pData=%p, pcbSize=%p, cbSizeHeader=%d) stub!\n", -+ BOOL ret; -+ UINT result; -+ -+ TRACE("(hRawInput=%p, uiCommand=%d, pData=%p, pcbSize=%p, cbSizeHeader=%d)\n", - hRawInput, uiCommand, pData, pcbSize, cbSizeHeader); - -- return 0; --} -+ if (cbSizeHeader != sizeof( RAWINPUTHEADER )) -+ { -+ SetLastError( ERROR_INVALID_PARAMETER ); -+ return (UINT)-1; -+ } - -+ SERVER_START_REQ( get_raw_input_data ) -+ { -+ req->handle = wine_server_user_handle( hRawInput ); -+ req->command = uiCommand; -+ req->report_size_only = pData == NULL || pcbSize == NULL; -+ req->header_size = cbSizeHeader; -+ if (pData != NULL && pcbSize != NULL) -+ wine_server_set_reply( req, pData, *pcbSize ); -+ ret = !wine_server_call_err( req ); -+ if ((!ret || pData == NULL) && pcbSize != NULL) -+ { -+ *pcbSize = reply->size; -+ result = 0; -+ } -+ else -+ result = reply->size; -+ } -+ SERVER_END_REQ; -+ -+ /* Error for an invalid handle is checked before checking if pcbSize is NULL on windows */ -+ if (ret && pcbSize != NULL) -+ return result; -+ else if (ret && pcbSize == NULL) -+ SetLastError( ERROR_NOACCESS ); -+ -+ return (UINT)-1; -+} - - /****************************************************************** - * GetRawInputBuffer (USER32.@) - */ - UINT WINAPI DECLSPEC_HOTPATCH GetRawInputBuffer(PRAWINPUT pData, PUINT pcbSize, UINT cbSizeHeader) - { -- FIXME("(pData=%p, pcbSize=%p, cbSizeHeader=%d) stub!\n", pData, pcbSize, cbSizeHeader); -+ BOOL ret; -+ UINT result; -+ -+ TRACE("(pData=%p, pcbSize=%p, cbSizeHeader=%d)\n", pData, pcbSize, cbSizeHeader); -+ -+ if (pcbSize == NULL || cbSizeHeader != sizeof( RAWINPUTHEADER )) -+ { -+ SetLastError( ERROR_INVALID_PARAMETER ); -+ return (UINT)-1; -+ } -+ -+ SERVER_START_REQ( get_raw_input_buffer ) -+ { -+ req->report_size_only = pData == NULL; -+ req->header_size = cbSizeHeader; -+ if (pData != NULL) -+ wine_server_set_reply( req, pData, *pcbSize ); -+ ret = !wine_server_call_err( req ); -+ if (!ret || pData == NULL) -+ { -+ *pcbSize = reply->minimum_size; -+ result = 0; -+ } -+ else -+ result = reply->count; -+ } -+ SERVER_END_REQ; - -- return 0; -+ return ret ? result : (UINT)-1; - } - - -@@ -522,20 +801,91 @@ UINT WINAPI DECLSPEC_HOTPATCH GetRawInputBuffer(PRAWINPUT pData, PUINT pcbSize, - */ - UINT WINAPI GetRawInputDeviceInfoA(HANDLE hDevice, UINT uiCommand, LPVOID pData, PUINT pcbSize) - { -- FIXME("(hDevice=%p, uiCommand=%d, pData=%p, pcbSize=%p) stub!\n", hDevice, uiCommand, pData, pcbSize); -+ TRACE("(hDevice=%p, uiCommand=%d, pData=%p, pcbSize=%p)\n", hDevice, uiCommand, pData, pcbSize); - -- return 0; --} -+ if (pcbSize == NULL) -+ { -+ SetLastError( ERROR_NOACCESS ); -+ return (UINT)-1; -+ } - -+ if (uiCommand == RIDI_DEVICENAME && pData != NULL) -+ { -+ WCHAR buffer[256]; -+ UINT size = 256; -+ const UINT ret = GetRawInputDeviceInfoW( hDevice, uiCommand, buffer, &size ); -+ /* ret is the character count */ -+ if (ret == (UINT)-1) -+ { -+ return ret; -+ } -+ else if (ret > 0 && *pcbSize >= ret) -+ { -+ const int ret2 = WideCharToMultiByte( CP_ACP, 0, buffer, ret, pData, *pcbSize, NULL, NULL ); -+ return ret2 ? ret2 : (UINT)-1; -+ } -+ else if (ret > 0) -+ { -+ *pcbSize = ret; -+ SetLastError( ERROR_INSUFFICIENT_BUFFER ); -+ return (UINT)-1; -+ } -+ else -+ { -+ *pcbSize = size; -+ return ret; -+ } -+ } -+ else -+ return GetRawInputDeviceInfoW( hDevice, uiCommand, pData, pcbSize ); -+} - - /****************************************************************** - * GetRawInputDeviceInfoW (USER32.@) - */ - UINT WINAPI GetRawInputDeviceInfoW(HANDLE hDevice, UINT uiCommand, LPVOID pData, PUINT pcbSize) - { -- FIXME("(hDevice=%p, uiCommand=%d, pData=%p, pcbSize=%p) stub!\n", hDevice, uiCommand, pData, pcbSize); -+ BOOL ret; -+ UINT result, size_in_bytes; -+ -+ TRACE("(hDevice=%p, uiCommand=%d, pData=%p, pcbSize=%p)\n", hDevice, uiCommand, pData, pcbSize); -+ -+ if (pcbSize == NULL) -+ { -+ SetLastError( ERROR_NOACCESS ); -+ return (UINT)-1; -+ } -+ if (uiCommand == RIDI_DEVICEINFO && pData != NULL) -+ { -+ RID_DEVICE_INFO *info = (RID_DEVICE_INFO *)pData; -+ if (info->cbSize != sizeof( RID_DEVICE_INFO )) -+ { -+ SetLastError( ERROR_INVALID_PARAMETER ); -+ return (UINT)-1; -+ } -+ } -+ -+ size_in_bytes = uiCommand == RIDI_DEVICENAME ? *pcbSize * sizeof( WCHAR ) : *pcbSize; -+ -+ SERVER_START_REQ( get_raw_input_device_info ) -+ { -+ req->handle = wine_server_user_handle( hDevice ); -+ req->command = uiCommand; -+ req->report_size_only = pData == NULL; -+ if (pData != NULL) -+ wine_server_set_reply( req, pData, size_in_bytes ); -+ ret = !wine_server_call_err( req ); -+ if (!ret || pData == NULL) -+ { -+ *pcbSize = reply->size; -+ result = 0; -+ } -+ else -+ result = reply->size; -+ } -+ SERVER_END_REQ; - -- return 0; -+ return ret ? result : (UINT)-1; - } - - -@@ -544,9 +894,39 @@ UINT WINAPI GetRawInputDeviceInfoW(HANDLE hDevice, UINT uiCommand, LPVOID pData, - */ - UINT WINAPI GetRegisteredRawInputDevices(PRAWINPUTDEVICE pRawInputDevices, PUINT puiNumDevices, UINT cbSize) - { -- FIXME("(pRawInputDevices=%p, puiNumDevices=%p, cbSize=%d) stub!\n", pRawInputDevices, puiNumDevices, cbSize); -+ BOOL ret = FALSE; -+ UINT result; -+ -+ TRACE("(pRawInputDevices=%p, puiNumDevices=%p, cbSize=%d)\n", pRawInputDevices, puiNumDevices, cbSize); -+ -+ if (cbSize != sizeof( RAWINPUTDEVICE )) -+ { -+ SetLastError( ERROR_INVALID_PARAMETER ); -+ return (UINT)-1; -+ } -+ if (puiNumDevices == NULL) -+ { -+ SetLastError( ERROR_NOACCESS ); -+ return (UINT)-1; -+ } -+ -+ SERVER_START_REQ( get_registered_raw_input_devices ) -+ { -+ req->report_size_only = pRawInputDevices == NULL; -+ if (pRawInputDevices != NULL) -+ wine_server_set_reply( req, pRawInputDevices, *puiNumDevices * sizeof( RAWINPUTDEVICE ) ); -+ ret = !wine_server_call_err( req ); -+ if (!ret || pRawInputDevices == NULL) -+ { -+ *puiNumDevices = reply->num_devices; -+ result = 0; -+ } -+ else -+ result = reply->num_devices; -+ } -+ SERVER_END_REQ; - -- return 0; -+ return ret ? result : (UINT)-1; - } - - -@@ -555,11 +935,19 @@ UINT WINAPI GetRegisteredRawInputDevices(PRAWINPUTDEVICE pRawInputDevices, PUINT - */ - LRESULT WINAPI DefRawInputProc(PRAWINPUT *paRawInput, INT nInput, UINT cbSizeHeader) - { -- FIXME("(paRawInput=%p, nInput=%d, cbSizeHeader=%d) stub!\n", *paRawInput, nInput, cbSizeHeader); -+ TRACE("(paRawInput=%p, nInput=%d, cbSizeHeader=%d)\n", *paRawInput, nInput, cbSizeHeader); - -- return 0; --} -+ if (cbSizeHeader != sizeof( RAWINPUTHEADER )) -+ { -+ /* Windows does not set last error code */ -+ return (LRESULT)-1; -+ } - -+ /* The supplied raw input entries can still be retrieved, -+ so they will have to be released later */ -+ -+ return S_OK; -+} - - /********************************************************************** - * AttachThreadInput (USER32.@) -diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c -index cb090dd..3b0a76f 100644 ---- a/dlls/user32/tests/input.c -+++ b/dlls/user32/tests/input.c -@@ -77,6 +77,18 @@ static struct { - - static UINT (WINAPI *pSendInput) (UINT, INPUT*, size_t); - static int (WINAPI *pGetMouseMovePointsEx) (UINT, LPMOUSEMOVEPOINT, LPMOUSEMOVEPOINT, int, DWORD); -+static UINT (WINAPI *pDefRawInputProc) (PRAWINPUT*, INT, UINT); -+static UINT (WINAPI *pGetRawInputBuffer) (PRAWINPUT, PUINT, UINT); -+static INT (WINAPI *pGetRawInputData) (HRAWINPUT, UINT, LPVOID, PUINT, UINT); -+static UINT (WINAPI *pGetRawInputDeviceInfoA) (HANDLE, UINT, LPVOID, PUINT); -+static UINT (WINAPI *pGetRawInputDeviceInfoW) (HANDLE, UINT, LPVOID, PUINT); -+static UINT (WINAPI *pGetRawInputDeviceList) (PRAWINPUTDEVICELIST, PUINT, UINT); -+static UINT (WINAPI *pGetRegisteredRawInputDevices) (PRAWINPUTDEVICE, PUINT, UINT); -+static BOOL (WINAPI *pRegisterRawInputDevices) (PRAWINPUTDEVICE, UINT, UINT); -+ -+#define HID_USAGE_PAGE_GENERIC ((unsigned short)0x01) -+#define HID_USAGE_GENERIC_MOUSE ((unsigned short)0x02) -+#define HID_USAGE_GENERIC_KEYBOARD ((unsigned short)0x06) - - #define MAXKEYEVENTS 12 - #define MAXKEYMESSAGES MAXKEYEVENTS /* assuming a key event generates one -@@ -159,7 +171,15 @@ static void init_function_pointers(void) - trace("GetProcAddress(%s) failed\n", #func); - - GET_PROC(SendInput) -+ GET_PROC(DefRawInputProc) - GET_PROC(GetMouseMovePointsEx) -+ GET_PROC(GetRawInputBuffer) -+ GET_PROC(GetRawInputData) -+ GET_PROC(GetRawInputDeviceInfoA) -+ GET_PROC(GetRawInputDeviceInfoW) -+ GET_PROC(GetRawInputDeviceList) -+ GET_PROC(GetRegisteredRawInputDevices) -+ GET_PROC(RegisterRawInputDevices) - - #undef GET_PROC - } -@@ -1643,6 +1663,1169 @@ static void test_key_names(void) - ok( bufferW[0] == 0xcccc, "wrong string %s\n", wine_dbgstr_w(bufferW) ); - } - -+static void test_def_raw_input_proc(void) -+{ -+ RAWINPUT *input = NULL, raw; -+ LRESULT ret; -+ -+ if (!pDefRawInputProc) -+ { -+ win_skip("DefRawInputProc is not available\n"); -+ return; -+ } -+ -+ ret = pDefRawInputProc(&input, 0, 0); -+ ok(ret == (LRESULT)-1, "DefRawInputProc returned wrong value: expected (LRESULT)-1, got %lu\n", ret); -+ -+ ret = pDefRawInputProc(&input, 0, sizeof(RAWINPUTHEADER)); -+ ok(ret == S_OK, "DefRawInputProc returned wrong value: expected S_OK, got %lu\n", ret); -+ -+ /* Test that DefRawInputProc is ignorant of the other parameters */ -+ memset(&raw, 0xFF, sizeof(raw)); -+ input = &raw; -+ -+ ret = pDefRawInputProc(&input, 1000000, sizeof(RAWINPUTHEADER)); -+ ok(ret == S_OK, "DefRawInputProc returned wrong value: expected S_OK, got %lu\n", ret); -+ -+ ret = pDefRawInputProc(&input, -1000000, sizeof(RAWINPUTHEADER)); -+ ok(ret == S_OK, "DefRawInputProc returned wrong value: expected S_OK, got %lu\n", ret); -+} -+ -+static void test_get_raw_input_device_list(void) -+{ -+ RAWINPUTDEVICELIST *device_list; -+ UINT ret, count, count2; -+ DWORD error; -+ -+ if (!pGetRawInputDeviceList) -+ { -+ win_skip("GetRawInputDeviceList is not available\n"); -+ return; -+ } -+ -+ count = 0; -+ ret = pGetRawInputDeviceList(NULL, &count, sizeof(RAWINPUTDEVICELIST)); -+ ok(ret == 0, "GetRawInputDeviceList returned wrong value: " -+ "expected 0, got %u\n", ret); -+ ok(count >= 1, "GetRawInputDeviceList returned incorrect number of " -+ "raw input device available: expected x >= 1, got %u\n", count); -+ -+ device_list = HeapAlloc(GetProcessHeap(), 0, count * sizeof(RAWINPUTDEVICELIST)); -+ memset(device_list, 0xFF, count * sizeof(RAWINPUTDEVICELIST)); -+ -+ SetLastError(0xdeadbeef); -+ count2 = 0; -+ ret = pGetRawInputDeviceList(device_list, &count2, sizeof(RAWINPUTDEVICELIST)); -+ error = GetLastError(); -+ ok(ret == (UINT)-1, "GetRawInputDeviceList returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret); -+ ok(error == ERROR_INSUFFICIENT_BUFFER, "GetRawInputDeviceList returned " -+ "wrong error code: %u\n", error); -+ ok(count2 == count, "GetRawInputDeviceList returned incorrect number of devices: " -+ "expected %u, got %u\n", count, count2); -+ -+ count2 = count; -+ ret = pGetRawInputDeviceList(device_list, &count2, sizeof(RAWINPUTDEVICELIST)); -+ ok(ret == count, "GetRawInputDeviceList returned wrong value: " -+ "expected %u, got %u\n", count, ret); -+ ok(count2 == count, "GetRawInputDeviceList returned incorrect number of devices: " -+ "expected %u, got %u\n", count, count2); -+ -+ ok(device_list[0].hDevice != NULL, "First raw input device doesn't have " -+ "a non-null handle\n"); -+ ok(device_list[0].dwType == RIM_TYPEMOUSE || device_list[0].dwType == RIM_TYPEKEYBOARD, -+ "First raw input device wasn't a mouse or a keyboard"); -+ -+ HeapFree(GetProcessHeap(), 0, device_list); -+} -+ -+static void test_get_raw_input_device_info_w(void) -+{ -+ UINT ret, size = 0, count; -+ RAWINPUTDEVICELIST *devices; -+ WCHAR buffer[512]; -+ RID_DEVICE_INFO info; -+ DWORD error; -+ -+ if (!pGetRawInputDeviceInfoW || !pGetRawInputDeviceList) -+ { -+ win_skip("GetRawInputDeviceInfoW and GetRawInputDeviceList are not available\n"); -+ return; -+ } -+ -+ SetLastError(0xdeadbeef); -+ ret = pGetRawInputDeviceInfoW(NULL, 0, NULL, NULL); -+ error = GetLastError(); -+ ok(ret == (UINT)-1, "GetRawInputDeviceInfoW returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret); -+ ok(error == ERROR_NOACCESS, "GetRawInputDeviceInfoW returned " -+ "wrong error code: %u\n", error); -+ -+ SetLastError(0xdeadbeef); -+ size = 0; -+ ret = pGetRawInputDeviceInfoW(NULL, 0, NULL, &size); -+ error = GetLastError(); -+ ok(ret == (UINT)-1, -+ "GetRawInputDeviceInfoW returned wrong value: expected (UINT)-1, got %u\n", ret); -+ ok(error == ERROR_INVALID_HANDLE, -+ "GetRawInputDeviceInfoW returned wrong error code: %u\n", error); -+ -+ ret = pGetRawInputDeviceList(NULL, &count, sizeof(RAWINPUTDEVICELIST)); -+ ok(ret == 0, "GetRawInputDeviceList failed to return raw input device count\n"); -+ ok(count > 0, "Should have at least one raw input device available\n"); -+ -+ devices = HeapAlloc(GetProcessHeap(), 0, count * sizeof(RAWINPUTDEVICELIST)); -+ ok(devices != NULL, "Failed to allocate memory for raw input devices\n"); -+ if (!devices) -+ return; -+ -+ ret = pGetRawInputDeviceList(devices, &count, sizeof(RAWINPUTDEVICELIST)); -+ ok(ret == count, "GetRawInputDeviceList returned incorrect " -+ "number of devices: expected %u, got %u", count, ret); -+ -+ SetLastError(0xdeadbeef); -+ size = 0; -+ ret = pGetRawInputDeviceInfoW(devices[0].hDevice, 0, NULL, &size); -+ error = GetLastError(); -+ ok(ret == (UINT)-1, "GetRawInputDeviceInfoW returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret); -+ ok(error == ERROR_INVALID_PARAMETER, "GetRawInputDeviceInfoW returned " -+ "wrong error code: %u\n", error); -+ -+ SetLastError(0xdeadbeef); -+ size = 0; -+ ret = pGetRawInputDeviceInfoW(devices[0].hDevice, RIDI_DEVICENAME, buffer, &size); -+ error = GetLastError(); -+ ok(ret == (UINT)-1, "GetRawInputDeviceInfoW returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret); -+ ok(error == ERROR_INSUFFICIENT_BUFFER, "GetRawInputDeviceInfoW returned " -+ "wrong error code: %u\n", error); -+ -+ size = 0; -+ ret = pGetRawInputDeviceInfoW(devices[0].hDevice, RIDI_DEVICENAME, NULL, &size); -+ ok(ret == 0, "GetRawInputDeviceInfoW returned wrong value: expected 0, got %u\n", ret); -+ ok(size > 5, "GetRawInputDeviceInfoW returned wrong " -+ "device name size: expected x > 5, got %u\n", size); -+ -+ buffer[0] = 0; -+ ret = pGetRawInputDeviceInfoW(devices[0].hDevice, RIDI_DEVICENAME, buffer, &size); -+ ok(ret != (UINT)-1 && ret > 0, "GetRawInputDeviceInfoW returned wrong value: " -+ "expected 0 < x < (UINT)-1, got %u\n", ret); -+ size = lstrlenW(buffer); -+ ok(size > 5, "GetRawInputDeviceInfoW returned too short device name: " -+ "expected x > 5, got %u\n", size); -+ -+ size = 0; -+ ret = pGetRawInputDeviceInfoW(devices[0].hDevice, RIDI_DEVICEINFO, NULL, &size); -+ ok(ret == 0, "GetRawInputDeviceInfoW returned wrong value: expected 0, got %u\n", ret); -+ ok(size == sizeof(RID_DEVICE_INFO), "GetRawInputDeviceInfoW returned " -+ "wrong device info size: expected sizeof(RID_DEVICE_INFO), got %u\n", size); -+ -+ size = sizeof(RID_DEVICE_INFO); -+ info.cbSize = sizeof(RID_DEVICE_INFO); -+ ret = pGetRawInputDeviceInfoW(devices[0].hDevice, RIDI_DEVICEINFO, &info, &size); -+ ok(ret == sizeof(RID_DEVICE_INFO), "GetRawInputDeviceInfoW returned wrong value: " -+ "expected sizeof(RID_DEVICE_INFO), got %u\n", ret); -+ -+ size = 0xdeadbeef; -+ ret = pGetRawInputDeviceInfoW(devices[0].hDevice, RIDI_PREPARSEDDATA, NULL, &size); -+ ok(ret == 0, "GetRawInputDeviceInfoW returned wrong value: " -+ "expected 0, got %u\n", ret); -+ ok(size == 0, "GetRawInputDeviceInfoW returned wrong preparsed data size: " -+ "expected 0, got %u\n", size); -+ -+ HeapFree(GetProcessHeap(), 0, devices); -+} -+ -+static void test_get_raw_input_device_info_a(void) -+{ -+ UINT ret, size = 0, count; -+ RAWINPUTDEVICELIST *devices; -+ char buffer[512]; -+ RID_DEVICE_INFO info; -+ DWORD error; -+ -+ if (!pGetRawInputDeviceInfoA || !pGetRawInputDeviceList) -+ { -+ win_skip("GetRawInputDeviceInfoA and GetRawInputDeviceList are not available\n"); -+ return; -+ } -+ -+ SetLastError(0xdeadbeef); -+ ret = pGetRawInputDeviceInfoA(NULL, 0, NULL, NULL); -+ error = GetLastError(); -+ ok(ret == (UINT)-1, "GetRawInputDeviceInfoA returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret); -+ ok(error == ERROR_NOACCESS, "GetRawInputDeviceInfoA returned " -+ "wrong error code: %u\n", error); -+ -+ SetLastError(0xdeadbeef); -+ size = 0; -+ ret = pGetRawInputDeviceInfoA(NULL, 0, NULL, &size); -+ error = GetLastError(); -+ ok(ret == (UINT)-1, -+ "GetRawInputDeviceInfoA returned wrong value: expected (UINT)-1, got %u\n", ret); -+ ok(error == ERROR_INVALID_HANDLE, -+ "GetRawInputDeviceInfoA returned wrong error code: %u\n", error); -+ -+ ret = pGetRawInputDeviceList(NULL, &count, sizeof(RAWINPUTDEVICELIST)); -+ ok(ret == 0, "GetRawInputDeviceList failed to return raw input device count\n"); -+ ok(count > 0, "Should have at least one raw input device available\n"); -+ -+ devices = HeapAlloc(GetProcessHeap(), 0, count * sizeof(RAWINPUTDEVICELIST)); -+ ok(devices != NULL, "Failed to allocate memory for raw input devices\n"); -+ if (!devices) -+ return; -+ -+ ret = pGetRawInputDeviceList(devices, &count, sizeof(RAWINPUTDEVICELIST)); -+ ok(ret == count, "GetRawInputDeviceList returned incorrect " -+ "number of devices: expected %u, got %u", count, ret); -+ -+ SetLastError(0xdeadbeef); -+ size = 0; -+ ret = pGetRawInputDeviceInfoA(devices[0].hDevice, 0, NULL, &size); -+ error = GetLastError(); -+ ok(ret == (UINT)-1, "GetRawInputDeviceInfoA returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret); -+ ok(error == ERROR_INVALID_PARAMETER, "GetRawInputDeviceInfoA returned " -+ "wrong error code: %u\n", error); -+ -+ SetLastError(0xdeadbeef); -+ size = 0; -+ ret = pGetRawInputDeviceInfoA(devices[0].hDevice, RIDI_DEVICENAME, buffer, &size); -+ error = GetLastError(); -+ ok(ret == (UINT)-1, "GetRawInputDeviceInfoA returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret); -+ ok(error == ERROR_INSUFFICIENT_BUFFER, "GetRawInputDeviceInfoA returned " -+ "wrong error code: %u\n", error); -+ -+ size = 0; -+ ret = pGetRawInputDeviceInfoA(devices[0].hDevice, RIDI_DEVICENAME, NULL, &size); -+ ok(ret == 0, "GetRawInputDeviceInfoA returned wrong value: expected 0, got %u\n", ret); -+ ok(size > 5, "GetRawInputDeviceInfoA returned wrong " -+ "device name size: expected x > 5, got %u\n", size); -+ -+ buffer[0] = 0; -+ ret = pGetRawInputDeviceInfoA(devices[0].hDevice, RIDI_DEVICENAME, buffer, &size); -+ ok(ret != (UINT)-1 && ret > 0, "GetRawInputDeviceInfoA returned wrong value: " -+ "expected 0 < x < (UINT)-1, got %u\n", ret); -+ size = strlen(buffer); -+ ok(size > 5, "GetRawInputDeviceInfoA returned too short device name: " -+ "expected x > 5, got %u\n", size); -+ -+ size = 0; -+ ret = pGetRawInputDeviceInfoA(devices[0].hDevice, RIDI_DEVICEINFO, NULL, &size); -+ ok(ret == 0, "GetRawInputDeviceInfoA returned wrong value: expected 0, got %u\n", ret); -+ ok(size == sizeof(RID_DEVICE_INFO), "GetRawInputDeviceInfoA returned " -+ "wrong device info size: expected sizeof(RID_DEVICE_INFO), got %u\n", size); -+ -+ size = sizeof(RID_DEVICE_INFO); -+ info.cbSize = sizeof(RID_DEVICE_INFO); -+ ret = pGetRawInputDeviceInfoA(devices[0].hDevice, RIDI_DEVICEINFO, &info, &size); -+ ok(ret == sizeof(RID_DEVICE_INFO), "GetRawInputDeviceInfoA returned wrong value: " -+ "expected sizeof(RID_DEVICE_INFO), got %u\n", ret); -+ -+ size = 0xdeadbeef; -+ ret = pGetRawInputDeviceInfoA(devices[0].hDevice, RIDI_PREPARSEDDATA, NULL, &size); -+ ok(ret == 0, "GetRawInputDeviceInfoA returned wrong value: " -+ "expected 0, got %u\n", ret); -+ ok(size == 0, "GetRawInputDeviceInfoA returned wrong preparsed data size: " -+ "expected 0, got %u\n", size); -+ -+ HeapFree(GetProcessHeap(), 0, devices); -+} -+ -+static void test_basic_get_registered_raw_input_devices(void) -+{ -+ RAWINPUTDEVICE device, devices[2]; -+ BOOL ret; -+ UINT ret2, count; -+ DWORD error; -+ -+ if (!pGetRegisteredRawInputDevices || !pRegisterRawInputDevices) -+ { -+ win_skip("GetRegisteredRawInputDevices and RegisterRawInputDevices are not available\n"); -+ return; -+ } -+ -+ /* Basic tests for GetRegisteredRawInputDevices */ -+ SetLastError(0xdeadbeef); -+ ret2 = pGetRegisteredRawInputDevices(NULL, NULL, 0); -+ error = GetLastError(); -+ ok(ret2 == (UINT)-1, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret2); -+ ok(error == ERROR_INVALID_PARAMETER, "GetRegisteredRawInputDevices returned " -+ "wrong error code: %u\n", error); -+ -+ SetLastError(0xdeadbeef); -+ ret2 = pGetRegisteredRawInputDevices(NULL, NULL, sizeof(RAWINPUTDEVICE)); -+ error = GetLastError(); -+ ok(ret2 == (UINT)-1, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret2); -+ ok(error == ERROR_NOACCESS, "GetRegisteredRawInputDevices returned " -+ "wrong error code: %u\n", error); -+ -+ SetLastError(0xdeadbeef); -+ ret2 = pGetRegisteredRawInputDevices(NULL, &count, 1); -+ error = GetLastError(); -+ ok(ret2 == (UINT)-1, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret2); -+ ok(error == ERROR_INVALID_PARAMETER, "GetRegisteredRawInputDevices returned " -+ "wrong error code: %u\n", error); -+ -+ count = 0xdeadbeef; -+ ret2 = pGetRegisteredRawInputDevices(NULL, &count, sizeof(RAWINPUTDEVICE)); -+ ok(ret2 == 0, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected 0, got %u\n", ret2); -+ ok(count == 0, "GetRegisteredRawInputDevices returned incorrect registration count: " -+ "expected 0, got %u\n", count); -+ -+ device.usUsagePage = HID_USAGE_PAGE_GENERIC; -+ device.usUsage = HID_USAGE_GENERIC_MOUSE; -+ device.dwFlags = 0; -+ device.hwndTarget = NULL; -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to subscribe to mouse raw input\n"); -+ -+ ret2 = pGetRegisteredRawInputDevices(NULL, &count, sizeof(RAWINPUTDEVICE)); -+ ok(ret2 == 0, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected 0, got %u\n", ret2); -+ ok(count == 1, "GetRegisteredRawInputDevices returned incorrect registration count: " -+ "expected 1, got %u\n", count); -+ -+ memset(&devices[0], 0xFF, sizeof(RAWINPUTDEVICE)); -+ ret2 = pGetRegisteredRawInputDevices(&devices[0], &count, sizeof(RAWINPUTDEVICE)); -+ ok(ret2 == 1, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected 1, got %u\n", ret2); -+ ok(memcmp(&device, &devices[0], sizeof(RAWINPUTDEVICE)) == 0, -+ "GetRegisteredRawInputDevices returned incorrect raw input device registration\n"); -+ -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to resubscribe to mouse raw input\n"); -+ -+ /* Verify that there is still the only one registration */ -+ memset(&devices[0], 0xFF, sizeof(RAWINPUTDEVICE)); -+ ret2 = pGetRegisteredRawInputDevices(&devices[0], &count, sizeof(RAWINPUTDEVICE)); -+ ok(ret2 == 1, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected 1, got %u\n", ret2); -+ ok(memcmp(&device, &devices[0], sizeof(RAWINPUTDEVICE)) == 0, -+ "GetRegisteredRawInputDevices returned incorrect raw input device registration\n"); -+ -+ device.dwFlags = RIDEV_REMOVE; -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to unsubscribe from mouse raw input\n"); -+ -+ /* Verify that no registrations are present */ -+ count = 0xdeadbeef; -+ ret2 = pGetRegisteredRawInputDevices(NULL, &count, sizeof(RAWINPUTDEVICE)); -+ ok(ret2 == 0, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected 0, got %u\n", ret2); -+ ok(count == 0, "GetRegisteredRawInputDevices returned incorrect registration count: " -+ "expected 0, got %u\n", count); -+} -+ -+static void test_basic_register_raw_input_devices(void) -+{ -+ RAWINPUTDEVICE device; -+ BOOL ret; -+ UINT ret2, count; -+ DWORD error; -+ -+ if (!pGetRegisteredRawInputDevices || !pRegisterRawInputDevices) -+ { -+ win_skip("GetRegisteredRawInputDevices and RegisterRawInputDevices are not available\n"); -+ return; -+ } -+ -+ /* Basic tests for RegisterRawInputDevices */ -+ SetLastError(0xdeadbeef); -+ ret = pRegisterRawInputDevices(NULL, 0, 0); -+ error = GetLastError(); -+ ok(!ret, "RegisterRawInputDevices should have failed\n"); -+ ok(error == ERROR_INVALID_PARAMETER, "RegisterRawInputDevices returned " -+ "wrong error code: %u\n", error); -+ -+ SetLastError(0xdeadbeef); -+ ret = pRegisterRawInputDevices(NULL, 0, sizeof(RAWINPUTDEVICE)); -+ error = GetLastError(); -+ ok(!ret, "RegisterRawInputDevices should have failed\n"); -+ ok(error == ERROR_INVALID_PARAMETER, "RegisterRawInputDevices returned " -+ "wrong error code: %u\n", error); -+ -+ device.usUsagePage = 0; -+ device.usUsage = 0; -+ device.dwFlags = 0; -+ device.hwndTarget = NULL; -+ SetLastError(0xdeadbeef); -+ ret = pRegisterRawInputDevices(&device, 0, sizeof(RAWINPUTDEVICE)); -+ error = GetLastError(); -+ ok(!ret, "RegisterRawInputDevices should have failed\n"); -+ ok(error == ERROR_INVALID_PARAMETER, "RegisterRawInputDevices returned " -+ "wrong error code: %u\n", error); -+ -+ SetLastError(0xdeadbeef); -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ error = GetLastError(); -+ ok(!ret, "RegisterRawInputDevices should have failed\n"); -+ ok(error == ERROR_INVALID_PARAMETER, "RegisterRawInputDevices returned " -+ "wrong error code: %u\n", error); -+ -+ device.usUsagePage = HID_USAGE_PAGE_GENERIC; -+ device.usUsage = HID_USAGE_GENERIC_MOUSE; -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to subscribe to mouse raw input\n"); -+ -+ device.dwFlags = RIDEV_REMOVE; -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to unsubscribe from mouse raw input\n"); -+ -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to reunsubscribe from mouse raw input\n"); -+ -+ device.usUsagePage = 0xFF; -+ device.usUsage = 0xFF; -+ device.dwFlags = 0; -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to subscribe to a non-existing device\n"); -+ -+ device.dwFlags = RIDEV_REMOVE; -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to unsubscribe from a non-existing device\n"); -+ -+ /* Assert that no registrations are present */ -+ count = 0xdeadbeef; -+ ret2 = pGetRegisteredRawInputDevices(NULL, &count, sizeof(RAWINPUTDEVICE)); -+ ok(ret2 == 0, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected 0, got %u\n", ret2); -+ ok(count == 0, "GetRegisteredRawInputDevices returned incorrect registration count: " -+ "expected 0, got %u\n", count); -+} -+ -+static void test_raw_input_device_flag_preconditions(void) -+{ -+ RAWINPUTDEVICE device; -+ BOOL ret; -+ UINT ret2, count; -+ DWORD error; -+ -+ if (!pGetRegisteredRawInputDevices || !pRegisterRawInputDevices) -+ { -+ win_skip("GetRegisteredRawInputDevices and RegisterRawInputDevices are not available\n"); -+ return; -+ } -+ -+ /* Test that RIDEV_REMOVE flags requires hwndTarget to be null*/ -+ device.usUsagePage = HID_USAGE_PAGE_GENERIC; -+ device.usUsage = HID_USAGE_GENERIC_MOUSE; -+ device.dwFlags = RIDEV_REMOVE; -+ device.hwndTarget = (HWND)-1; -+ SetLastError(0xdeadbeef); -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ error = GetLastError(); -+ ok(!ret, "RegisterRawInputDevices should have failed\n"); -+ ok(error == ERROR_INVALID_PARAMETER, "RegisterRawInputDevices returned " -+ "wrong error code: %u\n", error); -+ -+ /* Test that RIDEV_PAGEONLY requires usUsage to be 0 */ -+ device.usUsage = 0xFF; -+ device.dwFlags = RIDEV_PAGEONLY; -+ device.hwndTarget = NULL; -+ SetLastError(0xdeadbeef); -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ error = GetLastError(); -+ ok(!ret, "RegisterRawInputDevices should have failed\n"); -+ ok(error == ERROR_INVALID_PARAMETER, "RegisterRawInputDevices returned " -+ "wrong error code: %u\n", error); -+ -+ /* Test that RIDEV_EXCLUDE requires usUsage to be non-0 */ -+ device.usUsage = 0; -+ device.dwFlags = RIDEV_EXCLUDE; -+ device.hwndTarget = NULL; -+ SetLastError(0xdeadbeef); -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ error = GetLastError(); -+ ok(!ret, "RegisterRawInputDevices should have failed\n"); -+ ok(error == ERROR_INVALID_PARAMETER, "RegisterRawInputDevices returned " -+ "wrong error code: %u\n", error); -+ -+ /* Test that RIDEV_NOLEGACY cannot be used with other device then mouse and keyboard */ -+ device.usUsage = 0xFF; -+ device.dwFlags = RIDEV_NOLEGACY; -+ device.hwndTarget = NULL; -+ SetLastError(0xdeadbeef); -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ error = GetLastError(); -+ ok(!ret, "RegisterRawInputDevices should have failed\n"); -+ ok(error == ERROR_INVALID_PARAMETER, "RegisterRawInputDevices returned " -+ "wrong error code: %u\n", error); -+ -+ /* Test that RIDEV_INPUTSINK requires hwndTarget to be non-null */ -+ device.usUsage = HID_USAGE_GENERIC_MOUSE; -+ device.dwFlags = RIDEV_INPUTSINK; -+ device.hwndTarget = NULL; -+ SetLastError(0xdeadbeef); -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ error = GetLastError(); -+ ok(!ret, "RegisterRawInputDevices should have failed\n"); -+ ok(error == ERROR_INVALID_PARAMETER, "RegisterRawInputDevices returned " -+ "wrong error code: %u\n", error); -+ -+ /* Test that RIDEV_CAPTUREMOUSE must be combined with RIDEV_NOLEGACY -+ Since RIDEV_CAPTUREMOUSE == RIDEV_NOHOTKEYS, scope it for the mouse device */ -+ device.usUsage = HID_USAGE_GENERIC_MOUSE; -+ device.dwFlags = RIDEV_CAPTUREMOUSE; -+ device.hwndTarget = NULL; -+ SetLastError(0xdeadbeef); -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ error = GetLastError(); -+ ok(!ret, "RegisterRawInputDevices should have failed\n"); -+ ok(error == ERROR_INVALID_FLAGS, "RegisterRawInputDevices returned " -+ "wrong error code: %u\n", error); -+ -+ /* Test that RIDEV_APPKEYS must be combined with RIDEV_NOLEGACY */ -+ device.usUsage = HID_USAGE_GENERIC_KEYBOARD; -+ device.dwFlags = RIDEV_APPKEYS; -+ device.hwndTarget = NULL; -+ SetLastError(0xdeadbeef); -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ error = GetLastError(); -+ ok(!ret, "RegisterRawInputDevices should have failed\n"); -+ ok(error == ERROR_INVALID_FLAGS, "RegisterRawInputDevices returned " -+ "wrong error code: %u\n", error); -+ -+ /* Test that RIDEV_APPKEYS cannot be used with mouse */ -+ device.usUsage = HID_USAGE_GENERIC_MOUSE; -+ device.dwFlags = RIDEV_NOLEGACY | RIDEV_APPKEYS; -+ device.hwndTarget = NULL; -+ SetLastError(0xdeadbeef); -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ error = GetLastError(); -+ ok(!ret, "RegisterRawInputDevices should have failed\n"); -+ ok(error == ERROR_INVALID_FLAGS, "RegisterRawInputDevices returned " -+ "wrong error code: %u\n", error); -+ -+ /* Test that RIDEV_NOHOTKEYS cannot be used with mouse */ -+ device.usUsage = HID_USAGE_GENERIC_MOUSE; -+ device.dwFlags = RIDEV_NOHOTKEYS; -+ device.hwndTarget = NULL; -+ SetLastError(0xdeadbeef); -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ error = GetLastError(); -+ ok(!ret, "RegisterRawInputDevices should have failed\n"); -+ ok(error == ERROR_INVALID_FLAGS, "RegisterRawInputDevices returned " -+ "wrong error code: %u\n", error); -+ -+ /* Test reaction to an invalid flag */ -+ SetLastError(0xdeadbeef); -+ device.usUsagePage = HID_USAGE_PAGE_GENERIC; -+ device.usUsage = HID_USAGE_GENERIC_MOUSE; -+ device.dwFlags = 0x80000000; -+ device.hwndTarget = NULL; -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ error = GetLastError(); -+ ok(!ret, "RegisterRawInputDevices should have failed\n"); -+ ok(error == ERROR_INVALID_FLAGS, "RegisterRawInputDevices returned " -+ "wrong error code: %u\n", error); -+ -+ /* Assert that no registrations are present */ -+ count = 0xdeadbeef; -+ ret2 = pGetRegisteredRawInputDevices(NULL, &count, sizeof(RAWINPUTDEVICE)); -+ ok(ret2 == 0, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected 0, got %u\n", ret2); -+ ok(count == 0, "GetRegisteredRawInputDevices returned incorrect registration count: " -+ "expected 0, got %u\n", count); -+} -+ -+static void test_extended_register_raw_input_devices(void) -+{ -+ RAWINPUTDEVICE device, devices[2]; -+ BOOL ret; -+ UINT ret2, count; -+ -+ if (!pGetRegisteredRawInputDevices || !pRegisterRawInputDevices) -+ { -+ win_skip("GetRegisteredRawInputDevices and RegisterRawInputDevices are not available\n"); -+ return; -+ } -+ -+ /* Subscribe and unsubscribe from all devices in usage page */ -+ device.usUsagePage = HID_USAGE_PAGE_GENERIC; -+ device.usUsage = 0; -+ device.dwFlags = RIDEV_PAGEONLY; -+ device.hwndTarget = NULL; -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to subscribe to a usage page\n"); -+ -+ device.dwFlags = RIDEV_REMOVE | RIDEV_PAGEONLY; -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to unsubscribe to a usage page\n"); -+ -+ /* Assert that there are no devices registered */ -+ count = 0xdeadbeef; -+ ret2 = pGetRegisteredRawInputDevices(NULL, &count, sizeof(RAWINPUTDEVICE)); -+ ok(ret2 == 0, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected 0, got %u\n", ret2); -+ ok(count == 0, "GetRegisteredRawInputDevices returned incorrect registration count: " -+ "expected 0, got %u\n", count); -+ -+ /* Should allow to exclude a device */ -+ device.usUsagePage = HID_USAGE_PAGE_GENERIC; -+ device.usUsage = HID_USAGE_GENERIC_MOUSE; -+ device.dwFlags = RIDEV_EXCLUDE; -+ device.hwndTarget = NULL; -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to exclude mouse raw input\n"); -+ ok(ret, "Given (&device{1,2,RIDEV_EXCLUDE,0}, 1, sizeof), " -+ "RegisterRawInputDevices should successfully exclude a device from input feed\n"); -+ -+ /* Assert that there is one registration */ -+ count = 0xdeadbeef; -+ ret2 = pGetRegisteredRawInputDevices(NULL, &count, sizeof(RAWINPUTDEVICE)); -+ ok(ret2 == 0, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected 0, got %u\n", ret2); -+ ok(count == 1, "GetRegisteredRawInputDevices returned incorrect registration count: " -+ "expected 1, got %u\n", count); -+ -+ device.dwFlags = RIDEV_REMOVE; -+ ret = pRegisterRawInputDevices(&device, 1, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to unsubscribe\n"); -+ -+ /* Should override a device exclusion with an inclusion */ -+ devices[0].usUsagePage = HID_USAGE_PAGE_GENERIC; -+ devices[0].usUsage = HID_USAGE_GENERIC_MOUSE; -+ devices[0].dwFlags = RIDEV_EXCLUDE; -+ devices[0].hwndTarget = NULL; -+ devices[1].usUsagePage = HID_USAGE_PAGE_GENERIC; -+ devices[1].usUsage = HID_USAGE_GENERIC_MOUSE; -+ devices[1].dwFlags = 0; -+ devices[1].hwndTarget = NULL; -+ ret = pRegisterRawInputDevices(devices, 2, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to exclude and include mouse raw input " -+ "in the same call\n"); -+ -+ devices[1].dwFlags = RIDEV_REMOVE; -+ ret = pRegisterRawInputDevices(&devices[1], 1, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to unsubscribe\n"); -+ -+ /* Assert that there are no devices registered */ -+ count = 0xdeadbeef; -+ ret2 = pGetRegisteredRawInputDevices(NULL, &count, sizeof(RAWINPUTDEVICE)); -+ ok(ret2 == 0, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected 0, got %u\n", ret2); -+ ok(count == 0, "GetRegisteredRawInputDevices returned incorrect registration count: " -+ "expected 0, got %u\n", count); -+ -+ /* Should register a usage page and a device from that usage page, -+ unsubscribing from them separately */ -+ devices[0].usUsagePage = HID_USAGE_PAGE_GENERIC; -+ devices[0].usUsage = 0; -+ devices[0].dwFlags = RIDEV_PAGEONLY; -+ devices[0].hwndTarget = NULL; -+ devices[1].usUsagePage = HID_USAGE_PAGE_GENERIC; -+ devices[1].usUsage = HID_USAGE_GENERIC_MOUSE; -+ devices[1].dwFlags = 0; -+ devices[1].hwndTarget = NULL; -+ ret = pRegisterRawInputDevices(devices, 2, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to subscribe\n"); -+ -+ devices[0].dwFlags = RIDEV_REMOVE | RIDEV_PAGEONLY; -+ ret = pRegisterRawInputDevices(&devices[0], 1, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to unsubscribe\n"); -+ -+ /* Assert that one device is registered */ -+ count = 0xdeadbeef; -+ ret2 = pGetRegisteredRawInputDevices(NULL, &count, sizeof(RAWINPUTDEVICE)); -+ ok(ret2 == 0, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected 0, got %u\n", ret2); -+ ok(count == 1, "GetRegisteredRawInputDevices returned incorrect registration count: " -+ "expected 1, got %u\n", count); -+ -+ devices[1].dwFlags = RIDEV_REMOVE; -+ ret = pRegisterRawInputDevices(&devices[1], 1, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to unsubscribe\n"); -+ -+ /* Assert that there are no devices registered */ -+ count = 0xdeadbeef; -+ ret2 = pGetRegisteredRawInputDevices(NULL, &count, sizeof(RAWINPUTDEVICE)); -+ ok(ret2 == 0, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected 0, got %u\n", ret2); -+ ok(count == 0, "GetRegisteredRawInputDevices returned incorrect registration count: " -+ "expected 0, got %u\n", count); -+ -+ /* Should include a usage page and exclude a device */ -+ devices[0].usUsagePage = HID_USAGE_PAGE_GENERIC; -+ devices[0].usUsage = 0; -+ devices[0].dwFlags = RIDEV_PAGEONLY; -+ devices[0].hwndTarget = NULL; -+ devices[1].usUsagePage = HID_USAGE_PAGE_GENERIC; -+ devices[1].usUsage = HID_USAGE_GENERIC_MOUSE; -+ devices[1].dwFlags = RIDEV_EXCLUDE; -+ devices[1].hwndTarget = NULL; -+ ret = pRegisterRawInputDevices(devices, 2, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to subscribe\n"); -+ -+ count = 0xdeadbeef; -+ ret2 = pGetRegisteredRawInputDevices(NULL, &count, sizeof(RAWINPUTDEVICE)); -+ ok(ret2 == 0, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected 0, got %u\n", ret2); -+ ok(count == 2, "GetRegisteredRawInputDevices returned incorrect registration count: " -+ "expected 2, got %u\n", count); -+ -+ devices[0].dwFlags = RIDEV_REMOVE | RIDEV_PAGEONLY; -+ devices[1].dwFlags = RIDEV_REMOVE; -+ ret = pRegisterRawInputDevices(devices, 2, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to unsubscribe\n"); -+ -+ /* Assert that there are no devices registered */ -+ count = 0xdeadbeef; -+ ret2 = pGetRegisteredRawInputDevices(NULL, &count, sizeof(RAWINPUTDEVICE)); -+ ok(ret2 == 0, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected 0, got %u\n", ret2); -+ ok(count == 0, "GetRegisteredRawInputDevices returned incorrect registration count: " -+ "expected 0, got %u\n", count); -+ -+ /* Should allow to subscribe and unsubscribe in the same call */ -+ devices[0].usUsagePage = HID_USAGE_PAGE_GENERIC; -+ devices[0].usUsage = HID_USAGE_GENERIC_MOUSE; -+ devices[0].dwFlags = 0; -+ devices[0].hwndTarget = NULL; -+ devices[1].usUsagePage = HID_USAGE_PAGE_GENERIC; -+ devices[1].usUsage = HID_USAGE_GENERIC_MOUSE; -+ devices[1].dwFlags = RIDEV_REMOVE; -+ devices[1].hwndTarget = NULL; -+ ret = pRegisterRawInputDevices(devices, 2, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to subscribe and unsubscribe in the same call\n"); -+ -+ /* Assert that there are no devices registered */ -+ count = 0xdeadbeef; -+ ret2 = pGetRegisteredRawInputDevices(NULL, &count, sizeof(RAWINPUTDEVICE)); -+ ok(ret2 == 0, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected 0, got %u\n", ret2); -+ ok(count == 0, "GetRegisteredRawInputDevices returned incorrect registration count: " -+ "expected 0, got %u\n", count); -+ -+ /* Test that RegisterRawInputDevices is atomic, -+ if one device fails to register, no changes are made */ -+ devices[0].usUsagePage = HID_USAGE_PAGE_GENERIC; -+ devices[0].usUsage = HID_USAGE_GENERIC_MOUSE; -+ devices[0].dwFlags = 0; -+ devices[0].hwndTarget = NULL; -+ devices[1].usUsagePage = 0; -+ devices[1].usUsage = 0; -+ devices[1].dwFlags = 0; -+ devices[1].hwndTarget = NULL; -+ ret = pRegisterRawInputDevices(devices, 2, sizeof(RAWINPUTDEVICE)); -+ ok(!ret, "RegisterRawInputDevices should fail to register the devices\n"); -+ -+ /* Assert that there are no devices registered */ -+ count = 0xdeadbeef; -+ ret2 = pGetRegisteredRawInputDevices(NULL, &count, sizeof(RAWINPUTDEVICE)); -+ ok(ret2 == 0, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected 0, got %u\n", ret2); -+ ok(count == 0, "GetRegisteredRawInputDevices returned incorrect registration count: " -+ "expected 0, got %u\n", count); -+} -+ -+static void test_get_raw_input_data(void) -+{ -+ UINT ret, count; -+ DWORD error; -+ -+ if (!pGetRawInputData) -+ { -+ win_skip("GetRawInputData is not available\n"); -+ return; -+ } -+ -+ SetLastError(0xdeadbeef); -+ ret = pGetRawInputData(NULL, 0, NULL, NULL, 0); -+ error = GetLastError(); -+ ok(ret == (UINT)-1, "GetRawInputData returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret); -+ ok(error == ERROR_INVALID_PARAMETER, "GetRawInputData returned " -+ "wrong error code: %u\n", error); -+ -+ SetLastError(0xdeadbeef); -+ ret = pGetRawInputData(NULL, 0, NULL, NULL, sizeof(RAWINPUTHEADER)); -+ error = GetLastError(); -+ ok(ret == (UINT)-1, "GetRawInputData returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret); -+ ok(error == ERROR_INVALID_HANDLE, "GetRawInputData returned " -+ "wrong error code: %u\n", error); -+ -+ SetLastError(0xdeadbeef); -+ ret = pGetRawInputData(NULL, 0, NULL, &count, 1); -+ error = GetLastError(); -+ ok(ret == (UINT)-1, "GetRawInputData returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret); -+ ok(error == ERROR_INVALID_PARAMETER, "GetRawInputData returned " -+ "wrong error code: %u\n", error); -+ -+ SetLastError(0xdeadbeef); -+ ret = pGetRawInputData(NULL, 0, NULL, &count, sizeof(RAWINPUTHEADER)); -+ error = GetLastError(); -+ ok(ret == (UINT)-1, "GetRawInputData returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret); -+ ok(error == ERROR_INVALID_HANDLE, "GetRawInputData returned " -+ "wrong error code: %u\n", error); -+} -+ -+static void test_get_raw_input_buffer(void) -+{ -+ UINT ret, size; -+ DWORD error; -+ -+ if (!pGetRawInputBuffer) -+ { -+ win_skip("GetRawInputBuffer is not available\n"); -+ return; -+ } -+ -+ SetLastError(0xdeadbeef); -+ ret = pGetRawInputBuffer(NULL, NULL, 0); -+ error = GetLastError(); -+ ok(ret == (UINT)-1, "GetRawInputBuffer returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret); -+ ok(error == ERROR_INVALID_PARAMETER, "GetRawInputBuffer returned " -+ "wrong error code: %u\n", error); -+ -+ SetLastError(0xdeadbeef); -+ ret = pGetRawInputBuffer(NULL, NULL, sizeof(RAWINPUTHEADER)); -+ error = GetLastError(); -+ ok(ret == (UINT)-1, "GetRawInputBuffer returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret); -+ ok(error == ERROR_INVALID_PARAMETER, "GetRawInputBuffer returned " -+ "wrong error code: %u\n", error); -+ -+ SetLastError(0xdeadbeef); -+ ret = pGetRawInputBuffer(NULL, &size, 1); -+ error = GetLastError(); -+ ok(ret == (UINT)-1, "GetRawInputBuffer returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret); -+ ok(error == ERROR_INVALID_PARAMETER, "GetRawInputBuffer returned " -+ "wrong error code: %u\n", error); -+ -+ size = 0xdeadbeef; -+ ret = pGetRawInputBuffer(NULL, &size, sizeof(RAWINPUTHEADER)); -+ ok(ret == 0, "GetRawInputBuffer returned wrong value: expected 0, got %u\n", ret); -+ ok(size == 0, "GetRawInputBuffer returned wrong minimal buffer size: " -+ "expected 0, got %u\n", size); -+} -+ -+static BOOL wm_input_recieved; -+static BOOL legacy_mouse_message_recieved; -+static BOOL legacy_keyboard_message_recieved; -+ -+static LRESULT CALLBACK get_raw_input_data_wnd_proc(HWND hWnd, UINT msg, -+ WPARAM wParam, LPARAM lParam) -+{ -+ UINT dwSize, ret2; -+ RAWINPUT *raw; -+ BOOL ret; -+ LRESULT ret3; -+ DWORD error; -+ -+ legacy_mouse_message_recieved |= msg >= WM_MOUSEFIRST && msg <= WM_MOUSELAST; -+ legacy_keyboard_message_recieved |= msg >= WM_KEYFIRST && msg <= WM_KEYLAST; -+ -+ switch (msg) -+ { -+ case WM_INPUT: -+ /* Now that we have a valid HRAWINPUT handle, -+ let's test the case, when &dwSize is NULL */ -+ SetLastError(0xdeadbeef); -+ ret = pGetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, NULL, -+ sizeof(RAWINPUTHEADER)); -+ error = GetLastError(); -+ ok(ret == (UINT)-1, "GetRawInputData returned wrong value: " -+ "expected (UINT)-1, got %u\n", ret); -+ ok(error == ERROR_NOACCESS, "GetRawInputData returned " -+ "wrong error code: %u\n", error); -+ -+ /* Test retrieving of RAWINPUT data */ -+ ret2 = pGetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, &dwSize, -+ sizeof(RAWINPUTHEADER)); -+ ok(ret2 == 0, "GetRawInputData failed to retrieve raw input data size\n"); -+ -+ if (!(raw = HeapAlloc(GetProcessHeap(), 0, dwSize))) -+ break; -+ ret2 = pGetRawInputData((HRAWINPUT)lParam, RID_INPUT, raw, &dwSize, -+ sizeof(RAWINPUTHEADER)); -+ ok(ret2 == dwSize, "GetRawInputData failed to retrieve raw input data\n"); -+ ok(raw->header.dwType == RIM_TYPEMOUSE || raw->header.dwType == RIM_TYPEKEYBOARD, -+ "Raw input data entry was not from mouse or keyboard, expected otherwise\n"); -+ -+ ret3 = pDefRawInputProc(&raw, 1, sizeof(RAWINPUTHEADER)); -+ ok(ret3 == S_OK, "DefRawInputProc failed\n"); -+ -+ ret2 = pGetRawInputData((HRAWINPUT)lParam, RID_INPUT, raw, &dwSize, -+ sizeof(RAWINPUTHEADER)); -+ ok(ret2 == dwSize, "GetRawInputData failed to reretrieve raw input data after " -+ "calling DefRawInputProc\n"); -+ -+ HeapFree(GetProcessHeap(), 0, raw); -+ wm_input_recieved = TRUE; -+ return ret3; -+ } -+ return DefWindowProcA(hWnd, msg, wParam, lParam); -+} -+ -+#define ID_TIMER 1 -+ -+static void timer_proc(HWND hParent, UINT uMsg, UINT uEventID, DWORD dwTimer) -+{ -+ PostQuitMessage(0); -+} -+ -+static HWND test_get_raw_input_data_simulation_setup(HANDLE hInstance, const char *class_name, -+ RAWINPUTDEVICE *device, INPUT *input, UINT input_count) -+{ -+ MSG msg; -+ BOOL ret; -+ UINT ret2, size, ret3, i; -+ RAWINPUT *raw, *raw2; -+ -+ HWND hWnd = CreateWindowA(class_name, "GetRawInputDataTest", WS_OVERLAPPEDWINDOW, -+ 10, 10, 200, 200, NULL, NULL, hInstance, NULL); -+ assert(hWnd); -+ -+ ShowWindow(hWnd, SW_SHOW); -+ SetWindowPos(hWnd, HWND_TOPMOST, 10, 10, 200, 200, SWP_NOSIZE|SWP_NOMOVE); -+ SetForegroundWindow(hWnd); -+ UpdateWindow(hWnd); -+ SetFocus(hWnd); -+ -+ /* Flush queued messages */ -+ while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) -+ { -+ TranslateMessage(&msg); -+ DispatchMessageA(&msg); -+ } -+ -+ wm_input_recieved = FALSE; -+ legacy_mouse_message_recieved = FALSE; -+ legacy_keyboard_message_recieved = FALSE; -+ -+ device->hwndTarget = hWnd; -+ ret = pRegisterRawInputDevices(device, 1, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to subscribe to " -+ "a raw input device: %u\n", GetLastError()); -+ -+ ok(!GetInputState(), "GetInputState returned that there are mouse or keyboard " -+ "messages queued, expected otherwise\n"); -+ size = 0xdeadbeef; -+ ret2 = pGetRawInputBuffer(NULL, &size, sizeof(RAWINPUTHEADER)); -+ ok(ret2 == 0, "GetRawInputBuffer returned wrong value: expected 0, got %u\n", ret2); -+ ok(size == 0, "GetRawInputBuffer returned incorrect minimum buffer size: " -+ "expected 0, got %u\n", size); -+ -+ /* First send input to test raw input buffer */ -+ pSendInput(input_count, input, sizeof(INPUT)); -+ -+ ok(GetQueueStatus(QS_RAWINPUT), "GetQueueStatus returned that the queue was " -+ "not marked as containing raw input messages, expected otherwise\n"); -+ size = 0; -+ ret2 = pGetRawInputBuffer(NULL, &size, sizeof(RAWINPUTHEADER)); -+ ok(ret2 == 0, "GetRawInputBuffer returned wrong value: expected 0, got %u\n", ret2); -+ ok(size > 0, "GetRawInputBuffer returned incorrect minimum buffer size: " -+ "expected x > 0, got %u\n", size); -+ -+ /* Size variable is the size of a single entry of what GetRawInputBuffer will return, -+ therefore we will allocate enough space to accommodate 16 entries */ -+ size *= 16; -+ raw = HeapAlloc(GetProcessHeap(), 0, size * sizeof(RAWINPUT)); -+ ok(raw != NULL, "HeapAlloc failed to allocate memory for raw input buffer data\n"); -+ if (raw) -+ { -+ ret3 = pGetRawInputBuffer(raw, &size, sizeof(RAWINPUTHEADER)); -+ ok(ret3 > 0 && ret3 != (UINT)-1, "GetRawInputBuffer failed to read raw input buffer\n"); -+ for (i = 0, raw2 = raw; ret3 != (UINT)-1 && i < ret3; i++) -+ { -+ ok(raw2->header.dwType == RIM_TYPEMOUSE || raw2->header.dwType == RIM_TYPEKEYBOARD, -+ "Raw input event was not from mouse or keyboard, expected otherwise\n"); -+ ok( -+ (raw2->header.dwType == RIM_TYPEMOUSE && -+ raw2->header.dwSize == sizeof(RAWINPUTHEADER) + sizeof(RAWMOUSE)) || -+ (raw2->header.dwType == RIM_TYPEKEYBOARD && -+ raw2->header.dwSize == sizeof(RAWINPUTHEADER) + sizeof(RAWKEYBOARD)), -+ "Raw input event size didn't match the one expected for mouse or keyboard\n"); -+ raw2 = NEXTRAWINPUTBLOCK(raw2); -+ } -+ HeapFree(GetProcessHeap(), 0, raw); -+ } -+ ret2 = pGetRawInputBuffer(NULL, &size, sizeof(RAWINPUTHEADER)); -+ ok(ret2 == 0, "GetRawInputBuffer returned wrong value: expected 0, got %u\n", ret2); -+ ok(size == 0, "GetRawInputBuffer returned incorrect minimum buffer size: " -+ "expected 0, got %u\n", size); -+ -+ /* Proceed with testing other functionality */ -+ pSendInput(input_count, input, sizeof(INPUT)); -+ -+ ok(GetQueueStatus(QS_RAWINPUT), "GetQueueStatus returned that the queue was " -+ "not marked as containing raw input messages, expected otherwise\n"); -+ ret2 = pGetRawInputBuffer(NULL, &size, sizeof(RAWINPUTHEADER)); -+ ok(ret2 == 0, "GetRawInputBuffer returned wrong value: expected 0, got %u\n", ret2); -+ ok(size > 0, "GetRawInputBuffer returned incorrect minimum buffer size: " -+ "expected x > 0, got %u\n", size); -+ -+ /* Give half a second of running time for each test to be sure all messages are processed */ -+ SetTimer(hWnd, ID_TIMER, 500, (TIMERPROC)timer_proc); -+ -+ while (1 == 1) -+ { -+ ret = GetMessageA(&msg, NULL, 0, 0); -+ if (!ret || ret == (BOOL)-1) -+ break; -+ TranslateMessage(&msg); -+ DispatchMessageA(&msg); -+ } -+ -+ ok(ret != -1, "Error getting window message: %u\n", GetLastError()); -+ ok(wm_input_recieved, "WM_INPUT was not received\n"); -+ ok(!GetQueueStatus(QS_RAWINPUT), "GetQueueStatus returned that the queue was " -+ "marked as containing raw input messages, expected otherwise\n"); -+ -+ return hWnd; -+} -+ -+static void test_get_raw_input_data_simulation_teardown(HWND hWnd, RAWINPUTDEVICE *device) -+{ -+ BOOL ret; -+ UINT ret2; -+ DWORD count; -+ -+ KillTimer(hWnd, ID_TIMER); -+ -+ device->dwFlags = RIDEV_REMOVE | (device->usUsage == 0 ? RIDEV_PAGEONLY : 0); -+ device->hwndTarget = NULL; -+ ret = pRegisterRawInputDevices(device, 1, sizeof(RAWINPUTDEVICE)); -+ ok(ret, "RegisterRawInputDevices failed to unsubscribe from " -+ "a raw input device: %u\n", GetLastError()); -+ -+ count = 0xdeadbeef; -+ ret2 = pGetRegisteredRawInputDevices(NULL, &count, sizeof(RAWINPUTDEVICE)); -+ ok(ret2 == 0, "GetRegisteredRawInputDevices returned wrong value: " -+ "expected 0, got %u\n", ret2); -+ ok(count == 0, "GetRegisteredRawInputDevices returned incorrect registration count: " -+ "expected 0, got %u\n", count); -+ -+ DestroyWindow(hWnd); -+} -+ -+static void test_get_raw_input_data_simulation(void) -+{ -+ HWND hWnd; -+ WNDCLASSA wclass; -+ HANDLE hInstance = GetModuleHandleA( NULL ); -+ INPUT mouse_input[5], keyboard_input; -+ ATOM registration; -+ RAWINPUTDEVICE device; -+ unsigned int i; -+ -+ if (!pRegisterRawInputDevices || !pGetRawInputData || !pDefRawInputProc || -+ !pGetRawInputBuffer || !pSendInput) -+ { -+ win_skip("Functions required to perform raw input simulation are not available\n"); -+ return; -+ } -+ -+ wclass.lpszClassName = "GetRawInputDataTestClass"; -+ wclass.style = CS_HREDRAW | CS_VREDRAW; -+ wclass.lpfnWndProc = get_raw_input_data_wnd_proc; -+ wclass.hInstance = hInstance; -+ wclass.hIcon = LoadIconA(0, IDI_APPLICATION); -+ wclass.hCursor = LoadCursorA(NULL, IDC_ARROW); -+ wclass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); -+ wclass.lpszMenuName = NULL; -+ wclass.cbClsExtra = 0; -+ wclass.cbWndExtra = 0; -+ registration = RegisterClassA(&wclass); -+ assert(registration); -+ -+ /* Setup fixtures */ -+ device.usUsagePage = HID_USAGE_PAGE_GENERIC; -+ -+ memset(&keyboard_input, 0, sizeof(keyboard_input)); -+ keyboard_input.type = INPUT_KEYBOARD; -+ keyboard_input.ki.wVk = VK_SPACE; -+ -+ /* Be sure to move over the window, because the absolute window position on the screen -+ depends on how desktop widgets are placed */ -+ memset(&mouse_input, 0, sizeof(mouse_input)); -+ mouse_input[0].type = INPUT_MOUSE; -+ mouse_input[0].mi.dx = mouse_input[0].mi.dy = 15; -+ mouse_input[0].mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE; -+ mouse_input[1].type = INPUT_MOUSE; -+ mouse_input[1].mi.mouseData = 0x0078; -+ mouse_input[1].mi.dwFlags = MOUSEEVENTF_WHEEL; -+ for (i = 2; i < sizeof(mouse_input) / sizeof(mouse_input[0]); i++) -+ { -+ mouse_input[i].type = INPUT_MOUSE; -+ mouse_input[i].mi.dx = mouse_input[i].mi.dy = 30; -+ mouse_input[i].mi.dwFlags = MOUSEEVENTF_MOVE; -+ } -+ -+ /* Test WM_INPUT for mouse */ -+ device.usUsage = HID_USAGE_GENERIC_MOUSE; -+ device.dwFlags = 0; -+ -+ hWnd = test_get_raw_input_data_simulation_setup(hInstance, wclass.lpszClassName, &device, -+ mouse_input, 5); -+ ok(legacy_mouse_message_recieved, -+ "Didn't receive legacy mouse messages, while was expecting to\n"); -+ test_get_raw_input_data_simulation_teardown(hWnd, &device); -+ -+ /* Test WM_INPUT for keyboard */ -+ device.usUsage = HID_USAGE_GENERIC_KEYBOARD; -+ device.dwFlags = 0; -+ -+ hWnd = test_get_raw_input_data_simulation_setup(hInstance, wclass.lpszClassName, &device, -+ &keyboard_input, 1); -+ ok(legacy_keyboard_message_recieved, -+ "Didn't receive keyboard messages, while was expecting to\n"); -+ test_get_raw_input_data_simulation_teardown(hWnd, &device); -+ -+ /* Test RIDEV_PAGEONLY using mouse */ -+ device.usUsage = 0; -+ device.dwFlags = RIDEV_PAGEONLY; -+ -+ hWnd = test_get_raw_input_data_simulation_setup(hInstance, wclass.lpszClassName, &device, -+ mouse_input, 5); -+ ok(legacy_mouse_message_recieved, -+ "Didn't receive legacy mouse messages, while was expecting to\n"); -+ test_get_raw_input_data_simulation_teardown(hWnd, &device); -+ -+ /* Test RIDEV_PAGEONLY using keyboard */ -+ device.usUsage = 0; -+ device.dwFlags = RIDEV_PAGEONLY; -+ -+ hWnd = test_get_raw_input_data_simulation_setup(hInstance, wclass.lpszClassName, &device, -+ &keyboard_input, 1); -+ ok(legacy_keyboard_message_recieved, -+ "Didn't receive legacy keyboard messages, while was expecting to\n"); -+ test_get_raw_input_data_simulation_teardown(hWnd, &device); -+ -+ /* Test RIDEV_NOLEGACY for mouse */ -+ device.usUsage = HID_USAGE_GENERIC_MOUSE; -+ device.dwFlags = RIDEV_NOLEGACY; -+ -+ hWnd = test_get_raw_input_data_simulation_setup(hInstance, wclass.lpszClassName, &device, -+ mouse_input, 5); -+ ok(!legacy_mouse_message_recieved, -+ "Did receive legacy mouse messages, while was expecting not to\n"); -+ test_get_raw_input_data_simulation_teardown(hWnd, &device); -+ -+ /* Test RIDEV_NOLEGACY for keyboard */ -+ device.usUsage = HID_USAGE_GENERIC_KEYBOARD; -+ device.dwFlags = RIDEV_NOLEGACY; -+ -+ hWnd = test_get_raw_input_data_simulation_setup(hInstance, wclass.lpszClassName, &device, -+ &keyboard_input, 1); -+ ok(!legacy_keyboard_message_recieved, -+ "Did receive legacy mouse messages, while was expecting not to\n"); -+ test_get_raw_input_data_simulation_teardown(hWnd, &device); -+} -+ - START_TEST(input) - { - init_function_pointers(); -@@ -1663,6 +2846,18 @@ START_TEST(input) - test_keyboard_layout_name(); - test_key_names(); - -+ test_def_raw_input_proc(); -+ test_get_raw_input_device_list(); -+ test_get_raw_input_device_info_w(); -+ test_get_raw_input_device_info_a(); -+ test_basic_get_registered_raw_input_devices(); -+ test_basic_register_raw_input_devices(); -+ test_raw_input_device_flag_preconditions(); -+ test_extended_register_raw_input_devices(); -+ test_get_raw_input_data(); -+ test_get_raw_input_buffer(); -+ test_get_raw_input_data_simulation(); -+ - if(pGetMouseMovePointsEx) - test_GetMouseMovePointsEx(); - else -diff --git a/server/Makefile.in b/server/Makefile.in -index a2f1a52..c12b2df 100644 ---- a/server/Makefile.in -+++ b/server/Makefile.in -@@ -28,6 +28,7 @@ C_SRCS = \ - procfs.c \ - ptrace.c \ - queue.c \ -+ raw_input.c \ - region.c \ - registry.c \ - request.c \ -diff --git a/server/process.c b/server/process.c -index de3b594..806e4ae 100644 ---- a/server/process.c -+++ b/server/process.c -@@ -48,6 +48,7 @@ - #include "request.h" - #include "user.h" - #include "security.h" -+#include "raw_input.h" - - /* process structure */ - -@@ -333,10 +334,14 @@ struct thread *create_process( int fd, struct thread *parent_thread, int inherit - process->desktop = 0; - process->token = NULL; - process->trace_data = 0; -+ process->raw_input_len = 0; -+ process->raw_input_index = 0; - list_init( &process->thread_list ); - list_init( &process->locks ); - list_init( &process->classes ); - list_init( &process->dlls ); -+ list_init( &process->raw_registered ); -+ list_init( &process->raw_inputs ); - - process->start_time = current_time; - process->end_time = 0; -@@ -419,6 +424,7 @@ static void process_destroy( struct object *obj ) - - close_process_handles( process ); - set_process_startup_state( process, STARTUP_ABORTED ); -+ release_raw_input( &process->raw_registered, &process->raw_inputs ); - if (process->console) release_object( process->console ); - if (process->parent) release_object( process->parent ); - if (process->msg_fd) release_object( process->msg_fd ); -diff --git a/server/process.h b/server/process.h -index 93ec6c7..97d3120 100644 ---- a/server/process.h -+++ b/server/process.h -@@ -22,6 +22,7 @@ - #define __WINE_SERVER_PROCESS_H - - #include "object.h" -+#include "raw_input.h" - - struct atom_table; - struct handle_table; -@@ -81,6 +82,10 @@ struct process - client_ptr_t peb; /* PEB address in client address space */ - client_ptr_t ldt_copy; /* pointer to LDT copy in client addr space */ - unsigned int trace_data; /* opaque data used by the process tracing mechanism */ -+ struct list raw_registered; /* registered raw input devices */ -+ struct list raw_inputs; /* queued raw inputs */ -+ unsigned int raw_input_len; /* number of valid raw input event ids */ -+ unsigned int raw_input_index; /* number of raw input events issued */ - }; - - struct process_snapshot -diff --git a/server/protocol.def b/server/protocol.def -index 80c0cd3..903ddee 100644 ---- a/server/protocol.def -+++ b/server/protocol.def -@@ -3375,3 +3375,74 @@ enum coords_relative - @REQ(set_suspend_context) - VARARG(context,context); /* thread context */ - @END -+ -+ -+/* Get the raw input device list */ -+@REQ(get_raw_input_device_list) -+ unsigned int report_size_only; /* reply only with the device count */ -+@REPLY -+ unsigned int num_devices; /* number of raw input device in the system */ -+ VARARG(devices,bytes); /* RAWINPUTDEVICELIST structures */ -+@END -+ -+/* Get the raw input device info */ -+@REQ(get_raw_input_device_info) -+ user_handle_t handle; /* raw input device handle */ -+ unsigned int command; /* desired characteristic of the device */ -+ unsigned int report_size_only; /* reply only the with the required size to store the data */ -+@REPLY -+ data_size_t size; /* size of the data about the device */ -+ VARARG(info,bytes); /* string or data structure about the device */ -+@END -+ -+/* Get the registered raw input devices */ -+@REQ(get_registered_raw_input_devices) -+ unsigned int report_size_only; /* reply only with the device count */ -+@REPLY -+ unsigned int num_devices; /* number of raw input device registrations */ -+ VARARG(devices,bytes); /* RAWINPUTDEVICE structures */ -+@END -+ -+/* Register raw input devices */ -+@REQ(register_raw_input_devices) -+ unsigned int count; /* number of registrations submitted */ -+ VARARG(registrations,bytes); /* raw_input_device_registration structures (see below) */ -+@END -+struct raw_input_device_registration -+{ -+ unsigned short usage_page; /* usage page of the device group to register to */ -+ unsigned short usage; /* usage id of the device to register to */ -+ unsigned int flags; /* configuration of the registration (see below) */ -+ user_handle_t target_window; /* optional window handle to receive input messages */ -+}; -+#define RAW_INPUT_DEVICE_FLAG_REMOVE 0x0001 -+#define RAW_INPUT_DEVICE_FLAG_PAGEONLY 0x0002 -+#define RAW_INPUT_DEVICE_FLAG_EXCLUDE 0x0004 -+#define RAW_INPUT_DEVICE_FLAG_NOLEGACY 0x0008 -+#define RAW_INPUT_DEVICE_FLAG_NOHOTKEYS 0x0010 -+#define RAW_INPUT_DEVICE_FLAG_CAPTUREMOUSE 0x0020 -+#define RAW_INPUT_DEVICE_FLAG_APPKEYS 0x0040 -+#define RAW_INPUT_DEVICE_FLAG_INPUTSINK 0x0080 -+#define RAW_INPUT_DEVICE_FLAG_EXINPUTSINK 0x0100 -+#define RAW_INPUT_DEVICE_FLAG_DEVNOTIFY 0x0200 -+ -+/* Get raw input data */ -+@REQ(get_raw_input_data) -+ user_handle_t handle; /* raw input event handle */ -+ unsigned int command; /* instruction to reply with just the header or the whole data */ -+ unsigned int report_size_only; /* reply only with the required size to store the data */ -+ unsigned int header_size; /* client size of RAWINPUTHEADER data structure */ -+@REPLY -+ data_size_t size; /* size of the raw input data */ -+ VARARG(data,bytes); /* RAWINPUTHEADER or RAWINPUT data structure */ -+@END -+ -+/* Get buffered raw input data */ -+@REQ(get_raw_input_buffer) -+ unsigned int report_size_only; /* reply only with the minimum size to get the first entry */ -+ unsigned int header_size; /* client size of RAWINPUTHEADER data structure */ -+@REPLY -+ unsigned int count; /* count of raw input events returned */ -+ data_size_t minimum_size; /* minimum buffer size to retrieve a buffered entry */ -+ VARARG(data,bytes); /* RAWINPUT data structures */ -+@END -diff --git a/server/queue.c b/server/queue.c -index 4fd32ed..ae436ef 100644 ---- a/server/queue.c -+++ b/server/queue.c -@@ -40,6 +40,7 @@ - #include "process.h" - #include "request.h" - #include "user.h" -+#include "raw_input.h" - - #define WM_NCMOUSEFIRST WM_NCMOUSEMOVE - #define WM_NCMOUSELAST (WM_NCMOUSEFIRST+(WM_MOUSELAST-WM_MOUSEFIRST)) -@@ -121,6 +122,7 @@ struct msg_queue - unsigned int changed_mask; /* changed wakeup mask */ - int paint_count; /* pending paint messages count */ - int hotkey_count; /* pending hotkey messages count */ -+ int rawinput_count; /* pending raw input messages count */ - int quit_message; /* is there a pending quit message? */ - int exit_code; /* exit code of pending quit message */ - int cursor_count; /* per-queue cursor show count */ -@@ -281,6 +283,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_ - queue->changed_mask = 0; - queue->paint_count = 0; - queue->hotkey_count = 0; -+ queue->rawinput_count = 0; - queue->quit_message = 0; - queue->cursor_count = 0; - queue->recv_result = NULL; -@@ -437,6 +440,12 @@ static inline int is_keyboard_msg( struct message *msg ) - return (msg->msg >= WM_KEYFIRST && msg->msg <= WM_KEYLAST); - } - -+/* check whether msg is a mouse message */ -+static inline int is_mouse_msg( struct message *msg ) -+{ -+ return (msg->msg >= WM_MOUSEFIRST && msg->msg <= WM_MOUSELAST); -+} -+ - /* check if message is matched by the filter */ - static inline int check_msg_filter( unsigned int msg, unsigned int first, unsigned int last ) - { -@@ -604,6 +613,8 @@ static void remove_queue_message( struct msg_queue *queue, struct message *msg, - clear_queue_bits( queue, QS_POSTMESSAGE|QS_ALLPOSTMESSAGE ); - if (msg->msg == WM_HOTKEY && --queue->hotkey_count == 0) - clear_queue_bits( queue, QS_HOTKEY ); -+ if (msg->msg == WM_INPUT && --queue->rawinput_count == 0) -+ clear_queue_bits( queue, QS_RAWINPUT ); - break; - } - free_message( msg ); -@@ -1452,7 +1463,10 @@ static void queue_hardware_message( struct desktop *desktop, struct message *msg - if (win != desktop->cursor.win) always_queue = 1; - desktop->cursor.win = win; - -- if (!always_queue || merge_message( input, msg )) free_message( msg ); -+ if ((is_keyboard_msg( msg ) && is_nolegacy_set_for_raw_input_keyboard()) || -+ (is_mouse_msg( msg ) && is_nolegacy_set_for_raw_input_mouse()) || -+ !always_queue || merge_message( input, msg )) -+ free_message( msg ); - else - { - msg->unique_id = 0; /* will be set once we return it to the app */ -@@ -1957,6 +1971,11 @@ void post_message( user_handle_t win, unsigned int message, lparam_t wparam, lpa - set_queue_bits( thread->queue, QS_HOTKEY ); - thread->queue->hotkey_count++; - } -+ if (message == WM_INPUT) -+ { -+ set_queue_bits( thread->queue, QS_RAWINPUT ); -+ thread->queue->rawinput_count++; -+ } - } - release_object( thread ); - } -@@ -2019,6 +2038,52 @@ void free_hotkeys( struct desktop *desktop, user_handle_t window ) - } - - -+/* Get the count and handles of queued raw input messages */ -+BOOL get_queued_raw_input_message_handles( lparam_t **handles, unsigned int *count ) -+{ -+ struct msg_queue *queue = get_current_queue(); -+ struct message *msg; -+ unsigned int index = 0; -+ -+ if (!queue->rawinput_count) -+ { -+ *handles = NULL; -+ *count = 0; -+ return TRUE; -+ } -+ -+ *handles = mem_alloc( queue->rawinput_count * sizeof( lparam_t ) ); -+ if (!*handles) -+ return FALSE; -+ -+ *count = queue->rawinput_count; -+ -+ LIST_FOR_EACH_ENTRY( msg, &queue->msg_list[POST_MESSAGE], struct message, entry ) -+ { -+ if (msg->msg == WM_INPUT) -+ (*handles)[index++] = msg->lparam; -+ } -+ -+ return TRUE; -+} -+ -+/* Remove given amount of raw input messages */ -+void dequeue_raw_input_messages( unsigned int count ) -+{ -+ struct msg_queue *queue = get_current_queue(); -+ struct message *msg, *msg2; -+ -+ LIST_FOR_EACH_ENTRY_SAFE( msg, msg2, &queue->msg_list[POST_MESSAGE], struct message, entry ) -+ { -+ if (msg->msg != WM_INPUT) -+ continue; -+ if (!count--) -+ break; -+ remove_queue_message( queue, msg, POST_MESSAGE ); -+ } -+} -+ -+ - /* check if the thread owning the window is hung */ - DECL_HANDLER(is_window_hung) - { -@@ -2210,9 +2275,15 @@ DECL_HANDLER(send_hardware_message) - switch (req->input.type) - { - case INPUT_MOUSE: -+ queue_mouse_raw_input( req->input.mouse.flags, req->input.mouse.info, -+ req->input.mouse.data, req->input.mouse.x, req->input.mouse.y, desktop->cursor.x, -+ desktop->cursor.y, desktop->foreground_input ? desktop->foreground_input->focus : 0 ); - reply->wait = queue_mouse_message( desktop, req->win, &req->input, req->flags, sender ); - break; - case INPUT_KEYBOARD: -+ queue_keyboard_raw_input( req->input.kbd.flags, req->input.kbd.info, -+ req->input.kbd.vkey, req->input.kbd.scan, -+ desktop->foreground_input ? desktop->foreground_input->focus : 0 ); - reply->wait = queue_keyboard_message( desktop, req->win, &req->input, req->flags, sender ); - break; - case INPUT_HARDWARE: -diff --git a/server/raw_input.c b/server/raw_input.c -new file mode 100644 -index 0000000..4841683 ---- /dev/null -+++ b/server/raw_input.c -@@ -0,0 +1,747 @@ -+/* -+ * Server-side Raw Input Handling -+ * -+ * Copyright (C) 2011 Vincas Miliūnas -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+ -+#include "config.h" -+#include "wine/port.h" -+ -+#include -+#include -+#include -+ -+#include "ntstatus.h" -+#define WIN32_NO_STATUS -+#include "windef.h" -+#include "winbase.h" -+#include "winuser.h" -+#include "winternl.h" -+ -+#include "object.h" -+#include "process.h" -+#include "request.h" -+#include "user.h" -+ -+#define MAX_RAW_INPUT_QUEUE_LENGTH 32 -+ -+#define MOUSE_DEVICE_HANDLE ((user_handle_t)0x01) -+#define KEYBOARD_DEVICE_HANDLE ((user_handle_t)0x02) -+ -+#define HID_USAGE_PAGE_GENERIC ((unsigned short)0x01) -+#define HID_USAGE_GENERIC_MOUSE ((unsigned short)0x02) -+#define HID_USAGE_GENERIC_KEYBOARD ((unsigned short)0x06) -+ -+extern BOOL get_queued_raw_input_message_handles( lparam_t **handles, unsigned int *count ); -+extern void dequeue_raw_input_messages( unsigned int count ); -+ -+struct raw_registration -+{ -+ struct list entry; -+ unsigned short usage_page; -+ unsigned short usage; -+ unsigned int flags; -+ user_handle_t target_window; -+}; -+ -+struct raw_input -+{ -+ struct list entry; -+ unsigned int handle; -+ user_handle_t device_handle; -+ unsigned short input_usage_page; -+ unsigned short input_usage; -+ BOOL retrieved; -+ RAWINPUT raw; -+}; -+ -+struct raw_device -+{ -+ user_handle_t handle; -+ const WCHAR *name; -+ RID_DEVICE_INFO info; -+}; -+ -+/* Data structures to supply data for 32bit client from a 64bit server */ -+struct RAWINPUTHEADER32 -+{ -+ DWORD dwType; -+ DWORD dwSize; -+ DWORD hDevice; -+ DWORD wParam; -+}; -+ -+struct RAWINPUT32 -+{ -+ struct RAWINPUTHEADER32 header; -+ union -+ { -+ RAWMOUSE mouse; -+ RAWKEYBOARD keyboard; -+ } data; -+}; -+ -+/* Raw input device names */ -+static const WCHAR mouse_raw_input_device_name[] = -+ {'W','I','N','E',' ','R','a','w',' ','I','n','p','u','t',' ', -+ 'M','o','u','s','e','\0'}; -+static const WCHAR keyboard_raw_input_device_name[] = -+ {'W','I','N','E',' ','R','a','w',' ','I','n','p','u','t',' ', -+ 'K','e','y','b','o','a','r','d','\0'}; -+ -+/* Standard raw input devices with typical device info values */ -+static const struct raw_device raw_devices[] = -+{ -+ {MOUSE_DEVICE_HANDLE, mouse_raw_input_device_name, -+ {sizeof( RID_DEVICE_INFO ), RIM_TYPEMOUSE, {.mouse = {1, 3, 100, FALSE}}}}, -+ {KEYBOARD_DEVICE_HANDLE, keyboard_raw_input_device_name, -+ {sizeof( RID_DEVICE_INFO ), RIM_TYPEKEYBOARD, {.keyboard = {4, 0, 1, 12, 3, 101}}}} -+}; -+#define NUM_RAW_DEVICES (sizeof( raw_devices ) / sizeof( raw_devices[0] )) -+ -+/* Release allocated raw input data */ -+void release_raw_input( struct list *registrations, struct list *inputs ) -+{ -+ struct raw_registration *registration, *registration2; -+ struct raw_input *input, *input2; -+ -+ LIST_FOR_EACH_ENTRY_SAFE( registration, registration2, registrations, -+ struct raw_registration, entry ) -+ { -+ list_remove( ®istration->entry ); -+ free( registration ); -+ } -+ -+ LIST_FOR_EACH_ENTRY_SAFE( input, input2, inputs, struct raw_input, entry ) -+ { -+ list_remove( &input->entry ); -+ free( input ); -+ } -+} -+ -+/* Register or unregister a given raw input device registration */ -+static void register_raw_input_device( struct raw_input_device_registration *new_registration ) -+{ -+ struct raw_registration *registration; -+ LIST_FOR_EACH_ENTRY( registration, ¤t->process->raw_registered, -+ struct raw_registration, entry ) -+ { -+ /* * They must be on the same usage page -+ * both marked as PAGEONLY or -+ both not marked as PAGEONLY and have identical usage ids */ -+ if (registration->usage_page != new_registration->usage_page || -+ (!(registration->flags & RAW_INPUT_DEVICE_FLAG_PAGEONLY && -+ new_registration->flags & RAW_INPUT_DEVICE_FLAG_PAGEONLY) && -+ (registration->flags & RAW_INPUT_DEVICE_FLAG_PAGEONLY || -+ new_registration->flags & RAW_INPUT_DEVICE_FLAG_PAGEONLY || -+ registration->usage != new_registration->usage))) -+ continue; -+ -+ if (new_registration->flags & RAW_INPUT_DEVICE_FLAG_REMOVE) -+ { -+ list_remove( ®istration->entry ); -+ free( registration ); -+ return; -+ } -+ -+ /* Update existing registration */ -+ registration->flags = new_registration->flags; -+ registration->target_window = new_registration->target_window; -+ return; -+ } -+ -+ if (new_registration->flags & RAW_INPUT_DEVICE_FLAG_REMOVE || -+ !(registration = mem_alloc( sizeof( *registration ) ))) -+ return; -+ -+ registration->usage_page = new_registration->usage_page; -+ registration->usage = new_registration->usage; -+ registration->flags = new_registration->flags; -+ registration->target_window = new_registration->target_window; -+ -+ list_add_tail( ¤t->process->raw_registered, ®istration->entry ); -+} -+ -+/* Remove a raw input event from the queue */ -+static void remove_raw_input( struct raw_input *input ) -+{ -+ list_remove( &input->entry ); -+ current->process->raw_input_len -= 1; -+ free( input ); -+} -+ -+/* Queue a raw input event */ -+static void queue_raw_input( struct raw_input *input, struct raw_registration *registration, -+ user_handle_t focus ) -+{ -+ user_handle_t target; -+ struct raw_input *queued, *prev = NULL; -+ -+ input->handle = current->process->raw_input_index++; -+ -+ /* Prevent unprocessed raw input entries from being queued indefinitely */ -+ if (current->process->raw_input_len == MAX_RAW_INPUT_QUEUE_LENGTH) -+ { -+ struct raw_input *head = LIST_ENTRY( list_head( ¤t->process->raw_inputs ), -+ struct raw_input, entry ); -+ remove_raw_input( head ); -+ } -+ -+ /* Select raw input events that come from this device's input subcomponent and release -+ already processed ones, except for the last one, because it can still be -+ retrieved multiple times while processing its WIM_INPUT message */ -+ LIST_FOR_EACH_ENTRY( queued, ¤t->process->raw_inputs, struct raw_input, entry ) -+ { -+ /* Scope for the particular device and it's input subcomponent */ -+ if (queued->device_handle != input->device_handle || -+ queued->input_usage_page != input->input_usage_page || -+ queued->input_usage != input->input_usage) -+ continue; -+ -+ if (!queued->retrieved) -+ break; -+ -+ if (prev) -+ remove_raw_input( prev ); -+ -+ prev = queued; -+ } -+ -+ list_add_tail( ¤t->process->raw_inputs, &input->entry ); -+ current->process->raw_input_len += 1; -+ -+ target = registration->target_window ? registration->target_window : focus; -+ if (target) -+ post_message( target, WM_INPUT, RIM_INPUT, input->handle ); -+} -+ -+/* Find a queued raw input event by its handle id */ -+static struct raw_input *find_raw_input_event( unsigned int handle ) -+{ -+ struct raw_input *input; -+ LIST_FOR_EACH_ENTRY( input, ¤t->process->raw_inputs, struct raw_input, entry ) -+ { -+ if (input->handle == handle) -+ return input; -+ } -+ return NULL; -+} -+ -+/* Find a raw input registration, that matches given usage page/id */ -+static struct raw_registration *find_registered_usage( unsigned short usage_page, -+ unsigned short usage ) -+{ -+ struct raw_registration *registration, *found = NULL; -+ LIST_FOR_EACH_ENTRY( registration, ¤t->process->raw_registered, -+ struct raw_registration, entry ) -+ { -+ if (registration->usage_page != usage_page) -+ continue; -+ else if (registration->flags & RAW_INPUT_DEVICE_FLAG_EXCLUDE && -+ registration->usage == usage) -+ return NULL; -+ else if (registration->flags & RAW_INPUT_DEVICE_FLAG_PAGEONLY) -+ found = registration; -+ else if (registration->usage == usage) -+ return registration; -+ } -+ return found; -+} -+ -+/* Determine mouse flags */ -+static unsigned int map_mouse_flags( unsigned int flags, unsigned int mouse_data ) -+{ -+ unsigned int result = 0; -+ if (flags & MOUSEEVENTF_LEFTDOWN) -+ result |= RI_MOUSE_LEFT_BUTTON_DOWN; -+ if (flags & MOUSEEVENTF_LEFTUP) -+ result |= RI_MOUSE_LEFT_BUTTON_UP; -+ if (flags & MOUSEEVENTF_RIGHTDOWN) -+ result |= RI_MOUSE_RIGHT_BUTTON_DOWN; -+ if (flags & MOUSEEVENTF_RIGHTUP) -+ result |= RI_MOUSE_RIGHT_BUTTON_UP; -+ if (flags & MOUSEEVENTF_MIDDLEDOWN) -+ result |= RI_MOUSE_MIDDLE_BUTTON_DOWN; -+ if (flags & MOUSEEVENTF_MIDDLEUP) -+ result |= RI_MOUSE_MIDDLE_BUTTON_UP; -+ if (flags & MOUSEEVENTF_WHEEL) -+ result |= RI_MOUSE_WHEEL; -+ if (flags & MOUSEEVENTF_HWHEEL) -+ result |= RI_MOUSE_HORIZONTAL_WHEEL; -+ if (flags & MOUSEEVENTF_XDOWN && mouse_data == XBUTTON1) -+ result |= RI_MOUSE_BUTTON_4_DOWN; -+ if (flags & MOUSEEVENTF_XUP && mouse_data == XBUTTON1) -+ result |= RI_MOUSE_BUTTON_4_UP; -+ if (flags & MOUSEEVENTF_XDOWN && mouse_data == XBUTTON2) -+ result |= RI_MOUSE_BUTTON_5_DOWN; -+ if (flags & MOUSEEVENTF_XUP && mouse_data == XBUTTON2) -+ result |= RI_MOUSE_BUTTON_5_UP; -+ return result; -+} -+ -+/* Queue a mouse raw input event */ -+void queue_mouse_raw_input( unsigned int flags, unsigned int info, -+ unsigned int data, unsigned int input_x, unsigned int input_y, -+ unsigned int desktop_x, unsigned int desktop_y, user_handle_t focus ) -+{ -+ /* We know the device handle and its input subcomponent usage page/id in advance */ -+ const user_handle_t device_handle = MOUSE_DEVICE_HANDLE; -+ const unsigned short input_usage_page = HID_USAGE_PAGE_GENERIC; -+ const unsigned short input_usage = HID_USAGE_GENERIC_MOUSE; -+ struct raw_input *input; -+ -+ struct raw_registration *registration = find_registered_usage( input_usage_page, input_usage ); -+ if (!registration || !(input = mem_alloc( sizeof( *input ) ))) -+ return; -+ -+ input->device_handle = device_handle; -+ input->input_usage_page = input_usage_page; -+ input->input_usage = input_usage; -+ input->retrieved = FALSE; -+ -+ input->raw.header.dwType = RIM_TYPEMOUSE; -+ input->raw.header.dwSize = sizeof( RAWINPUTHEADER ) + sizeof( RAWMOUSE ); -+ input->raw.header.hDevice = (HANDLE)(ULONG_PTR)device_handle; -+ input->raw.header.wParam = RIM_INPUT; -+ -+ if (flags & MOUSEEVENTF_MOVE && flags & MOUSEEVENTF_ABSOLUTE) -+ { -+ input->raw.data.mouse.lLastX = input_x - desktop_x; -+ input->raw.data.mouse.lLastY = input_y - desktop_y; -+ if (flags & ~(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE) && -+ input_x == desktop_x && input_y == desktop_y) -+ flags &= ~MOUSEEVENTF_MOVE; -+ } -+ else if (flags & MOUSEEVENTF_MOVE) -+ { -+ input->raw.data.mouse.lLastX = input_x; -+ input->raw.data.mouse.lLastY = input_y; -+ } -+ else -+ { -+ input->raw.data.mouse.lLastX = 0; -+ input->raw.data.mouse.lLastY = 0; -+ } -+ -+ input->raw.data.mouse.usFlags = MOUSE_MOVE_RELATIVE; -+ input->raw.data.mouse.usButtonFlags = map_mouse_flags( flags, data ); -+ if (input->raw.data.mouse.usButtonFlags & (RI_MOUSE_WHEEL | RI_MOUSE_HORIZONTAL_WHEEL)) -+ input->raw.data.mouse.usButtonData = data; -+ else -+ input->raw.data.mouse.usButtonData = 0; -+ /* ulRawButtons is undocumented and hardware/drivers dependent, -+ therefore 0 is a valid value */ -+ input->raw.data.mouse.ulRawButtons = 0; -+ input->raw.data.mouse.ulExtraInformation = info; -+ -+ /* Filter out zero values that come after a scroll wheel event, -+ so it would be identical to windows */ -+ if (!input->raw.data.mouse.usButtonFlags && -+ !input->raw.data.mouse.lLastX && !input->raw.data.mouse.lLastY) -+ { -+ free( input ); -+ return; -+ } -+ -+ queue_raw_input( input, registration, focus ); -+} -+ -+/* Determine keyboard flags */ -+static unsigned int map_keyboard_flags( unsigned int flags, unsigned int vk_code ) -+{ -+ unsigned int result = 0; -+ -+ if (flags & KEYEVENTF_KEYUP) -+ result |= RI_KEY_BREAK; -+ else -+ result |= RI_KEY_MAKE; -+ -+ /* The extended keys are placed on the right side -+ Right shift doesn't have this flag */ -+ if (flags & KEYEVENTF_EXTENDEDKEY && vk_code != VK_SHIFT && vk_code != VK_RSHIFT) -+ result |= RI_KEY_E0; -+ -+ return result; -+} -+ -+/* Determine keyboard virtual key-code */ -+static unsigned int map_keyboard_vk_code( unsigned int vk_code ) -+{ -+ switch (vk_code) -+ { -+ case VK_LSHIFT: -+ case VK_RSHIFT: -+ return VK_SHIFT; -+ case VK_LCONTROL: -+ case VK_RCONTROL: -+ return VK_CONTROL; -+ case VK_LMENU: -+ case VK_RMENU: -+ return VK_MENU; -+ default: -+ return vk_code; -+ } -+} -+ -+/* Determine keyboard message code */ -+static unsigned int map_keyboard_message_code( unsigned int flags, unsigned int vk_code ) -+{ -+ /* Windows use WM_SYSKEYDOWN only for alt key-press */ -+ if (!(flags & KEYEVENTF_KEYUP) && (vk_code == VK_MENU || vk_code == VK_LMENU || -+ vk_code == VK_RMENU)) -+ return WM_SYSKEYDOWN; -+ else if (flags & KEYEVENTF_KEYUP) -+ return WM_KEYUP; -+ else -+ return WM_KEYDOWN; -+} -+ -+/* Queue a keyboard raw input event */ -+void queue_keyboard_raw_input( unsigned int flags, unsigned int info, unsigned int vk_code, -+ unsigned int scan_code, user_handle_t focus ) -+{ -+ /* We know the device handle and its input subcomponent usage page/id in advance */ -+ const user_handle_t device_handle = KEYBOARD_DEVICE_HANDLE; -+ const unsigned short input_usage_page = HID_USAGE_PAGE_GENERIC; -+ const unsigned short input_usage = HID_USAGE_GENERIC_KEYBOARD; -+ struct raw_input *input; -+ -+ struct raw_registration *registration = find_registered_usage( input_usage_page, input_usage ); -+ if (!registration || !(input = mem_alloc( sizeof( *input ) ))) -+ return; -+ -+ input->device_handle = device_handle; -+ input->input_usage_page = input_usage_page; -+ input->input_usage = input_usage; -+ input->retrieved = FALSE; -+ -+ input->raw.header.dwType = RIM_TYPEKEYBOARD; -+ input->raw.header.dwSize = sizeof( RAWINPUTHEADER ) + sizeof( RAWKEYBOARD ); -+ input->raw.header.hDevice = (HANDLE)(ULONG_PTR)device_handle; -+ input->raw.header.wParam = RIM_INPUT; -+ -+ input->raw.data.keyboard.MakeCode = scan_code; -+ input->raw.data.keyboard.Flags = map_keyboard_flags( flags, vk_code ); -+ input->raw.data.keyboard.Reserved = 0; -+ input->raw.data.keyboard.VKey = map_keyboard_vk_code( vk_code ); -+ input->raw.data.keyboard.Message = map_keyboard_message_code( flags, vk_code ); -+ input->raw.data.keyboard.ExtraInformation = info; -+ -+ queue_raw_input( input, registration, focus ); -+} -+ -+/* Check if nolegacy flag is set for a mouse device registration */ -+BOOL is_nolegacy_set_for_raw_input_mouse(void) -+{ -+ struct raw_registration *registration = find_registered_usage( HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_MOUSE ); -+ return registration ? registration->flags & RAW_INPUT_DEVICE_FLAG_NOLEGACY : FALSE; -+} -+ -+/* Check if nolegacy flag is set for a keyboard device registration */ -+BOOL is_nolegacy_set_for_raw_input_keyboard(void) -+{ -+ struct raw_registration *registration = find_registered_usage( HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_KEYBOARD ); -+ return registration ? registration->flags & RAW_INPUT_DEVICE_FLAG_NOLEGACY : FALSE; -+} -+ -+static UINT apply_32bit_header_size(UINT size) -+{ -+ return size - sizeof( RAWINPUTHEADER ) + sizeof( struct RAWINPUTHEADER32 ); -+} -+ -+static void copy_32bit_raw_input_data(void *target, RAWINPUT *source, UINT size) -+{ -+ struct RAWINPUT32 *ptr32bit = (struct RAWINPUT32 *)target; -+ ptr32bit->header.dwType = source->header.dwType; -+ ptr32bit->header.dwSize = size; -+ ptr32bit->header.hDevice = (DWORD)(ULONG_PTR)source->header.hDevice; -+ ptr32bit->header.wParam = (DWORD)(ULONG_PTR)source->header.wParam; -+ memcpy( &ptr32bit->data, &source->data, size - sizeof( struct RAWINPUTHEADER32 ) ); -+} -+ -+/* Get the raw input device list */ -+DECL_HANDLER(get_raw_input_device_list) -+{ -+ unsigned int i, size_in_bytes; -+ RAWINPUTDEVICELIST *result; -+ -+ reply->num_devices = NUM_RAW_DEVICES; -+ if (!reply->num_devices || req->report_size_only) -+ return; -+ -+ size_in_bytes = reply->num_devices * sizeof( RAWINPUTDEVICELIST ); -+ if (size_in_bytes > get_reply_max_size()) -+ { -+ set_error( STATUS_BUFFER_TOO_SMALL ); -+ return; -+ } -+ -+ result = set_reply_data_size( size_in_bytes ); -+ if (!result) -+ { -+ set_error( STATUS_NO_MEMORY ); -+ return; -+ } -+ -+ for (i = 0; i < reply->num_devices; i++) -+ { -+ /* Currently fake handles are provided, however they are only used to -+ identify the devices for the GetRawInputDeviceInfo function, thus it -+ should not create any undesirable side effects */ -+ result[i].hDevice = (HANDLE)(ULONG_PTR)raw_devices[i].handle; -+ result[i].dwType = raw_devices[i].info.dwType; -+ } -+} -+ -+/* Get the raw input device info */ -+DECL_HANDLER(get_raw_input_device_info) -+{ -+ BOOL valid = FALSE; -+ unsigned int i, size_in_bytes; -+ void *source = NULL; -+ -+ for (i = 0; i < NUM_RAW_DEVICES; i++) -+ { -+ if (raw_devices[i].handle != req->handle) -+ continue; -+ valid = TRUE; -+ -+ switch (req->command) -+ { -+ case RIDI_DEVICENAME: -+ /* reply->size is the character count */ -+ reply->size = lstrlenW( raw_devices[i].name ) + 1; -+ source = (void *)raw_devices[i].name; -+ break; -+ case RIDI_DEVICEINFO: -+ reply->size = sizeof( RID_DEVICE_INFO ); -+ source = (void *)&raw_devices[i].info; -+ break; -+ case RIDI_PREPARSEDDATA: -+ /* No preparsed data available */ -+ reply->size = 0; -+ break; -+ default: -+ set_error( STATUS_INVALID_PARAMETER ); -+ break; -+ } -+ if (get_error() > 0 || req->report_size_only) -+ break; -+ -+ size_in_bytes = req->command == RIDI_DEVICENAME ? -+ reply->size * sizeof( WCHAR ) : reply->size; -+ if (size_in_bytes > get_reply_max_size()) -+ { -+ set_error( STATUS_BUFFER_TOO_SMALL ); -+ } -+ else if (size_in_bytes > 0) -+ { -+ void *target = set_reply_data_size( size_in_bytes ); -+ if (!target) -+ { -+ set_error( STATUS_NO_MEMORY ); -+ break; -+ } -+ -+ memcpy( target, source, size_in_bytes ); -+ } -+ break; -+ } -+ if (!valid) -+ set_error( STATUS_INVALID_HANDLE ); -+} -+ -+/* Get the registered raw input devices */ -+DECL_HANDLER(get_registered_raw_input_devices) -+{ -+ unsigned int index = 0, size_in_bytes; -+ struct raw_registration *registration; -+ RAWINPUTDEVICE *result; -+ -+ reply->num_devices = list_count(¤t->process->raw_registered); -+ if (!reply->num_devices || req->report_size_only) -+ return; -+ -+ size_in_bytes = reply->num_devices * sizeof( RAWINPUTDEVICE ); -+ if (size_in_bytes > get_reply_max_size()) -+ { -+ set_error( STATUS_BUFFER_TOO_SMALL ); -+ return; -+ } -+ -+ result = set_reply_data_size( size_in_bytes ); -+ if (!result) -+ { -+ set_error( STATUS_NO_MEMORY ); -+ return; -+ } -+ -+ LIST_FOR_EACH_ENTRY( registration, ¤t->process->raw_registered, -+ struct raw_registration, entry ) -+ { -+ result[index].usUsagePage = registration->usage_page; -+ result[index].usUsage = registration->usage; -+ result[index].dwFlags = registration->flags; -+ result[index].hwndTarget = (HWND)(ULONG_PTR)registration->target_window; -+ index += 1; -+ } -+} -+ -+/* Register raw input devices */ -+DECL_HANDLER(register_raw_input_devices) -+{ -+ struct raw_input_device_registration *registrations = -+ (struct raw_input_device_registration *)get_req_data(); -+ unsigned int i; -+ for (i = 0; i < req->count; i++) -+ register_raw_input_device( ®istrations[i] ); -+} -+ -+/* Get raw input data */ -+DECL_HANDLER(get_raw_input_data) -+{ -+ void *ptr; -+ struct raw_input *input = find_raw_input_event( req->handle ); -+ const unsigned int is_server64bit = sizeof( RAWINPUTHEADER ) != sizeof( struct RAWINPUTHEADER32 ); -+ const unsigned int is_client32bit = req->header_size == sizeof( struct RAWINPUTHEADER32 ); -+ const unsigned int is_64bit_to_32bit = is_server64bit && is_client32bit; -+ -+ if (!input) -+ { -+ set_error( STATUS_INVALID_HANDLE ); -+ return; -+ } -+ -+ if (req->command == RID_HEADER && is_64bit_to_32bit) -+ reply->size = sizeof( struct RAWINPUTHEADER32 ); -+ else if (req->command == RID_HEADER) -+ reply->size = sizeof( RAWINPUTHEADER ); -+ else if (req->command == RID_INPUT && is_64bit_to_32bit) -+ reply->size = apply_32bit_header_size( input->raw.header.dwSize ); -+ else if (req->command == RID_INPUT) -+ reply->size = input->raw.header.dwSize; -+ else -+ { -+ set_error( STATUS_INVALID_PARAMETER ); -+ return; -+ } -+ -+ if (req->report_size_only) -+ return; -+ -+ if (reply->size > get_reply_max_size()) -+ { -+ set_error( STATUS_BUFFER_TOO_SMALL ); -+ return; -+ } -+ -+ ptr = set_reply_data_size( reply->size ); -+ if (!ptr) -+ { -+ set_error( STATUS_NO_MEMORY ); -+ return; -+ } -+ -+ if (is_64bit_to_32bit) -+ copy_32bit_raw_input_data( ptr, &input->raw, reply->size ); -+ else -+ memcpy( ptr, &input->raw, reply->size ); -+ -+ if (req->command == RID_INPUT) -+ input->retrieved = TRUE; -+} -+ -+/* Get buffered raw input data */ -+DECL_HANDLER(get_raw_input_buffer) -+{ -+ unsigned int i, count, written_count = 0, written_size = 0; -+ lparam_t *handles; -+ RAWINPUT *result = NULL; -+ UINT tmp_size; -+ const unsigned int is_server64bit = sizeof( RAWINPUTHEADER ) != sizeof( struct RAWINPUTHEADER32 ); -+ const unsigned int is_client32bit = req->header_size == sizeof( struct RAWINPUTHEADER32 ); -+ const unsigned int is_64bit_to_32bit = is_server64bit && is_client32bit; -+ -+ reply->count = 0; -+ reply->minimum_size = 0; -+ -+ if (!get_queued_raw_input_message_handles( &handles, &count )) -+ { -+ set_error( STATUS_NO_MEMORY ); -+ return; -+ } -+ if (!count) -+ return; -+ -+ if (!req->report_size_only) -+ { -+ result = set_reply_data_size( get_reply_max_size() ); -+ if (!result) -+ { -+ free( handles ); -+ set_error( STATUS_NO_MEMORY ); -+ return; -+ } -+ } -+ -+ for (i = 0; i < count; i++) -+ { -+ struct raw_input *input = find_raw_input_event( handles[i] ); -+ -+ if (!input) -+ continue; -+ -+ if (is_64bit_to_32bit) -+ tmp_size = apply_32bit_header_size( input->raw.header.dwSize ); -+ else -+ tmp_size = input->raw.header.dwSize; -+ -+ if (!reply->minimum_size) -+ reply->minimum_size = tmp_size; -+ -+ if (written_size + tmp_size > get_reply_max_size() || req->report_size_only) -+ break; -+ -+ if (is_64bit_to_32bit) -+ copy_32bit_raw_input_data( result, &input->raw, tmp_size ); -+ else -+ memcpy( result, &input->raw, tmp_size ); -+ -+ written_count += 1; -+ written_size += tmp_size; -+ result = NEXTRAWINPUTBLOCK( result ); -+ -+ remove_raw_input( input ); -+ } -+ -+ free( handles ); -+ -+ if (req->report_size_only) -+ return; -+ -+ /* Windows needs the buffer to be at least 1 byte larger then -+ the minimum needed space */ -+ if (reply->minimum_size >= get_reply_max_size() || !written_count) -+ { -+ set_error( STATUS_BUFFER_TOO_SMALL ); -+ return; -+ } -+ -+ reply->count = written_count; -+ -+ dequeue_raw_input_messages( written_count ); -+} -diff --git a/server/raw_input.h b/server/raw_input.h -new file mode 100644 -index 0000000..4a4acf0 ---- /dev/null -+++ b/server/raw_input.h -@@ -0,0 +1,38 @@ -+/* -+ * Server-side Raw Input Handling -+ * -+ * Copyright (C) 2011 Vincas Miliūnas -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+ -+#ifndef __WINE_SERVER_RAW_INPUT_H -+#define __WINE_SERVER_RAW_INPUT_H -+ -+#include "wine/server_protocol.h" -+#include "wine/list.h" -+ -+extern void release_raw_input( struct list *registrations, struct list *inputs ); -+ -+extern void queue_mouse_raw_input( unsigned int flags, unsigned int info, -+ unsigned int data, unsigned int input_x, unsigned int input_y, -+ unsigned int desktop_x, unsigned int desktop_y, user_handle_t focus ); -+extern void queue_keyboard_raw_input( unsigned int flags, unsigned int info, -+ unsigned int vk_code, unsigned int scan_code, user_handle_t focus ); -+ -+extern BOOL is_nolegacy_set_for_raw_input_mouse(void); -+extern BOOL is_nolegacy_set_for_raw_input_keyboard(void); -+ -+#endif /* __WINE_SERVER_RAW_INPUT_H */ diff --git a/app-emulation/wine/files/wine-remove-support-for-GL_ARB_sync.patch b/app-emulation/wine/files/wine-remove-support-for-GL_ARB_sync.patch deleted file mode 100644 index 4aa53af..0000000 --- a/app-emulation/wine/files/wine-remove-support-for-GL_ARB_sync.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 9298116a4337c2c1c2ea6c4ba587783678e913ed Mon Sep 17 00:00:00 2001 -From: Simon Ruggier -Date: Sun, 1 Apr 2012 23:41:28 -0400 -Subject: [PATCH] Remove support for GL_ARB_sync - -This works around a deadlock issue that World of Tanks started -triggering at version 7.2. ---- - dlls/wined3d/directx.c | 1 - - 1 files changed, 0 insertions(+), 1 deletions(-) - -diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c -index 23cc6b2..c18bd1e 100644 ---- a/dlls/wined3d/directx.c -+++ b/dlls/wined3d/directx.c -@@ -114,7 +114,6 @@ static const struct wined3d_extension_map gl_extension_map[] = - {"GL_ARB_shader_texture_lod", ARB_SHADER_TEXTURE_LOD, 0 }, - {"GL_ARB_shading_language_100", ARB_SHADING_LANGUAGE_100, 0 }, - {"GL_ARB_shadow", ARB_SHADOW, 0 }, -- {"GL_ARB_sync", ARB_SYNC, 0 }, - {"GL_ARB_texture_border_clamp", ARB_TEXTURE_BORDER_CLAMP, 0 }, - {"GL_ARB_texture_compression", ARB_TEXTURE_COMPRESSION, 0 }, - {"GL_ARB_texture_compression_rgtc", ARB_TEXTURE_COMPRESSION_RGTC, 0 }, --- -1.7.9.1 diff --git a/app-emulation/wine/metadata.xml b/app-emulation/wine/metadata.xml deleted file mode 100644 index 1ece192..0000000 --- a/app-emulation/wine/metadata.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - -Wine is an Open Source implementation of the Windows API on top of X and Unix. - -Think of Wine as a compatibility layer for running Windows programs. Wine does not require Microsoft Windows, as it is a completely free alternative implementation of the Windows API consisting of 100% non-Microsoft code, however Wine can optionally use native Windows DLLs if they are available. Wine provides both a development toolkit for porting Windows source code to Unix as well as a program loader, allowing many unmodified Windows programs to run on x86-based Unixes, including Linux, FreeBSD, and Solaris. - - - Enable ISDN support via CAPI - Bypass strip-flags; use are your own peril - Add support for the Gecko engine when using iexplore - Enable OpenCL support - Install helpers written in perl (winedump/winemaker) - Add support for NTLM auth. see - http://wiki.winehq.org/NtlmAuthSetupGuide and - http://wiki.winehq.org/NtlmSigningAndSealing - Support dynamic storage devices using sys-fs/udisks - Build a 32bit version of Wine (won't run Win64 binaries) - Build a 64bit version of Wine (won't run Win32 binaries) - - diff --git a/app-emulation/wine/wine-1.5.2-r9999.ebuild b/app-emulation/wine/wine-1.5.2-r9999.ebuild deleted file mode 100644 index 1755ed1..0000000 --- a/app-emulation/wine/wine-1.5.2-r9999.ebuild +++ /dev/null @@ -1,238 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/wine/wine-1.5.2.ebuild,v 1.3 2012/05/12 21:12:50 tetromino Exp $ - -EAPI="4" - -inherit autotools eutils flag-o-matic multilib pax-utils - -if [[ ${PV} == "9999" ]] ; then - EGIT_REPO_URI="git://source.winehq.org/git/wine.git" - inherit git-2 - SRC_URI="" - #KEYWORDS="" -else - MY_P="${PN}-${PV/_/-}" - SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2" - KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" - S=${WORKDIR}/${MY_P} -fi - -GV="1.5" -DESCRIPTION="free implementation of Windows(tm) on Unix with custom patches to make World of Tanks work" -HOMEPAGE="http://www.winehq.org/" -SRC_URI="${SRC_URI} - gecko? ( - mirror://sourceforge/wine/wine_gecko-${GV}-x86.msi - win64? ( mirror://sourceforge/wine/wine_gecko-${GV}-x86_64.msi ) - )" - -LICENSE="LGPL-2.1" -SLOT="0" -# Pinkbyte: add fglrx VIDEO_CARDS use -IUSE="alsa capi cups custom-cflags elibc_glibc fontconfig +gecko gnutls gphoto2 gsm gstreamer hardened jpeg lcms ldap mp3 ncurses nls odbc openal opencl +opengl +oss +perl png samba scanner selinux ssl test +threads +truetype udisks v4l video_cards_fglrx +win32 +win64 +X xcomposite xinerama xml" -REQUIRED_USE="elibc_glibc? ( threads )" #286560 -RESTRICT="test" #72375 - -MLIB_DEPS="amd64? ( - truetype? ( >=app-emulation/emul-linux-x86-xlibs-2.1 ) - X? ( - >=app-emulation/emul-linux-x86-xlibs-2.1 - >=app-emulation/emul-linux-x86-soundlibs-2.1 - ) - mp3? ( app-emulation/emul-linux-x86-soundlibs ) - odbc? ( app-emulation/emul-linux-x86-db ) - openal? ( app-emulation/emul-linux-x86-sdl ) - opengl? ( app-emulation/emul-linux-x86-opengl ) - scanner? ( app-emulation/emul-linux-x86-medialibs ) - v4l? ( app-emulation/emul-linux-x86-medialibs ) - app-emulation/emul-linux-x86-baselibs - >=sys-kernel/linux-headers-2.6 - )" -RDEPEND="truetype? ( >=media-libs/freetype-2.0.0 media-fonts/corefonts ) - perl? ( dev-lang/perl dev-perl/XML-Simple ) - capi? ( net-dialup/capi4k-utils ) - ncurses? ( >=sys-libs/ncurses-5.2 ) - fontconfig? ( media-libs/fontconfig ) - gphoto2? ( media-libs/libgphoto2 ) - openal? ( media-libs/openal ) - udisks? ( - sys-apps/dbus - sys-fs/udisks:0 - ) - gnutls? ( net-libs/gnutls ) - gstreamer? ( media-libs/gstreamer media-libs/gst-plugins-base ) - X? ( - x11-libs/libXcursor - x11-libs/libXrandr - x11-libs/libXi - x11-libs/libXmu - x11-libs/libXxf86vm - x11-apps/xmessage - ) - xinerama? ( x11-libs/libXinerama ) - alsa? ( media-libs/alsa-lib ) - cups? ( net-print/cups ) - opencl? ( virtual/opencl ) - opengl? ( virtual/opengl ) - gsm? ( media-sound/gsm ) - jpeg? ( virtual/jpeg ) - ldap? ( net-nds/openldap ) - lcms? ( =media-libs/lcms-1* ) - mp3? ( >=media-sound/mpg123-1.5.0 ) - nls? ( sys-devel/gettext ) - odbc? ( dev-db/unixODBC ) - samba? ( >=net-fs/samba-3.0.25 ) - selinux? ( sec-policy/selinux-wine ) - xml? ( dev-libs/libxml2 dev-libs/libxslt ) - scanner? ( media-gfx/sane-backends ) - ssl? ( dev-libs/openssl ) - png? ( media-libs/libpng ) - v4l? ( media-libs/libv4l ) - !win64? ( ${MLIB_DEPS} ) - win32? ( ${MLIB_DEPS} ) - xcomposite? ( x11-libs/libXcomposite )" -DEPEND="${RDEPEND} - X? ( - x11-proto/inputproto - x11-proto/xextproto - x11-proto/xf86vidmodeproto - ) - xinerama? ( x11-proto/xineramaproto ) - !hardened? ( sys-devel/prelink ) - virtual/pkgconfig - virtual/yacc - sys-devel/flex" - -src_unpack() { - if use win64 ; then - [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]] \ - && die "you need gcc-4.4+ to build 64bit wine" - fi - - if use win32 && use opencl; then - [[ x$(eselect opencl show) = "xintel" ]] && - die "Cannot build wine[opencl,win32]: intel-ocl-sdk is 64-bit only" # 403947 - fi - - if [[ ${PV} == "9999" ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi -} - -src_prepare() { - epatch "${FILESDIR}"/${PN}-1.1.15-winegcc.patch #260726 - epatch "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615 - # Pinkbyte: hack for properly hook RawInput methods - epatch "${FILESDIR}"/${PN}-raw_input_mod.patch - # Pinkbyte: fix perfomance problems with vertex buffers - epatch "${FILESDIR}"/disable-dynamic-vertex-buffers.patch - # Pinkbyte: fix deadlock issue with WoT on fglrx (http://bugs.winehq.org/show_bug.cgi?id=30330). - # Thanks to eto-rapchik@jabber.ru for discovering this issue. - use video_cards_fglrx && epatch "${FILESDIR}"/${PN}-remove-support-for-GL_ARB_sync.patch - # Pinkbyte: finally, this should be executed after applying such patches - "${S}"/tools/make_requests - # - epatch_user #282735 - eautoreconf - sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die - sed -i '/^MimeType/d' tools/wine.desktop || die #117785 -} - -do_configure() { - local builddir="${WORKDIR}/wine$1" - mkdir -p "${builddir}" - pushd "${builddir}" >/dev/null - - ECONF_SOURCE=${S} \ - econf \ - --sysconfdir=/etc/wine \ - $(use_with alsa) \ - $(use_with capi) \ - $(use_with lcms cms) \ - $(use_with cups) \ - $(use_with ncurses curses) \ - $(use_with udisks dbus) \ - $(use_with fontconfig) \ - $(use_with gnutls) \ - $(use_with gphoto2 gphoto) \ - $(use_with gsm) \ - $(use_with gstreamer) \ - --without-hal \ - $(use_with jpeg) \ - $(use_with ldap) \ - $(use_with mp3 mpg123) \ - $(use_with nls gettext) \ - $(use_with openal) \ - $(use_with opencl) \ - $(use_with opengl) \ - $(use_with ssl openssl) \ - $(use_with oss) \ - $(use_with png) \ - $(use_with threads pthread) \ - $(use_with scanner sane) \ - $(use_enable test tests) \ - $(use_with truetype freetype) \ - $(use_with v4l) \ - $(use_with X x) \ - $(use_with xcomposite) \ - $(use_with xinerama) \ - $(use_with xml) \ - $(use_with xml xslt) \ - $2 - - emake -j1 depend - - popd >/dev/null -} - -src_configure() { - export LDCONFIG=/bin/true - use custom-cflags || strip-flags - - if use win64 ; then - do_configure 64 --enable-win64 - use win32 && ABI=x86 do_configure 32 --with-wine64=../wine64 - else - ABI=x86 do_configure 32 --disable-win64 - fi -} - -src_compile() { - local b - for b in 64 32 ; do - local builddir="${WORKDIR}/wine${b}" - [[ -d ${builddir} ]] || continue - emake -C "${builddir}" all - done -} - -src_install() { - local b - for b in 64 32 ; do - local builddir="${WORKDIR}/wine${b}" - [[ -d ${builddir} ]] || continue - emake -C "${builddir}" install DESTDIR="${D}" - done - dodoc ANNOUNCE AUTHORS README - if use gecko ; then - insinto /usr/share/wine/gecko - doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi - use win64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi - fi - if ! use perl ; then - rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die - fi - - if use win32 || ! use win64; then - pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055 - fi - use win64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader} - - if use win64 && ! use win32; then - dosym /usr/bin/wine{64,} # 404331 - dosym /usr/bin/wine{64,}-preloader - fi -} diff --git a/app-emulation/wine/wine-1.5.9-r9999.ebuild b/app-emulation/wine/wine-1.5.9-r9999.ebuild deleted file mode 100644 index a84a324..0000000 --- a/app-emulation/wine/wine-1.5.9-r9999.ebuild +++ /dev/null @@ -1,251 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -EAPI="4" - -inherit autotools eutils flag-o-matic multilib pax-utils - -if [[ ${PV} == "9999" ]] ; then - EGIT_REPO_URI="git://source.winehq.org/git/wine.git" - inherit git-2 - SRC_URI="" - #KEYWORDS="" -else - MY_P="${PN}-${PV/_/-}" - SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2" - KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd" - S=${WORKDIR}/${MY_P} -fi - -GV="1.6" -MV="0.0.4" -PULSE_PATCH="winepulse-2012.06.15.patch" - -DESCRIPTION="free implementation of Windows(tm) on Unix with custom patches to make World of Tanks work" -HOMEPAGE="http://www.winehq.org/" -SRC_URI="${SRC_URI} - gecko? ( - mirror://sourceforge/wine/wine_gecko-${GV}-x86.msi - win64? ( mirror://sourceforge/wine/wine_gecko-${GV}-x86_64.msi ) - ) - mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi ) - http://source.winehq.org/patches/data/87234 -> ${PULSE_PATCH}" - -LICENSE="LGPL-2.1" -SLOT="0" -# Pinkbyte: add fglrx VIDEO_CARDS use -IUSE="alsa capi cups custom-cflags elibc_glibc fontconfig +gecko gnutls gphoto2 gsm gstreamer hardened jpeg lcms ldap +mono mp3 ncurses nls odbc openal opencl +opengl +oss +perl png pulseaudio samba scanner selinux ssl test +threads +truetype udisks v4l video_cards_fglrx +win32 +win64 +X xcomposite xinerama xml" -REQUIRED_USE="elibc_glibc? ( threads ) - mono? ( || ( win32 !win64 ) )" #286560 -RESTRICT="test" #72375 - -MLIB_DEPS="amd64? ( - truetype? ( >=app-emulation/emul-linux-x86-xlibs-2.1 ) - X? ( - >=app-emulation/emul-linux-x86-xlibs-2.1 - >=app-emulation/emul-linux-x86-soundlibs-2.1[pulseaudio(+)?] - ) - mp3? ( app-emulation/emul-linux-x86-soundlibs ) - odbc? ( app-emulation/emul-linux-x86-db ) - openal? ( app-emulation/emul-linux-x86-sdl ) - opengl? ( app-emulation/emul-linux-x86-opengl ) - scanner? ( app-emulation/emul-linux-x86-medialibs ) - v4l? ( app-emulation/emul-linux-x86-medialibs ) - app-emulation/emul-linux-x86-baselibs - >=sys-kernel/linux-headers-2.6 - )" -RDEPEND="truetype? ( >=media-libs/freetype-2.0.0 media-fonts/corefonts ) - perl? ( dev-lang/perl dev-perl/XML-Simple ) - capi? ( net-dialup/capi4k-utils ) - ncurses? ( >=sys-libs/ncurses-5.2 ) - fontconfig? ( media-libs/fontconfig ) - gphoto2? ( media-libs/libgphoto2 ) - openal? ( media-libs/openal ) - udisks? ( - sys-apps/dbus - sys-fs/udisks:2 - ) - gnutls? ( net-libs/gnutls ) - gstreamer? ( media-libs/gstreamer media-libs/gst-plugins-base ) - X? ( - x11-libs/libXcursor - x11-libs/libXrandr - x11-libs/libXi - x11-libs/libXmu - x11-libs/libXxf86vm - x11-apps/xmessage - ) - xinerama? ( x11-libs/libXinerama ) - alsa? ( media-libs/alsa-lib ) - cups? ( net-print/cups ) - opencl? ( virtual/opencl ) - opengl? ( virtual/opengl ) - gsm? ( media-sound/gsm ) - jpeg? ( virtual/jpeg ) - ldap? ( net-nds/openldap ) - lcms? ( =media-libs/lcms-1* ) - mp3? ( >=media-sound/mpg123-1.5.0 ) - nls? ( sys-devel/gettext ) - odbc? ( dev-db/unixODBC ) - pulseaudio? ( media-sound/pulseaudio ) - samba? ( >=net-fs/samba-3.0.25 ) - selinux? ( sec-policy/selinux-wine ) - xml? ( dev-libs/libxml2 dev-libs/libxslt ) - scanner? ( media-gfx/sane-backends ) - ssl? ( dev-libs/openssl ) - png? ( media-libs/libpng ) - v4l? ( media-libs/libv4l ) - !win64? ( ${MLIB_DEPS} ) - win32? ( ${MLIB_DEPS} ) - xcomposite? ( x11-libs/libXcomposite )" -DEPEND="${RDEPEND} - X? ( - x11-proto/inputproto - x11-proto/xextproto - x11-proto/xf86vidmodeproto - ) - xinerama? ( x11-proto/xineramaproto ) - !hardened? ( sys-devel/prelink ) - virtual/pkgconfig - virtual/yacc - sys-devel/flex" - -src_unpack() { - if use win64 ; then - [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]] \ - && die "you need gcc-4.4+ to build 64bit wine" - fi - - if use win32 && use opencl; then - [[ x$(eselect opencl show) = "xintel" ]] && - die "Cannot build wine[opencl,win32]: intel-ocl-sdk is 64-bit only" # 403947 - fi - - if [[ ${PV} == "9999" ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi -} - -src_prepare() { - epatch "${FILESDIR}"/${PN}-1.1.15-winegcc.patch #260726 - epatch "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615 - epatch "${DISTDIR}/${PULSE_PATCH}" #421365 - # Pinkbyte: hack for properly hook RawInput methods - epatch "${FILESDIR}"/${PN}-raw_input_mod.patch - # Pinkbyte: fix perfomance problems with vertex buffers - epatch "${FILESDIR}"/disable-dynamic-vertex-buffers.patch - # Pinkbyte: fix deadlock issue with WoT on fglrx (http://bugs.winehq.org/show_bug.cgi?id=30330). - # Thanks to eto-rapchik@jabber.ru for discovering this issue. - use video_cards_fglrx && epatch "${FILESDIR}"/${PN}-remove-support-for-GL_ARB_sync.patch - # Pinkbyte: finally, this should be executed after applying such patches - "${S}"/tools/make_requests - # - epatch_user #282735 - eautoreconf - sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die - sed -i '/^MimeType/d' tools/wine.desktop || die #117785 -} - -do_configure() { - local builddir="${WORKDIR}/wine$1" - mkdir -p "${builddir}" - pushd "${builddir}" >/dev/null - - ECONF_SOURCE=${S} \ - econf \ - --sysconfdir=/etc/wine \ - $(use_with alsa) \ - $(use_with capi) \ - $(use_with lcms cms) \ - $(use_with cups) \ - $(use_with ncurses curses) \ - $(use_with udisks dbus) \ - $(use_with fontconfig) \ - $(use_with gnutls) \ - $(use_with gphoto2 gphoto) \ - $(use_with gsm) \ - $(use_with gstreamer) \ - --without-hal \ - $(use_with jpeg) \ - $(use_with ldap) \ - $(use_with mp3 mpg123) \ - $(use_with nls gettext) \ - $(use_with openal) \ - $(use_with opencl) \ - $(use_with opengl) \ - $(use_with ssl openssl) \ - $(use_with oss) \ - $(use_with png) \ - $(use_with threads pthread) \ - $(use_with pulseaudio pulse) \ - $(use_with scanner sane) \ - $(use_enable test tests) \ - $(use_with truetype freetype) \ - $(use_with v4l) \ - $(use_with X x) \ - $(use_with xcomposite) \ - $(use_with xinerama) \ - $(use_with xml) \ - $(use_with xml xslt) \ - $2 - - emake -j1 depend - - popd >/dev/null -} - -src_configure() { - export LDCONFIG=/bin/true - use custom-cflags || strip-flags - - if use win64 ; then - do_configure 64 --enable-win64 - use win32 && ABI=x86 do_configure 32 --with-wine64=../wine64 - else - ABI=x86 do_configure 32 --disable-win64 - fi -} - -src_compile() { - local b - for b in 64 32 ; do - local builddir="${WORKDIR}/wine${b}" - [[ -d ${builddir} ]] || continue - emake -C "${builddir}" all - done -} - -src_install() { - local b - for b in 64 32 ; do - local builddir="${WORKDIR}/wine${b}" - [[ -d ${builddir} ]] || continue - emake -C "${builddir}" install DESTDIR="${D}" - done - dodoc ANNOUNCE AUTHORS README - if use gecko ; then - insinto /usr/share/wine/gecko - doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi - use win64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi - fi - if use mono ; then - insinto /usr/share/wine/mono - doins "${DISTDIR}"/wine-mono-${MV}.msi - fi - if ! use perl ; then - rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die - fi - - if use win32 || ! use win64; then - pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055 - fi - use win64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader} - - if use win64 && ! use win32; then - dosym /usr/bin/wine{64,} # 404331 - dosym /usr/bin/wine{64,}-preloader - fi -}