Am 05.10.2014 12:28 schrieb "Jürgen Hestermann" <juergen.hesterm...@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
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal