Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Rousse authored and Guillaume Rousse committed Jan 10, 2012
1 parent 424adaf commit e9cbeec
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions lib/FusionInventory/Agent/Task/Inventory/Input/Generic/Screen.pm
Expand Up @@ -129,26 +129,17 @@ sub _getScreensFromWindows {
my @ret;
foreach my $PNPDeviceID (keys %{$devices}) {

my $KEY_WOW64_64KEY = 0x100;

my $machKey;
{
my $KEY_WOW64_64KEY = 0x100;
my $access = FusionInventory::Agent::Tools::Win32::is64bit() ?
Win32::TieRegistry::KEY_READ() | $KEY_WOW64_64KEY :
Win32::TieRegistry::KEY_READ();

my $access;

if (FusionInventory::Agent::Tools::Win32::is64bit()) {
$access = Win32::TieRegistry::KEY_READ() | $KEY_WOW64_64KEY;
} else {
$access = Win32::TieRegistry::KEY_READ();
}

# Win32-specifics constants can not be loaded on non-Windows OS
no strict 'subs';
$machKey = $Registry->Open('LMachine', {
Access => $access
} ) or $logger->fault("Can't open HKEY_LOCAL_MACHINE key: $EXTENDED_OS_ERROR");

}
my $machKey = $Registry->Open('LMachine', {
Access => $access
} ) or $logger->fault(
"Can't open HKEY_LOCAL_MACHINE key: $EXTENDED_OS_ERROR"
);

$devices->{$PNPDeviceID}{edid} =
$machKey->{"SYSTEM/CurrentControlSet/Enum/".$PNPDeviceID."/Device Parameters/EDID"} || '';
Expand Down

0 comments on commit e9cbeec

Please sign in to comment.