Einzelnen Beitrag anzeigen

TiGü

Registriert seit: 6. Apr 2011
Ort: Berlin
3.070 Beiträge
 
Delphi 10.4 Sydney
 
#3

AW: WMI-Abfrage zur Ermittlung des Speichertyps fehlerhaft

  Alt 3. Mär 2017, 10:13
Ich meine da gibt es auch einen Unterschied zwischen den Daten in root\CIMV2\Win32_PhysicalMemory und dem was in root\WMI\MSSmBios_RawSMBiosTables steht.
Da steht zumindest bei mir aber nicht der genaue Typ (DDR1, DDR2, DDR3...etc.) mit dabei.

Delphi-Quellcode:
//-----------------------------------------------------------------------------------------------------
// This code was generated by the Wmi Delphi Code Creator (WDCC) Version 1.9.9.350
// http://code.google.com/p/wmi-delphi-code-creator/
// Blog http://theroadtodelphi.wordpress.com/wmi-delphi-code-creator/
// Author Rodrigo Ruz V. (RRUZ) Copyright (C) 2011-2015
//-----------------------------------------------------------------------------------------------------
//
// LIABILITY DISCLAIMER
// THIS GENERATED CODE IS DISTRIBUTED "AS IS". NO WARRANTY OF ANY KIND IS EXPRESSED OR IMPLIED.
// YOU USE IT AT YOUR OWN RISK. THE AUTHOR NOT WILL BE LIABLE FOR DATA LOSS,
// DAMAGES AND LOSS OF PROFITS OR ANY OTHER KIND OF LOSS WHILE USING OR MISUSING THIS CODE.
//
//----------------------------------------------------------------------------------------------------
program GetWMI_Info;

{$APPTYPE CONSOLE}

uses
  SysUtils,
  ActiveX,
  ComObj,
  Variants,
  Classes;
  

    
// Raw SMBIOS Tables

procedure GetMSSmBios_RawSMBiosTablesInfo;
const
  WbemUser ='';
  WbemPassword ='';
  WbemComputer ='localhost';
  wbemFlagForwardOnly = $00000020;
var
  FSWbemLocator : OLEVariant;
  FWMIService : OLEVariant;
  FWbemObjectSet: OLEVariant;
  FWbemObject : OLEVariant;
  oEnum : IEnumvariant;
  iValue : LongWord;
  SMBiosData: TBytes;
  StringStream: TStringStream;
begin;
  FSWbemLocator := CreateOleObject('WbemScripting.SWbemLocator');
  FWMIService := FSWbemLocator.ConnectServer(WbemComputer, 'root\WMI', WbemUser, WbemPassword);
  FWbemObjectSet:= FWMIService.ExecQuery('SELECT * FROM MSSmBios_RawSMBiosTables','WQL',wbemFlagForwardOnly);
  oEnum := IUnknown(FWbemObjectSet._NewEnum) as IEnumVariant;
  while oEnum.Next(1, FWbemObject, iValue) = 0 do
  begin
    Writeln(Format('Active %s',[String(FWbemObject.Active)]));// Boolean
    Writeln(Format('DmiRevision %d',[Integer(FWbemObject.DmiRevision)]));// Uint8
    Writeln(Format('InstanceName %s',[String(FWbemObject.InstanceName)]));// String
    Writeln(Format('Size %d',[Integer(FWbemObject.Size)]));// Uint32
    Writeln('SMBiosData:');// Array of Uint8
    StringStream := TStringStream.Create(TBytes(FWbemObject.SMBiosData));
    Writeln(StringStream.DataString);
    StringStream.Free;
    Writeln(Format('SmbiosMajorVersion %d',[Integer(FWbemObject.SmbiosMajorVersion)]));// Uint8
    Writeln(Format('SmbiosMinorVersion %d',[Integer(FWbemObject.SmbiosMinorVersion)]));// Uint8
    Writeln(Format('Used20CallingMethod %s',[String(FWbemObject.Used20CallingMethod)]));// Boolean
       
    Writeln('');
    FWbemObject:=Unassigned;
  end;
end;


begin
 try
    CoInitialize(nil);
    try
      GetMSSmBios_RawSMBiosTablesInfo;
    finally
      CoUninitialize;
    end;
 except
    on E:EOleException do
        Writeln(Format('EOleException %s %x', [E.Message,E.ErrorCode]));
    on E:Exception do
        Writeln(E.Classname, ':', E.Message);
 end;
 Writeln('Press Enter to exit');
 Readln;
end.
Code:
Size                  2937
SMBiosData:
ÿÿAmerican Megatrends Inc. V1.9 03/30/2015             ØËSzq.MSI MS-7817 1.0 To be filled by O.E.M. To be filled by O.E.M. To be filled by O.E.M.          
 MSI H81M-P33 (MS-7817) 1.0 To be filled by O.E.M. To be filled by O.E.M. To be filled by O.E.M.        J1A1 Keyboard    ÿJ2A1 TV Out            J2A2A COM A     J2A2B Video                  J3A1 USB1
 ÿ  ÿJ6C2 - EXT HDMI   ÿ  ÿJ3C1 - GMCH FAN  ÿ  ÿJ1D1 - ITP       ÿ  ÿJ9E2 - MDC INTPSR        ÿ  ÿJ9E4 - MDC INTPSR        ÿ  ÿJ9E3 - LPC HOT DOCKING   ÿ  ÿJ9E1 - SCAN MATRIX       ÿ  ÿJ9G1 - LPC SIDE BAND     ÿ  ÿJ   J6B2           ãJ6B1             äJ6D1             åJ7B1            æJ8B4             çJ8D1              ðJ8B3  ! To Be Filled By O.E.M. " To Be Filled By O.E.M. #     $                   " %     LM78-1  &   ? ? ? ? ?     ?LM78A $'         # ( % % & To Be Filled By O.E.M. )   ? ? ? ? ?     ?LM78A $*         # + % ( ) To Be Filled By O.E.M. , )      ?Cooling Dev 1  $-         # . % + , To Be Filled By O.E.M. / )      ?   $0         # 1 % . / To Be Filled By O.E.M. 2   ? ? ? ? ?     ?ABC $3  ? ? ? ? ? ?  # 4 % 1 / To Be Filled By O.E.M. 5 j ? ? ? ? ?     ?LM78A 6 j ? ? ? ? ?     ?LM78A 7 6 g     ?Cooling Dev 1  8 j ? ? ? ? ?     ?ABC '9  ?¢5 7 8 To Be Filled By O.E.M. To Be Filled By O.E.M. To Be Filled By O.E.M. To Be Filled By O.E.M. To Be Filled By O.E.M. To Be Filled By O.E.M. To Be Filled By O.E.M. )A$? > @   Í SOCKET 0 Intel Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz Fill By OEM Fill By OEM > ?     CPU Internal L2  ? ?     CPU Internal L1  @ '      CPU Internal L3  A    þÿ           (B A þÿ@ @            ? @    @ÜÜÜChannelA-DIMM0 BANK 0 1311 41061E3F 9876543210 M2F8G64CB8HD5N-DI  #C    ÿÿ B G ÿÿÿ                  (D A þÿ                         ChannelA-DIMM1 BANK 1 [Empty] [Empty] 9876543210 [Empty] (E A þÿ                               ChannelB-DIMM0 BANK 2 [Empty] [Empty] 9876543210 [Empty] (F A þÿ
                  ChannelB-DIMM1 BANK 3 [Empty] [Empty] 9876543210 [Empty] G    ÿÿ A                   ^K    ƒ@L 5           ø \O               Ê     È ÿÿ        f  vPro     ?M 
N                 en|US|iso8859-1  P  N/A N/A N/A N/A N/A N/A N/A N/A N/A
SmbiosMajorVersion    2
SmbiosMinorVersion    8
Used20CallingMethod   False
  Mit Zitat antworten Zitat