Added patch to implement comctl32.PROPSHEET_InsertPage.

This commit is contained in:
Sebastian Lackner 2015-10-17 16:24:51 +02:00
parent 091bcbce3c
commit c83adcf25b
6 changed files with 405 additions and 1 deletions

View File

@ -34,9 +34,10 @@ Wine. All those differences are also documented on the
Included bug fixes and improvements
-----------------------------------
**Bug fixes and features included in the next upcoming release [5]:**
**Bug fixes and features included in the next upcoming release [6]:**
* Add implementation for IDXGIOutput::GetDesc ([Wine Bug #32006](https://bugs.winehq.org/show_bug.cgi?id=32006))
* Add implementation for comctl32.PROPSHEET_InsertPage. ([Wine Bug #25625](https://bugs.winehq.org/show_bug.cgi?id=25625))
* Do not check if object was signaled after user APC in server_select
* Fix the initialization of combined DACLs when the new DACL is empty ([Wine Bug #38423](https://bugs.winehq.org/show_bug.cgi?id=38423))
* Show windows version when collecting system info in winedbg

1
debian/changelog vendored
View File

@ -9,6 +9,7 @@ wine-staging (1.7.53) UNRELEASED; urgency=low
sandbox (32-bit).
* Added patch to fix the initialization of combined DACLs when the new DACL is
empty.
* Added patch to implement comctl32.PROPSHEET_InsertPage.
* Removed patch to mark RegOpenKeyExA, RegCloseKey and RegQueryValueExA as
hotpatchable (accepted upstream).
* Removed patch to mark BitBlt and StretchDIBits as hotpatchable (accepted

View File

@ -0,0 +1,132 @@
From 5bd9830f145a29823b4a44b079c70171e55fb5db Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 17 Oct 2015 15:38:13 +0200
Subject: comctl32/tests: Add tests for PROPSHEET_InsertPage.
---
dlls/comctl32/tests/propsheet.c | 97 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 96 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c
index 6594298..cdbbca8 100644
--- a/dlls/comctl32/tests/propsheet.c
+++ b/dlls/comctl32/tests/propsheet.c
@@ -806,7 +806,7 @@ static void test_PSM_ADDPAGE(void)
psp.pfnDlgProc = page_dlg_proc_messages;
psp.lParam = 0;
- /* two page with the same data */
+ /* multiple pages with the same data */
hpsp[0] = CreatePropertySheetPageA(&psp);
hpsp[1] = CreatePropertySheetPageA(&psp);
hpsp[2] = CreatePropertySheetPageA(&psp);
@@ -878,6 +878,100 @@ if (0)
DestroyWindow(hdlg);
}
+static void test_PSM_INSERTPAGE(void)
+{
+ HPROPSHEETPAGE hpsp[5];
+ PROPSHEETPAGEA psp;
+ PROPSHEETHEADERA psh;
+ HWND hdlg, tab;
+ BOOL ret;
+ DWORD r;
+
+ memset(&psp, 0, sizeof(psp));
+ psp.dwSize = sizeof(psp);
+ psp.dwFlags = 0;
+ psp.hInstance = GetModuleHandleA(NULL);
+ U(psp).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_MESSAGE_TEST);
+ U2(psp).pszIcon = NULL;
+ psp.pfnDlgProc = page_dlg_proc_messages;
+ psp.lParam = 0;
+
+ /* multiple pages with the same data */
+ hpsp[0] = CreatePropertySheetPageA(&psp);
+ hpsp[1] = CreatePropertySheetPageA(&psp);
+ hpsp[2] = CreatePropertySheetPageA(&psp);
+
+ U(psp).pszTemplate = (LPCSTR)MAKEINTRESOURCE(IDD_PROP_PAGE_ERROR);
+ hpsp[3] = CreatePropertySheetPageA(&psp);
+
+ psp.dwFlags = PSP_PREMATURE;
+ hpsp[4] = CreatePropertySheetPageA(&psp);
+
+ memset(&psh, 0, sizeof(psh));
+ psh.dwSize = PROPSHEETHEADERA_V1_SIZE;
+ psh.dwFlags = PSH_MODELESS;
+ psh.pszCaption = "test caption";
+ psh.nPages = 1;
+ psh.hwndParent = GetDesktopWindow();
+ U3(psh).phpage = hpsp;
+
+ hdlg = (HWND)PropertySheetA(&psh);
+ ok(hdlg != INVALID_HANDLE_VALUE, "got invalid handle %p\n", hdlg);
+
+ /* add pages one by one */
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 5, (LPARAM)hpsp[1]);
+ todo_wine ok(ret == TRUE, "got %d\n", ret);
+
+ /* try with invalid values */
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, 0);
+ ok(ret == FALSE, "got %d\n", ret);
+
+if (0)
+{
+ /* crashes on native */
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, (LPARAM)INVALID_HANDLE_VALUE);
+}
+
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, (LPARAM)INVALID_HANDLE_VALUE, (LPARAM)hpsp[2]);
+ ok(ret == FALSE, "got %d\n", ret);
+
+ /* check item count */
+ tab = (HWND)SendMessageA(hdlg, PSM_GETTABCONTROL, 0, 0);
+
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
+ todo_wine ok(r == 2, "got %d\n", r);
+
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, (WPARAM)hpsp[1], (LPARAM)hpsp[2]);
+ todo_wine ok(ret == TRUE, "got %d\n", ret);
+
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
+ todo_wine ok(r == 3, "got %d\n", r);
+
+ /* add property sheet page that can't be created */
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 1, (LPARAM)hpsp[3]);
+ todo_wine ok(ret == TRUE, "got %d\n", ret);
+
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
+ todo_wine ok(r == 4, "got %d\n", r);
+
+ /* select page that can't be created */
+ ret = SendMessageA(hdlg, PSM_SETCURSEL, 1, 0);
+ todo_wine ok(ret == TRUE, "got %d\n", ret);
+
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
+ todo_wine ok(r == 3, "got %d\n", r);
+
+ /* test PSP_PREMATURE flag with incorrect property sheet page */
+ ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, (LPARAM)hpsp[4]);
+ ok(ret == FALSE, "got %d\n", ret);
+
+ r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
+ todo_wine ok(r == 3, "got %d\n", r);
+
+ DestroyPropertySheetPage(hpsp[4]);
+ DestroyWindow(hdlg);
+}
+
START_TEST(propsheet)
{
test_title();
@@ -888,4 +982,5 @@ START_TEST(propsheet)
test_custom_default_button();
test_messages();
test_PSM_ADDPAGE();
+ test_PSM_INSERTPAGE();
}
--
2.6.1

View File

@ -0,0 +1,248 @@
From 8b23d1c04949938de77466556f7caf9321687a33 Mon Sep 17 00:00:00 2001
From: Peter Hater <7element@mail.bg>
Date: Wed, 16 Sep 2015 15:49:58 +0300
Subject: comctl32: Implement PROPSHEET_InsertPage based on PROPSHEET_AddPage
---
dlls/comctl32/propsheet.c | 152 +++++++++++++++++++++++++---------------
dlls/comctl32/tests/propsheet.c | 18 ++---
2 files changed, 104 insertions(+), 66 deletions(-)
diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c
index ce7001c..fecb0e4 100644
--- a/dlls/comctl32/propsheet.c
+++ b/dlls/comctl32/propsheet.c
@@ -172,6 +172,7 @@ static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, const PropSheetInfo* psI
static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg, const PropSheetInfo* psInfo);
static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID);
static BOOL PROPSHEET_RemovePage(HWND hwndDlg, int index, HPROPSHEETPAGE hpage);
+static BOOL PROPSHEET_InsertPage(HWND hwndDlg, HPROPSHEETPAGE hpageInsertAfter, HPROPSHEETPAGE hpage);
static INT_PTR CALLBACK
PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
@@ -2259,60 +2260,9 @@ static LRESULT PROPSHEET_QuerySiblings(HWND hwndDlg,
static BOOL PROPSHEET_AddPage(HWND hwndDlg,
HPROPSHEETPAGE hpage)
{
- PropPageInfo * ppi;
PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
- HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
- TCITEMW item;
- LPCPROPSHEETPAGEW ppsp = (LPCPROPSHEETPAGEW)hpage;
-
TRACE("hpage %p\n", hpage);
- /*
- * Allocate and fill in a new PropPageInfo entry.
- */
- ppi = ReAlloc(psInfo->proppage, sizeof(PropPageInfo) * (psInfo->nPages + 1));
- if (!ppi)
- return FALSE;
-
- psInfo->proppage = ppi;
- if (!PROPSHEET_CollectPageInfo(ppsp, psInfo, psInfo->nPages, FALSE))
- return FALSE;
-
- psInfo->proppage[psInfo->nPages].hpage = hpage;
-
- if (ppsp->dwFlags & PSP_PREMATURE)
- {
- /* Create the page but don't show it */
- if(!PROPSHEET_CreatePage(hwndDlg, psInfo->nPages, psInfo, ppsp))
- return FALSE;
- }
-
- /*
- * Add a new tab to the tab control.
- */
- item.mask = TCIF_TEXT;
- item.pszText = (LPWSTR) psInfo->proppage[psInfo->nPages].pszText;
- item.cchTextMax = MAX_TABTEXT_LENGTH;
-
- if (psInfo->hImageList)
- {
- SendMessageW(hwndTabControl, TCM_SETIMAGELIST, 0, (LPARAM)psInfo->hImageList);
- }
-
- if ( psInfo->proppage[psInfo->nPages].hasIcon )
- {
- item.mask |= TCIF_IMAGE;
- item.iImage = psInfo->nPages;
- }
-
- SendMessageW(hwndTabControl, TCM_INSERTITEMW, psInfo->nPages + 1,
- (LPARAM)&item);
-
- psInfo->nPages++;
-
- /* If it is the only page - show it */
- if(psInfo->nPages == 1)
- PROPSHEET_SetCurSel(hwndDlg, 0, 1, 0);
- return TRUE;
+ return PROPSHEET_InsertPage(hwndDlg, (HPROPSHEETPAGE)(ULONG_PTR)psInfo->nPages, hpage);
}
/******************************************************************************
@@ -2473,11 +2423,99 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
*/
static BOOL PROPSHEET_InsertPage(HWND hwndDlg, HPROPSHEETPAGE hpageInsertAfter, HPROPSHEETPAGE hpage)
{
- if (IS_INTRESOURCE(hpageInsertAfter))
- FIXME("(%p, %d, %p): stub\n", hwndDlg, LOWORD(hpageInsertAfter), hpage);
- else
- FIXME("(%p, %p, %p): stub\n", hwndDlg, hpageInsertAfter, hpage);
- return FALSE;
+ PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
+ PropPageInfo * ppi, * prev_ppi = psInfo->proppage;
+ HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
+ LPCPROPSHEETPAGEW ppsp = (LPCPROPSHEETPAGEW)hpage;
+ TCITEMW item;
+ int index;
+
+ TRACE("hwndDlg %p, hpageInsertAfter %p, hpage %p\n", hwndDlg, hpageInsertAfter, hpage);
+
+ if (IS_INTRESOURCE(hpageInsertAfter))
+ index = LOWORD(hpageInsertAfter);
+ else
+ {
+ index = PROPSHEET_GetPageIndex(hpageInsertAfter, psInfo, -1);
+ if (index < 0)
+ {
+ TRACE("Could not find page to insert after!\n");
+ return FALSE;
+ }
+ index++;
+ }
+
+ if (index > psInfo->nPages)
+ index = psInfo->nPages;
+
+ /*
+ * Allocate a new PropPageInfo entry.
+ */
+ ppi = Alloc(sizeof(PropPageInfo) * (psInfo->nPages + 1));
+ if (!ppi)
+ return FALSE;
+
+ /*
+ * Fill in a new PropPageInfo entry.
+ */
+ if (index > 0)
+ memcpy(ppi, prev_ppi, index * sizeof(PropPageInfo));
+ memset(&ppi[index], 0, sizeof(PropPageInfo));
+ if (index < psInfo->nPages)
+ memcpy(&ppi[index + 1], &prev_ppi[index], (psInfo->nPages - index) * sizeof(PropPageInfo));
+ psInfo->proppage = ppi;
+
+ if (!PROPSHEET_CollectPageInfo(ppsp, psInfo, index, FALSE))
+ {
+ psInfo->proppage = prev_ppi;
+ Free(ppi);
+ return FALSE;
+ }
+
+ psInfo->proppage[index].hpage = hpage;
+
+ if (ppsp->dwFlags & PSP_PREMATURE)
+ {
+ /* Create the page but don't show it */
+ if(!PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppsp))
+ {
+ psInfo->proppage = prev_ppi;
+ Free(ppi);
+ return FALSE;
+ }
+ }
+
+ Free(prev_ppi);
+ psInfo->nPages++;
+ if (index <= psInfo->active_page)
+ psInfo->active_page++;
+
+ /*
+ * Add a new tab to the tab control.
+ */
+ item.mask = TCIF_TEXT;
+ item.pszText = (LPWSTR) psInfo->proppage[index].pszText;
+ item.cchTextMax = MAX_TABTEXT_LENGTH;
+
+ if (psInfo->hImageList)
+ {
+ SendMessageW(hwndTabControl, TCM_SETIMAGELIST, 0, (LPARAM)psInfo->hImageList);
+ }
+
+ if (psInfo->proppage[index].hasIcon)
+ {
+ item.mask |= TCIF_IMAGE;
+ item.iImage = index;
+ }
+
+ SendMessageW(hwndTabControl, TCM_INSERTITEMW, index,
+ (LPARAM)&item);
+
+ /* If it is the only page - show it */
+ if (psInfo->nPages == 1)
+ PROPSHEET_SetCurSel(hwndDlg, 0, 1, 0);
+
+ return TRUE;
}
/******************************************************************************
diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c
index cdbbca8..bcc89bb 100644
--- a/dlls/comctl32/tests/propsheet.c
+++ b/dlls/comctl32/tests/propsheet.c
@@ -920,7 +920,7 @@ static void test_PSM_INSERTPAGE(void)
/* add pages one by one */
ret = SendMessageA(hdlg, PSM_INSERTPAGE, 5, (LPARAM)hpsp[1]);
- todo_wine ok(ret == TRUE, "got %d\n", ret);
+ ok(ret == TRUE, "got %d\n", ret);
/* try with invalid values */
ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, 0);
@@ -939,34 +939,34 @@ if (0)
tab = (HWND)SendMessageA(hdlg, PSM_GETTABCONTROL, 0, 0);
r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
- todo_wine ok(r == 2, "got %d\n", r);
+ ok(r == 2, "got %d\n", r);
ret = SendMessageA(hdlg, PSM_INSERTPAGE, (WPARAM)hpsp[1], (LPARAM)hpsp[2]);
- todo_wine ok(ret == TRUE, "got %d\n", ret);
+ ok(ret == TRUE, "got %d\n", ret);
r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
- todo_wine ok(r == 3, "got %d\n", r);
+ ok(r == 3, "got %d\n", r);
/* add property sheet page that can't be created */
ret = SendMessageA(hdlg, PSM_INSERTPAGE, 1, (LPARAM)hpsp[3]);
- todo_wine ok(ret == TRUE, "got %d\n", ret);
+ ok(ret == TRUE, "got %d\n", ret);
r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
- todo_wine ok(r == 4, "got %d\n", r);
+ ok(r == 4, "got %d\n", r);
/* select page that can't be created */
ret = SendMessageA(hdlg, PSM_SETCURSEL, 1, 0);
- todo_wine ok(ret == TRUE, "got %d\n", ret);
+ ok(ret == TRUE, "got %d\n", ret);
r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
- todo_wine ok(r == 3, "got %d\n", r);
+ ok(r == 3, "got %d\n", r);
/* test PSP_PREMATURE flag with incorrect property sheet page */
ret = SendMessageA(hdlg, PSM_INSERTPAGE, 0, (LPARAM)hpsp[4]);
ok(ret == FALSE, "got %d\n", ret);
r = SendMessageA(tab, TCM_GETITEMCOUNT, 0, 0);
- todo_wine ok(r == 3, "got %d\n", r);
+ ok(r == 3, "got %d\n", r);
DestroyPropertySheetPage(hpsp[4]);
DestroyWindow(hdlg);
--
2.6.1

View File

@ -0,0 +1 @@
Fixes: [25625] Add implementation for comctl32.PROPSHEET_InsertPage.

View File

@ -94,6 +94,7 @@ patch_enable_all ()
enable_browseui_Progress_Dialog="$1"
enable_combase_String="$1"
enable_comctl32_Button_Theming="$1"
enable_comctl32_PROPSHEET_InsertPage="$1"
enable_comctl32_TVM_GETITEM="$1"
enable_configure_Absolute_RPATH="$1"
enable_crypt32_CMS_Certificates="$1"
@ -374,6 +375,9 @@ patch_enable ()
comctl32-Button_Theming)
enable_comctl32_Button_Theming="$2"
;;
comctl32-PROPSHEET_InsertPage)
enable_comctl32_PROPSHEET_InsertPage="$2"
;;
comctl32-TVM_GETITEM)
enable_comctl32_TVM_GETITEM="$2"
;;
@ -2338,6 +2342,23 @@ if test "$enable_comctl32_Button_Theming" -eq 1; then
) >> "$patchlist"
fi
# Patchset comctl32-PROPSHEET_InsertPage
# |
# | This patchset fixes the following Wine bugs:
# | * [#25625] Add implementation for comctl32.PROPSHEET_InsertPage.
# |
# | Modified files:
# | * dlls/comctl32/propsheet.c, dlls/comctl32/tests/propsheet.c
# |
if test "$enable_comctl32_PROPSHEET_InsertPage" -eq 1; then
patch_apply comctl32-PROPSHEET_InsertPage/0001-comctl32-tests-Add-tests-for-PROPSHEET_InsertPage.patch
patch_apply comctl32-PROPSHEET_InsertPage/0002-comctl32-Implement-PROPSHEET_InsertPage-based-on-PRO.patch
(
echo '+ { "Sebastian Lackner", "comctl32/tests: Add tests for PROPSHEET_InsertPage.", 1 },';
echo '+ { "Peter Hater", "comctl32: Implement PROPSHEET_InsertPage based on PROPSHEET_AddPage.", 1 },';
) >> "$patchlist"
fi
# Patchset comctl32-TVM_GETITEM
# |
# | This patchset fixes the following Wine bugs: