Commit 407916e1 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

1. Make buffer for message large enough to hold very long file names.

2. Pass FORMAT_MESSAGE_ARGUMENT_ARRAY for FormatMessageA to not assume implementation specific behaviour. 3. Show actual message to user, not non-formatted one.
parent 42d20f9d
......@@ -19,13 +19,14 @@ DEFAULT_DEBUG_CHANNEL(shell);
static BOOL SHELL_WarnFolderDelete (int nKindOfDialog, LPCSTR szDir)
{
char szCaption[255], szText[255], szBuffer[256];
char szCaption[255], szText[255], szBuffer[MAX_PATH + 256];
LoadStringA(shell32_hInstance, IDS_DELETEFOLDER_TEXT, szText, sizeof(szText));
LoadStringA(shell32_hInstance, IDS_DELETEFOLDER_CAPTION, szCaption, sizeof(szCaption));
FormatMessageA(FORMAT_MESSAGE_FROM_STRING, szText, 0,0, szBuffer, sizeof(szBuffer), (DWORD*)&szDir);
FormatMessageA(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ARGUMENT_ARRAY,
szText, 0, 0, szBuffer, sizeof(szBuffer), (DWORD*)&szDir);
return (IDOK == MessageBoxA(GetActiveWindow(),szText, szCaption, MB_OKCANCEL | MB_ICONEXCLAMATION));
return (IDOK == MessageBoxA(GetActiveWindow(), szBuffer, szCaption, MB_OKCANCEL | MB_ICONEXCLAMATION));
}
/**************************************************************************
......
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