Commit f5660c23 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

comctl32: Fix the loading of strings for the property sheet page by

caching the ID of the string to load before overwriting it with an Alloc call.
parent e6b97ce2
...@@ -2907,9 +2907,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA( ...@@ -2907,9 +2907,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
PROPSHEET_AtoW( &ppsp->pszTitle, lpPropSheetPage->pszTitle ); PROPSHEET_AtoW( &ppsp->pszTitle, lpPropSheetPage->pszTitle );
else else
{ {
int len = LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszTitle), NULL, 0 ) + 1; UINT id = LOWORD(ppsp->pszTitle);
int len = LoadStringW( ppsp->hInstance, id, NULL, 0 ) + sizeof(WCHAR);
ppsp->pszTitle = Alloc( len ); ppsp->pszTitle = Alloc( len );
LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszTitle), (LPWSTR)ppsp->pszTitle, len ); LoadStringW( ppsp->hInstance, id, (LPWSTR)ppsp->pszTitle, len );
} }
} }
else else
...@@ -2924,9 +2925,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA( ...@@ -2924,9 +2925,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
PROPSHEET_AtoW(&ppsp->pszHeaderTitle, lpPropSheetPage->pszHeaderTitle); PROPSHEET_AtoW(&ppsp->pszHeaderTitle, lpPropSheetPage->pszHeaderTitle);
else else
{ {
int len = LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszHeaderTitle), NULL, 0 ) + 1; UINT id = LOWORD(ppsp->pszHeaderTitle);
int len = LoadStringW( ppsp->hInstance, id, NULL, 0 ) + sizeof(WCHAR);
ppsp->pszHeaderTitle = Alloc( len ); ppsp->pszHeaderTitle = Alloc( len );
LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszHeaderTitle), (LPWSTR)ppsp->pszHeaderTitle, len ); LoadStringW( ppsp->hInstance, id, (LPWSTR)ppsp->pszHeaderTitle, len );
} }
} }
else else
...@@ -2938,9 +2940,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA( ...@@ -2938,9 +2940,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
PROPSHEET_AtoW(&ppsp->pszHeaderSubTitle, lpPropSheetPage->pszHeaderSubTitle); PROPSHEET_AtoW(&ppsp->pszHeaderSubTitle, lpPropSheetPage->pszHeaderSubTitle);
else else
{ {
int len = LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszHeaderSubTitle), NULL, 0 ) + 1; UINT id = LOWORD(ppsp->pszHeaderSubTitle);
int len = LoadStringW( ppsp->hInstance, id, NULL, 0 ) + sizeof(WCHAR);
ppsp->pszHeaderSubTitle = Alloc( len ); ppsp->pszHeaderSubTitle = Alloc( len );
LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszHeaderSubTitle), (LPWSTR)ppsp->pszHeaderSubTitle, len ); LoadStringW( ppsp->hInstance, id, (LPWSTR)ppsp->pszHeaderSubTitle, len );
} }
} }
else else
...@@ -2992,9 +2995,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage ...@@ -2992,9 +2995,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage
} }
else else
{ {
int len = LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszTitle), NULL, 0 ) + 1; UINT id = LOWORD(ppsp->pszTitle);
int len = LoadStringW( ppsp->hInstance, id, NULL, 0 ) + sizeof(WCHAR);
ppsp->pszTitle = Alloc( len ); ppsp->pszTitle = Alloc( len );
LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszTitle), (LPWSTR)ppsp->pszTitle, len ); LoadStringW( ppsp->hInstance, id, (LPWSTR)ppsp->pszTitle, len );
} }
} }
else else
...@@ -3013,9 +3017,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage ...@@ -3013,9 +3017,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage
} }
else else
{ {
int len = LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszHeaderTitle), NULL, 0 ) + 1; UINT id = LOWORD(ppsp->pszHeaderTitle);
int len = LoadStringW( ppsp->hInstance, id, NULL, 0 ) + sizeof(WCHAR);
ppsp->pszHeaderTitle = Alloc( len ); ppsp->pszHeaderTitle = Alloc( len );
LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszHeaderTitle), (LPWSTR)ppsp->pszHeaderTitle, len ); LoadStringW( ppsp->hInstance, id, (LPWSTR)ppsp->pszHeaderTitle, len );
} }
} }
else else
...@@ -3031,9 +3036,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage ...@@ -3031,9 +3036,10 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage
} }
else else
{ {
int len = LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszHeaderSubTitle), NULL, 0 ) + 1; UINT id = LOWORD(ppsp->pszHeaderSubTitle);
int len = LoadStringW( ppsp->hInstance, id, NULL, 0 ) + sizeof(WCHAR);
ppsp->pszHeaderSubTitle = Alloc( len ); ppsp->pszHeaderSubTitle = Alloc( len );
LoadStringW( ppsp->hInstance, LOWORD(ppsp->pszHeaderSubTitle), (LPWSTR)ppsp->pszHeaderSubTitle, len ); LoadStringW( ppsp->hInstance, id, (LPWSTR)ppsp->pszHeaderSubTitle, len );
} }
} }
else else
......
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