locked
Missing DeviceContainer propkeys after upgrading to Release Preview..!?

    Question

  • Hi,

      I created an app which was running fine on Windows 8 Consumer preview.

    I used PnpObject::CreateFromIdAsync() with several property keys ; a few of them however (essential to me!) have been removed from <devpkey.h> since Consumer Preview... why??

    So, here is the list that I need :

    DEFINE_DEVPROPKEY(DEVPKEY_DeviceContainer_Devices,                  0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 102);   // DEVPROP_TYPE_STRING_LIST
    DEFINE_DEVPROPKEY(DEVPKEY_DeviceContainer_Interfaces,               0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 103);   // DEVPROP_TYPE_STRING_LIST
    DEFINE_DEVPROPKEY(DEVPKEY_DeviceContainer_InterfaceClasses,         0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 104);   // DEVPROP_TYPE_STRING_LIST

    in other terms, 

    • System.Devices.ContainedDevices
    • System.Devices.ContainedDeviceInterfaces
    • System.Devices.ContainedDeviceInterfaceClasses

    Now I'm trapped, since I first enumerate device containers, then I build (on demand) relationships with device interfaces this way..

    Can you tell me if the change was intentional, why did you do so, and a possible workaround?

    Thanks,

    Julien


    Julien Racle

    Monday, July 09, 2012 2:24 PM

Answers

  • Julien,

    Those three properties were intentionally removed from the container for performance reasons.  You can still achieve what you need by querying for the Device and DeviceInterface object types with the container id specified as the AQS filter.   e.g. PnpObject.FindAllAsync( Device, requestedProperties, “System.Devices.ContainerId := {121eca4b-e45b-40a8-be4b-d8d6fba8c533}” );.  For the interface classes you’ll need to get the interfaces belonging to the container, requesting the class guid property.  From that you can get all the interfaces classes belonging to a given container.

    Best Wishes - Eric

    Tuesday, July 10, 2012 8:05 PM
    Moderator

All replies

  • Julien,

    I am looking into this for you.

    Best Wishes - Eric

    Tuesday, July 10, 2012 6:54 AM
    Moderator
  • Thanks Eric!

    Julien Racle

    Tuesday, July 10, 2012 6:57 AM
  • Julien,

    Those three properties were intentionally removed from the container for performance reasons.  You can still achieve what you need by querying for the Device and DeviceInterface object types with the container id specified as the AQS filter.   e.g. PnpObject.FindAllAsync( Device, requestedProperties, “System.Devices.ContainerId := {121eca4b-e45b-40a8-be4b-d8d6fba8c533}” );.  For the interface classes you’ll need to get the interfaces belonging to the container, requesting the class guid property.  From that you can get all the interfaces classes belonging to a given container.

    Best Wishes - Eric

    Tuesday, July 10, 2012 8:05 PM
    Moderator
  • Hi Eric,

      thanks as always for your implication!!

    This is unfortunate.. I built up a device management API I use internally to my app. I'm basically creating one type of PnpObject by PnpObjectType. The 1st thing I query is the device container (filtered by my brand name), for which I then query interfaces that I need. Thus I have implemented a "deviceprovider", where device will basically contain one or more containers.

    I really did not see any performance issues this way (every simgle property string I wrapped as a property in my object, is queried lazily.. I just need the friendly name as a boot-up property in all of my PnpElements types).

    Now for instance, suppose I want all device containers or devices if you want to get them 1st of my company. How can I do it quickly enough without lots more filters (interface, compatible IDs..)? I bet that it'll be long too...

    Anyway I was not used to a lack of backward compatibility, but I have to cope with it :(. The app release is now delayed..


    Julien Racle

    Tuesday, July 10, 2012 9:26 PM