RRUZ / tsmbios

Library to access the SMBIOS using Object Pascal (Delphi, FPC).
https://theroadtodelphi.wordpress.com/
202 stars 72 forks source link

Access violoation in TSMBios.GetSMBiosTablesCount #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

While trying out your cool lib I get some access violations using it in my code 
and also using the example projects.

function TSMBios.GetSMBiosTablesCount: Integer;
Var
  Index : DWORD;
  Header: TSmBiosTableHeader;
begin
  Result    := 0;
  Index     := 0;
  repeat
    {$IFDEF FPC}{$HINTS OFF}{$ENDIF}
    Move(FRawSMBIOSData.SMBIOSTableData^[Index], Header, SizeOf(Header));

--> Error occours here with an access violation because of 
FRawSMBIOSData.SMBIOSTableData is nil

    .
    .
    .

What version of the product are you using? On what operating system?
Revision 105, updated today by google code svn repository, running on Windows 
8.1 Pro, using Delphi XE 4

Please provide any additional information below.
If you need further information, please contact me, micharath@googlemail.com

kind regard
Michael

Original issue reported on code.google.com by michar...@googlemail.com on 19 Oct 2013 at 12:35

GoogleCodeExporter commented 9 years ago
I cannot reproduce your issue. Anyway maybe is related to the WMI Services or 
your permissions to access the MSSmBios_RawSMBiosTables WMI class ( The default 
mode to extract the SMBIOS info is using the WMI), you can switch to WinAPI 
just looking and commenting this line in the uSMBIOS unit {$DEFINE USEWMI} . 
Try that and let me know the results.

Original comment by Rodrigo.Ruz.V@gmail.com on 20 Oct 2013 at 1:10

GoogleCodeExporter commented 9 years ago
I see the same problem working with Lazarus 64Bit 1.0.12 on Ubuntu Precise 64 
Bit
running lazarus as root.
The same code runs without any problem compiled at Ubuntu Precise 32 Bit with 
Lazarus 32Bit (1.0.12)
The same code runs without any problem compiled at Windows7-x64 with Lazarus 
32Bit (1.0.12)
I did no tests with lazarus 64 Bit at Windows.
Is it a 32/64 Bit Problem ?

Original comment by d.oerte...@googlemail.com on 19 Feb 2014 at 4:36

GoogleCodeExporter commented 9 years ago
Additional observation:
running the 32bit linux binary (which works at 32bit linux) on a 64bit 
ms-surface pro with a 64 bit ubuntu) leads to an access violation too.

regards
d.oertel

Original comment by d.oerte...@googlemail.com on 19 Feb 2014 at 8:26