Commit 2f0a4ac4 authored by Wolfgang Schwotzer's avatar Wolfgang Schwotzer Committed by Alexandre Julliard

Make file dialog support FNERR_BUFFERTOSMALL if buffer too small.

parent a2423c0d
......@@ -34,9 +34,6 @@
*
* FIXME: lpstrCustomFilter not handled
*
* FIXME: if the size of lpstrFile (nMaxFile) is too small the first
* two bytes of lpstrFile should contain the needed size
*
* FIXME: algorithm for selecting the initial directory is too simple
*
* FIXME: add to recent docs
......@@ -1989,9 +1986,16 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
}
else
{
/* FIXME set error FNERR_BUFFERTOSMALL */
WORD size;
size = strlenW(lpstrPathAndFile) + 1;
if (fodInfos->ofnInfos->Flags & OFN_ALLOWMULTISELECT)
size += 1;
/* return needed size in first two bytes of lpstrFile */
*(WORD *)fodInfos->ofnInfos->lpstrFile = size;
FILEDLG95_Clean(hwnd);
ret = EndDialog(hwnd, FALSE);
COMDLG32_SetCommDlgExtendedError(FNERR_BUFFERTOOSMALL);
}
goto ret;
}
......
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