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.
If GetLastError sometimes gives back a DWORD (Windows) and sometimes an INTEGER
(Linux) then
the complete sequence GetLastError-SysErrorMessage-FormatMessageA needs to
become platform
dependend to solve this. But as long as this is not the case at least one
platform (Windows) would
work okay when the parameter in SysErrorMessage becomes DWORD too. In the
current situation
it *never* works correctly (not even for Linux).
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal