comctl32/propsheet: Double size of a template buffer passed to PSCB_PRECREATE.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2017-01-13 14:25:54 +03:00 committed by Alexandre Julliard
parent e48d75862f
commit 9d404ddac6
2 changed files with 16 additions and 1 deletions

View File

@ -639,7 +639,7 @@ static INT_PTR PROPSHEET_CreateDialog(PropSheetInfo* psInfo)
*/
resSize = SizeofResource(COMCTL32_hModule, hRes);
temp = Alloc(resSize);
temp = Alloc(2 * resSize);
if (!temp)
return -1;

View File

@ -55,6 +55,21 @@ static int CALLBACK sheet_callback(HWND hwnd, UINT msg, LPARAM lparam)
{
switch(msg)
{
case PSCB_PRECREATE:
{
HMODULE module = GetModuleHandleA("comctl32.dll");
DWORD size, buffer_size;
HRSRC hrsrc;
hrsrc = FindResourceA(module, MAKEINTRESOURCEA(1006 /* IDD_PROPSHEET */),
(LPSTR)RT_DIALOG);
size = SizeofResource(module, hrsrc);
ok(size != 0, "Failed to get size of propsheet dialog resource\n");
buffer_size = HeapSize(GetProcessHeap(), 0, (void *)lparam);
ok(buffer_size == 2 * size, "Unexpected template buffer size %u, resource size %u\n",
buffer_size, size);
break;
}
case PSCB_INITIALIZED:
{
char caption[256];