/* Copyright (C) 2008-2016 Peter Palotas, Jeffrey Jangli, Alexandr Normuradov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ using Alphaleonis.Win32.Network; using System; using System.Collections.Generic; using System.Security; using System.Security.Permissions; namespace Alphaleonis.Win32.Filesystem { /// Provides access to information of a device, on a local or remote host. [SecurityPermission(SecurityAction.InheritanceDemand, UnmanagedCode = true)] [SerializableAttribute] [SecurityCritical] public sealed class DeviceInfo { #region Constructors /// Initializes a DeviceInfo class. [SecurityCritical] public DeviceInfo() { HostName = Host.GetUncName(); } /// Initializes a DeviceInfo class. /// The DNS or NetBIOS name of the remote server. refers to the local host. [SecurityCritical] public DeviceInfo(string host) { HostName = Host.GetUncName(host).Replace(Path.UncPrefix, string.Empty); } #endregion // Constructors #region Methods /// Enumerates all available devices on the local host. /// One of the devices. /// instances of type from the local host. [SecurityCritical] public IEnumerable EnumerateDevices(DeviceGuid deviceGuid) { return Device.EnumerateDevicesCore(null, HostName, deviceGuid); } #endregion // Methods #region Properties /// Represents the value of the base container identifier (ID) .The Windows Plug and Play (PnP) manager assigns this value to the device node (devnode). public Guid BaseContainerId { get; internal set; } /// Represents the name of the device setup class that a device instance belongs to. public string Class { get; internal set; } /// Represents the of the device setup class that a device instance belongs to. public Guid ClassGuid { get; internal set; } /// Represents the list of compatible identifiers for a device instance. public string CompatibleIds { get; internal set; } /// Represents a description of a device instance. public string DeviceDescription { get; internal set; } /// The device interface path. public string DevicePath { get; internal set; } /// Represents the registry entry name of the driver key for a device instance. public string Driver { get; internal set; } /// Represents the name of the enumerator for a device instance. public string EnumeratorName { get; internal set; } /// Represents the friendly name of a device instance. public string FriendlyName { get; internal set; } /// Represents the list of hardware identifiers for a device instance. public string HardwareId { get; internal set; } /// The host name that was passed to the class constructor. public string HostName { get; internal set; } /// Gets the instance Id of the device. public string InstanceId { get; internal set; } /// Represents the bus-specific physical location of a device instance. public string LocationInformation { get; internal set; } /// Represents the location of a device instance in the device tree. public string LocationPaths { get; internal set; } /// Represents the name of the manufacturer of a device instance. public string Manufacturer { get; internal set; } /// Encapsulates the physical device location information provided by a device's firmware to Windows. public string PhysicalDeviceObjectName { get; internal set; } /// Represents the name of the service that is installed for a device instance. public string Service { get; internal set; } #endregion // Properties } }