On Thu, 20 Mar 2014 13:02:28 +0100 (CET), Michael Van Canneyt 
<mich...@freepascal.org> wrote:
>
> Shortly said: No. The Delphi API is wrong; It should also return THandle 
> (as that is what Windows CreateFile returns), but probably for historical 
> reasons they still use Integer. 
> With the advent of 64-bit delphi, they could have cleaned up their API, but 
> Alas...
>

    I did try googling and it appears, that in 64 bit Delphi XE2 uses THandle 
as a result type. Anyway, in the case of error, it returns 
INVALID_HANDLE_VALUE, 
which is DWORD(-1).
   So, under Windows it would be possible to use same code, if you compare 
result 
against INVALID_HANDLE_VALUE. And you should be able safely cast return value 
to 
THandle for that (and use variable of that type). 
   I really don't know, how it would work on linux, because sys_open seems to 
return 
int there.

-- 
Virgo Pärna 
virgo.pa...@mail.ee

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to