[fpc-pascal] Syserrormessage, parameter data type

Sven Barth pascaldragon at googlemail.com
Sun Oct 5 20:21:38 CEST 2014


Am 05.10.2014 12:28 schrieb "Jürgen Hestermann" <juergen.hestermann at gmx.de>:
>
>
> Am 2014-10-05 um 12:10 schrieb Michael Van Canneyt:
>
>> Not necessarily, because it is a cross-platform function and on other
systems the error codes are not necessarily positive values.
>> Unfortunately, this kind of windows-api-creep is found throughout the
RTL.
>>
>> The proper procedure is probably to introduce TSysErrorCode which
depends on the platform, and replace integer/dword with that.
>> Please file a bug-report, so we do not forget this.
>
>
> But the current situation is wrong for *all* plattforms because the
sequence DWORD-INTEGER-DWORD
> does not work and when it becomes INTEGER-INTEGER-DWORD it doesn't work
either.
> The FormatMessageA call within SysErrorMessage expects DWORD too but an
INTEGER is provided.

Please note that GetLastError is Windows-specific. The cross platform
function in SysUtils is called GetLastOSError which does return Integer.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20141005/dd453cfa/attachment.html>


More information about the fpc-pascal mailing list