Nikolay Sivov : comctl32/propsheet: Double size of a template buffer passed to PSCB_PRECREATE.
Alexandre Julliard
julliard at winehq.org
Tue Feb 28 03:45:56 CST 2017
Module: wine
Branch: oldstable
Commit: 0a7e342d0370df6be26c4ec12c92bba8e5ca9612
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0a7e342d0370df6be26c4ec12c92bba8e5ca9612
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Fri Jan 13 14:25:54 2017 +0300
comctl32/propsheet: Double size of a template buffer passed to PSCB_PRECREATE.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 9d404ddac6e4f789b7ee417f4bedd3cb49e411e7)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/comctl32/propsheet.c | 2 +-
dlls/comctl32/tests/propsheet.c | 15 +++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c
index ed5f7d4..05cbc8a 100644
--- a/dlls/comctl32/propsheet.c
+++ b/dlls/comctl32/propsheet.c
@@ -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;
diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c
index 6594298..592ad15 100644
--- a/dlls/comctl32/tests/propsheet.c
+++ b/dlls/comctl32/tests/propsheet.c
@@ -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];
More information about the wine-cvs
mailing list