Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53768
-- v2: win32u: Move NtUserDragDetect() to window.c. user32: Add DragObject() stub.
From: Nikolay Sivov nsivov@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53768 Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/user32/user32.spec | 2 +- dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/win32u/window.c | 10 ++++++++++ dlls/wow64win/syscall.h | 1 + dlls/wow64win/user.c | 11 +++++++++++ include/ntuser.h | 1 + 7 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index 1bf3ebdc90d..4f15b4c06e5 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -182,7 +182,7 @@ @ stdcall DlgDirSelectExA(long ptr long long) @ stdcall DlgDirSelectExW(long ptr long long) @ stdcall DragDetect(long int64) -@ stub DragObject +@ stdcall DragObject(long long long long long) NtUserDragObject @ stdcall DrawAnimatedRects(long long ptr ptr) @ stdcall DrawCaption(long long ptr long) @ stdcall DrawCaptionTempA(long long ptr long long str long) diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index f9e608ed0b7..73e5dc3e15d 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -140,6 +140,7 @@ static void * const syscalls[] = NtUserDisableThreadIme, NtUserDispatchMessage, NtUserDragDetect, + NtUserDragObject, NtUserDrawIconEx, NtUserEmptyClipboard, NtUserEnableMenuItem, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index df722586ded..cc3431e195a 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -846,7 +846,7 @@ @ stub NtUserDoSoundDisconnect @ stub NtUserDownlevelTouchpad @ stdcall -syscall NtUserDragDetect(long long long) -@ stub NtUserDragObject +@ stdcall -syscall NtUserDragObject(long long long long long) @ stub NtUserDrawAnimatedRects @ stub NtUserDrawCaption @ stdcall NtUserDrawCaptionTemp(long long ptr long long wstr long) diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 5b87dcdf465..1672c4b02a0 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -5539,3 +5539,13 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) return 0; } } + +/******************************************************************* + * NtUserDragObject (win32u.@) + */ +DWORD WINAPI NtUserDragObject( HWND parent, HWND hwnd, UINT fmt, ULONG_PTR data, HCURSOR cursor ) +{ + FIXME( "%p, %p, %u, %#lx, %p stub!\n", parent, hwnd, fmt, data, cursor ); + + return 0; +} diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index 009a457fe6e..7017b344233 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -126,6 +126,7 @@ SYSCALL_ENTRY( NtUserDisableThreadIme ) \ SYSCALL_ENTRY( NtUserDispatchMessage ) \ SYSCALL_ENTRY( NtUserDragDetect ) \ + SYSCALL_ENTRY( NtUserDragObject ) \ SYSCALL_ENTRY( NtUserDrawIconEx ) \ SYSCALL_ENTRY( NtUserEmptyClipboard ) \ SYSCALL_ENTRY( NtUserEnableMenuItem ) \ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 041285fa37f..761754bd7f9 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -1558,6 +1558,17 @@ NTSTATUS WINAPI wow64_NtUserDragDetect( UINT *args ) return NtUserDragDetect( hwnd, x, y ); }
+NTSTATUS WINAPI wow64_NtUserDragObject( UINT *args ) +{ + HWND parent = get_handle( &args ); + HWND hwnd = get_handle( &args ); + UINT fmt = get_ulong( &args ); + ULONG_PTR data = get_ulong( &args ); + HCURSOR hcursor = get_handle( &args ); + + return NtUserDragObject( parent, hwnd, fmt, data, hcursor ); +} + NTSTATUS WINAPI wow64_NtUserDrawIconEx( UINT *args ) { HDC hdc = get_handle( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index d724ccad103..e987526c11e 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -678,6 +678,7 @@ BOOL WINAPI NtUserDestroyWindow( HWND hwnd ); BOOL WINAPI NtUserDisableThreadIme( DWORD thread_id ); LRESULT WINAPI NtUserDispatchMessage( const MSG *msg ); BOOL WINAPI NtUserDragDetect( HWND hwnd, int x, int y ); +DWORD WINAPI NtUserDragObject( HWND parent, HWND hwnd, UINT fmt, ULONG_PTR data, HCURSOR cursor ); BOOL WINAPI NtUserDrawCaptionTemp( HWND hwnd, HDC hdc, const RECT *rect, HFONT font, HICON icon, const WCHAR *str, UINT flags ); BOOL WINAPI NtUserDrawIconEx( HDC hdc, INT x0, INT y0, HICON icon, INT width,
From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/win32u/input.c | 45 -------------------------------------------- dlls/win32u/window.c | 45 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 45 deletions(-)
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index f3b724e7010..5ba7d151f57 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -1394,51 +1394,6 @@ BOOL WINAPI NtUserTrackMouseEvent( TRACKMOUSEEVENT *info ) return TRUE; }
-/******************************************************************* - * NtUserDragDetect (win32u.@) - */ -BOOL WINAPI NtUserDragDetect( HWND hwnd, int x, int y ) -{ - WORD width, height; - RECT rect; - MSG msg; - - TRACE( "%p (%d,%d)\n", hwnd, x, y ); - - if (!(NtUserGetKeyState( VK_LBUTTON ) & 0x8000)) return FALSE; - - width = get_system_metrics( SM_CXDRAG ); - height = get_system_metrics( SM_CYDRAG ); - SetRect( &rect, x - width, y - height, x + width, y + height ); - - NtUserSetCapture( hwnd ); - - for (;;) - { - while (NtUserPeekMessage( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE )) - { - if (msg.message == WM_LBUTTONUP) - { - release_capture(); - return FALSE; - } - if (msg.message == WM_MOUSEMOVE) - { - POINT tmp; - tmp.x = (short)LOWORD( msg.lParam ); - tmp.y = (short)HIWORD( msg.lParam ); - if (!PtInRect( &rect, tmp )) - { - release_capture(); - return TRUE; - } - } - } - NtUserMsgWaitForMultipleObjectsEx( 0, NULL, INFINITE, QS_ALLINPUT, 0 ); - } - return FALSE; -} - /********************************************************************** * set_capture_window */ diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 1672c4b02a0..27d4f63272d 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -5540,6 +5540,51 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) } }
+/******************************************************************* + * NtUserDragDetect (win32u.@) + */ +BOOL WINAPI NtUserDragDetect( HWND hwnd, int x, int y ) +{ + WORD width, height; + RECT rect; + MSG msg; + + TRACE( "%p (%d,%d)\n", hwnd, x, y ); + + if (!(NtUserGetKeyState( VK_LBUTTON ) & 0x8000)) return FALSE; + + width = get_system_metrics( SM_CXDRAG ); + height = get_system_metrics( SM_CYDRAG ); + SetRect( &rect, x - width, y - height, x + width, y + height ); + + NtUserSetCapture( hwnd ); + + for (;;) + { + while (NtUserPeekMessage( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE )) + { + if (msg.message == WM_LBUTTONUP) + { + release_capture(); + return FALSE; + } + if (msg.message == WM_MOUSEMOVE) + { + POINT tmp; + tmp.x = (short)LOWORD( msg.lParam ); + tmp.y = (short)HIWORD( msg.lParam ); + if (!PtInRect( &rect, tmp )) + { + release_capture(); + return TRUE; + } + } + } + NtUserMsgWaitForMultipleObjectsEx( 0, NULL, INFINITE, QS_ALLINPUT, 0 ); + } + return FALSE; +} + /******************************************************************* * NtUserDragObject (win32u.@) */
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.
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=125560
Your paranoid android.
=== debian11 (32 bit report) ===
d3drm: d3drm.c:5843: Test failed: Cannot create IM device, skipping tests.
=== debian11 (build log) ===
0630:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this. 0630:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this. 0630:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this.
This merge request was approved by Rémi Bernon.
One thing I don't know is whether the spec should use `ptr` instead of `long` for the `ULONG_PTR` argument. Maybe it doesn't matter?
On Mon Oct 31 12:07:15 2022 +0000, Rémi Bernon wrote:
One thing I don't know is whether the spec should use `ptr` instead of `long` for the `ULONG_PTR` argument. Maybe it doesn't matter?
I think it doesn't matter in practice, because what's long in a spec file is always printed as ulong_ptr.