Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005902 [JEDI VCL] 00 JVCL Components crash always 2012-06-07 17:14 2012-09-10 14:15
Reporter Arioch View Status public  
Assigned To AHUser
Priority normal Resolution fixed  
Status resolved   Product Version
Summary 0005902: LoadDLL was sent into death spirale
Description // $Id: JvJCLUtils.pas,v 1.174 2006/02/16 20:28:05 ahuser Exp $
 
function LoadDLL(const LibName: string): THandle;
var
  ErrMode: Cardinal;
begin
  ErrMode := SetErrorMode(SEM_NOOPENFILEERRORBOX);
  Result := LoadLibrary(PChar(LibName));
  SetErrorMode(ErrMode);
  if Result < HINSTANCE_ERROR then
    OSCheck(False);
end;

---------------
// $Id: JvJCLUtils.pas 13219 2012-02-24 10:56:45Z obones $

{$IFDEF MSWINDOWS}
{ Service routines }

function LoadDLL(const LibName: string): THandle;
begin
  Result := SafeLoadLibrary(LibName);
  if Result <> 0 then
    OSCheck(False);
end;
Additional Information I believe that the condition should be reverted.

function LoadDLL(const LibName: string): THandle;
begin
  Result := SafeLoadLibrary(LibName);
  if Result < HINSTANCE_ERROR then
    OSCheck(False);
end;
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0019810)
AHUser (developer)
2012-06-09 11:02

Fixed in svn revision 13308.

You shouldn't use HINSTANCE_ERROR in combination with (Safe)LoadLibrary. LoadLibrary returns zero if it fails.

- Issue History
Date Modified Username Field Change
2012-06-07 17:14 Arioch New Issue
2012-06-09 11:02 AHUser Note Added: 0019810
2012-06-09 11:02 AHUser Status new => resolved
2012-06-09 11:02 AHUser Fixed in Version => Daily / SVN
2012-06-09 11:02 AHUser Resolution open => fixed
2012-06-09 11:02 AHUser Assigned To => AHUser
2012-09-10 14:15 obones Fixed in Version Daily / SVN => 3.46


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker