2
$Id: dynlibs.inc,v 1.3 2002/09/07 16:01:24 peter Exp $
3
This file is part of the Free Pascal run time library.
4
Copyright (c) 1999-2000 by the Free Pascal development team
6
Implements OS dependent part for loading of dynamic libraries.
8
See the file COPYING.FPC, included in this distribution,
9
for details about the copyright.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
**********************************************************************}
18
{$ifdef readinterface}
20
{ ---------------------------------------------------------------------
21
Interface declarations
22
---------------------------------------------------------------------}
32
{ ---------------------------------------------------------------------
33
Implementation section
34
---------------------------------------------------------------------}
39
function LoadLibrary (Name: AnsiString): TLibHandle;
41
ErrPath: array [0..259] of char;
44
if DosLoadModule (@ErrPath, SizeOf (ErrPath), PChar (Name), Handle) <> 0
45
then Result := Handle else Result := NilHandle;
48
function GetProcedureAddress (Lib: TLibHandle; ProcName: AnsiString): pointer;
52
if DosQueryProcAddr (Lib, 0, PChar (ProcName), P) = 0 then Result := P
56
function UnloadLibrary (Lib: TLibHandle): boolean;
58
Result := DosFreeModule (Lib) = 0;
65
Revision 1.3 2002/09/07 16:01:24 peter
66
* old logs removed and tabs fixed