MFRegisterLocalSchemeHandler function (mfapi.h)

Registers a scheme handler in the caller's process.

Syntax

HRESULT MFRegisterLocalSchemeHandler(
  [in] PCWSTR      szScheme,
  [in] IMFActivate *pActivate
);

Parameters

[in] szScheme

A string that contains the scheme. The scheme includes the trailing ':' character; for example, "http:".

[in] pActivate

A pointer to the IMFActivate interface of an activation object. The caller implements this interface. The IMFActivate::ActivateObject method of the activation object must create a scheme handler object. The scheme handler exposes the IMFSchemeHandler interface.

Return value

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Scheme handlers are used in Microsoft Media Foundation during the source resolution process, which creates a media source from a URL. For more information, see Scheme Handlers and Byte-Stream Handlers.

Within a process, local scheme handlers take precedence over scheme handlers that are registered in the registry. Local scheme handlers are not visible to other processes.

Use this function if you want to register a custom scheme handler for your application, but do not want the handler available to other applications.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header mfapi.h
Library Mfplat.lib
DLL Mfplat.dll

See also

MFRegisterLocalByteStreamHandler

Media Foundation Functions

Scheme Handlers and Byte-Stream Handlers