Hardware/RAM/RAMGroup.cs
author moel.mich
Sun, 23 Sep 2012 18:37:43 +0000
changeset 380 573f1fff48b2
parent 370 8e4dedc41924
permissions -rw-r--r--
Fixed Issue 387. The new implementation does not try to start a ring 0 driver that already exists, but could not be opened. It tries to delete the driver and install it new. The driver is now stored temporarily in the application folder. The driver is not correctly removed on system shutdown.
     1 /*
     2  
     3   This Source Code Form is subject to the terms of the Mozilla Public
     4   License, v. 2.0. If a copy of the MPL was not distributed with this
     5   file, You can obtain one at http://mozilla.org/MPL/2.0/.
     6  
     7   Copyright (C) 2012 Michael Möller <mmoeller@openhardwaremonitor.org>
     8 	
     9 */
    10 
    11 using System;
    12 
    13 namespace OpenHardwareMonitor.Hardware.RAM {
    14   internal class RAMGroup : IGroup {
    15 
    16     private IHardware[] hardware;
    17 
    18     public RAMGroup(SMBIOS smbios, ISettings settings) {
    19 
    20       // No implementation for RAM on Unix systems
    21       int p = (int)Environment.OSVersion.Platform;
    22       if ((p == 4) || (p == 128)) {
    23         hardware = new IHardware[0];
    24         return;
    25       }
    26 
    27       string name;
    28       if (smbios.MemoryDevices.Length > 0) {
    29         name = smbios.MemoryDevices[0].ManufacturerName + " " + 
    30           smbios.MemoryDevices[0].PartNumber;
    31       } else {
    32         name = "Generic Memory";
    33       }
    34 
    35       hardware = new IHardware[] { new GenericRAM(name, settings) };
    36     }
    37 
    38     public string GetReport() {
    39       return null;
    40     }
    41 
    42     public IHardware[] Hardware {
    43       get {
    44         return hardware;
    45       }
    46     }
    47 
    48     public void Close() {
    49 
    50     }
    51   }
    52 }