Queries an object for a specified service interface.
This function is a helper function that wraps the IMFGetService::GetService method. The function queries the object for the IMFGetService interface and, if successful, calls GetService on the object.
HRESULT MFGetService(
IUnknown *punkObject,
REFGUID guidService,
REFIID riid,
_Outptr_ LPVOID *ppvObject
)
punkObject
Type: IUnknown *
A pointer to the IUnknown interface of the object to query.
guidService
Type: REFGUID
The service identifier (SID) of the service. For a list of service identifiers, see Service Interfaces.
riid
Type: REFIID
The interface identifier (IID) of the interface being requested.
ppvObject
Type: Outptr LPVOID *
Receives the interface pointer. The caller must release the interface.
Type: HRESULT
The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
| Return code | Description |
|---|---|
| S_OK | The method succeeded. |
| MF_E_UNSUPPORTED_SERVICE | The service requested cannot be found in the object represented by punkObject. |
Refer to Media Foundation return codes.
Header: Declared in mfidl.h.
Library: Use mf.lib.