VerifyNoLoops Method in Class SMS_Collection

The VerifyNoLoops WMI class method verifies that no loops would be formed if one collection were the parent of another. Use this method before creating a parent-child relationship in SMS_CollectToSubCollect or SMS_CollectToSubCollect_a.

The following syntax is simplified from MOF code and is intended to show you the definition of the method.

sint32 VerifyNoLoops(
  [in] SMS_Collection ref parentCollection,
  [in] SMS_Collection ref subCollection,
  [out] boolean Result
);

Parameters

  • parentCollection
    Data type: string
    Qualifiers: In

    Object path to the proposed parent collection.

  • subCollection
    Data type: string
    Qualifiers: In

    Object path to the proposed child collection.

  • Result
    Data type: boolean
    Qualifiers: Out

    Indicates whether a loop is found. If TRUE, the given parent-child relationship does not create a loop condition. If FALSE, the proposed child class should not be made a child of the parent class.

Return Values

The VerifyNoLoops method returns a sint32 which is always zero (0).

Example Code

The following example shows you how to use the VerifyNoLoops method.

    Dim clsCollection As SWbemObject        'SMS_Collection class definition
    Dim Result As Boolean                   'Loop condition?

    Set clsCollection = Services.Get("SMS_Collection")
    clsCollection.VerifyNoLoops "SMS_Collection.CollectionID=""<collectionid>""", _
                                "SMS_Collection.CollectionID=""<collectionid>""", _
                                Result

See Also

SMS_Collection