From 722514e842f023b8d638fc80d11748ffb97b150a Mon Sep 17 00:00:00 2001 From: Guillaume Bougard Date: Wed, 8 Aug 2018 12:00:16 +0200 Subject: [PATCH] Fix physical memory error correction detection via WMI --- Changes | 5 +++++ .../Agent/Task/Inventory/Win32/Memory.pm | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Changes b/Changes index 7efb53ac5d..c22f6cf88e 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ Revision history for FusionInventory agent +2.4.2 not released yet + +inventory: +* Fix physical memory error correction detection via WMI under win32 + 2.4.1 Fri, 29 Jun 2018 core: diff --git a/lib/FusionInventory/Agent/Task/Inventory/Win32/Memory.pm b/lib/FusionInventory/Agent/Task/Inventory/Win32/Memory.pm index 7dc8a9cf68..a59be51443 100644 --- a/lib/FusionInventory/Agent/Task/Inventory/Win32/Memory.pm +++ b/lib/FusionInventory/Agent/Task/Inventory/Win32/Memory.pm @@ -136,7 +136,7 @@ sub _getMemories { foreach my $object (getWMIObjects( class => 'Win32_PhysicalMemoryArray', properties => [ qw/ - MemoryDevices SerialNumber PhysicalMemoryCorrection + MemoryDevices SerialNumber MemoryErrorCorrection / ] )) { @@ -145,14 +145,14 @@ sub _getMemories { $memory->{SERIALNUMBER} = $object->{SerialNumber}; } - if ($object->{PhysicalMemoryCorrection}) { + if ($object->{MemoryErrorCorrection}) { $memory->{MEMORYCORRECTION} = $memoryErrorProtection[$object->{PhysicalMemoryCorrection}]; + if ($memory->{MEMORYCORRECTION}) { + $memory->{DESCRIPTION} .= " (".$memory->{MEMORYCORRECTION}.")"; + } } - if ($memory->{MEMORYCORRECTION}) { - $memory->{DESCRIPTION} .= " (".$memory->{MEMORYCORRECTION}.")"; - } } return @memories;