<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 1 April 2016 at 21:09, Bart <span dir="ltr"><<a href="mailto:bartjunk64@gmail.com" target="_blank">bartjunk64@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On 4/1/16, Denis Kozlov <<a href="mailto:dezlov@gmail.com" target="_blank">dezlov@gmail.com</a>> wrote:<br>
<br>
> This issue also affects Lazarus 1.6 and FPC 3.0+.<br>
><br>
> GetWindowsSpecialDir in FPC 3.0.0 and trunk has severe encoding and buffer<br>
> overrun issues. SHGetFolderPath links to SHGetFolderPathW if<br>
> FPC_UNICODE_RTL is defined. But GetWindowsSpecialDir still calls it as<br>
> SHGetFolderPathA, passing under-sized PChar buffer instead of PWideChar.<br>
<br>
GetAppConfigDirUTF8 on Windows uses SHGetFolderPathW directly and then<br>
does Utf16ToUtf8 on the result.<br>
Bypassig the GetWindowsSpecialDir in fpc completely.<br>
(revision 43495 by bart, Thu Nov 28 18:37:44 2013)<br>
<br>
Bart<br></blockquote><div><br></div><div><br></div><div>Yes, Lazarus 1.7 uses SHGetFolderPath directly. Lazarus 1.6 fixes branch still uses GetWindowsSpecialDir.</div><div><br></div><div>This patch should fix <span style="font-size:12.8px">GetWindowsSpecialDir, GetAppConfigDir and GetAppConfigFile in FPC:</span><br></div></div><div class="gmail_quote"><div><a href="http://bugs.freepascal.org/view.php?id=29942" target="_blank">http://bugs.freepascal.org/view.php?id=29942</a><br></div><div><br></div><div>Maybe LCL can then use FPC's implementation?</div><div><br></div><div>Denis</div></div></div></div>