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

Denis Kozlov dezlov at gmail.com
Fri Apr 1 18:36:40 CEST 2016


On 1 April 2016 at 16:55, Denis Kozlov <dezlov at gmail.com> wrote:

> In Lazarus 1.4.4, GetAppConfigDirUTF8 and GetAppConfigFileUTF8 internally
> use GetAppConfigDirAnsi and GetAppConfigFileAnsi (unless running on Windows
> CE), respectively. These functions call ANSI version of Windows API and
> then map the result into UTF8.
>
> If there are characters in the path which do not exist in your current
> system ANSI code page, then you would get question marks instead,
> e.g. "Configura??es".
>


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.

Working on a fix.

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


More information about the Lazarus mailing list