Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
June 2022
- 68 participants
- 3274 messages
[PATCH v2 3/4] win32u: Move NtUserGetRawInputData from user32.
by Zebediah Figura
From: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/user32/rawinput.c | 54 +--------------------
dlls/user32/user32.spec | 2 +-
dlls/user32/user_main.c | 1 +
dlls/user32/user_private.h | 8 +---
dlls/win32u/Makefile.in | 1 +
dlls/win32u/gdiobj.c | 1 +
dlls/win32u/ntuser_private.h | 7 +++
dlls/win32u/rawinput.c | 91 ++++++++++++++++++++++++++++++++++++
dlls/win32u/win32u.spec | 2 +-
dlls/win32u/win32u_private.h | 2 +
dlls/win32u/wrappers.c | 6 +++
include/ntuser.h | 1 +
12 files changed, 114 insertions(+), 62 deletions(-)
create mode 100644 dlls/win32u/rawinput.c
diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c
index 99e2270b77c..b1c79b4e186 100644
--- a/dlls/user32/rawinput.c
+++ b/dlls/user32/rawinput.c
@@ -351,7 +351,7 @@ BOOL rawinput_device_get_usages(HANDLE handle, USAGE *usage_page, USAGE *usage)
}
-struct rawinput_thread_data *rawinput_thread_data(void)
+struct rawinput_thread_data * WINAPI rawinput_thread_data(void)
{
struct user_thread_info *thread_info = get_user_thread_info();
struct rawinput_thread_data *data = thread_info->rawinput;
@@ -593,58 +593,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH RegisterRawInputDevices(const RAWINPUTDEVICE *devi
return ret;
}
-/***********************************************************************
- * GetRawInputData (USER32.@)
- */
-UINT WINAPI GetRawInputData(HRAWINPUT rawinput, UINT command, void *data, UINT *data_size, UINT header_size)
-{
- struct rawinput_thread_data *thread_data = rawinput_thread_data();
- UINT size;
-
- TRACE("rawinput %p, command %#x, data %p, data_size %p, header_size %u.\n",
- rawinput, command, data, data_size, header_size);
-
- if (!rawinput || thread_data->hw_id != (UINT_PTR)rawinput)
- {
- SetLastError(ERROR_INVALID_HANDLE);
- return ~0U;
- }
-
- if (header_size != sizeof(RAWINPUTHEADER))
- {
- WARN("Invalid structure size %u.\n", header_size);
- SetLastError(ERROR_INVALID_PARAMETER);
- return ~0U;
- }
-
- switch (command)
- {
- case RID_INPUT:
- size = thread_data->buffer->header.dwSize;
- break;
- case RID_HEADER:
- size = sizeof(RAWINPUTHEADER);
- break;
- default:
- SetLastError(ERROR_INVALID_PARAMETER);
- return ~0U;
- }
-
- if (!data)
- {
- *data_size = size;
- return 0;
- }
-
- if (*data_size < size)
- {
- SetLastError(ERROR_INSUFFICIENT_BUFFER);
- return ~0U;
- }
- memcpy(data, thread_data->buffer, size);
- return size;
-}
-
#ifdef _WIN64
typedef RAWINPUTHEADER RAWINPUTHEADER64;
typedef RAWINPUT RAWINPUT64;
diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec
index d0262a004f1..de20e692157 100644
--- a/dlls/user32/user32.spec
+++ b/dlls/user32/user32.spec
@@ -367,7 +367,7 @@
@ stdcall GetPropW(long wstr)
@ stdcall GetQueueStatus(long) NtUserGetQueueStatus
@ stdcall GetRawInputBuffer(ptr ptr long)
-@ stdcall GetRawInputData(ptr long ptr ptr long)
+@ stdcall GetRawInputData(ptr long ptr ptr long) NtUserGetRawInputData
@ stdcall GetRawInputDeviceInfoA(ptr long ptr ptr)
@ stdcall GetRawInputDeviceInfoW(ptr long ptr ptr)
@ stdcall GetRawInputDeviceList(ptr ptr long)
diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c
index 3cb42e15b1e..4901bcf7193 100644
--- a/dlls/user32/user_main.c
+++ b/dlls/user32/user_main.c
@@ -169,6 +169,7 @@ static const struct user_callbacks user_funcs =
register_imm,
unregister_imm,
try_finally,
+ rawinput_thread_data,
};
static NTSTATUS WINAPI User32CopyImage( const struct copy_image_params *params, ULONG size )
diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h
index a3a3d28c2d9..a31a2bd8a01 100644
--- a/dlls/user32/user_private.h
+++ b/dlls/user32/user_private.h
@@ -51,12 +51,6 @@ struct wm_char_mapping_data
/* hold up to 10s of 1kHz mouse rawinput events */
#define RAWINPUT_BUFFER_SIZE (512*1024)
-struct rawinput_thread_data
-{
- UINT hw_id; /* current rawinput message id */
- RAWINPUT buffer[1]; /* rawinput message data buffer */
-};
-
extern BOOL (WINAPI *imm_register_window)(HWND) DECLSPEC_HIDDEN;
extern void (WINAPI *imm_unregister_window)(HWND) DECLSPEC_HIDDEN;
@@ -73,7 +67,7 @@ struct tagWND;
struct hardware_msg_data;
extern BOOL rawinput_from_hardware_message(RAWINPUT *rawinput, const struct hardware_msg_data *msg_data);
extern BOOL rawinput_device_get_usages(HANDLE handle, USAGE *usage_page, USAGE *usage);
-extern struct rawinput_thread_data *rawinput_thread_data(void);
+extern struct rawinput_thread_data * WINAPI rawinput_thread_data(void);
extern void rawinput_update_device_list(void);
extern BOOL post_dde_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, DWORD dest_tid,
diff --git a/dlls/win32u/Makefile.in b/dlls/win32u/Makefile.in
index d58ed6bb41c..cc429836de3 100644
--- a/dlls/win32u/Makefile.in
+++ b/dlls/win32u/Makefile.in
@@ -43,6 +43,7 @@ C_SRCS = \
path.c \
pen.c \
printdrv.c \
+ rawinput.c \
region.c \
spy.c \
syscall.c \
diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c
index da2e78be2dd..77c3e16242a 100644
--- a/dlls/win32u/gdiobj.c
+++ b/dlls/win32u/gdiobj.c
@@ -1183,6 +1183,7 @@ static struct unix_funcs unix_funcs =
NtUserGetMessage,
NtUserGetPriorityClipboardFormat,
NtUserGetQueueStatus,
+ NtUserGetRawInputData,
NtUserGetSystemMenu,
NtUserGetUpdateRect,
NtUserGetUpdateRgn,
diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h
index 075fc714744..babbc8208bc 100644
--- a/dlls/win32u/ntuser_private.h
+++ b/dlls/win32u/ntuser_private.h
@@ -50,6 +50,7 @@ struct user_callbacks
void (WINAPI *unregister_imm)( HWND hwnd );
NTSTATUS (CDECL *try_finally)( NTSTATUS (CDECL *func)( void *), void *arg,
void (CALLBACK *finally_func)( BOOL ));
+ struct rawinput_thread_data *(WINAPI *get_rawinput_thread_data)(void);
};
#define WM_SYSTIMER 0x0118
@@ -61,6 +62,12 @@ enum system_timer_id
SYSTEM_TIMER_CARET = 0xffff,
};
+struct rawinput_thread_data
+{
+ UINT hw_id; /* current rawinput message id */
+ RAWINPUT buffer[1]; /* rawinput message data buffer */
+};
+
struct user_object
{
HANDLE handle;
diff --git a/dlls/win32u/rawinput.c b/dlls/win32u/rawinput.c
new file mode 100644
index 00000000000..0d2c585c36e
--- /dev/null
+++ b/dlls/win32u/rawinput.c
@@ -0,0 +1,91 @@
+/*
+ * Raw Input
+ *
+ * Copyright 2012 Henri Verbeet
+ * Copyright 2018 Zebediah Figura for CodeWeavers
+ *
+ * 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
+ */
+
+#if 0
+#pragma makedep unix
+#endif
+
+#include "win32u_private.h"
+#include "ntuser_private.h"
+#include "wine/server.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(rawinput);
+
+/**********************************************************************
+ * NtUserGetRawInputData (win32u.@)
+ */
+UINT WINAPI NtUserGetRawInputData( HRAWINPUT rawinput, UINT command, void *data, UINT *data_size, UINT header_size )
+{
+ struct rawinput_thread_data *thread_data;
+ UINT size;
+
+ TRACE( "rawinput %p, command %#x, data %p, data_size %p, header_size %u.\n",
+ rawinput, command, data, data_size, header_size );
+
+ if (!user_callbacks || !(thread_data = user_callbacks->get_rawinput_thread_data()))
+ {
+ SetLastError( ERROR_OUTOFMEMORY );
+ return ~0u;
+ }
+
+ if (!rawinput || thread_data->hw_id != (UINT_PTR)rawinput)
+ {
+ SetLastError( ERROR_INVALID_HANDLE );
+ return ~0u;
+ }
+
+ if (header_size != sizeof(RAWINPUTHEADER))
+ {
+ WARN( "Invalid structure size %u.\n", header_size );
+ SetLastError( ERROR_INVALID_PARAMETER );
+ return ~0u;
+ }
+
+ switch (command)
+ {
+ case RID_INPUT:
+ size = thread_data->buffer->header.dwSize;
+ break;
+
+ case RID_HEADER:
+ size = sizeof(RAWINPUTHEADER);
+ break;
+
+ default:
+ SetLastError( ERROR_INVALID_PARAMETER );
+ return ~0u;
+ }
+
+ if (!data)
+ {
+ *data_size = size;
+ return 0;
+ }
+
+ if (*data_size < size)
+ {
+ SetLastError( ERROR_INSUFFICIENT_BUFFER );
+ return ~0u;
+ }
+ memcpy( data, thread_data->buffer, size );
+ return size;
+}
diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec
index 6f9dc0e921b..c984316e7c9 100644
--- a/dlls/win32u/win32u.spec
+++ b/dlls/win32u/win32u.spec
@@ -984,7 +984,7 @@
@ stdcall NtUserGetQueueStatus(long)
@ stub NtUserGetQueueStatusReadonly
@ stub NtUserGetRawInputBuffer
-@ stub NtUserGetRawInputData
+@ stdcall NtUserGetRawInputData(ptr long ptr ptr long)
@ stub NtUserGetRawInputDeviceInfo
@ stub NtUserGetRawInputDeviceList
@ stub NtUserGetRawPointerDeviceData
diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h
index dc62f6846a5..f431b967c32 100644
--- a/dlls/win32u/win32u_private.h
+++ b/dlls/win32u/win32u_private.h
@@ -245,6 +245,8 @@ struct unix_funcs
BOOL (WINAPI *pNtUserGetMessage)( MSG *msg, HWND hwnd, UINT first, UINT last );
INT (WINAPI *pNtUserGetPriorityClipboardFormat)( UINT *list, INT count );
DWORD (WINAPI *pNtUserGetQueueStatus)( UINT flags );
+ UINT (WINAPI *pNtUserGetRawInputData)( HRAWINPUT rawinput, UINT command,
+ void *data, UINT *data_size, UINT header_size );
HMENU (WINAPI *pNtUserGetSystemMenu)( HWND hwnd, BOOL revert );
BOOL (WINAPI *pNtUserGetUpdateRect)( HWND hwnd, RECT *rect, BOOL erase );
INT (WINAPI *pNtUserGetUpdateRgn)( HWND hwnd, HRGN hrgn, BOOL erase );
diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c
index ed4337eae84..56ffef8f478 100644
--- a/dlls/win32u/wrappers.c
+++ b/dlls/win32u/wrappers.c
@@ -1041,6 +1041,12 @@ DWORD WINAPI NtUserGetQueueStatus( UINT flags )
return unix_funcs->pNtUserGetQueueStatus( flags );
}
+UINT WINAPI NtUserGetRawInputData( HRAWINPUT rawinput, UINT command, void *data, UINT *data_size, UINT header_size )
+{
+ if (!unix_funcs) return ~0u;
+ return unix_funcs->pNtUserGetRawInputData( rawinput, command, data, data_size, header_size );
+}
+
BOOL WINAPI NtUserGetUpdatedClipboardFormats( UINT *formats, UINT size, UINT *out_size )
{
if (!unix_funcs) return FALSE;
diff --git a/include/ntuser.h b/include/ntuser.h
index 56c920aacdf..269ba3ae490 100644
--- a/include/ntuser.h
+++ b/include/ntuser.h
@@ -604,6 +604,7 @@ HWINSTA WINAPI NtUserGetProcessWindowStation(void);
HANDLE WINAPI NtUserGetProp( HWND hwnd, const WCHAR *str );
ULONG WINAPI NtUserGetProcessDpiAwarenessContext( HANDLE process );
DWORD WINAPI NtUserGetQueueStatus( UINT flags );
+UINT WINAPI NtUserGetRawInputData( HRAWINPUT rawinput, UINT command, void *data, UINT *data_size, UINT header_size );
ULONG WINAPI NtUserGetSystemDpiForProcess( HANDLE process );
HMENU WINAPI NtUserGetSystemMenu( HWND hwnd, BOOL revert );
HDESK WINAPI NtUserGetThreadDesktop( DWORD thread );
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/233
June 17, 2022
[PATCH v2 2/4] user32: Correctly fill the RAWINPUT structure on WoW64.
by Zebediah Figura
From: Zebediah Figura <zfigura(a)codeweavers.com>
This changes the offset of the wParam field.
---
dlls/user32/rawinput.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c
index ab542956f11..99e2270b77c 100644
--- a/dlls/user32/rawinput.c
+++ b/dlls/user32/rawinput.c
@@ -646,12 +646,20 @@ UINT WINAPI GetRawInputData(HRAWINPUT rawinput, UINT command, void *data, UINT *
}
#ifdef _WIN64
+typedef RAWINPUTHEADER RAWINPUTHEADER64;
typedef RAWINPUT RAWINPUT64;
#else
typedef struct
{
- RAWINPUTHEADER header;
- char pad[8];
+ DWORD dwType;
+ DWORD dwSize;
+ ULONGLONG hDevice;
+ ULONGLONG wParam;
+} RAWINPUTHEADER64;
+
+typedef struct
+{
+ RAWINPUTHEADER64 header;
union {
RAWMOUSE mouse;
RAWKEYBOARD keyboard;
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/233
June 17, 2022
[PATCH v2 1/4] user32/tests: Add some more tests related to the RAWINPUT structure.
by Zebediah Figura
From: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/user32/tests/input.c | 96 +++++++++++++++++++++++++++++++++++++--
1 file changed, 91 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index 6232a7456e8..0d003c6cc21 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -2101,13 +2101,29 @@ static void test_RegisterRawInputDevices(void)
static int rawinputbuffer_wndproc_count;
+typedef struct
+{
+ DWORD dwType;
+ DWORD dwSize;
+ ULONG hDevice;
+ ULONG wParam;
+} RAWINPUTHEADER32;
+
#ifdef _WIN64
+typedef RAWINPUTHEADER RAWINPUTHEADER64;
typedef RAWINPUT RAWINPUT64;
#else
typedef struct
{
- RAWINPUTHEADER header;
- char pad[8];
+ DWORD dwType;
+ DWORD dwSize;
+ ULONGLONG hDevice;
+ ULONGLONG wParam;
+} RAWINPUTHEADER64;
+
+typedef struct
+{
+ RAWINPUTHEADER64 header;
union {
RAWMOUSE mouse;
RAWKEYBOARD keyboard;
@@ -2124,9 +2140,9 @@ static int rawinput_buffer_mouse_x(void *buffer, size_t index)
static LRESULT CALLBACK rawinputbuffer_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
+ UINT i, size, count, rawinput_size, iteration = rawinputbuffer_wndproc_count++;
RAWINPUT ri;
char buffer[16 * sizeof(RAWINPUT64)];
- UINT size, count, rawinput_size, iteration = rawinputbuffer_wndproc_count++;
MSG message;
if (is_wow64) rawinput_size = sizeof(RAWINPUT64);
@@ -2134,8 +2150,10 @@ static LRESULT CALLBACK rawinputbuffer_wndproc(HWND hwnd, UINT msg, WPARAM wpara
if (msg == WM_INPUT)
{
+ SetLastError(0xdeadbeef);
count = GetRawInputBuffer(NULL, NULL, sizeof(RAWINPUTHEADER));
ok(count == ~0U, "GetRawInputBuffer succeeded\n");
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %lu\n", GetLastError());
size = sizeof(buffer);
count = GetRawInputBuffer(NULL, &size, sizeof(RAWINPUTHEADER));
@@ -2147,6 +2165,27 @@ static LRESULT CALLBACK rawinputbuffer_wndproc(HWND hwnd, UINT msg, WPARAM wpara
count = GetRawInputBuffer((RAWINPUT*)buffer, &size, sizeof(RAWINPUTHEADER));
ok(count == 3, "GetRawInputBuffer returned %u\n", count);
ok(size == sizeof(buffer), "GetRawInputBuffer returned unexpected size: %u\n", size);
+
+ for (i = 0; i < 3; ++i)
+ {
+ if (is_wow64)
+ {
+ const RAWINPUT64 *data = &((RAWINPUT64 *)buffer)[i];
+ ok(data->header.dwType == RIM_TYPEMOUSE, "Unexpected rawinput type: %lu\n", data->header.dwType);
+ ok(data->header.dwSize == sizeof(*data), "Unexpected rawinput size: %lu\n", data->header.dwSize);
+ todo_wine_if (wparam)
+ ok(data->header.wParam == wparam, "Unexpected wparam: %#I64x\n", data->header.wParam);
+ }
+ else
+ {
+ const RAWINPUT *data = &((RAWINPUT *)buffer)[i];
+ ok(data->header.dwType == RIM_TYPEMOUSE, "Unexpected rawinput type: %lu\n", data->header.dwType);
+ ok(data->header.dwSize == sizeof(*data), "Unexpected rawinput size: %lu\n", data->header.dwSize);
+ todo_wine_if (wparam)
+ ok(data->header.wParam == wparam, "Unexpected wparam: %#Ix\n", data->header.wParam);
+ }
+ }
+
ok(rawinput_buffer_mouse_x(buffer, 0) == 2, "Unexpected rawinput data: %d\n", rawinput_buffer_mouse_x(buffer, 0));
ok(rawinput_buffer_mouse_x(buffer, 1) == 3, "Unexpected rawinput data: %d\n", rawinput_buffer_mouse_x(buffer, 1));
ok(rawinput_buffer_mouse_x(buffer, 2) == 4, "Unexpected rawinput data: %d\n", rawinput_buffer_mouse_x(buffer, 2));
@@ -2183,7 +2222,12 @@ static LRESULT CALLBACK rawinputbuffer_wndproc(HWND hwnd, UINT msg, WPARAM wpara
{
SetLastError(0xdeadbeef);
count = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &ri, &size, 0);
- ok(count == ~0U, "GetRawInputData succeeded\n");
+ ok(count == ~0u, "GetRawInputData returned %d\n", count);
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetRawInputData returned %08lx\n", GetLastError());
+
+ SetLastError(0xdeadbeef);
+ count = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &ri, &size, sizeof(RAWINPUTHEADER) + 1);
+ ok(count == ~0u, "GetRawInputData returned %d\n", count);
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetRawInputData returned %08lx\n", GetLastError());
SetLastError(0xdeadbeef);
@@ -2204,6 +2248,30 @@ static LRESULT CALLBACK rawinputbuffer_wndproc(HWND hwnd, UINT msg, WPARAM wpara
ok(count == sizeof(ri), "GetRawInputData failed\n");
ok(ri.data.mouse.lLastX == 6, "Unexpected rawinput data: %ld\n", ri.data.mouse.lLastX);
ok(GetLastError() == 0xdeadbeef, "GetRawInputData returned %08lx\n", GetLastError());
+
+ SetLastError(0xdeadbeef);
+ size = sizeof(buffer);
+ if (sizeof(void *) == 8)
+ {
+ count = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &ri, &size, sizeof(RAWINPUTHEADER32));
+ ok(count == ~0u, "GetRawInputData returned %d\n", count);
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetRawInputData returned %08lx\n", GetLastError());
+ }
+ else
+ {
+ count = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &ri, &size, sizeof(RAWINPUTHEADER64));
+ if (is_wow64)
+ {
+ todo_wine ok(count == sizeof(ri), "GetRawInputData returned %d\n", count);
+ ok(ri.data.mouse.lLastX == 6, "Unexpected rawinput data: %ld\n", ri.data.mouse.lLastX);
+ todo_wine ok(GetLastError() == 0xdeadbeef, "GetRawInputData returned %08lx\n", GetLastError());
+ }
+ else
+ {
+ ok(count == ~0u, "GetRawInputData returned %d\n", count);
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetRawInputData returned %08lx\n", GetLastError());
+ }
+ }
}
else
{
@@ -2219,9 +2287,9 @@ static LRESULT CALLBACK rawinputbuffer_wndproc(HWND hwnd, UINT msg, WPARAM wpara
static void test_GetRawInputBuffer(void)
{
+ unsigned int size, count, rawinput_size, header_size;
RAWINPUTDEVICE raw_devices[1];
char buffer[16 * sizeof(RAWINPUT64)];
- UINT size, count, rawinput_size;
HWND hwnd;
BOOL ret;
POINT pt;
@@ -2295,6 +2363,21 @@ static void test_GetRawInputBuffer(void)
ok(count == ~0U, "GetRawInputBuffer succeeded\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetRawInputBuffer returned %08lx\n", GetLastError());
+ SetLastError(0xdeadbeef);
+ size = sizeof(buffer);
+ count = GetRawInputBuffer((RAWINPUT*)buffer, &size, sizeof(RAWINPUTHEADER) + 1);
+ ok(count == ~0U, "GetRawInputBuffer succeeded\n");
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetRawInputBuffer returned %08lx\n", GetLastError());
+
+ /* the function returns 64-bit RAWINPUT structures on WoW64, but still
+ * forbids sizeof(RAWINPUTHEADER) from the wrong architecture */
+ SetLastError(0xdeadbeef);
+ size = sizeof(buffer);
+ header_size = (sizeof(void *) == 8 ? sizeof(RAWINPUTHEADER32) : sizeof(RAWINPUTHEADER64));
+ count = GetRawInputBuffer((RAWINPUT*)buffer, &size, header_size);
+ ok(count == ~0U, "GetRawInputBuffer succeeded\n");
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetRawInputBuffer returned %08lx\n", GetLastError());
+
size = sizeof(buffer);
memset(buffer, 0, sizeof(buffer));
count = GetRawInputBuffer((RAWINPUT*)buffer, &size, sizeof(RAWINPUTHEADER));
@@ -2365,6 +2448,9 @@ static LRESULT CALLBACK rawinput_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPA
ret = GetRawInputData((HRAWINPUT)lparam, RID_INPUT, &raw, &raw_size, sizeof(RAWINPUTHEADER));
ok(ret > 0 && ret != (UINT)-1, "GetRawInputData failed\n");
ok(raw.header.dwType == RIM_TYPEMOUSE, "Unexpected rawinput type: %lu\n", raw.header.dwType);
+ ok(raw.header.dwSize == raw_size, "Expected size %u, got %lu\n", raw_size, raw.header.dwSize);
+ todo_wine_if (wparam)
+ ok(raw.header.wParam == wparam, "Expected wparam %Iu, got %Iu\n", wparam, raw.header.wParam);
ok(!(raw.data.mouse.usFlags & MOUSE_MOVE_ABSOLUTE), "Unexpected absolute rawinput motion\n");
ok(!(raw.data.mouse.usFlags & MOUSE_VIRTUAL_DESKTOP), "Unexpected virtual desktop rawinput motion\n");
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/233
June 17, 2022
[PATCH v2 0/4] MR233: win32u: Partially move raw input APIs.
by Zebediah Figura (@zfigura)
--
v2: win32u: Move NtUserGetRawInputBuffer from user32.
win32u: Move NtUserGetRawInputData from user32.
user32: Correctly fill the RAWINPUT structure on WoW64.
user32/tests: Add some more tests related to the RAWINPUT structure.
https://gitlab.winehq.org/wine/wine/-/merge_requests/233
June 17, 2022
Re: [PATCH v4 4/4] server: Don't invalidate the newly exposed child region on the parent if it doesn't clip children.
by Marvin
Hi,
It looks like your patch introduced the new failures shown below.
Please investigate and fix them before resubmitting your patch.
If they are not new, fixing them anyway would help a lot. Otherwise
please ask for the known failures list to be updated.
1 TestBot errors prevented a full analysis of your patch.
If the test caused the operating system (e.g. Windows) to crash or
reboot you will probably have to modify it to avoid that.
Other issues should be reported to the TestBot administrators.
The tests also ran into some preexisting test failures. If you know how
to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=117156
Your paranoid android.
=== w1064 (testbot log) ===
WineRunTask.pl:error: The previous 1 run(s) terminated abnormally
=== w10pro64_zh_CN (testbot log) ===
WineRunTask.pl:error: BotError: The test VM is powered off! Did the test shut it down?
=== debian11 (32 bit report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9638: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (32 bit Arabic:Morocco report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9638: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (32 bit German report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9638: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (32 bit French report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9638: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (32 bit Hebrew:Israel report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9638: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (32 bit Hindi:India report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9638: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (32 bit Japanese:Japan report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9638: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (32 bit Chinese:China report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9638: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (32 bit WoW report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:6881: Test failed: SetFocus(hwnd) on a button: 4: the msg 0x0007 was expected, but got msg 0x0005 instead
msg.c:6881: Test failed: SetFocus(hwnd) on a button: 5: the msg 0x0138 was expected, but got msg 0x030f instead
msg.c:6881: Test failed: SetFocus(hwnd) on a button: 6: the msg 0x0111 was expected, but got msg 0x001c instead
msg.c:6881: Test failed: SetFocus(hwnd) on a button: 8: the msg 0x8000 was expected, but got msg 0x0086 instead
msg.c:6881: Test failed: SetFocus(hwnd) on a button: 9: the msg sequence is not complete: expected 0000 - actual 0006
msg.c:9638: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (64 bit WoW report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9638: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
June 17, 2022
Re: [PATCH v2 0/1] MR252: shell32/tests: Add tests for Program Manager name sanitization.
by Alex Henrie (@alexhenrie)
I benchmarked it today and on my laptop, the new tests raised the test time from 5 seconds to 2 minutes 15 seconds. I can see how that would be a problem.
I've now pared the tests back to the bare minimum set of tests that I believe are necessary to demonstrate that my proposed solution in merge request !23 solves the problem. Paring back the tests dropped the test time to 36 seconds, mainly because the check_window_exists tests are now skipped if check_exists has already failed. (check_window_exists is very fast if the window does exist, but it will spend a long time waiting for a window that never appears.)
Would it be acceptable to start by committing this set of tests, and build on it later as needed?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/252#note_2243
June 17, 2022
[PATCH v2 1/1] shell32/tests: Add tests for Program Manager name sanitization.
by Alex Henrie
From: Alex Henrie <alexhenrie24(a)gmail.com>
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/shell32/tests/progman_dde.c | 156 ++++++++++++++++++++++++++++++-
1 file changed, 155 insertions(+), 1 deletion(-)
diff --git a/dlls/shell32/tests/progman_dde.c b/dlls/shell32/tests/progman_dde.c
index 5d532f9222f..57d8d0ba1f7 100644
--- a/dlls/shell32/tests/progman_dde.c
+++ b/dlls/shell32/tests/progman_dde.c
@@ -23,7 +23,7 @@
* functionality
* - Todo: Handle CommonGroupFlag
* Better AddItem Tests (Lots of parameters to test)
- * Tests for Invalid Characters in Names / Invalid Parameters
+ * Tests for invalid parameters
*/
#include <stdio.h>
@@ -425,6 +425,159 @@ static void test_request_groups(DWORD instance, HCONV hconv)
FindClose(hfind);
}
+static BOOL is_unsanitary(char c)
+{
+ return (c > 0 && c < ' ') || strchr("*/:<>?\\|", c) != NULL;
+}
+
+static void sanitize_name(const char *original_name, char *sanitized_name, BOOL group)
+{
+ BOOL at_end = TRUE;
+ int i;
+
+ i = strlen(original_name);
+ sanitized_name[i] = 0;
+
+ while (--i >= 0)
+ {
+ if (is_unsanitary(original_name[i]))
+ {
+ /* replaced in all positions */
+ sanitized_name[i] = '_';
+ at_end = FALSE;
+ }
+ else if (original_name[i] == '.' || (original_name[i] == ' ' && group))
+ {
+ /* left alone if in the middle of the string, dropped if at the end of the string */
+ sanitized_name[i] = at_end ? '\0' : original_name[i];
+ }
+ else
+ {
+ /* left alone in all positions */
+ sanitized_name[i] = original_name[i];
+ at_end = FALSE;
+ }
+ }
+}
+
+static void test_name_sanitization(DWORD instance, HCONV hConv)
+{
+ static const char test_chars[] = "\x01\x1F !#$%&'*+,-./;<=>?@[\\]^`{|}~\x7F\xFF";
+ char original_name[16], sanitized_icon_name[16], sanitized_group_name[16];
+ char buf[64];
+ UINT error;
+ int i;
+ char c;
+
+ if (0) /* the directory isn't deleted on windows < 7 */
+ {
+ error = dde_execute(instance, hConv, "[CreateGroup(\" \")]");
+ ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %#x\n", error);
+ ok(check_exists(" "), "directory not created\n");
+ ok(!check_window_exists(" "), "window should not exist\n");
+
+ error = dde_execute(instance, hConv, "[DeleteGroup(\" \")]");
+ ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %#x\n", error);
+ ok(!check_exists(" "), "directory should not exist\n");
+ }
+
+ if (0) /* these calls will actually delete the start menu */
+ {
+ error = dde_execute(instance, hConv, "[DeleteGroup(\"\")]");
+ ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %#x\n", error);
+ ok(!check_exists("../Programs"), "directory should not exist\n");
+
+ error = dde_execute(instance, hConv, "[DeleteGroup(\"..\")]");
+ ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %#x\n", error);
+ ok(!check_exists("../../Start Menu"), "directory should not exist\n");
+ }
+
+ for (i = 0; i < sizeof(test_chars) - 1; i++)
+ {
+ c = test_chars[i];
+ winetest_push_context("char %d '%c'", c, c);
+
+ sprintf(original_name, "%03d_%c_.%c", c, c, c);
+ sanitize_name(original_name, sanitized_group_name, TRUE);
+ sanitize_name(original_name, sanitized_icon_name, FALSE);
+
+ sprintf(buf, "[CreateGroup(\"Group%s\")]", original_name);
+ error = dde_execute(instance, hConv, buf);
+ ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %#x\n", error);
+ sprintf(buf, "Group%s", sanitized_group_name);
+ todo_wine_if(is_unsanitary(c)) ok(check_exists(buf), "directory not created\n");
+ if (!check_exists(buf)) continue;
+ todo_wine_if(is_unsanitary(c)) ok(check_window_exists(buf) || broken(c == ' ') /* vista */, "window not created\n");
+
+ sprintf(buf, "[ShowGroup(\"Group%s\", 0)]", original_name);
+ error = dde_execute(instance, hConv, buf);
+ ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %#x\n", error);
+ sprintf(buf, "Group%s", sanitized_group_name);
+ todo_wine_if(is_unsanitary(c)) ok(check_window_exists(buf) || broken(c == ' ') /* vista */, "window not created\n");
+
+ if (c == ' ')
+ {
+ /* Although no error is reported, no icon is created if the group name ends in a space */
+ error = dde_execute(instance, hConv, "[AddItem(notepad,Notepad)]");
+ todo_wine ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %#x\n", error);
+ sprintf(buf, "Group%s/Notepad.lnk", sanitized_group_name);
+ ok(!check_exists(buf), "link should not exist\n");
+ goto delete_group;
+ }
+
+ sprintf(buf, "[AddItem(notepad,\"Notepad%s\")]", original_name);
+ error = dde_execute(instance, hConv, buf);
+ todo_wine_if(is_unsanitary(c) || c == '.') ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %#x\n", error);
+ sprintf(buf, "Group%s/Notepad%s.lnk", sanitized_group_name, sanitized_icon_name);
+ todo_wine_if(is_unsanitary(c) || c == '.') ok(check_exists(buf) || broken(c == '.') /* XP */, "link not created\n");
+ if (!check_exists(buf)) goto delete_group;
+
+ if (is_unsanitary(c))
+ {
+ sprintf(buf, "[ReplaceItem(\"Notepad%s\")]", original_name);
+ error = dde_execute(instance, hConv, buf);
+ ok(error == DMLERR_NOTPROCESSED, "expected DMLERR_NOTPROCESSED, got %#x\n", error);
+ todo_wine sprintf(buf, "Group%s/Notepad%s.lnk", sanitized_group_name, sanitized_icon_name);
+ ok(check_exists(buf), "link should still exist\n");
+
+ sprintf(buf, "[DeleteItem(\"Notepad%s\")]", original_name);
+ error = dde_execute(instance, hConv, buf);
+ ok(error == DMLERR_NOTPROCESSED, "expected DMLERR_NOTPROCESSED, got %#x\n", error);
+ todo_wine sprintf(buf, "Group%s/Notepad%s.lnk", sanitized_group_name, sanitized_icon_name);
+ ok(check_exists(buf), "link should still exist\n");
+ }
+ else
+ {
+ sprintf(buf, "[ReplaceItem(\"Notepad%s\")]", original_name);
+ error = dde_execute(instance, hConv, buf);
+ ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %#x\n", error);
+ sprintf(buf, "Group%s/Notepad%s.lnk", sanitized_group_name, sanitized_icon_name);
+ ok(!check_exists(buf), "link should not exist\n");
+
+ sprintf(buf, "[AddItem(notepad,\"Notepad%s\")]", original_name);
+ error = dde_execute(instance, hConv, buf);
+ ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %#x\n", error);
+ sprintf(buf, "Group%s/Notepad%s.lnk", sanitized_group_name, sanitized_icon_name);
+ ok(check_exists(buf), "link not created\n");
+
+ sprintf(buf, "[DeleteItem(\"Notepad%s\")]", original_name);
+ error = dde_execute(instance, hConv, buf);
+ ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %#x\n", error);
+ sprintf(buf, "Group%s/Notepad%s.lnk", sanitized_group_name, sanitized_icon_name);
+ ok(!check_exists(buf), "link should not exist\n");
+ }
+
+delete_group:
+ sprintf(buf, "[DeleteGroup(\"Group%s\")]", original_name);
+ error = dde_execute(instance, hConv, buf);
+ todo_wine_if(is_unsanitary(c) && strchr("*:?", c) == NULL) ok(error == DMLERR_NO_ERROR, "expected DMLERR_NO_ERROR, got %#x\n", error);
+ sprintf(buf, "Group%s", sanitized_group_name);
+ ok(!check_exists(buf), "directory should not exist\n");
+
+ winetest_pop_context();
+ }
+}
+
START_TEST(progman_dde)
{
DWORD instance = 0;
@@ -479,6 +632,7 @@ START_TEST(progman_dde)
/* Run Tests */
test_progman_dde2(instance, hConv);
+ test_name_sanitization(instance, hConv);
/* Cleanup & Exit */
ret = DdeDisconnect(hConv);
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/252
June 17, 2022
[PATCH v2 0/1] MR252: shell32/tests: Add tests for Program Manager name sanitization.
by Alex Henrie (@alexhenrie)
Split from https://gitlab.winehq.org/wine/wine/-/merge_requests/23
--
v2: shell32/tests: Add tests for Program Manager name sanitization.
https://gitlab.winehq.org/wine/wine/-/merge_requests/252
June 17, 2022
Re: [PATCH v4 3/4] server: Redraw composited window child when its z-order changes.
by Marvin
Hi,
It looks like your patch introduced the new failures shown below.
Please investigate and fix them before resubmitting your patch.
If they are not new, fixing them anyway would help a lot. Otherwise
please ask for the known failures list to be updated.
1 TestBot errors prevented a full analysis of your patch.
If the test caused the operating system (e.g. Windows) to crash or
reboot you will probably have to modify it to avoid that.
Other issues should be reported to the TestBot administrators.
The tests also ran into some preexisting test failures. If you know how
to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=117155
Your paranoid android.
=== w10pro64_ar (testbot log) ===
WineRunTask.pl:error: BotError: The test VM is powered off! Did the test shut it down?
=== debian11 (32 bit report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9642: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (32 bit Arabic:Morocco report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9642: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (32 bit German report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9642: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (32 bit French report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9642: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (32 bit Hebrew:Israel report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9642: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (32 bit Hindi:India report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9642: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (32 bit Japanese:Japan report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9642: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (32 bit Chinese:China report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9642: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (32 bit WoW report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9642: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
=== debian11 (64 bit WoW report) ===
user32:
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5782: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5791: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 4: the msg 0x0047 was expected, but got msg 0x0085 instead
msg.c:5797: Test failed: ShowWindow(SW_SHOW):child: 5: the msg sequence is not complete: expected 0000 - actual 0014
msg.c:9642: Test failed: destroy child on thread exit: 1: the msg sequence is not complete: expected 000f - actual 0000
June 17, 2022
Re: HLSL offsetting
by Zebediah Figura
On 6/16/22 11:48, Francisco Casas wrote:
> Hello, thanks for commenting on the patch!
>
> On 15-06-22 19:20, Zebediah Figura wrote:
>>
>> From skimming the patch, here are some immediate thoughts:
>>
>> * I have a patch which has been around for a while which replaces the
>> field linked list with an array. I think we wanted that anyway, but we
>> especially want it given list_get().
>>
>
> This seems like a good idea, I will see if I can add it before this patch.
>
>> * All current (upstream) uses of hlsl_new_store() and hlsl_new_load()
>> with a nonzero offset fall into one of two categories:
>>
>> - retrieving the element at a specific offset (initializer and matrix
>> parsing)
>>
>> - adding another offset to an existing hlsl_deref (splitting passes,
>> initial parsing of field/element derefs)
>>
>> I might have missed something, but assuming I've got that right, I
>> think that the hlsl_new_load() and hlsl_new_store() should take
>> arguments to reflect that. (I.e. split each into two functions, one
>> taking an unsigned int and the other taking a const struct hlsl_deref
>> *). In that case struct path_arg would be limited to hlsl.c, if it even
>> needs to exist.
>>
>
> Good observation, I can see some problems though:
>
> a)
> The version of the function that receives the component index can
> generate the path of constant nodes alright, but it also needs to insert
> these nodes in the corresponding instruction list.
>
> The instruction list can be received in this case and the new constant
> nodes can be added at the head
> -- or --
> we can allow the "steps" in the path to be either an hlsl_src or an
> unsigned int, and then add a pass that adds the constant nodes at the
> beginning of the program:
> ---
> struct hlsl_step
> {
> struct hlsl_src *src;
> unsigned int c; /* used if src is NULL */
> };
>
> struct hlsl_deref
> {
> struct hlsl_ir_var *var;
>
> unsigned int path_len;
> struct hlsl_step *path;
> };
> ---
> I don't like this idea too much, but it also covers for the field
> accesses that Giovanni mentioned.
>
> b)
> In my patch, accessing matrix components requires paths of length 2
> (which I think is the right thing to do) so the version of the functions
> that receive a hlsl_deref should also receive 2 optional nodes instead
> of 1. So for instance, hlsl_new_store would be:
> ---
> struct hlsl_ir_store *hlsl_new_store(struct hlsl_ctx *ctx,
> struct hlsl_ir_var *var, const hlsl_deref *deref,
> struct hlsl_ir_node *node1, struct hlsl_ir_node *node2,
> struct hlsl_ir_node *rhs, unsigned int writemask,
> struct vkd3d_shader_location loc);
> ---
> this adds a little clutter.
>
> c)
> We also have to change other functions, for instance, add_load() in
> upstream adds an arbitrary register offset to an hlsl_deref offset. In
> the patch, this generality is achieved by concatenating paths.
> Given the current uses of add_load() we would also need to create two
> versions of this function, the "hlsl_deref + 2 optional nodes" one and
> the "component index" one, and solve this particular case of problem (a)
> too.
Sure, we'd have to split add_load() into two helpers too. I'm inclined
to say that's worthwhile, though.
>
>
> I am not sure that loosing the generality of using path_arg is a good
> thing, it can simplify some calls to loads and stores but that's the
> only benefit I see (unless I am missing something).
> I can switch to this approach though, if we agree in a way of solving (a).
The problem with path_arg is that it's another layer of abstraction that
has to be understood. It'd be nice if we could avoid that, or at least
avoid letting it leak out of hlsl.c.
One obvious way to solve (a) and (b) is to replace hlsl_new_load() with
a hlsl_add_load() that explicitly takes an instruction list and adds to
the end. I think we had even discussed doing something similar to this
previously, to save a bit of effort in the common new + insert case.
This should cover most cases, but I'm not sure it covers all cases—there
are places in hlsl_codegen.c that we use list_add_before(),
list_add_after(), list_add_head().
What we could do instead, to make sure all cases are covered, is
something like
bool hlsl_new_xyzzy(struct hlsl_block *block, unsigned int c, ...)
{
struct hlsl_ir_constant *constant;
struct hlsl_ir_xyzzy *xyzzy;
list_init(&block->instrs);
constant = hlsl_new_uint_constant(c);
list_add_tail(&block->instrs, c);
xyzzy = hlsl_alloc(...);
init_node(&xyzzy);
return true; /* or xyzzy for convenience? */
}
and then
{
struct hlsl_block block;
hlsl_new_xyzzy(&block, 123, ...);
list_move_{head,tail,before,after}(..., &block->instrs);
}
the idea basically being to return a list of instructions in a
caller-allocated container.
I think there's been at least one other time I've wanted to do something
like this, although I don't know what that was now.
>
>> Note that this step could also be done independently of anything
>> else, which would help make the "big" patch more reviewable.
>>
>
> You mean something like adding a "Replace path_arg with specific load
> and store functions." patch afterwards?
I mean you can have one patch (or multiple patches) that change the
hlsl_new_load() and hlsl_new_store() functions like I describe above,
and then another patch (i.e. the one attached to your email, mostly)
that changes the internal representation of hlsl_derefs from a register
offset to a component chain.
>
>> * Similarly I think hlsl_new_resource_load() and friends should just
>> take a "const struct hlsl_deref *" or two.
>
> Yes, this seems consistent if we do stores and loads this way.
>
>> I'm not immediately sure what
>> to do with prepend_input_copy() and friends—maybe those should be
>> converted to iterative passes instead of recursive ones.
>
> I don't see any problem keeping them as recursive passes.
Well, if we follow my above suggestion regarding the interface for
hlsl_new_load() and hlsl_new_store(), there's no way to pass a whole
list of offsets at once. I think this is probably for the better, but it
does mean we probably need to split up I/O copies one level at a time.
>
>> * Stuff like free_hlsl_deref() can be made into a separate patch.
>
> Hmm, sorry, I am not sure I see a clear division here. What other things
> could be in this separate patch?
I just mean that you can invent a patch that adds
static void free_hlsl_deref(struct hlsl_deref *deref)
{
hlsl_src_remove(&deref->offset);
}
and then in "this" patch you only need to change the body of
free_hlsl_deref(), i.e. one hunk instead of several.
June 17, 2022