[PATCH 0/3] MR3158: explorer: Use CRT allocations, wide strings and non-prefixed trace macros.
From: Rémi Bernon <rbernon(a)codeweavers.com> --- programs/explorer/appbar.c | 4 ++-- programs/explorer/desktop.c | 41 +++++++++++++++++------------------ programs/explorer/explorer.c | 15 +++++-------- programs/explorer/startmenu.c | 12 +++++----- programs/explorer/systray.c | 12 +++++----- 5 files changed, 39 insertions(+), 45 deletions(-) diff --git a/programs/explorer/appbar.c b/programs/explorer/appbar.c index 443927e30f1..2f96c580e19 100644 --- a/programs/explorer/appbar.c +++ b/programs/explorer/appbar.c @@ -146,7 +146,7 @@ static UINT_PTR handle_appbarmessage(DWORD msg, struct appbar_data_msg *abd) return FALSE; } - data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct appbar_data)); + data = calloc( 1, sizeof(struct appbar_data) ); if (!data) { WINE_ERR("out of memory\n"); @@ -165,7 +165,7 @@ static UINT_PTR handle_appbarmessage(DWORD msg, struct appbar_data_msg *abd) send_poschanged(hwnd); - HeapFree(GetProcessHeap(), 0, data); + free( data ); } else WINE_WARN("removing hwnd %p not on the list\n", hwnd); diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 1610814048e..79652cbbc3b 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -288,8 +288,7 @@ static WCHAR *append_path( const WCHAR *path, const WCHAR *filename, int len_fil WCHAR *ret; if (len_filename == -1) len_filename = lstrlenW( filename ); - if (!(ret = HeapAlloc( GetProcessHeap(), 0, (len_path + len_filename + 2) * sizeof(WCHAR) ))) - return NULL; + if (!(ret = malloc( (len_path + len_filename + 2) * sizeof(WCHAR) ))) return NULL; memcpy( ret, path, len_path * sizeof(WCHAR) ); ret[len_path] = '\\'; memcpy( ret + len_path + 1, filename, len_filename * sizeof(WCHAR) ); @@ -358,7 +357,7 @@ static WCHAR *build_title( const WCHAR *filename, int len ) break; } } - if (!(ret = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) return NULL; + if (!(ret = malloc( (len + 1) * sizeof(WCHAR) ))) return NULL; memcpy( ret, filename, len * sizeof(WCHAR) ); ret[len] = 0; return ret; @@ -372,13 +371,13 @@ static BOOL add_launcher( const WCHAR *folder, const WCHAR *filename, int len_fi if (nb_launchers == nb_allocated) { unsigned int count = nb_allocated * 2; - struct launcher **tmp = HeapReAlloc( GetProcessHeap(), 0, launchers, count * sizeof(*tmp) ); + struct launcher **tmp = realloc( launchers, count * sizeof(*tmp) ); if (!tmp) return FALSE; launchers = tmp; nb_allocated = count; } - if (!(launcher = HeapAlloc( GetProcessHeap(), 0, sizeof(*launcher) ))) return FALSE; + if (!(launcher = malloc( sizeof(*launcher) ))) return FALSE; if (!(launcher->path = append_path( folder, filename, len_filename ))) goto error; if (!(link = load_shelllink( launcher->path ))) goto error; @@ -390,21 +389,21 @@ static BOOL add_launcher( const WCHAR *folder, const WCHAR *filename, int len_fi launchers[nb_launchers++] = launcher; return TRUE; } - HeapFree( GetProcessHeap(), 0, launcher->title ); + free( launcher->title ); DestroyIcon( launcher->icon ); error: - HeapFree( GetProcessHeap(), 0, launcher->path ); - HeapFree( GetProcessHeap(), 0, launcher ); + free( launcher->path ); + free( launcher ); return FALSE; } static void free_launcher( struct launcher *launcher ) { DestroyIcon( launcher->icon ); - HeapFree( GetProcessHeap(), 0, launcher->path ); - HeapFree( GetProcessHeap(), 0, launcher->title ); - HeapFree( GetProcessHeap(), 0, launcher ); + free( launcher->path ); + free( launcher->title ); + free( launcher ); } static BOOL remove_launcher( const WCHAR *folder, const WCHAR *filename, int len_filename ) @@ -425,7 +424,7 @@ static BOOL remove_launcher( const WCHAR *folder, const WCHAR *filename, int len break; } } - HeapFree( GetProcessHeap(), 0, path ); + free( path ); return ret; } @@ -498,8 +497,8 @@ static DWORD CALLBACK watch_desktop_folders( LPVOID param ) } if (!(ovl0.hEvent = events[0] = CreateEventW( NULL, FALSE, FALSE, NULL ))) goto error; if (!(ovl1.hEvent = events[1] = CreateEventW( NULL, FALSE, FALSE, NULL ))) goto error; - if (!(buf0 = HeapAlloc( GetProcessHeap(), 0, size ))) goto error; - if (!(buf1 = HeapAlloc( GetProcessHeap(), 0, size ))) goto error; + if (!(buf0 = malloc( size ))) goto error; + if (!(buf1 = malloc( size ))) goto error; for (;;) { @@ -540,8 +539,8 @@ error: CloseHandle( dir1 ); CloseHandle( events[0] ); CloseHandle( events[1] ); - HeapFree( GetProcessHeap(), 0, buf0 ); - HeapFree( GetProcessHeap(), 0, buf1 ); + free( buf0 ); + free( buf1 ); if (SUCCEEDED( init )) CoUninitialize(); return error; } @@ -554,7 +553,7 @@ static void add_folder( const WCHAR *folder ) HANDLE handle; WCHAR *glob; - if (!(glob = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) return; + if (!(glob = malloc( (len + 1) * sizeof(WCHAR) ))) return; lstrcpyW( glob, folder ); lstrcatW( glob, lnkW ); @@ -563,7 +562,7 @@ static void add_folder( const WCHAR *folder ) do { add_launcher( folder, data.cFileName, -1 ); } while (FindNextFileW( handle, &data )); FindClose( handle ); } - HeapFree( GetProcessHeap(), 0, glob ); + free( glob ); } #define BORDER_SIZE 4 @@ -605,7 +604,7 @@ static void initialize_launchers( HWND hwnd ) CoTaskMemFree( desktop_folder ); return; } - if ((launchers = HeapAlloc( GetProcessHeap(), 0, 2 * sizeof(launchers[0]) ))) + if ((launchers = malloc( 2 * sizeof(launchers[0]) ))) { nb_allocated = 2; @@ -996,7 +995,7 @@ static void set_desktop_window_title( HWND hwnd, const WCHAR *name ) window_title_len = lstrlenW(name) * sizeof(WCHAR) + sizeof(desktop_name_separatorW) + sizeof(desktop_nameW); - window_titleW = HeapAlloc( GetProcessHeap(), 0, window_title_len ); + window_titleW = malloc( window_title_len ); if (!window_titleW) { SetWindowTextW( hwnd, desktop_nameW ); @@ -1008,7 +1007,7 @@ static void set_desktop_window_title( HWND hwnd, const WCHAR *name ) lstrcatW( window_titleW, desktop_nameW ); SetWindowTextW( hwnd, window_titleW ); - HeapFree( GetProcessHeap(), 0, window_titleW ); + free( window_titleW ); } static inline BOOL is_whitespace(WCHAR c) diff --git a/programs/explorer/explorer.c b/programs/explorer/explorer.c index 7924991383f..8960ac62d81 100644 --- a/programs/explorer/explorer.c +++ b/programs/explorer/explorer.c @@ -23,7 +23,6 @@ #define COBJMACROS #include "wine/debug.h" -#include "wine/heap.h" #include "explorer_private.h" #include "resource.h" @@ -114,8 +113,7 @@ static ULONG WINAPI IExplorerBrowserEventsImpl_fnRelease(IExplorerBrowserEvents { IExplorerBrowserEventsImpl *This = impl_from_IExplorerBrowserEvents(iface); ULONG ref = InterlockedDecrement(&This->ref); - if(!ref) - HeapFree(GetProcessHeap(),0,This); + if(!ref) free(This); return ref; } @@ -334,8 +332,7 @@ static IExplorerBrowserEventsVtbl vt_IExplorerBrowserEvents = static IExplorerBrowserEvents *make_explorer_events(explorer_info *info) { - IExplorerBrowserEventsImpl *ret - = HeapAlloc(GetProcessHeap(), 0, sizeof(IExplorerBrowserEventsImpl)); + IExplorerBrowserEventsImpl *ret = malloc( sizeof(IExplorerBrowserEventsImpl) ); ret->IExplorerBrowserEvents_iface.lpVtbl = &vt_IExplorerBrowserEvents; ret->info = info; ret->ref = 1; @@ -447,7 +444,7 @@ static void make_explorer_window(parameters_struct *params) default_width = MulDiv(DEFAULT_WIDTH, dpix, USER_DEFAULT_SCREEN_DPI); default_height = MulDiv(DEFAULT_HEIGHT, dpiy, USER_DEFAULT_SCREEN_DPI); - info = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(explorer_info)); + info = calloc( 1, sizeof(explorer_info) ); if(!info) { WINE_ERR("Could not allocate an explorer_info struct\n"); @@ -459,8 +456,8 @@ static void make_explorer_window(parameters_struct *params) &IID_IExplorerBrowser,(LPVOID*)&info->browser); if(FAILED(hres)) { - WINE_ERR("Could not obtain an instance of IExplorerBrowser\n"); - HeapFree(GetProcessHeap(),0,info); + WINE_ERR( "Could not obtain an instance of IExplorerBrowser\n" ); + free(info); IShellWindows_Release(sw); free(path); return; @@ -727,7 +724,7 @@ static LRESULT CALLBACK explorer_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, L IExplorerBrowser_Release(browser); ILFree(info->pidl); IImageList_Release(info->icon_list); - HeapFree(GetProcessHeap(),0,info); + free(info); SetWindowLongPtrW(hwnd,EXPLORER_INFO_INDEX,0); PostQuitMessage(0); break; diff --git a/programs/explorer/startmenu.c b/programs/explorer/startmenu.c index b46bd068220..0a6ef5f9c25 100644 --- a/programs/explorer/startmenu.c +++ b/programs/explorer/startmenu.c @@ -185,7 +185,7 @@ static struct menu_item* add_shell_item(struct menu_item* parent, LPITEMIDLIST p BOOL match = FALSE; SFGAOF flags; - item = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct menu_item)); + item = calloc( 1, sizeof(struct menu_item) ); if (parent->pidl == NULL) { @@ -208,8 +208,8 @@ static struct menu_item* add_shell_item(struct menu_item* parent, LPITEMIDLIST p if (item->folder && shell_folder_is_empty(item->folder)) { IShellFolder_Release(item->folder); - HeapFree(GetProcessHeap(), 0, item->displayname); - HeapFree(GetProcessHeap(), 0, item); + free( item->displayname ); + free( item ); CoTaskMemFree(pidl); return NULL; } @@ -303,8 +303,8 @@ static struct menu_item* add_shell_item(struct menu_item* parent, LPITEMIDLIST p } else { /* duplicate shortcut, do nothing */ - HeapFree(GetProcessHeap(), 0, item->displayname); - HeapFree(GetProcessHeap(), 0, item); + free( item->displayname ); + free( item ); CoTaskMemFree(pidl); item = NULL; } @@ -350,7 +350,7 @@ static void destroy_menus(void) CoTaskMemFree(item->displayname); list_remove(&item->entry); - HeapFree(GetProcessHeap(), 0, item); + free( item ); } } diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index 5070e123829..4cea6c9f458 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -327,9 +327,7 @@ static BOOL show_icon(struct icon *icon) { unsigned int new_count = max( alloc_displayed * 2, 32 ); struct icon **ptr; - if (displayed) ptr = HeapReAlloc( GetProcessHeap(), 0, displayed, new_count * sizeof(*ptr) ); - else ptr = HeapAlloc( GetProcessHeap(), 0, new_count * sizeof(*ptr) ); - if (!ptr) return FALSE; + if (!(ptr = realloc( displayed, new_count * sizeof(*ptr) ))) return FALSE; displayed = ptr; alloc_displayed = new_count; } @@ -433,7 +431,7 @@ static BOOL add_icon(NOTIFYICONDATAW *nid) return FALSE; } - if (!(icon = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*icon)))) + if (!(icon = calloc( 1, sizeof(*icon) ))) { WINE_ERR("out of memory\n"); return FALSE; @@ -455,7 +453,7 @@ static BOOL delete_icon(struct icon *icon) hide_icon(icon); list_remove(&icon->entry); DestroyIcon(icon->image); - HeapFree(GetProcessHeap(), 0, icon); + free( icon ); return TRUE; } @@ -615,7 +613,7 @@ static void add_taskbar_button( HWND hwnd ) if (!GetWindowThreadProcessId( hwnd, &process ) || process == GetCurrentProcessId()) return; } - if (!(win = HeapAlloc( GetProcessHeap(), 0, sizeof(*win) ))) return; + if (!(win = malloc( sizeof(*win) ))) return; win->hwnd = hwnd; win->button = CreateWindowW( WC_BUTTONW, NULL, WS_CHILD | BS_OWNERDRAW, 0, 0, 0, 0, tray_window, (HMENU)hwnd, 0, 0 ); @@ -639,7 +637,7 @@ static void remove_taskbar_button( HWND hwnd ) if (!win) return; list_remove( &win->entry ); DestroyWindow( win->button ); - HeapFree( GetProcessHeap(), 0, win ); + free( win ); } static void paint_taskbar_button( const DRAWITEMSTRUCT *dis ) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3158
From: Rémi Bernon <rbernon(a)codeweavers.com> --- programs/explorer/appbar.c | 35 ++++++++++++++++------------------- programs/explorer/desktop.c | 26 ++++++++++++-------------- programs/explorer/explorer.c | 30 ++++++++++++++---------------- programs/explorer/startmenu.c | 4 ++-- programs/explorer/systray.c | 22 +++++++++++----------- 5 files changed, 55 insertions(+), 62 deletions(-) diff --git a/programs/explorer/appbar.c b/programs/explorer/appbar.c index 2f96c580e19..af2ede55ba3 100644 --- a/programs/explorer/appbar.c +++ b/programs/explorer/appbar.c @@ -149,7 +149,7 @@ static UINT_PTR handle_appbarmessage(DWORD msg, struct appbar_data_msg *abd) data = calloc( 1, sizeof(struct appbar_data) ); if (!data) { - WINE_ERR("out of memory\n"); + ERR( "out of memory\n" ); return FALSE; } data->hwnd = hwnd; @@ -167,18 +167,16 @@ static UINT_PTR handle_appbarmessage(DWORD msg, struct appbar_data_msg *abd) free( data ); } - else - WINE_WARN("removing hwnd %p not on the list\n", hwnd); + else WARN( "removing hwnd %p not on the list\n", hwnd ); return TRUE; case ABM_QUERYPOS: - if (abd->uEdge > ABE_BOTTOM) - WINE_WARN("invalid edge %i for %p\n", abd->uEdge, hwnd); + if (abd->uEdge > ABE_BOTTOM) WARN( "invalid edge %i for %p\n", abd->uEdge, hwnd ); appbar_cliprect( hwnd, &abd->rc ); return TRUE; case ABM_SETPOS: if (abd->uEdge > ABE_BOTTOM) { - WINE_WARN("invalid edge %i for %p\n", abd->uEdge, hwnd); + WARN( "invalid edge %i for %p\n", abd->uEdge, hwnd ); return TRUE; } if ((data = get_appbar(hwnd))) @@ -196,14 +194,14 @@ static UINT_PTR handle_appbarmessage(DWORD msg, struct appbar_data_msg *abd) } else { - WINE_WARN("app sent ABM_SETPOS message for %p without ABM_ADD\n", hwnd); + WARN( "app sent ABM_SETPOS message for %p without ABM_ADD\n", hwnd ); } return TRUE; case ABM_GETSTATE: - WINE_FIXME("SHAppBarMessage(ABM_GETSTATE): stub\n"); + FIXME( "SHAppBarMessage(ABM_GETSTATE): stub\n" ); return ABS_ALWAYSONTOP | ABS_AUTOHIDE; case ABM_GETTASKBARPOS: - WINE_FIXME("SHAppBarMessage(ABM_GETTASKBARPOS, hwnd=%p): stub\n", hwnd); + FIXME( "SHAppBarMessage(ABM_GETTASKBARPOS, hwnd=%p): stub\n", hwnd ); /* Report the taskbar is at the bottom of the screen. */ abd->rc.left = 0; abd->rc.right = GetSystemMetrics(SM_CXSCREEN); @@ -214,16 +212,16 @@ static UINT_PTR handle_appbarmessage(DWORD msg, struct appbar_data_msg *abd) case ABM_ACTIVATE: return TRUE; case ABM_GETAUTOHIDEBAR: - WINE_FIXME("SHAppBarMessage(ABM_GETAUTOHIDEBAR, hwnd=%p, edge=%x): stub\n", hwnd, abd->uEdge); + FIXME( "SHAppBarMessage(ABM_GETAUTOHIDEBAR, hwnd=%p, edge=%x): stub\n", hwnd, abd->uEdge ); return 0; case ABM_SETAUTOHIDEBAR: - WINE_FIXME("SHAppBarMessage(ABM_SETAUTOHIDEBAR, hwnd=%p, edge=%x, lparam=%s): stub\n", - hwnd, abd->uEdge, wine_dbgstr_longlong(abd->lParam)); + FIXME( "SHAppBarMessage(ABM_SETAUTOHIDEBAR, hwnd=%p, edge=%x, lparam=%s): stub\n", hwnd, + abd->uEdge, wine_dbgstr_longlong( abd->lParam ) ); return TRUE; case ABM_WINDOWPOSCHANGED: return TRUE; default: - WINE_FIXME("SHAppBarMessage(%lx) unimplemented\n", msg); + FIXME( "SHAppBarMessage(%lx) unimplemented\n", msg ); return FALSE; } } @@ -252,14 +250,14 @@ static LRESULT CALLBACK appbar_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARA return_hproc = OpenProcess(PROCESS_DUP_HANDLE, FALSE, cmd.return_process); if (return_hproc == NULL) { - WINE_ERR("couldn't open calling process\n"); + ERR( "couldn't open calling process\n" ); return TRUE; } if (!DuplicateHandle(return_hproc, UlongToHandle(cmd.return_map), GetCurrentProcess(), &return_map, 0, FALSE, DUPLICATE_SAME_ACCESS)) { - WINE_ERR("couldn't duplicate handle\n"); + ERR( "couldn't duplicate handle\n" ); CloseHandle(return_hproc); return TRUE; } @@ -275,8 +273,7 @@ static LRESULT CALLBACK appbar_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARA UnmapViewOfFile(return_view); } - else - WINE_ERR("couldn't map view of file\n"); + else ERR( "couldn't map view of file\n" ); CloseHandle(return_map); return TRUE; @@ -302,14 +299,14 @@ void initialize_appbar(void) if (!RegisterClassExW(&class)) { - WINE_ERR("Could not register appbar message window class\n"); + ERR( "Could not register appbar message window class\n" ); return; } appbarmsg_window = CreateWindowW(classname, classname, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL); if (!appbarmsg_window) { - WINE_ERR("Could not create appbar message window\n"); + ERR( "Could not create appbar message window\n" ); return; } } diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 79652cbbc3b..6a9724a6a2d 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -594,13 +594,13 @@ static void initialize_launchers( HWND hwnd ) hr = SHGetKnownFolderPath( &FOLDERID_Desktop, KF_FLAG_CREATE, NULL, &desktop_folder ); if (FAILED( hr )) { - WINE_ERR("Could not get user desktop folder\n"); + ERR( "Could not get user desktop folder\n" ); return; } hr = SHGetKnownFolderPath( &FOLDERID_PublicDesktop, KF_FLAG_CREATE, NULL, &desktop_folder_public ); if (FAILED( hr )) { - WINE_ERR("Could not get public desktop folder\n"); + ERR( "Could not get public desktop folder\n" ); CoTaskMemFree( desktop_folder ); return; } @@ -707,7 +707,7 @@ static WNDPROC desktop_orig_wndproc; /* window procedure for the desktop window */ static LRESULT WINAPI desktop_wnd_proc( HWND hwnd, UINT message, WPARAM wp, LPARAM lp ) { - WINE_TRACE( "got msg %04x wp %Ix lp %Ix\n", message, wp, lp ); + TRACE( "got msg %04x wp %Ix lp %Ix\n", message, wp, lp ); switch(message) { @@ -963,19 +963,17 @@ static void initialize_display_settings(void) { if (!EnumDisplaySettingsExW( ddW.DeviceName, ENUM_CURRENT_SETTINGS, &dmW, 0)) { - WINE_ERR( "Failed to query current display settings for %s.\n", - wine_dbgstr_w( ddW.DeviceName ) ); + ERR( "Failed to query current display settings for %s.\n", debugstr_w(ddW.DeviceName) ); continue; } - WINE_TRACE( "Device %s current display mode %lux%lu %luBits %luHz at %ld,%ld.\n", - wine_dbgstr_w( ddW.DeviceName ), dmW.dmPelsWidth, dmW.dmPelsHeight, - dmW.dmBitsPerPel, dmW.dmDisplayFrequency, dmW.dmPosition.x, dmW.dmPosition.y ); + TRACE( "Device %s current display mode %lux%lu %luBits %luHz at %ld,%ld.\n", + debugstr_w( ddW.DeviceName ), dmW.dmPelsWidth, dmW.dmPelsHeight, + dmW.dmBitsPerPel, dmW.dmDisplayFrequency, dmW.dmPosition.x, dmW.dmPosition.y ); if (ChangeDisplaySettingsExW( ddW.DeviceName, &dmW, 0, CDS_GLOBAL | CDS_NORESET | CDS_UPDATEREGISTRY, 0 )) - WINE_ERR( "Failed to initialize registry display settings for %s.\n", - wine_dbgstr_w( ddW.DeviceName ) ); + ERR( "Failed to initialize registry display settings for %s.\n", debugstr_w(ddW.DeviceName) ); } } @@ -1077,7 +1075,7 @@ void manage_desktop( WCHAR *arg ) else desktop = CreateDesktopW( name, NULL, &devmode, DF_WINE_CREATE_DESKTOP, DESKTOP_ALL_ACCESS, NULL ); if (!desktop) { - WINE_ERR( "failed to create desktop %s error %ld\n", wine_dbgstr_w(name), GetLastError() ); + ERR( "failed to create desktop %s error %ld\n", debugstr_w(name), GetLastError() ); ExitProcess( 1 ); } SetThreadDesktop( desktop ); @@ -1127,7 +1125,7 @@ void manage_desktop( WCHAR *arg ) memset( &si, 0, sizeof(si) ); si.cb = sizeof(si); - WINE_TRACE( "starting %s\n", wine_dbgstr_w(cmdline) ); + TRACE( "starting %s\n", debugstr_w(cmdline) ); if (CreateProcessW( NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi )) { CloseHandle( pi.hThread ); @@ -1141,9 +1139,9 @@ void manage_desktop( WCHAR *arg ) /* run the desktop message loop */ if (hwnd) { - WINE_TRACE( "desktop message loop starting on hwnd %p\n", hwnd ); + TRACE( "desktop message loop starting on hwnd %p\n", hwnd ); while (GetMessageW( &msg, 0, 0, 0 )) DispatchMessageW( &msg ); - WINE_TRACE( "desktop message loop exiting for hwnd %p\n", hwnd ); + TRACE( "desktop message loop exiting for hwnd %p\n", hwnd ); } if (pShellDDEInit) pShellDDEInit( FALSE ); diff --git a/programs/explorer/explorer.c b/programs/explorer/explorer.c index 8960ac62d81..66636d374ff 100644 --- a/programs/explorer/explorer.c +++ b/programs/explorer/explorer.c @@ -131,7 +131,7 @@ static BOOL create_combobox_item(IShellFolder *folder, LPCITEMIDLIST child_pidl, hres = StrRetToStrW(&strret, child_pidl, &item->pszText); if(FAILED(hres)) { - WINE_WARN("Could not get name for pidl\n"); + WARN( "Could not get name for pidl\n" ); return FALSE; } @@ -198,8 +198,8 @@ static void update_path_box(explorer_info *info) hres = IEnumIDList_Next(ids,1,&curr_pidl,NULL); if(FAILED(hres) || hres == S_FALSE) break; - if(!create_combobox_item(desktop,curr_pidl,info->icon_list,&item)) - WINE_WARN("Could not create a combobox item\n"); + if (!create_combobox_item( desktop, curr_pidl, info->icon_list, &item )) + WARN( "Could not create a combobox item\n" ); else { LPITEMIDLIST full_pidl = ILCombine(desktop_pidl,curr_pidl); @@ -215,8 +215,7 @@ static void update_path_box(explorer_info *info) hres = IShellFolder_BindToObject(desktop,curr_pidl,NULL, &IID_IShellFolder, (void**)&curr_folder); - if(FAILED(hres)) - WINE_WARN("Could not get an IShellFolder\n"); + if (FAILED(hres)) WARN( "Could not get an IShellFolder\n" ); while(!ILIsEmpty(next_pidl)) { LPITEMIDLIST first = ILCloneFirst(next_pidl); @@ -224,7 +223,7 @@ static void update_path_box(explorer_info *info) if(!create_combobox_item(curr_folder,first, info->icon_list,&item)) { - WINE_WARN("Could not create a combobox item\n"); + WARN( "Could not create a combobox item\n" ); break; } ++item.iIndent; @@ -237,7 +236,7 @@ static void update_path_box(explorer_info *info) (void**)&temp); if(FAILED(hres)) { - WINE_WARN("Could not get an IShellFolder\n"); + WARN( "Could not get an IShellFolder\n" ); break; } IShellFolder_Release(curr_folder); @@ -258,8 +257,7 @@ static void update_path_box(explorer_info *info) ILFree(curr_pidl); IEnumIDList_Release(ids); } - else - WINE_WARN("Could not enumerate the desktop\n"); + else WARN( "Could not enumerate the desktop\n" ); SendMessageW(info->path_box,CBEM_SETITEMW,0,(LPARAM)&main_item); CoTaskMemFree(main_item.pszText); } @@ -447,7 +445,7 @@ static void make_explorer_window(parameters_struct *params) info = calloc( 1, sizeof(explorer_info) ); if(!info) { - WINE_ERR("Could not allocate an explorer_info struct\n"); + ERR( "Could not allocate an explorer_info struct\n" ); IShellWindows_Release(sw); free(path); return; @@ -456,7 +454,7 @@ static void make_explorer_window(parameters_struct *params) &IID_IExplorerBrowser,(LPVOID*)&info->browser); if(FAILED(hres)) { - WINE_ERR( "Could not obtain an instance of IExplorerBrowser\n" ); + ERR( "Could not obtain an instance of IExplorerBrowser\n" ); free(info); IShellWindows_Release(sw); free(path); @@ -574,7 +572,7 @@ static LRESULT explorer_on_end_edit(explorer_info *info,NMCBEENDEDITW *edit_info { LPITEMIDLIST pidl = NULL; - WINE_TRACE("iWhy=%x\n",edit_info->iWhy); + TRACE( "iWhy=%x\n", edit_info->iWhy ); switch(edit_info->iWhy) { case CBENF_DROPDOWN: @@ -623,7 +621,7 @@ static LRESULT update_rebar_size(explorer_info* info,NMRBAUTOSIZE *size_info) static LRESULT explorer_on_notify(explorer_info* info,NMHDR* notification) { - WINE_TRACE("code=%i\n",notification->code); + TRACE( "code=%i\n", notification->code ); switch(notification->code) { case CBEN_BEGINEDIT: @@ -707,7 +705,7 @@ static LRESULT CALLBACK explorer_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, L = (explorer_info*)GetWindowLongPtrW(hwnd,EXPLORER_INFO_INDEX); IExplorerBrowser *browser = NULL; - WINE_TRACE("(hwnd=%p,uMsg=%u,wParam=%Ix,lParam=%Ix)\n",hwnd,uMsg,wParam,lParam); + TRACE( "(hwnd=%p,uMsg=%u,wParam=%Ix,lParam=%Ix)\n", hwnd, uMsg, wParam, lParam ); if(info) browser = info->browser; switch(uMsg) @@ -913,7 +911,7 @@ int WINAPI wWinMain(HINSTANCE hinstance, hres = OleInitialize(NULL); if(FAILED(hres)) { - WINE_ERR("Could not initialize COM\n"); + ERR( "Could not initialize COM\n" ); ExitProcess(EXIT_FAILURE); } if(parameters.root[0] && !PathIsDirectoryW(parameters.root)) @@ -923,7 +921,7 @@ int WINAPI wWinMain(HINSTANCE hinstance, init_info.dwICC = ICC_USEREX_CLASSES | ICC_BAR_CLASSES | ICC_COOL_CLASSES; if(!InitCommonControlsEx(&init_info)) { - WINE_ERR("Could not initialize Comctl\n"); + ERR( "Could not initialize Comctl\n" ); ExitProcess(EXIT_FAILURE); } register_explorer_window_class(); diff --git a/programs/explorer/startmenu.c b/programs/explorer/startmenu.c index 0a6ef5f9c25..489a81f94b9 100644 --- a/programs/explorer/startmenu.c +++ b/programs/explorer/startmenu.c @@ -440,7 +440,7 @@ void do_startmenu(HWND hwnd) destroy_menus(); - WINE_TRACE("creating start menu\n"); + TRACE( "creating start menu\n" ); root_menu.menuhandle = public_startmenu.menuhandle = user_startmenu.menuhandle = CreatePopupMenu(); if (!root_menu.menuhandle) @@ -498,6 +498,6 @@ void do_startmenu(HWND hwnd) TPM_LEFTALIGN|TPM_BOTTOMALIGN|TPM_VERTICAL, rc.left, rc.top, hwnd, &tpm)) { - WINE_ERR("couldn't display menu\n"); + ERR( "couldn't display menu\n" ); } } diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index 4cea6c9f458..7be26f4026f 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -319,7 +319,7 @@ static void invalidate_icons( unsigned int start, unsigned int end ) /* make an icon visible */ static BOOL show_icon(struct icon *icon) { - WINE_TRACE("id=0x%x, hwnd=%p\n", icon->id, icon->owner); + TRACE( "id=0x%x, hwnd=%p\n", icon->id, icon->owner ); if (icon->display != -1) return TRUE; /* already displayed */ @@ -349,7 +349,7 @@ static BOOL hide_icon(struct icon *icon) { unsigned int i; - WINE_TRACE("id=0x%x, hwnd=%p\n", icon->id, icon->owner); + TRACE( "id=0x%x, hwnd=%p\n", icon->id, icon->owner ); if (icon->display == -1) return TRUE; /* already hidden */ @@ -374,12 +374,12 @@ static BOOL hide_icon(struct icon *icon) /* Modifies an existing icon record */ static BOOL modify_icon( struct icon *icon, NOTIFYICONDATAW *nid ) { - WINE_TRACE("id=0x%x, hwnd=%p\n", nid->uID, nid->hWnd); + TRACE( "id=0x%x, hwnd=%p\n", nid->uID, nid->hWnd ); /* demarshal the request from the NID */ if (!icon) { - WINE_WARN("Invalid icon ID (0x%x) for HWND %p\n", nid->uID, nid->hWnd); + WARN( "Invalid icon ID (0x%x) for HWND %p\n", nid->uID, nid->hWnd ); return FALSE; } @@ -423,17 +423,17 @@ static BOOL add_icon(NOTIFYICONDATAW *nid) { struct icon *icon; - WINE_TRACE("id=0x%x, hwnd=%p\n", nid->uID, nid->hWnd); + TRACE( "id=0x%x, hwnd=%p\n", nid->uID, nid->hWnd ); if ((icon = get_icon(nid->hWnd, nid->uID))) { - WINE_WARN("duplicate tray icon add, buggy app?\n"); + WARN( "duplicate tray icon add, buggy app?\n" ); return FALSE; } if (!(icon = calloc( 1, sizeof(*icon) ))) { - WINE_ERR("out of memory\n"); + ERR( "out of memory\n" ); return FALSE; } @@ -554,7 +554,7 @@ static BOOL handle_incoming(HWND hwndSource, COPYDATASTRUCT *cds) if (cds->cbData < sizeof(*data) + cbMaskBits + cbColourBits) { - WINE_ERR("buffer underflow\n"); + ERR( "buffer underflow\n" ); return FALSE; } nid.hIcon = CreateIcon(NULL, data->width, data->height, data->planes, data->bpp, @@ -591,7 +591,7 @@ static BOOL handle_incoming(HWND hwndSource, COPYDATASTRUCT *cds) } break; default: - WINE_FIXME("unhandled tray message: %Id\n", cds->dwData); + FIXME( "unhandled tray message: %Id\n", cds->dwData ); break; } @@ -915,7 +915,7 @@ void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enab if (!RegisterClassExW(&class)) { - WINE_ERR("Could not register SysTray window class\n"); + ERR( "Could not register SysTray window class\n" ); return; } @@ -928,7 +928,7 @@ void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enab taskbar_rect.bottom - taskbar_rect.top, 0, 0, 0, 0 ); if (!tray_window) { - WINE_ERR("Could not create tray window\n"); + ERR( "Could not create tray window\n" ); return; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3158
From: Rémi Bernon <rbernon(a)codeweavers.com> --- programs/explorer/appbar.c | 5 ++- programs/explorer/desktop.c | 66 ++++++++++-------------------------- programs/explorer/explorer.c | 23 ++++++------- programs/explorer/systray.c | 5 ++- 4 files changed, 31 insertions(+), 68 deletions(-) diff --git a/programs/explorer/appbar.c b/programs/explorer/appbar.c index af2ede55ba3..18b125257ee 100644 --- a/programs/explorer/appbar.c +++ b/programs/explorer/appbar.c @@ -288,14 +288,13 @@ static LRESULT CALLBACK appbar_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARA void initialize_appbar(void) { WNDCLASSEXW class; - static const WCHAR classname[] = {'W','i','n','e','A','p','p','B','a','r',0}; /* register the appbar window class */ ZeroMemory(&class, sizeof(class)); class.cbSize = sizeof(class); class.lpfnWndProc = appbar_wndproc; class.hInstance = NULL; - class.lpszClassName = classname; + class.lpszClassName = L"WineAppBar"; if (!RegisterClassExW(&class)) { @@ -303,7 +302,7 @@ void initialize_appbar(void) return; } - appbarmsg_window = CreateWindowW(classname, classname, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL); + appbarmsg_window = CreateWindowW(class.lpszClassName, class.lpszClassName, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL); if (!appbarmsg_window) { ERR( "Could not create appbar message window\n" ); diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 6a9724a6a2d..9945f689313 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -276,12 +276,6 @@ static void draw_launchers( HDC hdc, RECT update_rect ) SetBkMode( hdc, mode ); } -static void do_launch( const struct launcher *launcher ) -{ - static const WCHAR openW[] = {'o','p','e','n',0}; - ShellExecuteW( NULL, openW, launcher->path, NULL, NULL, 0 ); -} - static WCHAR *append_path( const WCHAR *path, const WCHAR *filename, int len_filename ) { int len_path = lstrlenW( path ); @@ -547,7 +541,7 @@ error: static void add_folder( const WCHAR *folder ) { - static const WCHAR lnkW[] = {'\\','*','.','l','n','k',0}; + static const WCHAR lnkW[] = L"\\*.lnk"; int len = lstrlenW( folder ) + lstrlenW( lnkW ); WIN32_FIND_DATAW data; HANDLE handle; @@ -747,7 +741,7 @@ static LRESULT WINAPI desktop_wnd_proc( HWND hwnd, UINT message, WPARAM wp, LPAR if (!using_root) { const struct launcher *launcher = launcher_from_point( (short)LOWORD(lp), (short)HIWORD(lp) ); - if (launcher) do_launch( launcher ); + if (launcher) ShellExecuteW( NULL, L"open", launcher->path, NULL, NULL, 0 ); } return 0; @@ -784,10 +778,6 @@ static BOOL parse_size( const WCHAR *size, unsigned int *width, unsigned int *he /* retrieve the desktop name to use if not specified on the command line */ static const WCHAR *get_default_desktop_name(void) { - static const WCHAR desktopW[] = {'D','e','s','k','t','o','p',0}; - static const WCHAR defaultW[] = {'D','e','f','a','u','l','t',0}; - static const WCHAR explorer_keyW[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e','\\', - 'E','x','p','l','o','r','e','r',0}; static WCHAR buffer[MAX_PATH]; DWORD size = sizeof(buffer); HDESK desk = GetThreadDesktop( GetCurrentThreadId() ); @@ -796,13 +786,13 @@ static const WCHAR *get_default_desktop_name(void) if (desk && GetUserObjectInformationW( desk, UOI_NAME, buffer, ARRAY_SIZE( buffer ), NULL )) { - if (wcsicmp( buffer, defaultW )) return buffer; + if (wcsicmp( buffer, L"Default" )) return buffer; } /* @@ Wine registry key: HKCU\Software\Wine\Explorer */ - if (!RegOpenKeyW( HKEY_CURRENT_USER, explorer_keyW, &hkey )) + if (!RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Wine\\Explorer", &hkey )) { - if (!RegQueryValueExW( hkey, desktopW, 0, NULL, (LPBYTE)buffer, &size ) && *buffer) ret = buffer; + if (!RegQueryValueExW( hkey, L"Desktop", 0, NULL, (LPBYTE)buffer, &size ) && *buffer) ret = buffer; RegCloseKey( hkey ); } return ret; @@ -811,9 +801,6 @@ static const WCHAR *get_default_desktop_name(void) /* retrieve the default desktop size from the registry */ static BOOL get_default_desktop_size( const WCHAR *name, unsigned int *width, unsigned int *height ) { - static const WCHAR desktop_keyW[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e','\\', - 'E','x','p','l','o','r','e','r','\\', - 'D','e','s','k','t','o','p','s',0}; HKEY hkey; WCHAR buffer[64]; DWORD size = sizeof(buffer); @@ -823,7 +810,7 @@ static BOOL get_default_desktop_size( const WCHAR *name, unsigned int *width, un *height = 600; /* @@ Wine registry key: HKCU\Software\Wine\Explorer\Desktops */ - if (!RegOpenKeyW( HKEY_CURRENT_USER, desktop_keyW, &hkey )) + if (!RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Wine\\Explorer\\Desktops", &hkey )) { if (!RegQueryValueExW( hkey, name, 0, NULL, (LPBYTE)buffer, &size )) { @@ -837,44 +824,26 @@ static BOOL get_default_desktop_size( const WCHAR *name, unsigned int *width, un static BOOL get_default_enable_shell( const WCHAR *name ) { - static const WCHAR desktop_keyW[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e','\\', - 'E','x','p','l','o','r','e','r','\\', - 'D','e','s','k','t','o','p','s',0}; - static const WCHAR enable_shellW[] = {'E','n','a','b','l','e','S','h','e','l','l',0}; - static const WCHAR shellW[] = {'s','h','e','l','l',0}; HKEY hkey; BOOL found = FALSE; BOOL result; DWORD size = sizeof(result); /* @@ Wine registry key: HKCU\Software\Wine\Explorer\Desktops */ - if (!RegOpenKeyW( HKEY_CURRENT_USER, desktop_keyW, &hkey )) + if (!RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Wine\\Explorer\\Desktops", &hkey )) { - if (!RegGetValueW( hkey, name, enable_shellW, RRF_RT_REG_DWORD, NULL, &result, &size )) + if (!RegGetValueW( hkey, name, L"EnableShell", RRF_RT_REG_DWORD, NULL, &result, &size )) found = TRUE; RegCloseKey( hkey ); } /* Default off, except for the magic desktop name "shell" */ - if (!found) - result = (lstrcmpiW( name, shellW ) == 0); + if (!found) result = (lstrcmpiW( name, L"shell" ) == 0); return result; } static HMODULE load_graphics_driver( const WCHAR *driver, GUID *guid ) { - static const WCHAR device_keyW[] = { - 'S','y','s','t','e','m','\\', - 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', - 'C','o','n','t','r','o','l','\\', - 'V','i','d','e','o','\\', - '{','%','0','8','x','-','%','0','4','x','-','%','0','4','x','-', - '%','0','2','x','%','0','2','x','-','%','0','2','x','%','0','2','x','%','0','2','x', - '%','0','2','x','%','0','2','x','%','0','2','x','}','\\','0','0','0','0',0}; - static const WCHAR graphics_driverW[] = {'G','r','a','p','h','i','c','s','D','r','i','v','e','r',0}; - static const WCHAR driversW[] = {'S','o','f','t','w','a','r','e','\\', - 'W','i','n','e','\\','D','r','i','v','e','r','s',0}; - static const WCHAR graphicsW[] = {'G','r','a','p','h','i','c','s',0}; - static const WCHAR drv_formatW[] = {'w','i','n','e','%','s','.','d','r','v',0}; + static const WCHAR device_keyW[] = L"System\\CurrentControlSet\\Control\\Video\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\\0000"; WCHAR buffer[MAX_PATH], libname[32], *name, *next; WCHAR key[ARRAY_SIZE( device_keyW ) + 39]; @@ -888,10 +857,10 @@ static HMODULE load_graphics_driver( const WCHAR *driver, GUID *guid ) lstrcpyW( buffer, default_driver ); /* @@ Wine registry key: HKCU\Software\Wine\Drivers */ - if (!RegOpenKeyW( HKEY_CURRENT_USER, driversW, &hkey )) + if (!RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Wine\\Drivers", &hkey )) { DWORD count = sizeof(buffer); - RegQueryValueExW( hkey, graphicsW, 0, NULL, (LPBYTE)buffer, &count ); + RegQueryValueExW( hkey, L"Graphics", 0, NULL, (LPBYTE)buffer, &count ); RegCloseKey( hkey ); } } @@ -912,7 +881,7 @@ static HMODULE load_graphics_driver( const WCHAR *driver, GUID *guid ) break; } - swprintf( libname, ARRAY_SIZE( libname ), drv_formatW, name ); + swprintf( libname, ARRAY_SIZE( libname ), L"wine%s.drv", name ); if ((module = LoadLibraryW( libname )) != 0) break; switch (GetLastError()) { @@ -939,7 +908,7 @@ static HMODULE load_graphics_driver( const WCHAR *driver, GUID *guid ) REG_OPTION_VOLATILE, KEY_SET_VALUE, NULL, &hkey, NULL )) { if (module || null_driver) - RegSetValueExW( hkey, graphics_driverW, 0, REG_SZ, + RegSetValueExW( hkey, L"GraphicsDriver", 0, REG_SZ, (BYTE *)libname, (lstrlenW(libname) + 1) * sizeof(WCHAR) ); else RegSetValueExA( hkey, "DriverError", 0, REG_SZ, (BYTE *)error, strlen(error) + 1 ); @@ -979,8 +948,8 @@ static void initialize_display_settings(void) static void set_desktop_window_title( HWND hwnd, const WCHAR *name ) { - static const WCHAR desktop_nameW[] = {'W','i','n','e',' ','d','e','s','k','t','o','p',0}; - static const WCHAR desktop_name_separatorW[] = {' ', '-', ' ', 0}; + static const WCHAR desktop_nameW[] = L"Wine desktop"; + static const WCHAR desktop_name_separatorW[] = L" - "; WCHAR *window_titleW = NULL; int window_title_len; @@ -1016,7 +985,6 @@ static inline BOOL is_whitespace(WCHAR c) /* main desktop management function */ void manage_desktop( WCHAR *arg ) { - static const WCHAR messageW[] = {'M','e','s','s','a','g','e',0}; HDESK desktop = 0; GUID guid; MSG msg; @@ -1088,7 +1056,7 @@ void manage_desktop( WCHAR *arg ) if (hwnd) { /* create the HWND_MESSAGE parent */ - CreateWindowExW( 0, messageW, NULL, WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, + CreateWindowExW( 0, L"Message", NULL, WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0, 0, 100, 100, 0, 0, 0, NULL ); desktop_orig_wndproc = (WNDPROC)SetWindowLongPtrW( hwnd, GWLP_WNDPROC, diff --git a/programs/explorer/explorer.c b/programs/explorer/explorer.c index 66636d374ff..879fda42135 100644 --- a/programs/explorer/explorer.c +++ b/programs/explorer/explorer.c @@ -50,9 +50,6 @@ static int default_width; static int default_height; -static const WCHAR EXPLORER_CLASS[] = {'E','x','p','l','o','r','e','r','W','C','l','a','s','s',0}; -static const WCHAR PATH_BOX_NAME[] = {'\0'}; - HINSTANCE explorer_hInstance; typedef struct parametersTAG { @@ -462,7 +459,7 @@ static void make_explorer_window(parameters_struct *params) } info->rebar_height=0; info->main_window - = CreateWindowW(EXPLORER_CLASS,explorer_title,WS_OVERLAPPEDWINDOW, + = CreateWindowW(L"ExplorerWClass",explorer_title,WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,CW_USEDEFAULT,default_width, default_height,NULL,NULL,explorer_hInstance,NULL); @@ -519,7 +516,7 @@ static void make_explorer_window(parameters_struct *params) band_info.cyMinChild=nav_toolbar_height; band_info.cxMinChild=0; SendMessageW(rebar,RB_INSERTBANDW,-1,(LPARAM)&band_info); - info->path_box = CreateWindowW(WC_COMBOBOXEXW,PATH_BOX_NAME, + info->path_box = CreateWindowW(WC_COMBOBOXEXW,L"", WS_CHILD | WS_VISIBLE | CBS_DROPDOWN, 0,0,default_width,pathbox_height,rebar,NULL, explorer_hInstance,NULL); @@ -771,7 +768,7 @@ static void register_explorer_window_class(void) window_class.hCursor = NULL; window_class.hbrBackground = (HBRUSH)COLOR_BACKGROUND; window_class.lpszMenuName = NULL; - window_class.lpszClassName = EXPLORER_CLASS; + window_class.lpszClassName = L"ExplorerWClass"; window_class.hIconSm = NULL; RegisterClassExW(&window_class); } @@ -834,13 +831,13 @@ static void copy_path_root(LPWSTR root, LPWSTR path) */ static void parse_command_line(LPWSTR commandline,parameters_struct *parameters) { - static const WCHAR arg_n[] = {'/','n'}; - static const WCHAR arg_e[] = {'/','e',','}; - static const WCHAR arg_cd[] = {'/','c','d',','}; - static const WCHAR arg_root[] = {'/','r','o','o','t',','}; - static const WCHAR arg_select[] = {'/','s','e','l','e','c','t',','}; - static const WCHAR arg_desktop[] = {'/','d','e','s','k','t','o','p'}; - static const WCHAR arg_desktop_quotes[] = {'"','/','d','e','s','k','t','o','p'}; + static const WCHAR arg_n[] = L"/n"; + static const WCHAR arg_e[] = L"/e,"; + static const WCHAR arg_cd[] = L"/cd,"; + static const WCHAR arg_root[] = L"/root,"; + static const WCHAR arg_select[] = L"/select,"; + static const WCHAR arg_desktop[] = L"/desktop"; + static const WCHAR arg_desktop_quotes[] = L"\"/desktop"; LPWSTR p = commandline; diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index 7be26f4026f..6253b65cf35 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -892,7 +892,6 @@ void handle_parent_notify( HWND hwnd, WPARAM wp ) void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enable_shell ) { WNDCLASSEXW class; - static const WCHAR classname[] = {'S','h','e','l','l','_','T','r','a','y','W','n','d',0}; RECT work_rect, primary_rect, taskbar_rect; if (using_root && graphics_driver) wine_notify_icon = (void *)GetProcAddress( graphics_driver, "wine_notify_icon" ); @@ -911,7 +910,7 @@ void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enab class.hIcon = LoadIconW(0, (LPCWSTR)IDI_WINLOGO); class.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW); class.hbrBackground = (HBRUSH) COLOR_WINDOW; - class.lpszClassName = classname; + class.lpszClassName = L"Shell_TrayWnd"; if (!RegisterClassExW(&class)) { @@ -923,7 +922,7 @@ void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enab SetRect( &primary_rect, 0, 0, GetSystemMetrics( SM_CXSCREEN ), GetSystemMetrics( SM_CYSCREEN ) ); SubtractRect( &taskbar_rect, &primary_rect, &work_rect ); - tray_window = CreateWindowExW( WS_EX_NOACTIVATE, classname, NULL, WS_POPUP, taskbar_rect.left, + tray_window = CreateWindowExW( WS_EX_NOACTIVATE, 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) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3158
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=134161 Your paranoid android. === debian11 (build log) === error: patch failed: programs/explorer/appbar.c:149 error: patch failed: programs/explorer/explorer.c:447 error: patch failed: programs/explorer/systray.c:423 error: patch failed: programs/explorer/appbar.c:303 Task: Patch failed to apply === debian11b (build log) === error: patch failed: programs/explorer/appbar.c:149 error: patch failed: programs/explorer/explorer.c:447 error: patch failed: programs/explorer/systray.c:423 error: patch failed: programs/explorer/appbar.c:303 Task: Patch failed to apply
participants (2)
-
Marvin -
Rémi Bernon