[fpc-devel] Some more THandle problems
Sergei Gorelkin
sergei_gorelkin at mail.ru
Sat Nov 20 15:00:17 CET 2010
Marco van de Voort пишет:
> In our previous episode, Sergei Gorelkin said:
>>> 2. THandleStream has a field FHandle which is defined as Integer. Now
>>> this handle is filled either by the constructor which takes an Integer
>>> as well or by e.g. TFileStream which gets its handle from
>>> FileOpen/FileCreate. Those return a THandle and you might guess what
>>> happens if a value >= 2^32 is returned. ^^
>>>
>> 1 and 2 fixed in rev. 16383
>
> Is it wise to recycle thandle for that? Windows has a system where all
> handles are of the same type, but other systems might not. (and have
> different handles for e.g. dynloaded shared libs and files).
>
I won't say it is very wise, but it is anyway more consistent than using both THandle and
Integer/Longint to represent the same handle type (namely file handles) all over the place.
Sergei
More information about the fpc-devel
mailing list