From 3e903bb925286860c1940dfba9fb26413deb4a14 Mon Sep 17 00:00:00 2001 From: henrypp Date: Tue, 18 Jul 2023 16:56:28 +0600 Subject: [PATCH] fixed uwp icon calculation --- src/editor.c | 2 +- src/helper.c | 7 ++++--- src/messages.c | 10 ++++------ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/editor.c b/src/editor.c index 207fa6fc..449f8186 100644 --- a/src/editor.c +++ b/src/editor.c @@ -779,7 +779,7 @@ INT_PTR CALLBACK EditorPagesProc ( { string = NULL; - _app_getappinfoparam2 (context->ptr_app->app_hash, INFO_SIGNATURE_STRING, &string, sizeof (string)); + _app_getappinfoparam2 (context->ptr_app->app_hash, 0, INFO_SIGNATURE_STRING, &string, sizeof (string)); _r_ctrl_setstringformat ( hwnd, diff --git a/src/helper.c b/src/helper.c index 2f1990a0..ce44ccde 100644 --- a/src/helper.c +++ b/src/helper.c @@ -413,6 +413,7 @@ PITEM_APP_INFO _app_getappinfobyhash2 ( _Success_ (return) BOOLEAN _app_getappinfoparam2 ( _In_ ULONG_PTR app_hash, + _In_opt_ INT listview_id, _In_ ENUM_INFO_DATA2 info_data, _Out_writes_bytes_all_ (size) PVOID buffer, _In_ SIZE_T size @@ -450,7 +451,7 @@ BOOLEAN _app_getappinfoparam2 ( } if (!icon_id) - icon_id = _app_icons_getdefaultapp_id (DATA_APP_REGULAR); + icon_id = _app_icons_getdefaultapp_id ((listview_id == IDC_APPS_UWP) ? DATA_APP_UWP : DATA_APP_REGULAR); if (icon_id) { @@ -522,7 +523,7 @@ BOOLEAN _app_isappsigned ( PR_STRING string = NULL; BOOLEAN is_signed; - if (_app_getappinfoparam2 (app_hash, INFO_SIGNATURE_STRING, &string, sizeof (string))) + if (_app_getappinfoparam2 (app_hash, 0, INFO_SIGNATURE_STRING, &string, sizeof (string))) { is_signed = !_r_obj_isstringempty2 (string); @@ -1893,7 +1894,7 @@ VOID NTAPI _app_queuenotifyinformation ( L":" ); - if (!_app_getappinfoparam2 (ptr_log->app_hash, INFO_SIGNATURE_STRING, &signature_str, sizeof (signature_str))) + if (!_app_getappinfoparam2 (ptr_log->app_hash, 0, INFO_SIGNATURE_STRING, &signature_str, sizeof (signature_str))) _r_obj_movereference (&signature_str, _r_locale_getstring_ex (IDS_SIGN_UNSIGNED)); hdefer = BeginDeferWindowPos (2); diff --git a/src/messages.c b/src/messages.c index 0a053e3a..81e68ca8 100644 --- a/src/messages.c +++ b/src/messages.c @@ -1472,7 +1472,7 @@ VOID _app_displayinfoapp_callback ( // set image if (lpnmlv->item.mask & LVIF_IMAGE) { - if (_app_getappinfoparam2 (ptr_app->app_hash, INFO_ICON_ID, &icon_id, sizeof (icon_id))) + if (_app_getappinfoparam2 (ptr_app->app_hash, listview_id, INFO_ICON_ID, &icon_id, sizeof (icon_id))) lpnmlv->item.iImage = icon_id; } @@ -1643,9 +1643,7 @@ VOID _app_displayinfonetwork_callback ( PITEM_APP ptr_app; PR_STRING string; LPCWSTR name; - LONG icon_id; - - icon_id = 0; + LONG icon_id = 0; // set text if (lpnmlv->item.mask & LVIF_TEXT) @@ -1792,7 +1790,7 @@ VOID _app_displayinfonetwork_callback ( // set image if (lpnmlv->item.mask & LVIF_IMAGE) { - if (_app_getappinfoparam2 (ptr_network->app_hash, INFO_ICON_ID, &icon_id, sizeof (icon_id))) + if (_app_getappinfoparam2 (ptr_network->app_hash, 0, INFO_ICON_ID, &icon_id, sizeof (icon_id))) lpnmlv->item.iImage = icon_id; } @@ -2007,7 +2005,7 @@ VOID _app_displayinfolog_callback ( // set image if (lpnmlv->item.mask & LVIF_IMAGE) { - if (_app_getappinfoparam2 (ptr_log->app_hash, INFO_ICON_ID, &icon_id, sizeof (icon_id))) + if (_app_getappinfoparam2 (ptr_log->app_hash, 0, INFO_ICON_ID, &icon_id, sizeof (icon_id))) lpnmlv->item.iImage = icon_id; }