Nikolay Sivov : shlwapi: Don' t limit text size for message boxes from ShellMessageBoxWrapW.
Alexandre Julliard
julliard at winehq.org
Mon May 31 11:21:36 CDT 2010
Module: wine
Branch: master
Commit: 1b105553d7ae1b7b53c2cb10db39ebccef9790ee
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1b105553d7ae1b7b53c2cb10db39ebccef9790ee
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Sun May 30 00:24:32 2010 +0400
shlwapi: Don't limit text size for message boxes from ShellMessageBoxWrapW.
---
dlls/shlwapi/ordinal.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c
index 22851d9..18295e4 100644
--- a/dlls/shlwapi/ordinal.c
+++ b/dlls/shlwapi/ordinal.c
@@ -4487,8 +4487,8 @@ DWORD WINAPI GetUIVersion(void)
INT WINAPIV ShellMessageBoxWrapW(HINSTANCE hInstance, HWND hWnd, LPCWSTR lpText,
LPCWSTR lpCaption, UINT uType, ...)
{
- WCHAR szText[100], szTitle[100];
- LPCWSTR pszText = szText, pszTitle = szTitle;
+ WCHAR *szText = NULL, szTitle[100];
+ LPCWSTR pszText, pszTitle = szTitle;
LPWSTR pszTemp;
__ms_va_list args;
int ret;
@@ -4503,7 +4503,16 @@ INT WINAPIV ShellMessageBoxWrapW(HINSTANCE hInstance, HWND hWnd, LPCWSTR lpText,
pszTitle = lpCaption;
if (IS_INTRESOURCE(lpText))
- LoadStringW(hInstance, LOWORD(lpText), szText, sizeof(szText)/sizeof(szText[0]));
+ {
+ const WCHAR *ptr;
+ UINT len = LoadStringW(hInstance, LOWORD(lpText), (LPWSTR)&ptr, 0);
+ if (len)
+ {
+ szText = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
+ if (szText) LoadStringW(hInstance, LOWORD(lpText), szText, len + 1);
+ }
+ pszText = szText;
+ }
else
pszText = lpText;
@@ -4513,6 +4522,8 @@ INT WINAPIV ShellMessageBoxWrapW(HINSTANCE hInstance, HWND hWnd, LPCWSTR lpText,
__ms_va_end(args);
ret = MessageBoxW(hWnd, pszTemp, pszTitle, uType);
+
+ HeapFree(GetProcessHeap(), 0, szText);
LocalFree(pszTemp);
return ret;
}
More information about the wine-cvs
mailing list