장치 또는 PnP 개체의 추가 속성을 검색하는 방법(HTML)

[ 이 문서는 Windows 런타임 앱을 작성하는 Windows에서 8.x 및 Windows Phone 8.x 개발자를 대상으로 합니다. Windows 10용으로 개발하는 경우에는 최신 설명서를 참조하세요.]

DeviceInformation 또는 PnpObject에서 추가 장치 속성을 가져오는 방법을 설명합니다.

추가 속성 지정

기본적으로 findAllAsynccreateWatcher는 다음 속성을 갖는 DeviceInformation 개체를 반환합니다.

속성 정식 이름
Id 해당 없음 이 속성은 개체의 ID입니다.
이름 System.ItemNameDisplay
IsDefault System.Devices.IsDefault
IsEnabled System.Devices.InterfaceEnabled
EnclosureLocation System.Devices.PhysicalDeviceLocation

 

DeviceInformationPnpObject 클래스에 제공되는 findAllAsynccreateWatcher 메서드의 오버로드된 형식을 사용할 수 있습니다. 다음과 같이 additionalProperties 매개 변수를 사용하여 결과에 포함할 추가 속성을 지정할 수 있습니다.



// Create a set of two additional properties.
    var propertiesToRetrieve = new Array();
    propertiesToRetrieve.push("System.Devices.InterfaceClassGuid");
    propertiesToRetrieve.push("System.Devices.ContainerId");

    Windows.Devices.Enumeration.findAllAsync(selectorString, 
             propertiesToRetrieve).then(successCallback, errorCallback);)

// Handles successful completion of the findAllAsync method.
function successCallback(deviceInformationCollection) {
    var numDevices = deviceInformationCollection.length;
    if (numDevices) {
        for (var i = 0; i < numDevices; i++) {
            printProperties(document.getElementById("log"),
                 deviceInformationCollection[i].properties);
        }
    } 
}

// Handles an error completion of the findAllAsync method.
function errorCallback(e) {
    document.getElementById("statusMessage").innerHTML = 
        "Failed to find devices, error: " + e.message;
}

function printProperties(log, prop) {
    log.innerHTML += "property store count is: " + prop.size;
    var pt = prop.first();
    while (pt.hasCurrent) {
        log.innerHTML += "<br />" + pt.current.key + " := " + pt.current.value;
        pt.moveNext();
    }
    log.innerHTML += "<br />";
}

정식 속성 목록

속성 값이 특정 장치 인터페이스와 관련이 없는 경우 인터페이스가 속한 장치 또는 제조업체나 모델 이름과 같은 장치 하드웨어 제품의 시각적 측면을 나타내는 장치 컨테이너 개체와 연관되어 있을 수 있습니다. 다음은 장치 인터페이스, 장치 및 장치 컨테이너에 대한 속성 이름의 목록입니다. 개체 유형을 탐색하는 방법에 대한 알아보려면 관련 PnP 개체 검색을 참조하세요.

장치 인터페이스 속성

이름 속성 설명

System.Devices.ContainerId

DEVPKEY_Device_ContainerId

장치 인터페이스 컨테이너의 ID입니다.

System.Devices.DeviceInstanceId

DEVPKEY_Device_InstanceId

이 인터페이스가 속한 장치의 장치 인스턴스 ID입니다.

System.Devices.InterfaceClassGuid

DEVPKEY_DeviceInterface_ClassGuid

인터페이스의 클래스 GUID입니다.

System.Devices.InterfaceEnabled

DEVPKEY_DeviceInterface_Enabled

인터페이스를 사용할 수 있는지 여부를 나타냅니다.

System.ItemNameDisplay

DEVPKEY_NAME

장치 인터페이스의 표시 이름입니다.

System.Storage.IsMediaRemovable

DEVPKEY_Storage_Removable_Media

볼륨의 미디어가 이동식인지 여부를 나타냅니다.

System.Storage.IsPortable

DEVPKEY_Storage_Portable

저장소 스택에서 저장소를 휴대용으로 간주하는지 여부를 나타냅니다.

 

장치 속성

이름 속성 설명

System.Devices.Children

DEVPKEY_Device_Children

자식의 장치 인스턴스 ID입니다. 커널 상태에서 라이브로 쿼리됩니다.

System.Devices.CompatibleIds

DEVPKEY_Device_CompatibleIds

이 속성을 장치의 비교 가능한 ID 목록을 포함하는 multi-sz 문자열 값입니다.

System.Devices.ContainerId

DEVPKEY_Device_ContainerId

장치 컨테이너의 ID입니다.

System.Devices.DeviceCapabilities

DEVPKEY_Device_Capabilities

이 속성은 장치의 기능에 대한 비트 OR를 포함하는 DWORD 값입니다. 이러한 기능은 cfgmgr32.h에 정의된 CM_DEVCAP_Xxxxx 비트 마스크로 표시됩니다.

System.Devices.DeviceCharacteristics

DEVPKEY_Device_Characteristics

이 속성은 장치의 특성에 대한 비트 OR를 포함하는 DWORD 값입니다. wdm.h 및 ntddk.h에 정의된 이러한 플래그에 대한 설명은 IoCreateDevice 함수의 DeviceCharacteristics 매개 변수를 참조하세요.

System.Devices.DeviceHasProblem

DEVPKEY_Device_HasProblem

이 속성은 커널 상태에서 라이브로 쿼리됩니다.

System.Devices.DeviceInstanceId

DEVPKEY_Device_InstanceId

장치 인스턴스 ID입니다.

System.Devices.HardwareIds

DEVPKEY_Device_HardwareIds

이 속성을 장치의 하드웨어 ID 목록을 포함하는 multi-sz 문자열 값입니다.

System.Devices.InLocalMachineContainer

DEVPKEY_Device_InLocalMachineContainerr

컴퓨터의 컨테이너에 devnode가 있는지 여부를 나타냅니다.

System.ItemNameDisplay

DEVPKEY_NAME

장치 인터페이스의 이름입니다.

 

컨테이너 속성

이름 속성 및 설명
System.ItemNameDisplay PKEY_NAME - 컨테이너 이름입니다.
System.Devices.DiscoveryMethod DEVPKEY_DeviceContainer_DiscoveryMethod - 장치 검색 메서드 목록입니다.
System.Devices.Connected DEVPKEY_DeviceContainer_IsConnected - 장치가 연결되어 있는지 여부를 나타냅니다.
System.Devices.Paired DEVPKEY_DeviceContainer_IsPaired - 장치가 쌍으로 연결되어 있는지 여부를 나타냅니다.
System.Devices.Icon DEVPKEY_DeviceContainer_Icon - 장치 아이콘의 경로입니다.
System.Devices.LocalMachine DEVPKEY_DeviceContainer_IsLocalMachine - 이 컨테이너가 로컬 컴퓨터(PC)를 나타내는지 여부입니다.
System.Devices.MetadataPath DEVPKEY_DeviceContainer_MetadataPath - 장치 메타데이터의 경로입니다.
System.Devices.LaunchDeviceStageFromExplorer DEVPKEY_DeviceContainer_LaunchDeviceStageFromExlplorer - Windows 탐색기에서 Device Stage를 시작할지 여부입니다.
System.Devices.DeviceDescription1 DEVPKEY_DeviceContainer_DeviceDescription1 - 장치 설명입니다.
System.Devices.DeviceDescription2 DEVPKEY_DeviceContainer_DeviceDescription2 - 장치 설명입니다.
System.Devices.NotWorkingProperly DEVPKEY_DeviceContainer_HasProblem - 컨테이너에 문제가 있는지 여부입니다. TRUE이면 컨테이너에서 현재 장치의 DEVPKEY_DEVICE_HasProblem이 TRUE로 설정된 것입니다.
System.Devices.IsShared DEVPKEY_DeviceContainer_IsSharedDevice - 장치를 공유하는지 여부입니다.
System.Devices.IsNetworkConnected DEVPKEY_DeviceContainer_IsNetworkDevice - 장치가 네트워크 연결되어 있는지 여부입니다.
System.Devices.IsDefault DEVPKEY_DeviceContainer_IsDefaultDevice - 장치가 기본 장치인지 여부입니다.
System.Devices.Category DEVPKEY_DeviceContainer_Category_Desc_Singular - 장치 범주입니다(단수).
System.Devices.CategoryPlural DEVPKEY_DeviceContainer_Category_Desc_Singular - 장치 범주입니다(복수).
System.Devices.CategoryGroup DEVPKEY_DeviceContainer_CategoryGroup_Desc - 장치 범주 그룹입니다.
System.Devices.FriendlyName DEVPKEY_DeviceContainer_FriendlyName - 표시 이름입니다.
System.Devices.Manufacturer DEVPKEY_DeviceContainer_Manufacturer - 제조업체 이름입니다.
System.Devices.ModelName DEVPKEY_DeviceContainer_ModelName - 모델 이름입니다.
System.Devices.ModelNumber DEVPKEY_DeviceContainer_ModelNumber - 모델 번호입니다.

 

정식 이름이 없는 속성 지정

속성에 정식 이름이 지정되어 있지 않더라도 "{Guid} pid" 형식의 문자열로 키를 지정하여 속성을 검색할 수 있습니다. 예를 들어 System.Devices.ContainerId는 "{8C7ED206-3F8A-4827-B3AB-AE9E1FAEFC6C} 2"로 지정할 수 있습니다.

관련 항목

개념

시스템 정의 장치 속성

통합 장치 속성 모델