Export (0) Print
Expand All

IWbemCallResult::GetResultServices method

The IWbemCallResult::GetResultServices method retrieves the IWbemServices pointer, which results from a semisynchronous call to IWbemServices::OpenNamespace when it becomes available.

Syntax


HRESULT GetResultServices(
  [in]   LONG lTimeout,
  [out]  IWbemServices **ppServices
);

Parameters

lTimeout [in]

The maximum time in milliseconds that this call blocks before it returns. If you use the constant WBEM_INFINITE (0xFFFFFFFF), the call blocks until the interface pointer is available. If you use 0, the call immediately returns either the pointer or a status code.

ppServices [out]

Cannot be NULL. It receives a pointer to the IWbemServices interface requested by the original call to OpenNamespace when it becomes available The caller must call IWbemServices::Release on the returned object when it is no longer required.

On error, a new object is not returned.

Return value

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

On error, the COM function GetErrorInfo can be called to obtain more error information.

COM-specific error codes may also be returned if network problems cause you to lose the remote connection to Windows Management.

Return codeDescription
WBEM_S_NO_ERROR

The call succeeded and returned an IWbemServices pointer.

WBEM_S_TIMEDOUT

The time-out occurred, and the call had not yet completed.

WBEM_E_UNEXPECTED

An internal failure occurred.

WBEM_E_TRANSPORT_FAILURE

This indicates the failure of the remote procedure call (RPC) link between the current process and Windows Management.

WBEM_E_ACCESS_DENIED

The user attempted to perform an unauthorized operation.

WBEM_E_INVALID_NAMESPACE

The specified namespace did not exist on the server.

WBEM_E_FAILED

There has been a general failure.

WBEM_E_INVALID_PARAMETER

A specified parameter is not valid.

 

Examples

For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.

For C++ code examples, see WMI C++ Application Examples.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

Wbemcli.h (include Wbemidl.h)

See also

IWbemCallResult
IWbemServices::OpenNamespace

 

 

Show:
© 2014 Microsoft