View Issue Details

IDProjectCategoryView StatusLast Update
0002378JEDI VCL00 JVCL Componentspublic2004-12-14 01:48
ReporterdbarrosAssigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.00 BETA 2 
Target VersionFixed in Version3.00 RC 1 
Summary0002378: TJvVersionInfo access violation reading properties when file does not exist.
DescriptionWhen creating a TJvVersionInfo, and passing it a filename of a file that does not exists, access violations occur when subsequently trying to read some properties.
Additional InformationHere is an example:

v := TJvVersionInfo.Create(Filename);
_comments := v.Comments;
_companyName := v.CompanyName;
_versionMajor := (HiWord(v.FileLongVersion.MS) shl 16) or (LoWord(v.FileLongVersion.MS));

When the file "Filename" does not exist, the component sets itself to an "Invalid" state. Most properties, like Comments and CompanyName, check its state and return a default even the Filename does not exist.

In the case of the FileLongVersion property, it does not do the check and contains code which is set to nil and hence causes access violations.

Here is a snippet from JvVersionInfo.pas which shows this:

function TJvVersionInfo.GetProductLongVersion: TLongVersion;
begin
    Result.MS := FixedFileInfo^.dwProductVersionMS;
    Result.LS := FixedFileInfo^.dwProductVersionLS;
end;

TagsNo tags attached.

Activities

2004-12-13 15:50

 

JvVersionInfo.pas (12,241 bytes)

dbarros

2004-12-13 15:51

reporter   ~0005878

I have uploaded a fix in the attached file.

user72

2004-12-14 01:48

  ~0005881

Fixed in CVS

Issue History

Date Modified Username Field Change
2004-12-13 15:14 dbarros New Issue
2004-12-13 15:50 dbarros File Added: JvVersionInfo.pas
2004-12-13 15:51 dbarros Note Added: 0005878
2004-12-14 01:48 user72 Status new => resolved
2004-12-14 01:48 user72 Resolution open => fixed
2004-12-14 01:48 user72 Assigned To => user72
2004-12-14 01:48 user72 Note Added: 0005881
2004-12-14 01:48 user72 Assigned To user72 =>