[fpc-devel] THandle and 64bit platforms
Tomas Hajny
hajny at freepascal.org
Mon Dec 20 22:19:11 CET 2004
Date sent: Mon, 20 Dec 2004 22:50:06 +0100 (CET)
From: Michael.VanCanneyt at Wisa.be
To: XHajT03 at vol.cz,
"FPC developers' list" <fpc-devel at lists.freepascal.org>
Subject: RE: [fpc-devel] THandle and 64bit platforms
Copies to: Send reply to: FPC developers' list <fpc-devel at lists.freepascal.org>
<mailto:fpc-devel-request at lists.freepascal.org?subject=unsubscribe>
<mailto:fpc-devel-request at lists.freepascal.org?subject=subscribe>
.
.
> > > > > > In the LCL a THandle is used everywhere and in most cases it
> > > > > > represents a pointer. It is also part of the emulated
> > > > > > message records. All members of it are defined as PtrInt. On
> > > > > > placed where a handle is iused, it should map on a PtrInt.
> > .
> > .
> In principle, a windows handle is an 'opaque' type.
> You're not supposed to make any assumptions about it's size or
> internal structure.
>
> That Windows uses the same handle type for the I/O API and it's GUI
> subsystem is an unfortunate coincidence.
Probably more design decision than "coincidence" - the same type is
used for everything, not just I/O and GUI, but processes, threads and
all kinds of system resources too.
> Thinking about it some more I think the more 'correct' choice for
> Lazarus is to introduce a TLCLHandle type, which will be equal to a
> HANDLE (or THANDLE) type on Windows, but which probably will equal a
> pointer under e.g. GTK, and hence a 64-bit pointer on 64-bit
> platforms.
>
> This will take some work :-)
.
.
Would THandle exist on non-Windows platforms under your concept then?
If so, what would it be on Linux x86-64 (by pure coincidence, of
course ;-) )?
Tomas
More information about the fpc-devel
mailing list