diff options
Diffstat (limited to 'rtl/os2/dynlibs.inc')
-rw-r--r-- | rtl/os2/dynlibs.inc | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/rtl/os2/dynlibs.inc b/rtl/os2/dynlibs.inc index ac37305fe1..bd791ea857 100644 --- a/rtl/os2/dynlibs.inc +++ b/rtl/os2/dynlibs.inc @@ -54,7 +54,10 @@ begin if DynLibErrNo = 0 then Result := Handle else - Result := NilHandle; + begin + Result := NilHandle; + OSErrorWatch (DynLibErrNo); + end; end; function GetProcedureAddress (Lib: TLibHandle; const ProcName: AnsiString): pointer; @@ -66,7 +69,10 @@ begin if DynLibErrNo = 0 then Result := P else - Result := nil; + begin + Result := nil; + OSErrorWatch (DynLibErrNo); + end; end; function GetProcedureAddress (Lib: TLibHandle; Ordinal: TOrdinalEntry): pointer; @@ -78,7 +84,10 @@ begin if DynLibErrNo = 0 then Result := P else - Result := nil; + begin + Result := nil; + OSErrorWatch (DynLibErrNo); + end; end; function UnloadLibrary (Lib: TLibHandle): boolean; @@ -86,6 +95,8 @@ begin DynLibErrPath [0] := #0; DynLibErrNo := DosFreeModule (Lib); Result := DynLibErrNo = 0; + if DynLibErrNo <> 0 then + OSErrorWatch (DynLibErrNo); end; function GetDynLibsError: longint; @@ -106,18 +117,23 @@ begin GetDynLibsErrorStr := '' else begin + Result := ''; VarArr [1] := @DynLibErrPath [0]; RC := DosGetMessage (@VarArr, 1, @OutBuf [0], SizeOf (OutBuf), DynLibErrNo, @SysMsgFile [0], RetMsgSize); if RC = 0 then - Result := StrPas (@OutBuf [0]) + begin + SetLength (Result, RetMsgSize); + Move (OutBuf [0], Result [1], RetMsgSize); + end else begin Str (DynLibErrNo, Result); Result := 'Error ' + Result; + if DynLibErrPath [0] <> #0 then + Result := StrPas (@DynLibErrPath [0]) + ' - ' + Result; + OSErrorWatch (RC); end; - if DynLibErrPath [0] <> #0 then - Result := StrPas (@DynLibErrPath [0]) + ' - ' + Result; end; end; |