Düzenle

Aracılığıyla paylaş


SWbemObject.References_ method

The References_ method of the SWbemObject object returns a collection of all association classes or instances that refer to the current object.

This method performs the same function as the REFERENCES OF WQL query.

For an explanation of this syntax, see Document Conventions for the Scripting API.

Syntax

objWbemObjectSet = .References_( _
  [ ByVal strResultClass ], _
  [ ByVal strRole ], _
  [ ByVal bClassesOnly ], _
  [ ByVal bSchemaOnly ], _
  [ ByVal strRequiredQualifier ], _
  [ ByVal iFlags ], _
  [ ByVal objwbemNamedValueSet ] _
)

Parameters

strResultClass [in, optional]

String that contains a class name. If specified, this parameter indicates that the returned association objects must belong to or be derived from the class specified in this parameter.

strRole [in, optional]

String that contains a property name. If specified, this parameter indicates that the returned association objects must be limited to those in which the source object plays a specific role. The role is defined by the name of a specified property (which must be a reference property) of an association.

bClassesOnly [in, optional]

Boolean value that indicates whether or not a list of class names should be returned rather than actual instances of the classes. These are the classes to which the association objects belong. The default value for this parameter is FALSE.

bSchemaOnly [in, optional]

Boolean value that indicates whether or not the query applies to the schema rather than the data. The default value for this parameter is FALSE. It can only be set to TRUE if the object on which this method is invoked is a class. When set to TRUE, the set of returned endpoints represents classes that are suitably associated with the source class in the schema.

strRequiredQualifier [in, optional]

String that contains a qualifier name. If specified, this parameter indicates that the returned association objects must include the specified qualifier.

iFlags [in, optional]

Integer specifying additional flags to the operation. The default for this parameter is wbemFlagReturnImmediately, which directs the call to return immediately rather than wait until the query has completed. This parameter can accept the following values.

wbemFlagForwardOnly (32 (0x20))

Causes a forward-only enumerator to be returned. Forward-only enumerators are generally much faster and use less memory than conventional enumerators, but they do not allow calls to SWbemObject.Clone_.

wbemFlagBidirectional (0 (0x0))

Causes Windows Management Instrumentation (WMI) to retain pointers to objects of the enumeration until the client releases the enumerator.

wbemFlagReturnImmediately (16 (0x10))

Causes the call to return immediately.

wbemFlagReturnWhenComplete (0 (0x0))

Causes this call to block until the query has completed.

wbemFlagUseAmendedQualifiers (131072 (0x20000))

Causes WMI to return class amendment data with the base class definition. For more information about amended qualifiers, see Localizing WMI Class Information.

objwbemNamedValueSet [in, optional]

Typically, this is undefined. Otherwise, this is an SWbemNamedValueSet object whose elements represent the context information that can be used by the provider that is servicing the request. A provider that supports or requires such information must document the recognized value names, data type of the value, allowed values, and semantics.

Return value

If the call is successful, an SWbemObjectSet object is returned.

Error codes

After the completion of the References_ method, the Err object may contain one of the error codes in the following list.

wbemErrAccessDenied - 2147749891 (0x80041003)

Current user does not have permission to view one or more of the classes returned by the call.

wbemErrFailed - 2147749889 (0x80041001)

Unspecified error.

wbemErrInvalidParameter - 2147749896 (0x80041008)

Invalid parameter was specified.

wbemErrOutOfMemory - 2147749894 (0x80041006)

Not enough memory to complete the operation.

Remarks

For more information about the REFERENCES OF associated WQL query, source instances, and association objects, see ASSOCIATORS OF Statement.

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Header
Wbemdisp.h
Type library
Wbemdisp.tlb
DLL
Wbemdisp.dll
CLSID
CLSID_SWbemObject
IID
IID_ISWbemObject

See also

SWbemObject

SWbemObject.Associators_

SWbemServices.AssociatorsOf

SWbemServices.ReferencesTo