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
For Each operator maps to querying for IEnumXXX object and then calling ->Next on it till this will fail.
--
Maxim S. Shatskih
Windows DDK MVP
ma...@storagecraft.com
http://www.storagecraft.com
<nutrag...@yahoo.com> wrote in message news:93d7feae-6edc-4a3e...@r3g2000vbp.googlegroups.com...
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.