mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
[SHELL32]
For the input string, WideCharToMultiByte takes a char count and not a buffer size. CID 1401096, 1401088 svn path=/trunk/; revision=73845
This commit is contained in:
parent
e78b6c5179
commit
7fb841c839
1 changed files with 6 additions and 2 deletions
|
@ -1074,13 +1074,17 @@ HRESULT STDMETHODCALLTYPE CShellLink::GetPath(LPSTR pszFile, INT cchMaxPath, WIN
|
|||
/* Copy the file data if a file path was returned */
|
||||
if (*pszFile)
|
||||
{
|
||||
DWORD len;
|
||||
|
||||
/* Copy the fixed part */
|
||||
CopyMemory(pfd, &wfd, FIELD_OFFSET(WIN32_FIND_DATAA, cFileName));
|
||||
|
||||
/* Convert the file names to ANSI */
|
||||
WideCharToMultiByte(CP_ACP, 0, wfd.cFileName, sizeof(wfd.cFileName),
|
||||
len = lstrlenW(wfd.cFileName);
|
||||
WideCharToMultiByte(CP_ACP, 0, wfd.cFileName, len + 1,
|
||||
pfd->cFileName, sizeof(pfd->cFileName), NULL, NULL);
|
||||
WideCharToMultiByte(CP_ACP, 0, wfd.cAlternateFileName, sizeof(wfd.cAlternateFileName),
|
||||
len = lstrlenW(wfd.cAlternateFileName);
|
||||
WideCharToMultiByte(CP_ACP, 0, wfd.cAlternateFileName, len + 1,
|
||||
pfd->cAlternateFileName, sizeof(pfd->cAlternateFileName), NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue