2
This file is part of the Free Pascal run time library.
3
Copyright (c) 1999-2000 by the Free Pascal development team
5
Implements OS dependent part for loading of dynamic libraries.
7
See the file COPYING.FPC, included in this distribution,
8
for details about the copyright.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
**********************************************************************}
17
{$ifdef readinterface}
19
{ ---------------------------------------------------------------------
20
Interface declarations
21
---------------------------------------------------------------------}
31
{ ---------------------------------------------------------------------
32
Implementation section
33
---------------------------------------------------------------------}
38
function LoadLibrary (Name: AnsiString): TLibHandle;
40
ErrPath: array [0..259] of char;
43
if DosLoadModule (@ErrPath, SizeOf (ErrPath), PChar (Name), Handle) = 0
44
then Result := Handle else Result := NilHandle;
47
function GetProcedureAddress (Lib: TLibHandle; ProcName: AnsiString): pointer;
51
if DosQueryProcAddr (Lib, 0, PChar (ProcName), P) = 0 then Result := P
55
function UnloadLibrary (Lib: TLibHandle): boolean;
57
Result := DosFreeModule (Lib) = 0;