Commit ebe35f6f authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

comctl32: Add support for adding extra data in CreatePropertySheetPage.

parent cae20edb
......@@ -103,6 +103,7 @@ struct _PSP
{
PROPSHEETPAGEA pspA;
PROPSHEETPAGEW pspW;
BYTE data[1];
};
};
......@@ -3076,10 +3077,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
if (lpPropSheetPage->dwSize < PROPSHEETPAGEA_V1_SIZE)
return NULL;
ret = Alloc(sizeof(*ret));
ret = Alloc(FIELD_OFFSET(struct _PSP, data[lpPropSheetPage->dwSize]));
ret->magic = HPROPSHEETPAGE_MAGIC;
ppsp = &ret->pspA;
memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEA)));
memcpy(ppsp, lpPropSheetPage, lpPropSheetPage->dwSize);
if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) )
{
......@@ -3131,11 +3132,11 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage
if (lpPropSheetPage->dwSize < PROPSHEETPAGEW_V1_SIZE)
return NULL;
ret = Alloc(sizeof(*ret));
ret = Alloc(FIELD_OFFSET(struct _PSP, data[lpPropSheetPage->dwSize]));
ret->magic = HPROPSHEETPAGE_MAGIC;
ret->unicode = TRUE;
ppsp = &ret->pspW;
memcpy(ppsp, lpPropSheetPage, min(lpPropSheetPage->dwSize, sizeof(PROPSHEETPAGEW)));
memcpy(ppsp, lpPropSheetPage, lpPropSheetPage->dwSize);
if ( !(ppsp->dwFlags & PSP_DLGINDIRECT) )
{
......
......@@ -1058,7 +1058,7 @@ static UINT CALLBACK proppage_callback_a(HWND hwnd, UINT msg, PROPSHEETPAGEA *ps
if (psp->dwSize >= FIELD_OFFSET(struct custom_proppage, addref_called))
{
struct custom_proppage *extra_data = (struct custom_proppage *)psp;
todo_wine ok(extra_data->extra_data == 0x1234, "Expected extra_data to be preserved, got %lx\n",
ok(extra_data->extra_data == 0x1234, "Expected extra_data to be preserved, got %lx\n",
extra_data->extra_data);
}
......@@ -1092,7 +1092,7 @@ static UINT CALLBACK proppage_callback_w(HWND hwnd, UINT msg, PROPSHEETPAGEW *ps
if (psp->dwSize >= FIELD_OFFSET(struct custom_proppage, addref_called))
{
struct custom_proppage *extra_data = (struct custom_proppage *)psp;
todo_wine ok(extra_data->extra_data == 0x4321, "Expected extra_data to be preserved, got %lx\n",
ok(extra_data->extra_data == 0x4321, "Expected extra_data to be preserved, got %lx\n",
extra_data->extra_data);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment