https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3faa56d2c7eff8330dc57…
commit 3faa56d2c7eff8330dc57cbb6beab808ba60ba04
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Thu Nov 16 14:58:49 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Thu Nov 16 14:58:49 2023 +0900
[CRYPTUI] Let image list be automatically deleted (#5891)
Based on KRosUser's cryptui.patch.
- Don't delete the image list because the list view will delete the image list
automatically.
CORE-17290
---
dll/win32/cryptui/main.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/dll/win32/cryptui/main.c b/dll/win32/cryptui/main.c
index f4dee4aded1..75f55df1c17 100644
--- a/dll/win32/cryptui/main.c
+++ b/dll/win32/cryptui/main.c
@@ -789,11 +789,15 @@ static LRESULT CALLBACK cert_mgr_advanced_dlg_proc(HWND hwnd, UINT
msg,
{
case IDOK:
save_cert_mgr_usages(hwnd);
+#ifndef __REACTOS__
ImageList_Destroy((HIMAGELIST)GetWindowLongPtrW(hwnd, DWLP_USER));
+#endif
EndDialog(hwnd, IDOK);
break;
case IDCANCEL:
+#ifndef __REACTOS__
ImageList_Destroy((HIMAGELIST)GetWindowLongPtrW(hwnd, DWLP_USER));
+#endif
EndDialog(hwnd, IDCANCEL);
break;
}
@@ -1153,6 +1157,14 @@ static LRESULT CALLBACK cert_mgr_dlg_proc(HWND hwnd, UINT msg,
WPARAM wp,
show_store_certs(hwnd, cert_mgr_index_to_store(tab, 0));
break;
}
+#ifdef __REACTOS__
+ case WM_DESTROY:
+ free_certs(GetDlgItem(hwnd, IDC_MGR_CERTS));
+ close_stores(GetDlgItem(hwnd, IDC_MGR_STORES));
+ data = (struct CertMgrData *)GetWindowLongPtrW(hwnd, DWLP_USER);
+ HeapFree(GetProcessHeap(), 0, data);
+ break;
+#endif
case WM_NOTIFY:
{
NMHDR *hdr = (NMHDR *)lp;
@@ -1278,11 +1290,13 @@ static LRESULT CALLBACK cert_mgr_dlg_proc(HWND hwnd, UINT msg,
WPARAM wp,
cert_mgr_do_remove(hwnd);
break;
case IDCANCEL:
+#ifndef __REACTOS__
free_certs(GetDlgItem(hwnd, IDC_MGR_CERTS));
close_stores(GetDlgItem(hwnd, IDC_MGR_STORES));
data = (struct CertMgrData *)GetWindowLongPtrW(hwnd, DWLP_USER);
ImageList_Destroy(data->imageList);
HeapFree(GetProcessHeap(), 0, data);
+#endif
EndDialog(hwnd, IDCANCEL);
break;
}
@@ -3717,7 +3731,9 @@ static UINT CALLBACK cert_properties_general_callback(HWND hwnd,
UINT msg,
data = (struct edit_cert_data *)GetWindowLongPtrW(hwnd, DWLP_USER);
if (data)
{
+#ifndef __REACTOS__
ImageList_Destroy(data->imageList);
+#endif
HeapFree(GetProcessHeap(), 0, data);
}
break;
@@ -4219,7 +4235,9 @@ static UINT CALLBACK hierarchy_callback(HWND hwnd, UINT msg,
{
case PSPCB_RELEASE:
data = (struct hierarchy_data *)page->lParam;
+#ifndef __REACTOS__
ImageList_Destroy(data->imageList);
+#endif
HeapFree(GetProcessHeap(), 0, data);
break;
}
@@ -7321,6 +7339,13 @@ static LRESULT CALLBACK select_cert_dlg_proc(HWND hwnd, UINT msg,
WPARAM wp, LPA
select_cert_update_view_button(hwnd);
break;
}
+#ifdef __REACTOS__
+ case WM_DESTROY:
+ free_certs(GetDlgItem(hwnd, IDC_SELECT_CERTS));
+ data = (struct SelectCertData *)GetWindowLongPtrW(hwnd, DWLP_USER);
+ HeapFree(GetProcessHeap(), 0, data);
+ break;
+#endif
case WM_NOTIFY:
{
NMHDR *hdr = (NMHDR *)lp;
@@ -7378,17 +7403,21 @@ static LRESULT CALLBACK select_cert_dlg_proc(HWND hwnd, UINT msg,
WPARAM wp, LPA
break;
}
*data->cert = CertDuplicateCertificateContext(cert);
+#ifndef __REACTOS__
free_certs(GetDlgItem(hwnd, IDC_SELECT_CERTS));
ImageList_Destroy(data->imageList);
HeapFree(GetProcessHeap(), 0, data);
+#endif
EndDialog(hwnd, IDOK);
break;
}
case IDCANCEL:
+#ifndef __REACTOS__
data = (struct SelectCertData *)GetWindowLongPtrW(hwnd, DWLP_USER);
free_certs(GetDlgItem(hwnd, IDC_SELECT_CERTS));
ImageList_Destroy(data->imageList);
HeapFree(GetProcessHeap(), 0, data);
+#endif
EndDialog(hwnd, IDCANCEL);
break;
case IDC_SELECT_VIEW_CERT: