mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
fixed bug in PhSetFileDialogFileName
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@4177 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
@@ -8,6 +8,7 @@ Process Hacker
|
||||
* Image file versions
|
||||
* Workaround for an IPv6-related bug in Windows XP
|
||||
* DPCs and Interrupts in System Information tooltips
|
||||
* File dialog crash on Windows XP
|
||||
|
||||
2.14
|
||||
* NEW/IMPROVED:
|
||||
|
||||
@@ -4177,6 +4177,7 @@ VOID PhSetFileDialogFileName(
|
||||
else
|
||||
{
|
||||
OPENFILENAME *ofn = (OPENFILENAME *)FileDialog;
|
||||
SIZE_T length;
|
||||
|
||||
if (wcschr(FileName, '/') || wcschr(FileName, '\"'))
|
||||
{
|
||||
@@ -4185,8 +4186,11 @@ VOID PhSetFileDialogFileName(
|
||||
}
|
||||
|
||||
PhFree(ofn->lpstrFile);
|
||||
ofn->nMaxFile = max((ULONG)wcslen(FileName) + 1, 0x400);
|
||||
ofn->lpstrFile = PhAllocateCopy(FileName, ofn->nMaxFile * 2);
|
||||
|
||||
length = wcslen(FileName);
|
||||
ofn->nMaxFile = max(length + 1, 0x400);
|
||||
ofn->lpstrFile = PhAllocate(ofn->nMaxFile * 2);
|
||||
memcpy(ofn->lpstrFile, FileName, (length + 1) * 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user