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
November 2023
----- 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
989 discussions
Start a n
N
ew thread
Louis Lenders : shell32: Add stub for SHCreateItemWithParent.
by Alexandre Julliard
28 Nov '23
28 Nov '23
Module: wine Branch: master Commit: 44cbc8ef8462a4556c110b350b2d8e78d21181a4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/44cbc8ef8462a4556c110b350b2d8e…
Author: Louis Lenders <xerox.xerox2000x(a)gmail.com> Date: Sun Nov 26 22:12:42 2023 +0100 shell32: Add stub for SHCreateItemWithParent. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=55851
--- dlls/shell32/shell32.spec | 1 + dlls/shell32/shellitem.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec index 2c969869722..60bd63ab7a8 100644 --- a/dlls/shell32/shell32.spec +++ b/dlls/shell32/shell32.spec @@ -349,6 +349,7 @@ @ stdcall SHCreateItemFromParsingName(wstr ptr ptr ptr) @ stdcall SHCreateItemInKnownFolder(ptr long wstr ptr ptr) @ stdcall SHCreateItemFromRelativeName(ptr wstr ptr ptr ptr) +@ stdcall SHCreateItemWithParent(ptr ptr ptr ptr ptr) @ stub SHCreateProcessAsUserW @ stdcall SHCreateQueryCancelAutoPlayMoniker(ptr) @ stdcall SHCreateShellItem(ptr ptr ptr ptr) diff --git a/dlls/shell32/shellitem.c b/dlls/shell32/shellitem.c index 6f8f52469fc..d8720734e22 100644 --- a/dlls/shell32/shellitem.c +++ b/dlls/shell32/shellitem.c @@ -769,6 +769,14 @@ HRESULT WINAPI SHCreateItemFromIDList(PCIDLIST_ABSOLUTE pidl, REFIID riid, void return ret; } +HRESULT WINAPI SHCreateItemWithParent(PCIDLIST_ABSOLUTE pidl_parent, IShellFolder *psf, + PCUITEMID_CHILD pidl, REFIID riid, void **ppv) +{ + FIXME("(%p, %p, %p, %s, %p)\n", pidl_parent, psf, pidl, debugstr_guid(riid), ppv); + + return E_NOTIMPL; +} + HRESULT WINAPI SHCreateItemInKnownFolder(REFKNOWNFOLDERID rfid, DWORD flags, PCWSTR filename, REFIID riid, void **ppv) {
1
0
0
0
Eric Pouech : ntdll: Return NULL in RtlFindExportedRoutine for forwarded entries.
by Alexandre Julliard
28 Nov '23
28 Nov '23
Module: wine Branch: master Commit: 6a4dca0e5ba2c3ad17fd8ac78f0eabd2b0f09726 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6a4dca0e5ba2c3ad17fd8ac78f0eab…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Tue Nov 28 18:51:10 2023 +0100 ntdll: Return NULL in RtlFindExportedRoutine for forwarded entries. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- dlls/ntdll/loader.c | 8 +++++++- dlls/ntdll/tests/rtl.c | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index df8324e0b6b..a3de8791498 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1066,6 +1066,7 @@ void * WINAPI RtlFindExportedRoutineByName( HMODULE module, const char *name ) const DWORD *functions; DWORD exp_size; int ordinal; + void *proc; exports = RtlImageDirectoryEntryToData( module, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &exp_size ); if (!exports || exp_size < sizeof(*exports)) return NULL; @@ -1074,7 +1075,12 @@ void * WINAPI RtlFindExportedRoutineByName( HMODULE module, const char *name ) if (ordinal >= exports->NumberOfFunctions) return NULL; functions = get_rva( module, exports->AddressOfFunctions ); if (!functions[ordinal]) return NULL; - return get_rva( module, functions[ordinal] ); + proc = get_rva( module, functions[ordinal] ); + /* if the address falls into the export dir, it's a forward */ + if (((const char *)proc >= (const char *)exports) && + ((const char *)proc < (const char *)exports + exp_size)) + return NULL; + return proc; } diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c index 88f62b0b588..442ad729540 100644 --- a/dlls/ntdll/tests/rtl.c +++ b/dlls/ntdll/tests/rtl.c @@ -95,6 +95,7 @@ static NTSTATUS (WINAPI *pRtlIpv6StringToAddressExW)(PCWSTR, struct in6_addr *, static BOOL (WINAPI *pRtlIsCriticalSectionLocked)(CRITICAL_SECTION *); static BOOL (WINAPI *pRtlIsCriticalSectionLockedByThread)(CRITICAL_SECTION *); static NTSTATUS (WINAPI *pRtlInitializeCriticalSectionEx)(CRITICAL_SECTION *, ULONG, ULONG); +static void * (WINAPI *pRtlFindExportedRoutineByName)(HMODULE,const char *); static NTSTATUS (WINAPI *pLdrEnumerateLoadedModules)(void *, void *, void *); static NTSTATUS (WINAPI *pLdrRegisterDllNotification)(ULONG, PLDR_DLL_NOTIFICATION_FUNCTION, void *, void **); static NTSTATUS (WINAPI *pLdrUnregisterDllNotification)(void *); @@ -137,6 +138,7 @@ static void InitFunctionPtrs(void) pRtlIsCriticalSectionLocked = (void *)GetProcAddress(hntdll, "RtlIsCriticalSectionLocked"); pRtlIsCriticalSectionLockedByThread = (void *)GetProcAddress(hntdll, "RtlIsCriticalSectionLockedByThread"); pRtlInitializeCriticalSectionEx = (void *)GetProcAddress(hntdll, "RtlInitializeCriticalSectionEx"); + pRtlFindExportedRoutineByName = (void *)GetProcAddress(hntdll, "RtlFindExportedRoutineByName"); pLdrEnumerateLoadedModules = (void *)GetProcAddress(hntdll, "LdrEnumerateLoadedModules"); pLdrRegisterDllNotification = (void *)GetProcAddress(hntdll, "LdrRegisterDllNotification"); pLdrUnregisterDllNotification = (void *)GetProcAddress(hntdll, "LdrUnregisterDllNotification"); @@ -3651,6 +3653,21 @@ static void test_RtlValidSecurityDescriptor(void) free(sd); } +static void test_RtlFindExportedRoutineByName(void) +{ + void *proc; + + if (!pRtlFindExportedRoutineByName) + { + win_skip( "RtlFindExportedRoutineByName is not present\n" ); + return; + } + proc = pRtlFindExportedRoutineByName( GetModuleHandleW( L"kernelbase" ), "CtrlRoutine" ); + ok( proc != NULL, "Expected non NULL address\n" ); + proc = pRtlFindExportedRoutineByName( GetModuleHandleW( L"kernel32" ), "CtrlRoutine" ); + ok( proc == NULL, "Shouldn't find forwarded function\n" ); +} + START_TEST(rtl) { InitFunctionPtrs(); @@ -3697,4 +3714,5 @@ START_TEST(rtl) test_RtlFirstFreeAce(); test_RtlInitializeSid(); test_RtlValidSecurityDescriptor(); + test_RtlFindExportedRoutineByName(); }
1
0
0
0
Eric Pouech : uninstall: No longer use console/file output APIs.
by Alexandre Julliard
28 Nov '23
28 Nov '23
Module: wine Branch: master Commit: 8e00767fb441c90240129b40798aecb1941514d1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/8e00767fb441c90240129b40798aec…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Tue Nov 28 18:49:41 2023 +0100 uninstall: No longer use console/file output APIs. Regular GUI apps don't. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- programs/uninstaller/main.c | 101 ++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 59 deletions(-) diff --git a/programs/uninstaller/main.c b/programs/uninstaller/main.c index 52e8a0debe9..8a22cc7288c 100644 --- a/programs/uninstaller/main.c +++ b/programs/uninstaller/main.c @@ -21,6 +21,7 @@ * */ +#include <locale.h> #include <string.h> #include <windows.h> #include <commctrl.h> @@ -44,70 +45,48 @@ static uninst_entry *entries = NULL; static unsigned int numentries = 0; static int oldsel = -1; static WCHAR *sFilter; +static BOOL silent; static int FetchUninstallInformation(void); static void UninstallProgram(void); static const WCHAR PathUninstallW[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"; -static void output_writeconsole(const WCHAR *str, DWORD len) -{ - DWORD written, lenA; - char *strA; - - if (WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), str, len, &written, NULL)) - return; - - /* WriteConsole fails if its output is redirected to a file. - * If this occurs, we should use an OEM codepage and call WriteFile. - */ - lenA = WideCharToMultiByte(GetOEMCP(), 0, str, len, NULL, 0, NULL, NULL); - strA = malloc(lenA); - if (strA) - { - WideCharToMultiByte(GetOEMCP(), 0, str, len, strA, lenA, NULL, NULL); - WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), strA, lenA, &written, FALSE); - free(strA); - } -} -static void output_formatstring(const WCHAR *fmt, va_list va_args) +static void WINAPIV output_message(BOOL with_usage, unsigned int id, ...) { - WCHAR *str; - DWORD len; + WCHAR fmt[2048]; + LCID current_lcid; - len = FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ALLOCATE_BUFFER, - fmt, 0, 0, (LPWSTR)&str, 0, &va_args); - if (len == 0 && GetLastError() != ERROR_NO_WORK_DONE) - { - WINE_FIXME("Could not format string: le=%lu, fmt=%s\n", GetLastError(), wine_dbgstr_w(fmt)); - return; - } - output_writeconsole(str, len); - LocalFree(str); -} - -static void WINAPIV output_message(unsigned int id, ...) -{ - WCHAR fmt[1024]; - va_list va_args; + current_lcid = GetThreadLocale(); + if (silent) /* force en-US not to have localized strings */ + SetThreadLocale(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT)); - if (!LoadStringW(GetModuleHandleW(NULL), id, fmt, ARRAY_SIZE(fmt))) + if (LoadStringW(GetModuleHandleW(NULL), id, fmt, ARRAY_SIZE(fmt)) && + (!with_usage || LoadStringW(GetModuleHandleW(NULL), STRING_USAGE, fmt + wcslen(fmt), ARRAY_SIZE(fmt) - wcslen(fmt)))) { - WINE_FIXME("LoadString failed with %ld\n", GetLastError()); - return; + va_list va_args; + WCHAR *str; + DWORD len; + + va_start(va_args, id); + len = FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ALLOCATE_BUFFER, + fmt, 0, 0, (LPWSTR)&str, 0, &va_args); + if (len > 0 || GetLastError() == ERROR_NO_WORK_DONE) + { + if (silent) + MESSAGE("%ls", str); + else + MessageBoxW(NULL, str, MAKEINTRESOURCEW(IDS_APPNAME), MB_OK | MB_ICONSTOP); + LocalFree(str); + } + else + WINE_FIXME("Could not format string: le=%lu, fmt=%s\n", GetLastError(), wine_dbgstr_w(fmt)); + va_end(va_args); } - va_start(va_args, id); - output_formatstring(fmt, va_args); - va_end(va_args); -} - -static void WINAPIV output_array(const WCHAR *fmt, ...) -{ - va_list va_args; + else + WINE_FIXME("LoadString failed with %ld\n", GetLastError()); - va_start(va_args, fmt); - output_formatstring(fmt, va_args); - va_end(va_args); + SetThreadLocale(current_lcid); } /** @@ -119,8 +98,9 @@ static void ListUninstallPrograms(void) FetchUninstallInformation(); + setlocale(LC_ALL, "en-US"); for (i=0; i < numentries; i++) - output_array(L"%1|||%2\n", entries[i].key, entries[i].descr); + MESSAGE("%ls|||%ls\n", entries[i].key, entries[i].descr); } @@ -142,7 +122,7 @@ static void RemoveSpecificProgram(WCHAR *nameW) if (i < numentries) UninstallProgram(); else - output_message(STRING_NO_APP_MATCH, nameW); + output_message(FALSE, STRING_NO_APP_MATCH, nameW); } @@ -185,10 +165,13 @@ int __cdecl wmain(int argc, WCHAR *argv[]) if( !lstrcmpW( token, L"--help" ) ) { - output_message(STRING_HEADER); - output_message(STRING_USAGE); + output_message(TRUE, STRING_HEADER); return 0; } + else if( !lstrcmpW( token, L"--silent" ) ) + { + silent = TRUE; + } else if( !lstrcmpW( token, L"--list" ) ) { ListUninstallPrograms(); @@ -198,16 +181,16 @@ int __cdecl wmain(int argc, WCHAR *argv[]) { if( i >= argc ) { - output_message(STRING_PARAMETER_REQUIRED); + output_message(FALSE, STRING_PARAMETER_REQUIRED); return 1; } RemoveSpecificProgram( argv[i++] ); return 0; } - else + else { - output_message(STRING_INVALID_OPTION, token); + output_message(FALSE, STRING_INVALID_OPTION, token); return 1; } }
1
0
0
0
Eric Pouech : winecfg: Output with MESSAGE.
by Alexandre Julliard
28 Nov '23
28 Nov '23
Module: wine Branch: master Commit: 1ba6a13528d6100fab716b4a3371779d79d543e1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/1ba6a13528d6100fab716b4a337177…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Tue Nov 28 18:49:41 2023 +0100 winecfg: Output with MESSAGE. Regular GUI programs don't use console nor std I/O. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- programs/winecfg/appdefaults.c | 7 +++---- programs/winecfg/audio.c | 1 - programs/winecfg/drive.c | 1 - programs/winecfg/driveui.c | 2 -- programs/winecfg/libraries.c | 1 - programs/winecfg/main.c | 29 +++++++++++++++-------------- programs/winecfg/theme.c | 1 - programs/winecfg/winecfg.c | 1 - programs/winecfg/x11drvdlg.c | 1 - 9 files changed, 18 insertions(+), 26 deletions(-) diff --git a/programs/winecfg/appdefaults.c b/programs/winecfg/appdefaults.c index 4900c1e14fd..da4fc93c06f 100644 --- a/programs/winecfg/appdefaults.c +++ b/programs/winecfg/appdefaults.c @@ -25,7 +25,6 @@ #include <windows.h> #include <commdlg.h> #include <wine/debug.h> -#include <stdio.h> #include <stdlib.h> #include <assert.h> #include "winecfg.h" @@ -516,7 +515,7 @@ void print_windows_versions(void) for (i = 0; i < ARRAY_SIZE(win_versions); i++) { - wprintf(L" %10s %s\n", win_versions[i].szVersion, win_versions[i].szDescription); + MESSAGE(" %10ls %ls\n", win_versions[i].szVersion, win_versions[i].szDescription); } } @@ -527,10 +526,10 @@ void print_current_winver(void) if (!winver || !winver[0]) { int ver = get_registry_version(); - wprintf(L"%s\n", ver == -1 ? DEFAULT_WIN_VERSION : win_versions[ver].szVersion); + MESSAGE("%ls\n", ver == -1 ? DEFAULT_WIN_VERSION : win_versions[ver].szVersion); } else - wprintf(L"%s\n", winver); + MESSAGE("%ls\n", winver); free(winver); } diff --git a/programs/winecfg/audio.c b/programs/winecfg/audio.c index a5065ee5c21..b98efbc2ec6 100644 --- a/programs/winecfg/audio.c +++ b/programs/winecfg/audio.c @@ -23,7 +23,6 @@ #include <assert.h> #include <stdlib.h> -#include <stdio.h> #include <string.h> #define COBJMACROS diff --git a/programs/winecfg/drive.c b/programs/winecfg/drive.c index f002482f510..b113b71b199 100644 --- a/programs/winecfg/drive.c +++ b/programs/winecfg/drive.c @@ -23,7 +23,6 @@ #include <assert.h> #include <stdarg.h> -#include <stdio.h> #include <string.h> #include <ntstatus.h> diff --git a/programs/winecfg/driveui.c b/programs/winecfg/driveui.c index e21c99a6697..611c467b082 100644 --- a/programs/winecfg/driveui.c +++ b/programs/winecfg/driveui.c @@ -21,8 +21,6 @@ * */ -#include <stdio.h> - #define WIN32_LEAN_AND_MEAN #define COBJMACROS diff --git a/programs/winecfg/libraries.c b/programs/winecfg/libraries.c index 43cfe81a104..09fd397ab63 100644 --- a/programs/winecfg/libraries.c +++ b/programs/winecfg/libraries.c @@ -23,7 +23,6 @@ #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <commdlg.h> -#include <stdio.h> #include <assert.h> #include <stdlib.h> diff --git a/programs/winecfg/main.c b/programs/winecfg/main.c index d218d79770c..2697383d781 100644 --- a/programs/winecfg/main.c +++ b/programs/winecfg/main.c @@ -23,6 +23,7 @@ #define WIN32_LEAN_AND_MEAN +#include <locale.h> #include <windows.h> #include <commctrl.h> #include <objbase.h> @@ -186,6 +187,9 @@ ProcessCmdLine(LPWSTR lpCmdLine) { return -1; } + + setlocale(LC_ALL, "en-US"); + if (lpCmdLine[1] == 'V' || lpCmdLine[1] == 'v') { if (wcslen(lpCmdLine) > 4) @@ -194,22 +198,19 @@ ProcessCmdLine(LPWSTR lpCmdLine) print_current_winver(); return 0; } + if (lpCmdLine[1] != '?') + MESSAGE("Unsupported option '%ls'\n", lpCmdLine); - if (lpCmdLine[1] == '?') - { - printf("Usage: winecfg [options]\n\n"); - printf("Options:\n"); - printf(" [no option] Launch the graphical version of this program.\n"); - printf(" /v Display the current global Windows version.\n"); - printf(" /v version Set global Windows version to 'version'.\n"); - printf(" /? Display this information and exit.\n\n"); - printf("Valid versions for 'version':\n\n"); - print_windows_versions(); + MESSAGE("Usage: winecfg [options]\n\n"); + MESSAGE("Options:\n"); + MESSAGE(" [no option] Launch the graphical version of this program.\n"); + MESSAGE(" /v Display the current global Windows version.\n"); + MESSAGE(" /v version Set global Windows version to 'version'.\n"); + MESSAGE(" /? Display this information and exit.\n\n"); + MESSAGE("Valid versions for 'version':\n\n"); + print_windows_versions(); - return 0; - } - - return -1; + return 0; } /***************************************************************************** diff --git a/programs/winecfg/theme.c b/programs/winecfg/theme.c index d52c127db0b..cc1a3c66820 100644 --- a/programs/winecfg/theme.c +++ b/programs/winecfg/theme.c @@ -25,7 +25,6 @@ #include <assert.h> #include <stdarg.h> #include <stdlib.h> -#include <stdio.h> #define COBJMACROS diff --git a/programs/winecfg/winecfg.c b/programs/winecfg/winecfg.c index c5c78c12b96..0433db0a728 100644 --- a/programs/winecfg/winecfg.c +++ b/programs/winecfg/winecfg.c @@ -30,7 +30,6 @@ #define WIN32_LEAN_AND_MEAN #include <assert.h> -#include <stdio.h> #include <limits.h> #include <windows.h> #include <winreg.h> diff --git a/programs/winecfg/x11drvdlg.c b/programs/winecfg/x11drvdlg.c index 215cd6534a2..aea52717a78 100644 --- a/programs/winecfg/x11drvdlg.c +++ b/programs/winecfg/x11drvdlg.c @@ -25,7 +25,6 @@ #include <stdarg.h> #include <stdlib.h> -#include <stdio.h> #include <windows.h> #include <wine/debug.h>
1
0
0
0
Eric Pouech : msiexec: No longer use console/file output APIs.
by Alexandre Julliard
28 Nov '23
28 Nov '23
Module: wine Branch: master Commit: e048f71ecbb103ae7c1876092cb8244b24a73cb7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/e048f71ecbb103ae7c1876092cb824…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Tue Nov 28 09:19:16 2023 +0100 msiexec: No longer use console/file output APIs. Regular GUI apps don't. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- programs/msiexec/msiexec.c | 55 ++++++++++++++++++++++++------------- programs/msiexec/msiexec_internal.h | 27 ++++++++++++++++++ programs/msiexec/service.c | 14 +++++----- 3 files changed, 70 insertions(+), 26 deletions(-) diff --git a/programs/msiexec/msiexec.c b/programs/msiexec/msiexec.c index 4770dfe4a02..68b7c938097 100644 --- a/programs/msiexec/msiexec.c +++ b/programs/msiexec/msiexec.c @@ -26,9 +26,9 @@ #include <msi.h> #include <winsvc.h> #include <objbase.h> -#include <stdio.h> #include "wine/debug.h" +#include "msiexec_internal.h" #include "initguid.h" DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); @@ -39,6 +39,7 @@ typedef HRESULT (WINAPI *DLLREGISTERSERVER)(void); typedef HRESULT (WINAPI *DLLUNREGISTERSERVER)(void); DWORD DoService(void); +static BOOL silent; struct string_list { @@ -46,6 +47,21 @@ struct string_list WCHAR str[1]; }; +void report_error(const char* msg, ...) +{ + char buffer[2048]; + va_list va_args; + + va_start(va_args, msg); + vsnprintf(buffer, sizeof(buffer), msg, va_args); + va_end(va_args); + + if (silent) + MESSAGE("%s", buffer); + else + MsiMessageBoxA(NULL, buffer, "MsiExec", 0, GetUserDefaultLangID(), 0); +} + static void ShowUsage(int ExitCode) { WCHAR msiexec_version[40]; @@ -269,14 +285,14 @@ static VOID *LoadProc(LPCWSTR DllName, LPCSTR ProcName, HMODULE* DllHandle) *DllHandle = LoadLibraryExW(DllName, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); if(!*DllHandle) { - fprintf(stderr, "Unable to load dll %s\n", wine_dbgstr_w(DllName)); + report_error("Unable to load dll %s\n", wine_dbgstr_w(DllName)); ExitProcess(1); } proc = (VOID *) GetProcAddress(*DllHandle, ProcName); if(!proc) { - fprintf(stderr, "Dll %s does not implement function %s\n", - wine_dbgstr_w(DllName), ProcName); + report_error("Dll %s does not implement function %s\n", + wine_dbgstr_w(DllName), ProcName); FreeLibrary(*DllHandle); ExitProcess(1); } @@ -295,10 +311,10 @@ static DWORD DoDllRegisterServer(LPCWSTR DllName) hr = pfDllRegisterServer(); if(FAILED(hr)) { - fprintf(stderr, "Failed to register dll %s\n", wine_dbgstr_w(DllName)); + report_error("Failed to register dll %s\n", wine_dbgstr_w(DllName)); return 1; } - printf("Successfully registered dll %s\n", wine_dbgstr_w(DllName)); + MESSAGE("Successfully registered dll %s\n", wine_dbgstr_w(DllName)); if(DllHandle) FreeLibrary(DllHandle); return 0; @@ -315,10 +331,10 @@ static DWORD DoDllUnregisterServer(LPCWSTR DllName) hr = pfDllUnregisterServer(); if(FAILED(hr)) { - fprintf(stderr, "Failed to unregister dll %s\n", wine_dbgstr_w(DllName)); + report_error("Failed to unregister dll %s\n", wine_dbgstr_w(DllName)); return 1; } - printf("Successfully unregistered dll %s\n", wine_dbgstr_w(DllName)); + MESSAGE("Successfully unregistered dll %s\n", wine_dbgstr_w(DllName)); if(DllHandle) FreeLibrary(DllHandle); return 0; @@ -332,7 +348,7 @@ static DWORD DoRegServer(void) if (!(scm = OpenSCManagerW(NULL, SERVICES_ACTIVE_DATABASEW, SC_MANAGER_CREATE_SERVICE))) { - fprintf(stderr, "Failed to open the service control manager.\n"); + report_error("Failed to open the service control manager.\n"); return 1; } len = GetSystemDirectoryW(path, MAX_PATH); @@ -345,7 +361,7 @@ static DWORD DoRegServer(void) } else if (GetLastError() != ERROR_SERVICE_EXISTS) { - fprintf(stderr, "Failed to create MSI service\n"); + report_error("Failed to create MSI service\n"); ret = 1; } CloseServiceHandle(scm); @@ -359,21 +375,21 @@ static DWORD DoUnregServer(void) if (!(scm = OpenSCManagerW(NULL, SERVICES_ACTIVE_DATABASEW, SC_MANAGER_CONNECT))) { - fprintf(stderr, "Failed to open service control manager\n"); + report_error("Failed to open service control manager\n"); return 1; } if ((service = OpenServiceW(scm, L"MSIServer", DELETE))) { if (!DeleteService(service)) { - fprintf(stderr, "Failed to delete MSI service\n"); + report_error("Failed to delete MSI service\n"); ret = 1; } CloseServiceHandle(service); } else if (GetLastError() != ERROR_SERVICE_DOES_NOT_EXIST) { - fprintf(stderr, "Failed to open MSI service\n"); + report_error("Failed to open MSI service\n"); ret = 1; } CloseServiceHandle(scm); @@ -765,7 +781,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine RepairMode |= REINSTALLMODE_PACKAGE; break; default: - fprintf(stderr, "Unknown option \"%c\" in Repair mode\n", argvW[i][j]); + report_error("Unknown option \"%c\" in Repair mode\n", argvW[i][j]); break; } } @@ -815,7 +831,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine AdvertiseMode = ADVERTISEFLAGS_MACHINEASSIGN; break; default: - fprintf(stderr, "Unknown option \"%c\" in Advertise mode\n", argvW[i][j]); + report_error("Unknown option \"%c\" in Advertise mode\n", argvW[i][j]); break; } } @@ -947,8 +963,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine LogFileName = argvW[i]; if(MsiEnableLogW(LogMode, LogFileName, LogAttributes) != ERROR_SUCCESS) { - fprintf(stderr, "Logging in %s (0x%08lx, %lu) failed\n", - wine_dbgstr_w(LogFileName), LogMode, LogAttributes); + report_error("Logging in %s (0x%08lx, %lu) failed\n", + wine_dbgstr_w(LogFileName), LogMode, LogAttributes); ExitProcess(1); } } @@ -966,6 +982,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine if(lstrlenW(argvW[i]) == 2 || msi_strequal(argvW[i]+2, "n") || msi_strequal(argvW[i] + 2, "uiet")) { + silent = TRUE; InstallUILevel = INSTALLUILEVEL_NONE; } else if(msi_strequal(argvW[i]+2, "r")) @@ -1002,8 +1019,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine } else { - fprintf(stderr, "Unknown option \"%s\" for UI level\n", - wine_dbgstr_w(argvW[i]+2)); + report_error("Unknown option \"%s\" for UI level\n", + wine_dbgstr_w(argvW[i]+2)); } } else if(msi_option_equal(argvW[i], "passive")) diff --git a/programs/msiexec/msiexec_internal.h b/programs/msiexec/msiexec_internal.h new file mode 100644 index 00000000000..258ee5a106c --- /dev/null +++ b/programs/msiexec/msiexec_internal.h @@ -0,0 +1,27 @@ +/* + * msiexec.exe internal definitions + * + * Copyright 2023 Eric Pouech 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 + */ + +#include <corecrt.h> + +#ifdef __WINE_CRT_PRINTF_ATTR +extern void report_error(const char* msg, ...) __WINE_CRT_PRINTF_ATTR(1, 2); +#else +extern void report_error(const char* msg, ...); +#endif diff --git a/programs/msiexec/service.c b/programs/msiexec/service.c index 573b3782473..ee81da1bfcd 100644 --- a/programs/msiexec/service.c +++ b/programs/msiexec/service.c @@ -20,11 +20,11 @@ #define WIN32_LEAN_AND_MEAN -#include <stdio.h> #include <windows.h> #include <winsvc.h> #include "wine/debug.h" +#include "msiexec_internal.h" WINE_DEFAULT_DEBUG_CHANNEL(msiexec); @@ -73,7 +73,7 @@ static BOOL UpdateSCMStatus(DWORD dwCurrentState, DWORD dwWin32ExitCode, if (!SetServiceStatus(hstatus, &status)) { - fprintf(stderr, "Failed to set service status\n"); + report_error("Failed to set service status\n"); KillService(); return FALSE; } @@ -93,7 +93,7 @@ static void WINAPI ServiceCtrlHandler(DWORD code) KillService(); break; default: - fprintf(stderr, "Unhandled service control code: %ld\n", code); + report_error("Unhandled service control code: %ld\n", code); UpdateSCMStatus(SERVICE_RUNNING, NO_ERROR, 0); break; } @@ -113,7 +113,7 @@ static BOOL StartServiceThread(void) thread = CreateThread(0, 0, ServiceExecutionThread, 0, 0, &id); if (!thread) { - fprintf(stderr, "Failed to create thread\n"); + report_error("Failed to create thread\n"); return FALSE; } @@ -125,7 +125,7 @@ static void WINAPI ServiceMain(DWORD argc, LPSTR *argv) hstatus = RegisterServiceCtrlHandlerA("MSIServer", ServiceCtrlHandler); if (!hstatus) { - fprintf(stderr, "Failed to register service ctrl handler\n"); + report_error("Failed to register service ctrl handler\n"); return; } @@ -134,7 +134,7 @@ static void WINAPI ServiceMain(DWORD argc, LPSTR *argv) kill_event = CreateEventW(0, TRUE, FALSE, 0); if (!kill_event) { - fprintf(stderr, "Failed to create event\n"); + report_error("Failed to create event\n"); KillService(); UpdateSCMStatus(SERVICE_STOPPED, NO_ERROR, 0); return; @@ -166,7 +166,7 @@ DWORD DoService(void) if (!StartServiceCtrlDispatcherA(service)) { - fprintf(stderr, "Failed to start MSIServer service\n"); + report_error("Failed to start MSIServer service\n"); return 1; }
1
0
0
0
Giovanni Mascellani : vkd3d-shader/dxil: Declare IO registers as VEC4.
by Alexandre Julliard
28 Nov '23
28 Nov '23
Module: vkd3d Branch: master Commit: a52604da8cae8ce5639eeb20ef263c12bf70e1df URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/a52604da8cae8ce5639eeb20ef263…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com> Date: Mon Nov 27 22:00:45 2023 +0100 vkd3d-shader/dxil: Declare IO registers as VEC4. Otherwise, for instance, their write masks and swizzles are not written in the D3D ASM dump. --- libs/vkd3d-shader/dxil.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index c03948ae..beb9ae57 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -2884,6 +2884,7 @@ static void dst_param_io_init(struct vkd3d_shader_dst_param *param, /* DXIL types do not have signedness. Load signed elements as unsigned. */ component_type = e->component_type == VKD3D_SHADER_COMPONENT_INT ? VKD3D_SHADER_COMPONENT_UINT : e->component_type; vsir_register_init(¶m->reg, reg_type, vkd3d_data_type_from_component_type(component_type), 0); + param->reg.dimension = VSIR_DIMENSION_VEC4; } static void sm6_parser_init_signature(struct sm6_parser *sm6, const struct shader_signature *s,
1
0
0
0
Rémi Bernon : explorer: Cache the balloon window position.
by Alexandre Julliard
28 Nov '23
28 Nov '23
Module: wine Branch: master Commit: 6e85177aa75df1efac21c6bc0b0fea2bf12ea320 URL:
https://gitlab.winehq.org/wine/wine/-/commit/6e85177aa75df1efac21c6bc0b0fea…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Jun 22 18:56:16 2023 +0200 explorer: Cache the balloon window position. --- programs/explorer/systray.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index c684608ee4e..eb844a45003 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -105,6 +105,7 @@ static WCHAR start_label[50]; static struct icon *balloon_icon; static HWND balloon_window; +static POINT balloon_pos; #define MIN_DISPLAYED 8 #define ICON_BORDER 2 @@ -211,6 +212,8 @@ static void update_systray_balloon_position(void) GetWindowRect( balloon_icon->window, &rect ); pos.x = (rect.left + rect.right) / 2; pos.y = (rect.top + rect.bottom) / 2; + if (pos.x == balloon_pos.x && pos.y == balloon_pos.y) return; /* nothing changed */ + balloon_pos = pos; SendMessageW( balloon_window, TTM_TRACKPOSITION, 0, MAKELONG( pos.x, pos.y )); } @@ -236,6 +239,7 @@ static void balloon_create_timer( struct icon *icon ) else SendMessageW( balloon_window, TTM_SETTITLEW, icon->info_flags, (LPARAM)icon->info_title ); balloon_icon = icon; + balloon_pos.x = balloon_pos.y = MAXLONG; update_systray_balloon_position(); SendMessageW( balloon_window, TTM_TRACKACTIVATE, TRUE, (LPARAM)&ti ); KillTimer( icon->window, BALLOON_CREATE_TIMER );
1
0
0
0
Rémi Bernon : explorer: Support standalone systray window mode.
by Alexandre Julliard
28 Nov '23
28 Nov '23
Module: wine Branch: master Commit: 118810ad3bac91bfeea81e4408059d48c158e8c5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/118810ad3bac91bfeea81e4408059d…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Jun 22 21:05:15 2023 +0200 explorer: Support standalone systray window mode. --- programs/explorer/systray.c | 77 ++++++++++++++++++++++++++++++-------- programs/explorer/tests/explorer.c | 3 ++ 2 files changed, 64 insertions(+), 16 deletions(-) diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index b2581c90840..c684608ee4e 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -98,7 +98,7 @@ static HWND tray_window; static unsigned int nb_displayed; -static BOOL hide_systray, enable_shell; +static BOOL show_systray = TRUE, enable_shell, enable_taskbar; static int icon_cx, icon_cy, tray_width, tray_height; static int start_button_width, taskbar_button_width; static WCHAR start_label[50]; @@ -312,12 +312,36 @@ static POINT get_icon_pos( struct icon *icon ) { POINT pos; - pos.x = tray_width - icon_cx * (icon->display + 1); - pos.y = (tray_height - icon_cy) / 2; + if (enable_taskbar) + { + pos.x = tray_width - icon_cx * (icon->display + 1); + pos.y = (tray_height - icon_cy) / 2; + } + else + { + pos.x = icon_cx * icon->display; + pos.y = 0; + } return pos; } +/* get the size of the stand-alone tray window */ +static SIZE get_window_size(void) +{ + SIZE size; + RECT rect; + + rect.left = 0; + rect.top = 0; + rect.right = icon_cx * max( nb_displayed, MIN_DISPLAYED ); + rect.bottom = icon_cy; + AdjustWindowRect( &rect, WS_CAPTION, FALSE ); + size.cx = rect.right - rect.left; + size.cy = rect.bottom - rect.top; + return size; +} + /* synchronize tooltip position with tooltip window */ static void update_tooltip_position( struct icon *icon ) { @@ -446,7 +470,7 @@ static void systray_add_icon( struct icon *icon ) pos = get_icon_pos( icon ); SetWindowPos( icon->window, 0, pos.x, pos.y, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_SHOWWINDOW ); - if (nb_displayed == 1 && !hide_systray) do_show_systray(); + if (nb_displayed == 1 && show_systray) do_show_systray(); TRACE( "added %u now %d icons\n", icon->id, nb_displayed ); } @@ -620,6 +644,7 @@ static void sync_taskbar_buttons(void) int right = tray_width - nb_displayed * icon_cx; HWND foreground = GetAncestor( GetForegroundWindow(), GA_ROOTOWNER ); + if (!enable_taskbar) return; if (!IsWindowVisible( tray_window )) return; LIST_FOR_EACH_ENTRY( win, &taskbar_buttons, struct taskbar_button, entry ) @@ -743,7 +768,7 @@ static void add_taskbar_button( HWND hwnd ) { struct taskbar_button *win; - if (hide_systray) return; + if (!enable_taskbar || !show_systray) return; /* ignore our own windows */ if (hwnd) @@ -856,7 +881,16 @@ static void do_show_systray(void) SIZE size; NONCLIENTMETRICSW ncm; HFONT font; - HDC hdc = GetDC( 0 ); + HDC hdc; + + if (!enable_taskbar) + { + size = get_window_size(); + SetWindowPos( tray_window, 0, 0, 0, size.cx, size.cy, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_SHOWWINDOW ); + return; + } + + hdc = GetDC( 0 ); ncm.cbSize = sizeof(NONCLIENTMETRICSW); SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSW), &ncm, 0 ); @@ -888,7 +922,8 @@ static LRESULT WINAPI shell_traywnd_proc( HWND hwnd, UINT msg, WPARAM wparam, LP return handle_incoming((HWND)wparam, (COPYDATASTRUCT *)lparam); case WM_DISPLAYCHANGE: - if (hide_systray || (!nb_displayed && !enable_shell)) do_hide_systray(); + if (!show_systray) do_hide_systray(); + else if (!nb_displayed && !enable_shell) do_hide_systray(); else do_show_systray(); break; @@ -956,8 +991,8 @@ void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enab icon_cx = GetSystemMetrics( SM_CXSMICON ) + 2*ICON_BORDER; icon_cy = GetSystemMetrics( SM_CYSMICON ) + 2*ICON_BORDER; - hide_systray = using_root; enable_shell = arg_enable_shell; + enable_taskbar = enable_shell || !using_root; /* register the systray listener window class */ if (!RegisterClassExW( &shell_traywnd_class )) @@ -971,13 +1006,23 @@ void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enab return; } - SystemParametersInfoW( SPI_GETWORKAREA, 0, &work_rect, 0 ); - SetRect( &primary_rect, 0, 0, GetSystemMetrics( SM_CXSCREEN ), GetSystemMetrics( SM_CYSCREEN ) ); - SubtractRect( &taskbar_rect, &primary_rect, &work_rect ); + if (enable_taskbar) + { + SystemParametersInfoW( SPI_GETWORKAREA, 0, &work_rect, 0 ); + SetRect( &primary_rect, 0, 0, GetSystemMetrics( SM_CXSCREEN ), GetSystemMetrics( SM_CYSCREEN ) ); + SubtractRect( &taskbar_rect, &primary_rect, &work_rect ); + + tray_window = CreateWindowExW( WS_EX_NOACTIVATE, shell_traywnd_class.lpszClassName, NULL, WS_POPUP, + taskbar_rect.left, taskbar_rect.top, taskbar_rect.right - taskbar_rect.left, + taskbar_rect.bottom - taskbar_rect.top, 0, 0, 0, 0 ); + } + else + { + SIZE size = get_window_size(); + tray_window = CreateWindowExW( 0, shell_traywnd_class.lpszClassName, L"", WS_CAPTION | WS_SYSMENU, + CW_USEDEFAULT, CW_USEDEFAULT, size.cx, size.cy, 0, 0, 0, 0 ); + } - tray_window = CreateWindowExW( WS_EX_NOACTIVATE, shell_traywnd_class.lpszClassName, NULL, WS_POPUP, taskbar_rect.left, - taskbar_rect.top, taskbar_rect.right - taskbar_rect.left, - taskbar_rect.bottom - taskbar_rect.top, 0, 0, 0, 0 ); if (!tray_window) { ERR( "Could not create tray window\n" ); @@ -988,6 +1033,6 @@ void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enab add_taskbar_button( 0 ); - if (hide_systray) do_hide_systray(); - else if (enable_shell) do_show_systray(); + if (enable_taskbar) do_show_systray(); + else do_hide_systray(); } diff --git a/programs/explorer/tests/explorer.c b/programs/explorer/tests/explorer.c index 3882027ae46..f1243c14622 100644 --- a/programs/explorer/tests/explorer.c +++ b/programs/explorer/tests/explorer.c @@ -40,6 +40,9 @@ static void test_taskbar(void) SystemParametersInfoW(SPI_GETWORKAREA, 0, &work_rect, 0); SetRect(&primary_rect, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)); SubtractRect(&expected_rect, &primary_rect, &work_rect); + + /* In standalone mode, the systray window is floating */ + todo_wine_if(!(GetWindowLongW(hwnd, GWL_STYLE) & WS_POPUP)) ok(EqualRect(&taskbar_rect, &expected_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(&expected_rect), wine_dbgstr_rect(&taskbar_rect)); }
1
0
0
0
Rémi Bernon : explorer: Use an explicit display constant for hidden icons.
by Alexandre Julliard
28 Nov '23
28 Nov '23
Module: wine Branch: master Commit: b8518d320fe3f562129b84f72e5cdcd86b0b05e6 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b8518d320fe3f562129b84f72e5cdc…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Jun 23 15:16:25 2023 +0200 explorer: Use an explicit display constant for hidden icons. --- programs/explorer/systray.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index 623abcd03a3..b2581c90840 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -58,6 +58,8 @@ struct notify_data /* platform-independent format for NOTIFYICONDATA */ static int (CDECL *wine_notify_icon)(DWORD,NOTIFYICONDATAW *); +#define ICON_DISPLAY_HIDDEN -1 + /* an individual systray icon, unpacked from the NOTIFYICONDATA and always in unicode */ struct icon { @@ -242,7 +244,7 @@ static void balloon_create_timer( struct icon *icon ) static BOOL show_balloon( struct icon *icon ) { - if (icon->display == -1) return FALSE; /* not displayed */ + if (icon->display == ICON_DISPLAY_HIDDEN) return FALSE; /* not displayed */ if (!icon->info_text[0]) return FALSE; /* no balloon */ balloon_icon = icon; SetTimer( icon->window, BALLOON_CREATE_TIMER, BALLOON_CREATE_TIMEOUT, NULL ); @@ -438,7 +440,7 @@ static void systray_add_icon( struct icon *icon ) { POINT pos; - if (icon->display != -1) return; /* already added */ + if (icon->display != ICON_DISPLAY_HIDDEN) return; /* already added */ icon->display = nb_displayed++; pos = get_icon_pos( icon ); @@ -454,7 +456,7 @@ static void systray_remove_icon( struct icon *icon ) struct icon *ptr; POINT pos; - if (icon->display == -1) return; /* already removed */ + if (icon->display == ICON_DISPLAY_HIDDEN) return; /* already removed */ assert( nb_displayed ); LIST_FOR_EACH_ENTRY( ptr, &icon_list, struct icon, entry ) @@ -470,7 +472,7 @@ static void systray_remove_icon( struct icon *icon ) if (!--nb_displayed && !enable_shell) do_hide_systray(); TRACE( "removed %u now %d icons\n", icon->id, nb_displayed ); - icon->display = -1; + icon->display = ICON_DISPLAY_HIDDEN; } /* make an icon visible */ @@ -478,7 +480,7 @@ static BOOL show_icon(struct icon *icon) { TRACE( "id=0x%x, hwnd=%p\n", icon->id, icon->owner ); - if (icon->display != -1) return TRUE; /* already displayed */ + if (icon->display != ICON_DISPLAY_HIDDEN) return TRUE; /* already displayed */ systray_add_icon( icon ); @@ -492,7 +494,7 @@ static BOOL hide_icon(struct icon *icon) { TRACE( "id=0x%x, hwnd=%p\n", icon->id, icon->owner ); - if (icon->display == -1) return TRUE; /* already hidden */ + if (icon->display == ICON_DISPLAY_HIDDEN) return TRUE; /* already hidden */ ShowWindow( icon->window, SW_HIDE ); systray_remove_icon( icon ); @@ -523,7 +525,7 @@ static BOOL modify_icon( struct icon *icon, NOTIFYICONDATAW *nid ) { if (icon->image) DestroyIcon(icon->image); icon->image = CopyIcon(nid->hIcon); - if (icon->display != -1) InvalidateRect( icon->window, NULL, TRUE ); + if (icon->display >= 0) InvalidateRect( icon->window, NULL, TRUE ); } if (nid->uFlags & NIF_MESSAGE) @@ -533,7 +535,7 @@ static BOOL modify_icon( struct icon *icon, NOTIFYICONDATAW *nid ) if (nid->uFlags & NIF_TIP) { lstrcpynW( icon->tiptext, nid->szTip, ARRAY_SIZE( icon->tiptext )); - if (icon->display != -1) update_tooltip_text(icon); + if (icon->display != ICON_DISPLAY_HIDDEN) update_tooltip_text(icon); } if (nid->uFlags & NIF_INFO && nid->cbSize >= NOTIFYICONDATAA_V2_SIZE) { @@ -571,7 +573,7 @@ static BOOL add_icon(NOTIFYICONDATAW *nid) ZeroMemory(icon, sizeof(struct icon)); icon->id = nid->uID; icon->owner = nid->hWnd; - icon->display = -1; + icon->display = ICON_DISPLAY_HIDDEN; CreateWindowW( tray_icon_class.lpszClassName, NULL, WS_CHILD, 0, 0, icon_cx, icon_cy, tray_window, NULL, NULL, icon );
1
0
0
0
Rémi Bernon : explorer: Handle balloon timer in the icons window proc.
by Alexandre Julliard
28 Nov '23
28 Nov '23
Module: wine Branch: master Commit: b135fa4cd08f1b7933a6a71b2ab20df11ad3eba2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b135fa4cd08f1b7933a6a71b2ab20d…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Jun 22 19:18:53 2023 +0200 explorer: Handle balloon timer in the icons window proc. --- programs/explorer/systray.c | 77 ++++++++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 29 deletions(-) diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index cc2f6440115..623abcd03a3 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -200,7 +200,19 @@ static void set_balloon_position( struct icon *icon ) SendMessageW( balloon_window, TTM_TRACKPOSITION, 0, MAKELONG( pos.x, pos.y )); } -static void balloon_create_timer(void) +static void update_systray_balloon_position(void) +{ + RECT rect; + POINT pos; + + if (!balloon_icon) return; + GetWindowRect( balloon_icon->window, &rect ); + pos.x = (rect.left + rect.right) / 2; + pos.y = (rect.top + rect.bottom) / 2; + SendMessageW( balloon_window, TTM_TRACKPOSITION, 0, MAKELONG( pos.x, pos.y )); +} + +static void balloon_create_timer( struct icon *icon ) { TTTOOLINFOW ti; @@ -208,24 +220,24 @@ static void balloon_create_timer(void) balloon_window = CreateWindowExW( WS_EX_TOPMOST, TOOLTIPS_CLASSW, NULL, WS_POPUP | TTS_ALWAYSTIP | TTS_NOPREFIX | TTS_BALLOON | TTS_CLOSE, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - tray_window, NULL, NULL, NULL); + icon->window, NULL, NULL, NULL ); memset( &ti, 0, sizeof(ti) ); ti.cbSize = sizeof(TTTOOLINFOW); - ti.hwnd = tray_window; - ti.uFlags = TTF_TRACK; - ti.lpszText = balloon_icon->info_text; + ti.hwnd = icon->window; + ti.uId = (UINT_PTR)icon->window; + ti.uFlags = TTF_TRACK | TTF_IDISHWND; + ti.lpszText = icon->info_text; SendMessageW( balloon_window, TTM_ADDTOOLW, 0, (LPARAM)&ti ); - if ((balloon_icon->info_flags & NIIF_ICONMASK) == NIIF_USER) - SendMessageW( balloon_window, TTM_SETTITLEW, (WPARAM)balloon_icon->info_icon, - (LPARAM)balloon_icon->info_title ); + if ((icon->info_flags & NIIF_ICONMASK) == NIIF_USER) + SendMessageW( balloon_window, TTM_SETTITLEW, (WPARAM)icon->info_icon, (LPARAM)icon->info_title ); else - SendMessageW( balloon_window, TTM_SETTITLEW, balloon_icon->info_flags, - (LPARAM)balloon_icon->info_title ); - set_balloon_position( balloon_icon ); + SendMessageW( balloon_window, TTM_SETTITLEW, icon->info_flags, (LPARAM)icon->info_title ); + balloon_icon = icon; + update_systray_balloon_position(); SendMessageW( balloon_window, TTM_TRACKACTIVATE, TRUE, (LPARAM)&ti ); - KillTimer( tray_window, BALLOON_CREATE_TIMER ); - SetTimer( tray_window, BALLOON_SHOW_TIMER, balloon_icon->info_timeout, NULL ); + KillTimer( icon->window, BALLOON_CREATE_TIMER ); + SetTimer( icon->window, BALLOON_SHOW_TIMER, icon->info_timeout, NULL ); } static BOOL show_balloon( struct icon *icon ) @@ -233,20 +245,20 @@ static BOOL show_balloon( struct icon *icon ) if (icon->display == -1) return FALSE; /* not displayed */ if (!icon->info_text[0]) return FALSE; /* no balloon */ balloon_icon = icon; - SetTimer( tray_window, BALLOON_CREATE_TIMER, BALLOON_CREATE_TIMEOUT, NULL ); + SetTimer( icon->window, BALLOON_CREATE_TIMER, BALLOON_CREATE_TIMEOUT, NULL ); return TRUE; } -static void hide_balloon(void) +static void hide_balloon( struct icon *icon ) { if (!balloon_icon) return; if (balloon_window) { - KillTimer( tray_window, BALLOON_SHOW_TIMER ); + KillTimer( balloon_icon->window, BALLOON_SHOW_TIMER ); DestroyWindow( balloon_window ); balloon_window = 0; } - else KillTimer( tray_window, BALLOON_CREATE_TIMER ); + else KillTimer( balloon_icon->window, BALLOON_CREATE_TIMER ); balloon_icon = NULL; } @@ -262,20 +274,19 @@ static void update_balloon( struct icon *icon ) { if (balloon_icon == icon) { - hide_balloon(); + hide_balloon( icon ); show_balloon( icon ); } else if (!balloon_icon) { - if (!show_balloon( icon )) return; + show_balloon( icon ); } - if (!balloon_icon) show_next_balloon(); } -static void balloon_timer(void) +static void balloon_timer( struct icon *icon ) { - if (balloon_icon) balloon_icon->info_text[0] = 0; /* clear text now that balloon has been shown */ - hide_balloon(); + icon->info_text[0] = 0; /* clear text now that balloon has been shown */ + hide_balloon( icon ); show_next_balloon(); } @@ -405,6 +416,18 @@ static LRESULT WINAPI tray_icon_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPA } break; } + + case WM_WINDOWPOSCHANGED: + update_systray_balloon_position(); + break; + + case WM_TIMER: + switch (wparam) + { + case BALLOON_CREATE_TIMER: balloon_create_timer( icon ); break; + case BALLOON_SHOW_TIMER: balloon_timer( icon ); break; + } + return 0; } return DefWindowProcW( hwnd, msg, wparam, lparam ); @@ -867,12 +890,8 @@ static LRESULT WINAPI shell_traywnd_proc( HWND hwnd, UINT msg, WPARAM wparam, LP else do_show_systray(); break; - case WM_TIMER: - switch (wparam) - { - case BALLOON_CREATE_TIMER: balloon_create_timer(); break; - case BALLOON_SHOW_TIMER: balloon_timer(); break; - } + case WM_MOVE: + update_systray_balloon_position(); break; case WM_CLOSE:
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
99
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Results per page:
10
25
50
100
200