winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
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
List overview
wine-commits
October 2022
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
537 discussions
Start a n
N
ew thread
Nikolay Sivov : user32: Add DragObject() stub.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 645326214f0ef263e0fd8cf4758b67f74977fbf3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/645326214f0ef263e0fd8cf4758b67…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Oct 30 22:00:23 2022 +0300 user32: Add DragObject() stub. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53768
Signed-off-by: Nikolay Sivov <nsivov(a)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 ec21f7f5984..ec6cd859ff6 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -141,6 +141,7 @@ static void * const syscalls[] = NtUserDispatchMessage, NtUserDisplayConfigGetDeviceInfo, NtUserDragDetect, + NtUserDragObject, NtUserDrawIconEx, NtUserEmptyClipboard, NtUserEnableMenuItem, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 8a3344257ed..3771dafcf76 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 683e7978653..e9b63f365dd 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -127,6 +127,7 @@ SYSCALL_ENTRY( NtUserDispatchMessage ) \ SYSCALL_ENTRY( NtUserDisplayConfigGetDeviceInfo ) \ 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 8d15c84ac30..e1454347ecf 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 1ec4898dcd1..7759f2b3174 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -679,6 +679,7 @@ BOOL WINAPI NtUserDisableThreadIme( DWORD thread_id ); LRESULT WINAPI NtUserDispatchMessage( const MSG *msg ); NTSTATUS WINAPI NtUserDisplayConfigGetDeviceInfo( DISPLAYCONFIG_DEVICE_INFO_HEADER *packet ); 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,
1
0
0
0
Alexandre Julliard : makedep: Remove arch directories on distclean.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: abee72f32dbca311764aeafd7ad1b76efcad28a5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/abee72f32dbca311764aeafd7ad1b7…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Oct 31 12:30:07 2022 +0100 makedep: Remove arch directories on distclean. --- tools/makedep.c | 59 ++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 19 deletions(-) diff --git a/tools/makedep.c b/tools/makedep.c index 21ea7fa9820..82cd37934b5 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -436,19 +436,19 @@ static void output_filenames( struct strarray array ) /******************************************************************* * output_rm_filenames */ -static void output_rm_filenames( struct strarray array ) +static void output_rm_filenames( struct strarray array, const char *command ) { static const unsigned int max_cmdline = 30000; /* to be on the safe side */ unsigned int i, len; if (!array.count) return; - output( "\trm -f" ); + output( "\t%s", command ); for (i = len = 0; i < array.count; i++) { if (len > max_cmdline) { output( "\n" ); - output( "\trm -f" ); + output( "\t%s", command ); len = 0; } output_filename( array.str[i] ); @@ -2600,6 +2600,30 @@ static int cmp_string_length( const char **a, const char **b ) return strcmp( *a, *b ); } +/******************************************************************* + * get_removable_dirs + * + * Retrieve a list of directories to try to remove after deleting the files. + */ +static struct strarray get_removable_dirs( struct strarray files ) +{ + struct strarray dirs = empty_strarray; + unsigned int i; + + for (i = 0; i < files.count; i++) + { + char *dir = xstrdup( files.str[i] ); + while (strchr( dir, '/' )) + { + *strrchr( dir, '/' ) = 0; + strarray_add_uniq( &dirs, xstrdup(dir) ); + } + } + strarray_qsort( &dirs, cmp_string_length ); + return dirs; +} + + /******************************************************************* * output_uninstall_rules */ @@ -2608,25 +2632,16 @@ static void output_uninstall_rules( struct makefile *make ) static const char *dirs_order[] = { "$(includedir)", "$(mandir)", "$(fontdir)", "$(nlsdir)", "$(datadir)", "$(dlldir)" }; - struct strarray uninstall_dirs = empty_strarray; + struct strarray uninstall_dirs; unsigned int i, j; if (!make->uninstall_files.count) return; output( "uninstall::\n" ); - output_rm_filenames( make->uninstall_files ); + output_rm_filenames( make->uninstall_files, "rm -f" ); strarray_add_uniq( &make->phony_targets, "uninstall" ); if (!subdirs.count) return; - for (i = 0; i < make->uninstall_files.count; i++) - { - char *dir = xstrdup( make->uninstall_files.str[i] ); - while (strchr( dir, '/' )) - { - *strrchr( dir, '/' ) = 0; - strarray_add_uniq( &uninstall_dirs, xstrdup(dir) ); - } - } - strarray_qsort( &uninstall_dirs, cmp_string_length ); + uninstall_dirs = get_removable_dirs( make->uninstall_files ); output( "\t-rmdir" ); for (i = 0; i < ARRAY_SIZE(dirs_order); i++) { @@ -3664,6 +3679,7 @@ static void output_subdirs( struct makefile *make ) struct strarray clean_files = empty_strarray; struct strarray testclean_files = empty_strarray; struct strarray distclean_files = empty_strarray; + struct strarray distclean_dirs = empty_strarray; struct strarray dependencies = empty_strarray; struct strarray install_deps[NB_INSTALL_RULES] = { empty_strarray }; struct strarray tooldeps_deps = empty_strarray; @@ -3675,12 +3691,16 @@ static void output_subdirs( struct makefile *make ) for (arch = 0; arch < archs.count; arch++) strarray_addall( &all_targets, make->all_targets[arch] ); for (i = 0; i < subdirs.count; i++) { + struct strarray subclean = empty_strarray; + strarray_addall( &subclean, get_removable_dirs( submakes[i]->clean_files )); + strarray_addall( &subclean, get_removable_dirs( submakes[i]->distclean_files )); strarray_add( &makefile_deps, src_dir_path( submakes[i], "Makefile.in" )); strarray_addall_uniq( &make->phony_targets, submakes[i]->phony_targets ); strarray_addall_uniq( &make->uninstall_files, submakes[i]->uninstall_files ); strarray_addall_uniq( &dependencies, submakes[i]->dependencies ); strarray_addall_path( &clean_files, submakes[i]->obj_dir, submakes[i]->clean_files ); strarray_addall_path( &distclean_files, submakes[i]->obj_dir, submakes[i]->distclean_files ); + strarray_addall_path( &distclean_dirs, submakes[i]->obj_dir, subclean ); strarray_addall_path( &make->maintainerclean_files, submakes[i]->obj_dir, submakes[i]->maintainerclean_files ); strarray_addall_path( &testclean_files, submakes[i]->obj_dir, submakes[i]->ok_files ); strarray_addall_path( &make->pot_files, submakes[i]->obj_dir, submakes[i]->pot_files ); @@ -3740,13 +3760,14 @@ static void output_subdirs( struct makefile *make ) if (get_expanded_make_variable( make, "GETTEXTPO_LIBS" )) output_po_files( make ); output( "clean::\n"); - output_rm_filenames( clean_files ); + output_rm_filenames( clean_files, "rm -f" ); output( "testclean::\n"); - output_rm_filenames( testclean_files ); + output_rm_filenames( testclean_files, "rm -f" ); output( "distclean::\n"); - output_rm_filenames( distclean_files ); + output_rm_filenames( distclean_files, "rm -f" ); + output_rm_filenames( distclean_dirs, "-rmdir 2>/dev/null" ); output( "maintainer-clean::\n"); - output_rm_filenames( make->maintainerclean_files ); + output_rm_filenames( make->maintainerclean_files, "rm -f" ); strarray_add_uniq( &make->phony_targets, "distclean" ); strarray_add_uniq( &make->phony_targets, "testclean" ); strarray_add_uniq( &make->phony_targets, "maintainer-clean" );
1
0
0
0
Alexandre Julliard : configure: Remove no longer needed check for dlltool.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 37910bebfd33bcf7ab4803663c570bccf9f3ee1a URL:
https://gitlab.winehq.org/wine/wine/-/commit/37910bebfd33bcf7ab4803663c570b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Oct 31 12:28:41 2022 +0100 configure: Remove no longer needed check for dlltool. --- configure | 104 -------------------------------------------------------- configure.ac | 1 - tools/makedep.c | 2 -- 3 files changed, 107 deletions(-) diff --git a/configure b/configure index 0a2e5964f64..a5a4debb40f 100755 --- a/configure +++ b/configure @@ -761,7 +761,6 @@ COREFOUNDATION_LIBS ac_ct_OBJC OBJCFLAGS OBJC -DLLTOOL WINELOADER_PROGRAMS CONFIGURE_TARGETS DISABLED_SUBDIRS @@ -9461,108 +9460,6 @@ libwine_soversion=`expr $libwine_version : '\([0-9]*\)\..*'` case $host_os in cygwin*|mingw32*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_DLLTOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -printf "%s\n" "$DLLTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_DLLTOOL+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -printf "%s\n" "$ac_ct_DLLTOOL" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" -fi - LIBEXT="dll" EXTRACFLAGS="-D__WINE_PE_BUILD" case $host_cpu in @@ -23244,7 +23141,6 @@ SUBDIRS = $SUBDIRS DISABLED_SUBDIRS = $DISABLED_SUBDIRS CONFIGURE_TARGETS = $CONFIGURE_TARGETS WINELOADER_PROGRAMS = $WINELOADER_PROGRAMS -DLLTOOL = $DLLTOOL OBJC = $OBJC OBJCFLAGS = $OBJCFLAGS ac_ct_OBJC = $ac_ct_OBJC diff --git a/configure.ac b/configure.ac index e11f3cfdb63..10c773908be 100644 --- a/configure.ac +++ b/configure.ac @@ -667,7 +667,6 @@ libwine_soversion=`expr $libwine_version : '\([[0-9]]*\)\..*'` case $host_os in cygwin*|mingw32*) - AC_CHECK_TOOL(DLLTOOL,dlltool,false) LIBEXT="dll" EXTRACFLAGS="-D__WINE_PE_BUILD" dnl Disable stdcall fixups to catch prototype mismatches diff --git a/tools/makedep.c b/tools/makedep.c index 86a6493a33f..21ea7fa9820 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -157,7 +157,6 @@ static const char *ar; static const char *ranlib; static const char *rsvg; static const char *icotool; -static const char *dlltool; static const char *msgfmt; static const char *ln_s; static const char *sed_cmd; @@ -4480,7 +4479,6 @@ int main( int argc, char *argv[] ) ranlib = get_expanded_make_variable( top_makefile, "RANLIB" ); rsvg = get_expanded_make_variable( top_makefile, "RSVG" ); icotool = get_expanded_make_variable( top_makefile, "ICOTOOL" ); - dlltool = get_expanded_make_variable( top_makefile, "DLLTOOL" ); msgfmt = get_expanded_make_variable( top_makefile, "MSGFMT" ); sed_cmd = get_expanded_make_variable( top_makefile, "SED_CMD" ); ln_s = get_expanded_make_variable( top_makefile, "LN_S" );
1
0
0
0
Akihiro Sagawa : shell32: Returns a number of copied bytes in DropQueryFileA.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: f88fecf80ffaad9e12c92326c3c9b72e5d6898b3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f88fecf80ffaad9e12c92326c3c9b7…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sun Oct 30 16:28:48 2022 +0900 shell32: Returns a number of copied bytes in DropQueryFileA. --- dlls/shell32/shellole.c | 4 ++-- dlls/shell32/tests/shellole.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c index 45ff2a5410c..29d973bf165 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -583,10 +583,10 @@ UINT WINAPI DragQueryFileA(HDROP hDrop, UINT lFile, LPSTR lpszFile, UINT lLength } filename = malloc(i); if (!filename) goto error; - WideCharToMultiByte(CP_ACP, 0, filenameW, -1, filename, i, NULL, NULL); + i = WideCharToMultiByte(CP_ACP, 0, filenameW, -1, filename, i, NULL, NULL); - i = strlen(filename); lstrcpynA(lpszFile, filename, lLength); + i = min(i, lLength) - 1; end: free(filenameW); free(filename); diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index 6d9d348dc6e..4864d35ea9a 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -796,7 +796,7 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA memset(filename, 0xaa, sizeof(filename)); num = DragQueryFileA(hDrop, 0, filename, 2); - todo_wine ok(num == 1, "expected 1, got %u\n", num); + ok(num == 1, "expected 1, got %u\n", num); ok(filename[0] == expected_filename[0], "expected '%c', got '%c'\n", expected_filename[0], filename[0]); ok(filename[1] == '\0', "expected nul, got %#x\n", (BYTE)filename[1]);
1
0
0
0
Akihiro Sagawa : shell32: Returns a number of copied characters in DropQueryFileW.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 205f952db1cf2f508cb5defc4d365dec410c6a8c URL:
https://gitlab.winehq.org/wine/wine/-/commit/205f952db1cf2f508cb5defc4d365d…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sun Oct 30 16:21:50 2022 +0900 shell32: Returns a number of copied characters in DropQueryFileW. --- dlls/shell32/shellole.c | 3 ++- dlls/shell32/tests/shellole.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c index 4f9d0db7ff6..45ff2a5410c 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -652,8 +652,9 @@ UINT WINAPI DragQueryFileW( } i = lstrlenW(filename); - if ( !lpszwFile) goto end; /* needed buffer size */ + if (!lpszwFile || !lLength) goto end; /* needed buffer size */ lstrcpynW(lpszwFile, filename, lLength); + i = min(i, lLength - 1); end: GlobalUnlock(hDrop); free(buffer); diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index ca156ebda62..6d9d348dc6e 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -819,7 +819,7 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA memset(filenameW, 0xaa, sizeof(filenameW)); num = DragQueryFileW(hDrop, 0, filenameW, 2); - todo_wine ok(num == 1, "expected 1, got %u\n", num); + ok(num == 1, "expected 1, got %u\n", num); ok(filenameW[0] == expected_filenameW[0], "expected '%lc', got '%lc'\n", expected_filenameW[0], filenameW[0]); ok(filenameW[1] == L'\0', "expected nul, got %#x\n", (WCHAR)filenameW[1]);
1
0
0
0
Akihiro Sagawa : shell32: Reimplement DragQueryFileA to rely on its Unicode version.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 9f61e1e593f69dee98921f172ca1e8880442d73c URL:
https://gitlab.winehq.org/wine/wine/-/commit/9f61e1e593f69dee98921f172ca1e8…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sun Oct 30 15:41:08 2022 +0900 shell32: Reimplement DragQueryFileA to rely on its Unicode version. Now, it returns a correct buffer size especially for a DBCS file name. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53738
--- dlls/shell32/shellole.c | 72 +++++++++++++++++-------------------------- dlls/shell32/tests/shellole.c | 3 -- 2 files changed, 28 insertions(+), 47 deletions(-) diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c index 0ee5c95402b..4f9d0db7ff6 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -560,56 +560,40 @@ BOOL WINAPI DragQueryPoint(HDROP hDrop, POINT *p) * DragQueryFileA [SHELL32.@] * DragQueryFile [SHELL32.@] */ -UINT WINAPI DragQueryFileA( - HDROP hDrop, - UINT lFile, - LPSTR lpszFile, - UINT lLength) +UINT WINAPI DragQueryFileA(HDROP hDrop, UINT lFile, LPSTR lpszFile, UINT lLength) { - LPSTR lpDrop; - UINT i = 0; - DROPFILES *lpDropFileStruct = GlobalLock(hDrop); - - TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszFile,lLength); + LPWSTR filenameW = NULL; + LPSTR filename = NULL; + UINT i; - if(!lpDropFileStruct) goto end; + TRACE("(%p, %x, %p, %u)\n", hDrop, lFile, lpszFile, lLength); - lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->pFiles; - - if(lpDropFileStruct->fWide) { - LPWSTR lpszFileW = NULL; - - if(lpszFile && lFile != 0xFFFFFFFF) { - lpszFileW = malloc(lLength * sizeof(WCHAR)); - if(lpszFileW == NULL) { - goto end; - } - } - i = DragQueryFileW(hDrop, lFile, lpszFileW, lLength); + i = DragQueryFileW(hDrop, lFile, NULL, 0); + if (!i || lFile == 0xFFFFFFFF) goto end; + filenameW = malloc((i + 1) * sizeof(WCHAR)); + if (!filenameW) goto error; + if (!DragQueryFileW(hDrop, lFile, filenameW, i + 1)) goto error; - if(lpszFileW) { - WideCharToMultiByte(CP_ACP, 0, lpszFileW, -1, lpszFile, lLength, 0, NULL); - free(lpszFileW); - } - goto end; - } - - while (i++ < lFile) - { - while (*lpDrop++); /* skip filename */ - if (!*lpDrop) - { - i = (lFile == 0xFFFFFFFF) ? i : 0; - goto end; - } - } + i = WideCharToMultiByte(CP_ACP, 0, filenameW, -1, NULL, 0, NULL, NULL); + if (!lpszFile || !lLength) + { + /* minus a trailing null */ + i--; + goto end; + } + filename = malloc(i); + if (!filename) goto error; + WideCharToMultiByte(CP_ACP, 0, filenameW, -1, filename, i, NULL, NULL); - i = strlen(lpDrop); - if (!lpszFile ) goto end; /* needed buffer size */ - lstrcpynA (lpszFile, lpDrop, lLength); + i = strlen(filename); + lstrcpynA(lpszFile, filename, lLength); end: - GlobalUnlock(hDrop); - return i; + free(filenameW); + free(filename); + return i; +error: + i = 0; + goto end; } /************************************************************************* diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index 7d1204d1c1f..ca156ebda62 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -783,16 +783,13 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA len = strlen(expected_filename); num = DragQueryFileA(hDrop, 0, NULL, 0); - todo_wine_if(expected_filename[0] == 'd' && (flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); num = DragQueryFileA(hDrop, 0, filename, 0); - todo_wine_if(expected_filename[0] == 'd' && (flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); ok(!strcmp(filename, "dummy"), "got %s\n", filename); num = DragQueryFileA(hDrop, 0, filename, sizeof(filename)); - todo_wine_if(expected_filename[0] == 'd' && (flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); ok(!strcmp(filename, expected_filename), "expected %s, got %s\n", expected_filename, filename);
1
0
0
0
Akihiro Sagawa : shell32: Merge ANSI part of DROPFILES handler into DragQueryFileW.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 3389ba479b9c2d8ac2b76d8a1e0862bb0d070f8b URL:
https://gitlab.winehq.org/wine/wine/-/commit/3389ba479b9c2d8ac2b76d8a1e0862…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sat Oct 29 17:49:15 2022 +0900 shell32: Merge ANSI part of DROPFILES handler into DragQueryFileW. --- dlls/shell32/shellole.c | 66 ++++++++++++++++++++++++------------------- dlls/shell32/tests/shellole.c | 3 -- 2 files changed, 37 insertions(+), 32 deletions(-) diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c index 055244b1e67..0ee5c95402b 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -621,50 +621,58 @@ UINT WINAPI DragQueryFileW( LPWSTR lpszwFile, UINT lLength) { - LPWSTR lpwDrop; + LPWSTR buffer = NULL; + LPCWSTR filename; UINT i = 0; - DROPFILES *lpDropFileStruct = GlobalLock(hDrop); + const DROPFILES *lpDropFileStruct = GlobalLock(hDrop); TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszwFile,lLength); if(!lpDropFileStruct) goto end; - lpwDrop = (LPWSTR) ((LPSTR)lpDropFileStruct + lpDropFileStruct->pFiles); - - if(lpDropFileStruct->fWide == FALSE) { - LPSTR lpszFileA = NULL; - - if(lpszwFile && lFile != 0xFFFFFFFF) { - lpszFileA = malloc(lLength); - if(lpszFileA == NULL) { + if(lpDropFileStruct->fWide) + { + LPCWSTR p = (LPCWSTR) ((LPCSTR)lpDropFileStruct + lpDropFileStruct->pFiles); + while (i++ < lFile) + { + while (*p++); /* skip filename */ + if (!*p) + { + i = (lFile == 0xFFFFFFFF) ? i : 0; goto end; } } - i = DragQueryFileA(hDrop, lFile, lpszFileA, lLength); - - if(lpszFileA) { - MultiByteToWideChar(CP_ACP, 0, lpszFileA, -1, lpszwFile, lLength); - free(lpszFileA); + filename = p; + } + else + { + LPCSTR p = (LPCSTR)lpDropFileStruct + lpDropFileStruct->pFiles; + while (i++ < lFile) + { + while (*p++); /* skip filename */ + if (!*p) + { + i = (lFile == 0xFFFFFFFF) ? i : 0; + goto end; + } } - goto end; + i = MultiByteToWideChar(CP_ACP, 0, p, -1, NULL, 0); + buffer = malloc(i * sizeof(WCHAR)); + if (!buffer) + { + i = 0; + goto end; + } + MultiByteToWideChar(CP_ACP, 0, p, -1, buffer, i); + filename = buffer; } - i = 0; - while (i++ < lFile) - { - while (*lpwDrop++); /* skip filename */ - if (!*lpwDrop) - { - i = (lFile == 0xFFFFFFFF) ? i : 0; - goto end; - } - } - - i = lstrlenW(lpwDrop); + i = lstrlenW(filename); if ( !lpszwFile) goto end; /* needed buffer size */ - lstrcpynW (lpszwFile, lpwDrop, lLength); + lstrcpynW(lpszwFile, filename, lLength); end: GlobalUnlock(hDrop); + free(buffer); return i; } diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index 0b1146ba8bb..7d1204d1c1f 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -809,16 +809,13 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA len = wcslen(expected_filenameW); num = DragQueryFileW(hDrop, 0, NULL, 0); - todo_wine_if(expected_filename[0] == 'd' && !(flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); num = DragQueryFileW(hDrop, 0, filenameW, 0); - todo_wine_if(expected_filename[0] == 'd' && !(flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); ok(!wcscmp(filenameW, L"dummy"), "got %s\n", wine_dbgstr_w(filenameW)); num = DragQueryFileW(hDrop, 0, filenameW, ARRAY_SIZE(filename)); - todo_wine_if(expected_filename[0] == 'd' && !(flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); ok(!wcscmp(filenameW, expected_filenameW), "expected %s, got %s\n", wine_dbgstr_w(expected_filenameW), wine_dbgstr_w(filenameW));
1
0
0
0
Akihiro Sagawa : shell32/tests: Add more DragQueryFile tests.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 2176e83060678e4734cbe0f78de2e023bf832e34 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2176e83060678e4734cbe0f78de2e0…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sat Oct 29 21:24:16 2022 +0900 shell32/tests: Add more DragQueryFile tests. --- dlls/shell32/tests/shellole.c | 64 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 56 insertions(+), 8 deletions(-) diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index 1129b603201..0b1146ba8bb 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -746,6 +746,8 @@ static void test_SHCreateQueryCancelAutoPlayMoniker(void) } #define WM_EXPECTED_VALUE WM_APP +#define DROP_NC_AREA 1 +#define DROP_WIDE_FILENAME 2 struct DragParam { HWND hwnd; HANDLE ready; @@ -753,24 +755,25 @@ struct DragParam { static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { - static BOOL expected; + static DWORD flags; static char expected_filename[MAX_PATH]; switch (msg) { case WM_EXPECTED_VALUE: { lstrcpynA(expected_filename, (const char*)wparam, sizeof(expected_filename)); - expected = lparam; + flags = lparam; break; } case WM_DROPFILES: { HDROP hDrop = (HDROP)wparam; char filename[MAX_PATH] = "dummy"; + WCHAR filenameW[MAX_PATH] = L"dummy", expected_filenameW[MAX_PATH]; POINT pt; BOOL r; UINT num, len; - winetest_push_context("%s", wine_dbgstr_a(expected_filename)); + winetest_push_context("%s(%lu)", wine_dbgstr_a(expected_filename), flags); num = DragQueryFileA(hDrop, 0xffffffff, NULL, 0); ok(num == 1, "expected 1, got %u\n", num); @@ -780,16 +783,16 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA len = strlen(expected_filename); num = DragQueryFileA(hDrop, 0, NULL, 0); - todo_wine_if(expected_filename[0] == 'd') + todo_wine_if(expected_filename[0] == 'd' && (flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); num = DragQueryFileA(hDrop, 0, filename, 0); - todo_wine_if(expected_filename[0] == 'd') + todo_wine_if(expected_filename[0] == 'd' && (flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); ok(!strcmp(filename, "dummy"), "got %s\n", filename); num = DragQueryFileA(hDrop, 0, filename, sizeof(filename)); - todo_wine_if(expected_filename[0] == 'd') + todo_wine_if(expected_filename[0] == 'd' && (flags & DROP_WIDE_FILENAME)) ok(num == len, "expected %u, got %u\n", len, num); ok(!strcmp(filename, expected_filename), "expected %s, got %s\n", expected_filename, filename); @@ -801,8 +804,34 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA expected_filename[0], filename[0]); ok(filename[1] == '\0', "expected nul, got %#x\n", (BYTE)filename[1]); + MultiByteToWideChar(CP_ACP, 0, expected_filename, -1, + expected_filenameW, ARRAY_SIZE(expected_filenameW)); + + len = wcslen(expected_filenameW); + num = DragQueryFileW(hDrop, 0, NULL, 0); + todo_wine_if(expected_filename[0] == 'd' && !(flags & DROP_WIDE_FILENAME)) + ok(num == len, "expected %u, got %u\n", len, num); + + num = DragQueryFileW(hDrop, 0, filenameW, 0); + todo_wine_if(expected_filename[0] == 'd' && !(flags & DROP_WIDE_FILENAME)) + ok(num == len, "expected %u, got %u\n", len, num); + ok(!wcscmp(filenameW, L"dummy"), "got %s\n", wine_dbgstr_w(filenameW)); + + num = DragQueryFileW(hDrop, 0, filenameW, ARRAY_SIZE(filename)); + todo_wine_if(expected_filename[0] == 'd' && !(flags & DROP_WIDE_FILENAME)) + ok(num == len, "expected %u, got %u\n", len, num); + ok(!wcscmp(filenameW, expected_filenameW), "expected %s, got %s\n", + wine_dbgstr_w(expected_filenameW), wine_dbgstr_w(filenameW)); + + memset(filenameW, 0xaa, sizeof(filenameW)); + num = DragQueryFileW(hDrop, 0, filenameW, 2); + todo_wine ok(num == 1, "expected 1, got %u\n", num); + ok(filenameW[0] == expected_filenameW[0], "expected '%lc', got '%lc'\n", + expected_filenameW[0], filenameW[0]); + ok(filenameW[1] == L'\0', "expected nul, got %#x\n", (WCHAR)filenameW[1]); + r = DragQueryPoint(hDrop, &pt); - ok(r == expected, "expected %d, got %d\n", expected, r); + ok(r == !(flags & DROP_NC_AREA), "expected %d, got %d\n", !(flags & DROP_NC_AREA), r); ok(pt.x == 10, "expected 10, got %ld\n", pt.x); ok(pt.y == 20, "expected 20, got %ld\n", pt.y); DragFinish(hDrop); @@ -909,7 +938,24 @@ static void test_DragQueryFile(BOOL non_client_flag) GlobalUnlock(hDrop); r = PostMessageA(param.hwnd, WM_EXPECTED_VALUE, - (WPARAM)testcase[i].filename, !non_client_flag); + (WPARAM)testcase[i].filename, DROP_WIDE_FILENAME | (non_client_flag ? DROP_NC_AREA : 0)); + ok(r, "got %d\n", r); + + r = PostMessageA(param.hwnd, WM_DROPFILES, (WPARAM)hDrop, 0); + ok(r, "got %d\n", r); + + hDrop = GlobalAlloc(GHND, sizeof(DROPFILES) + strlen(testcase[i].filename) + 2); + pDrop = GlobalLock(hDrop); + pDrop->pt.x = 10; + pDrop->pt.y = 20; + pDrop->fNC = non_client_flag; + pDrop->pFiles = sizeof(DROPFILES); + strcpy((char *)(pDrop + 1), testcase[i].filename); + pDrop->fWide = FALSE; + GlobalUnlock(hDrop); + + r = PostMessageA(param.hwnd, WM_EXPECTED_VALUE, + (WPARAM)testcase[i].filename, non_client_flag ? DROP_NC_AREA : 0); ok(r, "got %d\n", r); r = PostMessageA(param.hwnd, WM_DROPFILES, (WPARAM)hDrop, 0); @@ -928,6 +974,8 @@ static void test_DragQueryFile(BOOL non_client_flag) CloseHandle(hThread); } #undef WM_EXPECTED_VALUE +#undef DROP_NC_AREA +#undef DROP_WIDE_FILENAME static void test_SHCreateSessionKey(void) {
1
0
0
0
Akihiro Sagawa : shell32/tests: Add DBCS file name tests for DragQueryFile.
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 3ef081593c0d8e7d140eb446e3270ffeb5cf3daf URL:
https://gitlab.winehq.org/wine/wine/-/commit/3ef081593c0d8e7d140eb446e3270f…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Tue Oct 25 21:33:07 2022 +0900 shell32/tests: Add DBCS file name tests for DragQueryFile. --- dlls/shell32/tests/shellole.c | 92 ++++++++++++++++++++++++++++++++----------- 1 file changed, 70 insertions(+), 22 deletions(-) diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index 5f0c2ea1bca..1129b603201 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -746,7 +746,6 @@ static void test_SHCreateQueryCancelAutoPlayMoniker(void) } #define WM_EXPECTED_VALUE WM_APP -#define DROPTEST_FILENAME "c:\\wintest.bin" struct DragParam { HWND hwnd; HANDLE ready; @@ -755,10 +754,12 @@ struct DragParam { static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { static BOOL expected; + static char expected_filename[MAX_PATH]; switch (msg) { case WM_EXPECTED_VALUE: { + lstrcpynA(expected_filename, (const char*)wparam, sizeof(expected_filename)); expected = lparam; break; } @@ -768,19 +769,44 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA char filename[MAX_PATH] = "dummy"; POINT pt; BOOL r; - UINT num; + UINT num, len; + winetest_push_context("%s", wine_dbgstr_a(expected_filename)); + num = DragQueryFileA(hDrop, 0xffffffff, NULL, 0); ok(num == 1, "expected 1, got %u\n", num); + num = DragQueryFileA(hDrop, 0xffffffff, (char*)0xdeadbeef, 0xffffffff); ok(num == 1, "expected 1, got %u\n", num); + + len = strlen(expected_filename); + num = DragQueryFileA(hDrop, 0, NULL, 0); + todo_wine_if(expected_filename[0] == 'd') + ok(num == len, "expected %u, got %u\n", len, num); + + num = DragQueryFileA(hDrop, 0, filename, 0); + todo_wine_if(expected_filename[0] == 'd') + ok(num == len, "expected %u, got %u\n", len, num); + ok(!strcmp(filename, "dummy"), "got %s\n", filename); + num = DragQueryFileA(hDrop, 0, filename, sizeof(filename)); - ok(num == strlen(DROPTEST_FILENAME), "got %u\n", num); - ok(!strcmp(filename, DROPTEST_FILENAME), "got %s\n", filename); + todo_wine_if(expected_filename[0] == 'd') + ok(num == len, "expected %u, got %u\n", len, num); + ok(!strcmp(filename, expected_filename), "expected %s, got %s\n", + expected_filename, filename); + + memset(filename, 0xaa, sizeof(filename)); + num = DragQueryFileA(hDrop, 0, filename, 2); + todo_wine ok(num == 1, "expected 1, got %u\n", num); + ok(filename[0] == expected_filename[0], "expected '%c', got '%c'\n", + expected_filename[0], filename[0]); + ok(filename[1] == '\0', "expected nul, got %#x\n", (BYTE)filename[1]); + r = DragQueryPoint(hDrop, &pt); ok(r == expected, "expected %d, got %d\n", expected, r); ok(pt.x == 10, "expected 10, got %ld\n", pt.x); ok(pt.y == 20, "expected 20, got %ld\n", pt.y); DragFinish(hDrop); + winetest_pop_context(); return 0; } } @@ -841,8 +867,15 @@ static void test_DragQueryFile(BOOL non_client_flag) DWORD rc; HGLOBAL hDrop; DROPFILES *pDrop; - int ret; + int ret, i; BOOL r; + static const struct { + UINT codepage; + const char* filename; + } testcase[] = { + { 0, "c:\\wintest.bin" }, + { 932, "d:\\\x89\xb9\x8a\x79_02.CHY" }, + }; param.ready = CreateEventA(NULL, FALSE, FALSE, NULL); ok(param.ready != NULL, "can't create event\n"); @@ -851,23 +884,39 @@ static void test_DragQueryFile(BOOL non_client_flag) rc = WaitForSingleObject(param.ready, 5000); ok(rc == WAIT_OBJECT_0, "got %lu\n", rc); - hDrop = GlobalAlloc(GHND, sizeof(DROPFILES) + (strlen(DROPTEST_FILENAME) + 2) * sizeof(WCHAR)); - pDrop = GlobalLock(hDrop); - pDrop->pt.x = 10; - pDrop->pt.y = 20; - pDrop->fNC = non_client_flag; - pDrop->pFiles = sizeof(DROPFILES); - ret = MultiByteToWideChar(CP_ACP, 0, DROPTEST_FILENAME, -1, - (LPWSTR)(pDrop + 1), strlen(DROPTEST_FILENAME) + 1); - ok(ret > 0, "got %d\n", ret); - pDrop->fWide = TRUE; - GlobalUnlock(hDrop); - - r = PostMessageA(param.hwnd, WM_EXPECTED_VALUE, 0, !non_client_flag); - ok(r, "got %d\n", r); + for (i = 0; i < ARRAY_SIZE(testcase); i++) + { + winetest_push_context("%d", i); + if (testcase[i].codepage && testcase[i].codepage != GetACP()) + { + skip("need codepage %u for this test\n", testcase[i].codepage); + winetest_pop_context(); + continue; + } - r = PostMessageA(param.hwnd, WM_DROPFILES, (WPARAM)hDrop, 0); - ok(r, "got %d\n", r); + ret = MultiByteToWideChar(CP_ACP, 0, testcase[i].filename, -1, NULL, 0); + ok(ret > 0, "got %d\n", ret); + hDrop = GlobalAlloc(GHND, sizeof(DROPFILES) + (ret + 1) * sizeof(WCHAR)); + pDrop = GlobalLock(hDrop); + pDrop->pt.x = 10; + pDrop->pt.y = 20; + pDrop->fNC = non_client_flag; + pDrop->pFiles = sizeof(DROPFILES); + ret = MultiByteToWideChar(CP_ACP, 0, testcase[i].filename, -1, + (LPWSTR)(pDrop + 1), ret); + ok(ret > 0, "got %d\n", ret); + pDrop->fWide = TRUE; + GlobalUnlock(hDrop); + + r = PostMessageA(param.hwnd, WM_EXPECTED_VALUE, + (WPARAM)testcase[i].filename, !non_client_flag); + ok(r, "got %d\n", r); + + r = PostMessageA(param.hwnd, WM_DROPFILES, (WPARAM)hDrop, 0); + ok(r, "got %d\n", r); + + winetest_pop_context(); + } r = PostMessageA(param.hwnd, WM_QUIT, 0, 0); ok(r, "got %d\n", r); @@ -879,7 +928,6 @@ static void test_DragQueryFile(BOOL non_client_flag) CloseHandle(hThread); } #undef WM_EXPECTED_VALUE -#undef DROPTEST_FILENAME static void test_SHCreateSessionKey(void) {
1
0
0
0
Nikolay Sivov : kernelbase: Add QueryVirtualMemoryInformation().
by Alexandre Julliard
31 Oct '22
31 Oct '22
Module: wine Branch: master Commit: 9cd5bc0d86d53c2db32c8025df99a487dad94850 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9cd5bc0d86d53c2db32c8025df99a4…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jun 28 18:13:54 2022 +0300 kernelbase: Add QueryVirtualMemoryInformation(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/kernelbase/kernelbase.spec | 2 +- dlls/kernelbase/memory.c | 17 ++++++++++++++++ include/Makefile.in | 1 + include/memoryapi.h | 45 +++++++++++++++++++++++++++++++++++++++++ include/winbase.h | 1 + 5 files changed, 65 insertions(+), 1 deletion(-) diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index cbce448d3e9..c51dbd6bc73 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -1250,7 +1250,7 @@ @ stdcall QueryThreadpoolStackInformation(ptr ptr) @ stdcall QueryUnbiasedInterruptTime(ptr) ntdll.RtlQueryUnbiasedInterruptTime # @ stub QueryUnbiasedInterruptTimePrecise -# @ stub QueryVirtualMemoryInformation +@ stdcall QueryVirtualMemoryInformation(long ptr long ptr long ptr) @ stdcall QueryWorkingSet(long ptr long) @ stdcall QueryWorkingSetEx(long ptr long) @ stdcall QueueUserAPC(ptr long long) diff --git a/dlls/kernelbase/memory.c b/dlls/kernelbase/memory.c index 412d80f5cfd..19b1d0a3a1a 100644 --- a/dlls/kernelbase/memory.c +++ b/dlls/kernelbase/memory.c @@ -1411,6 +1411,23 @@ LPVOID WINAPI DECLSPEC_HOTPATCH VirtualAllocExNuma( HANDLE process, void *addr, } +/*********************************************************************** + * QueryVirtualMemoryInformation (kernelbase.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH QueryVirtualMemoryInformation( HANDLE process, const void *addr, + WIN32_MEMORY_INFORMATION_CLASS info_class, void *info, SIZE_T size, SIZE_T *ret_size) +{ + switch (info_class) + { + case MemoryRegionInfo: + return set_ntstatus( NtQueryVirtualMemory( process, addr, MemoryRegionInformation, info, size, ret_size )); + default: + FIXME("Unsupported info class %u.\n", info_class); + return FALSE; + } +} + + /*********************************************************************** * CPU functions ***********************************************************************/ diff --git a/include/Makefile.in b/include/Makefile.in index 1c04f9a298b..28ac4b3f2dc 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -416,6 +416,7 @@ SOURCES = \ mediaerr.h \ mediaobj.idl \ medparam.idl \ + memoryapi.h \ metahost.idl \ mfapi.h \ mfd3d12.idl \ diff --git a/include/memoryapi.h b/include/memoryapi.h new file mode 100644 index 00000000000..8743e67927c --- /dev/null +++ b/include/memoryapi.h @@ -0,0 +1,45 @@ +/* + * 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 + */ + +typedef enum WIN32_MEMORY_INFORMATION_CLASS +{ + MemoryRegionInfo +} WIN32_MEMORY_INFORMATION_CLASS; + +typedef struct WIN32_MEMORY_REGION_INFORMATION +{ + PVOID AllocationBase; + ULONG AllocationProtect; + union + { + ULONG Flags; + struct + { + ULONG Private : 1; + ULONG MappedDataFile : 1; + ULONG MappedImage : 1; + ULONG MappedPageFile : 1; + ULONG MappedPhysical : 1; + ULONG DirectMapped : 1; + ULONG Reserved : 26; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + SIZE_T RegionSize; + SIZE_T CommitSize; +} WIN32_MEMORY_REGION_INFORMATION; + +BOOL WINAPI QueryVirtualMemoryInformation(HANDLE process,const void *addr, + WIN32_MEMORY_INFORMATION_CLASS info_class, void *info, SIZE_T size, SIZE_T *ret_size); diff --git a/include/winbase.h b/include/winbase.h index 58f21a1361a..7c0d8afd36c 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -43,6 +43,7 @@ extern "C" { #include <processthreadsapi.h> #include <synchapi.h> #include <threadpoolapiset.h> +#include <memoryapi.h> /* Windows Exit Procedure flag values */ #define WEP_FREE_DLL 0
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
54
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Results per page:
10
25
50
100
200