[Lazarus] GetAppConfigDir on Windows XP (PT-BR): Configura??es

Denis Kozlov dezlov at gmail.com
Fri Apr 1 22:36:50 CEST 2016


On 1 April 2016 at 21:09, Bart <bartjunk64 at gmail.com> wrote:

> On 4/1/16, Denis Kozlov <dezlov at gmail.com> wrote:
>
> > This issue also affects Lazarus 1.6 and FPC 3.0+.
> >
> > GetWindowsSpecialDir in FPC 3.0.0 and trunk has severe encoding and
> buffer
> > overrun issues. SHGetFolderPath links to SHGetFolderPathW if
> > FPC_UNICODE_RTL is defined. But GetWindowsSpecialDir still calls it as
> > SHGetFolderPathA, passing under-sized PChar buffer instead of PWideChar.
>
> GetAppConfigDirUTF8 on Windows uses SHGetFolderPathW directly and then
> does Utf16ToUtf8 on the result.
> Bypassig the GetWindowsSpecialDir in fpc completely.
> (revision 43495 by bart, Thu Nov 28 18:37:44 2013)
>
> Bart
>


Yes, Lazarus 1.7 uses SHGetFolderPath directly. Lazarus 1.6 fixes branch
still uses GetWindowsSpecialDir.

This patch should fix GetWindowsSpecialDir, GetAppConfigDir
and GetAppConfigFile in FPC:
http://bugs.freepascal.org/view.php?id=29942

Maybe LCL can then use FPC's implementation?

Denis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160401/360c6c01/attachment-0003.html>


More information about the Lazarus mailing list