Export (0) Print
Expand All

IWbemConfigureRefresher::AddObjectByPath method

The IWbemConfigureRefresher::AddObjectByPath method adds an object to a refresher by specifying an object path.

Syntax


HRESULT AddObjectByPath(
  [in]  IWbemServices    *pNamespace,
  [in]  LPCWSTR          wszPath,
  [in]  long             lFlags,
  [in]  IWbemContext     *pCtx,
  [out] IWbemClassObject **ppRefreshable,
  [out] long             *plId
);

Parameters

pNamespace [in]

An IWbemServices pointer back into Windows Management, which can service any request made by the provider. The provider should call AddRef on this pointer if it is going to call back into Windows Management during its execution.

wszPath [in]

Constant, null-terminated string of 16-bit Unicode characters that contains the object path of the object you add to the refresher.

lFlags [in]

Bitmask of flags that modify the behavior of this method. If this parameter is set to WBEM_FLAG_USE_AMENDED_QUALIFIERS, the returned instance contain localized qualifiers if available.

pCtx [in]

Typically NULL; otherwise, a pointer to an IWbemContext object that is required by one or more dynamic class providers. The values in the context object must be specified in the specific provider documentation. For more information about this parameter, see Making Calls to WMI.

ppRefreshable [out]

Pointer to hold the reference to a IWbemClassObject object, which contains the refreshable instance object. The client must call Release on the returned object when it is no longer required.

plId [out]

Pointer to an integer returned by the provider that uniquely identifies the refreshable object.

Return value

This method returns an HRESULT indicating the status of the method call. The following table lists the value contained within an HRESULT.

Return codeDescription
WBEM_E_INVALID_PARAMETER

A parameter was not valid.

WBEM_E_NOT_FOUND

The requested instance could not be found.

WBEM_E_ACCESS_DENIED

The current user does not have permission to retrieve the specified instance.

WBEM_E_INVALID_OPERATION

The requested instance is not supplied by the High-Performance Provider.

WBEM_E_REFRESHER_BUSY

The refresher is busy with another operation.

WBEM_S_NO_ERROR

The method was successful.

 

Remarks

The supplied path must specify a valid object, which is provided by the High-Performance Provider. The returned object must not be touched by the client while a refresh operation is in process. The returned identifier can be used by the Remove function to remove the object.

Note  It is not necessary for the user to explicitly remove added objects. The client must call Release on the returned object when it is no longer required.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Wbemcli.h (include Wbemidl.h)

Library

Wbemuuid.lib

DLL

Wbemperf.dll

See also

IWbemConfigureRefresher
Accessing Performance Data in C++
Making an Instance Provider into a High-Performance Provider
Performance Counter Provider

 

 

Show:
© 2015 Microsoft