ShlwApiIUnknown_QueryService Method

Retrieves an interface for a service from a specified object.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("ShlwApi.dll", CharSet = CharSet.Ansi, BestFitMapping = false, 
	ThrowOnUnmappableChar = true)]
public static HResult IUnknown_QueryService(
	IntPtr pUnk,
	ref Guid refGuidService,
	ref Guid refRiid,
	out IntPtr refPpvOut
)

Parameters

pUnk  IntPtr
A pointer to the IUnknown instance of the COM object that supports the service..
refGuidService  Guid
The service's unique identifier (SID).
refRiid  Guid
The IID of the desired service interface.
refPpvOut  IntPtr
When this method returns, contains the interface pointer requested refRiid.

If successful, the calling application is responsible for calling IUnknown.Release() method using this value when the service is no longer needed.

In the case of failure, this value is NULL

Return Value

HResult
Returns S_OK if successful.

Returns E_FAIL if the object does not support IServiceProvider. Otherwise, the function returns the HResult value returned by the object's QueryService method.

Remarks

See Also