• Guidance on how to access WMI instance members within an instance!

    From bhavesh.sapra@gmail.com@21:1/5 to Zulk on Wed Jun 27 01:49:45 2018
    On Saturday, May 9, 2009 at 2:53:56 AM UTC+5:30, Zulk wrote:
    On May 8, 11:21 am, nutrageou...@yahoo.com wrote:
    Hi All,

    Does anyone know how to query an instance within an instance in c/C++?
    I can query the members of MSFC_FibrePortHBAAttributes instance but
    some how is not able to query the child instance of MSFC_HBAPortAttributesResults.

    Any pointers on how to do this will be greatly appreciated. Code
    snippet given below!

    MOF is;

    instance of MSFC_FibrePortHBAAttributes
    {
            Active = TRUE; <--- successfully able to access this
            Attributes =
    instance of MSFC_HBAPortAttributesResults <-- how to query for this instance and its members?
    {
            FabricName = {16, 0, 0, 96, 15, 28, 10, 6};
            NodeWWN = {20, 0, 0, 07, 34, 0, 233, 12};
            NumberofDiscoveredPorts = 12;
            PortActiveFc4Types = {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
            PortFcId = 80640;
            PortMaxFrameSize = 2048;
            PortSpeed = 2;
            PortState = 2;
            PortSupportedClassofService = 8;
            PortSupportedFc4Types = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
            PortSupportedSpeed = 1;
            PortType = 3;
            PortWWN = {21, 0, 0, 07, 34, 0, 233, 12}; <-- Want to access this????};

            HBAStatus = 0;
            InstanceName = "PCI\\VEN_1XXX&DEV_XXX&SUBSYS_0XXX&REV_03\\XXX_0";
            UniquePortId = "1XXX";

    };

    hr_next = pIEnumWbemClassObject->Next(
                 WBEM_INFINITE,
                 1,
                 &pIWbemClassObjectInst, ,
                 &ulCount
               );                                                      <--
    successfully able to get the MSFC_FibrePortHBAAttributes and is
    enumerating it here
    if (WBEM_S_NO_ERROR == hr_next) {

            hr = pIWbemClassObjectInst->BeginEnumeration (WBEM_FLAG_NONSYSTEM_ONLY);
            {
                    CIMTYPE         pvtType;
                    VARIANT pVal; VariantInit(&pVal);
                    BSTR        pstrName = NULL;

                    while(pIWbemClassObjectInst->Next(0, &pstrName, &pVal, &pvtType,
    NULL))
                    {
                            if( pVal.vt == VT_I4 )
                                    ;
                    }

    Thanks in advance.

    - Zulk

    Thanks everyone. I was able to fix. Just get another interface pointer
    to the embedded instance and use Get to find all the properties.

    Let me know if anyone need the code. I can post it here.

    Yes can you please share your snippet. I am also stuck at same point and i am having same requirement.
    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)