Revision: 9409 https://osdn.net/projects/ttssh2/scm/svn/commits/9409 Author: zmatsuo Date: 2021-09-11 00:51:15 +0900 (Sat, 11 Sep 2021) Log Message: ----------- _SHBrowseForFolderW() の実装が誤っていたので修正 - pszDisplayName を正しく返していなかった - Tera Term では使用していないメンバーだった - メモリを壊す可能性の高い不具合だった Modified Paths: -------------- trunk/teraterm/layer_for_unicode/layer_for_unicode.cpp -------------- next part -------------- Modified: trunk/teraterm/layer_for_unicode/layer_for_unicode.cpp =================================================================== --- trunk/teraterm/layer_for_unicode/layer_for_unicode.cpp 2021-09-10 15:51:03 UTC (rev 9408) +++ trunk/teraterm/layer_for_unicode/layer_for_unicode.cpp 2021-09-10 15:51:15 UTC (rev 9409) @@ -476,16 +476,17 @@ LPITEMIDLIST WINAPI _SHBrowseForFolderW(LPBROWSEINFOW lpbi) { + char display_name[MAX_PATH]; BROWSEINFOA biA; biA.hwndOwner = lpbi->hwndOwner; biA.pidlRoot = lpbi->pidlRoot; - biA.pszDisplayName = ToCharW(lpbi->pszDisplayName); + biA.pszDisplayName = display_name; biA.lpszTitle = ToCharW(lpbi->lpszTitle); biA.ulFlags = lpbi->ulFlags; biA.lpfn = lpbi->lpfn; biA.lParam = lpbi->lParam; LPITEMIDLIST pidlBrowse = SHBrowseForFolderA(&biA); - free(biA.pszDisplayName); + ACPToWideChar_t(display_name, lpbi->pszDisplayName, MAX_PATH); free((void *)biA.lpszTitle); return pidlBrowse;