MFRegisterLocalSchemeHandler function

Registers a scheme handler in the caller's process.


HRESULT MFRegisterLocalSchemeHandler(
  PCWSTR      szScheme,
  IMFActivate *pActivate



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


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.


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.


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


Media Foundation Functions

Scheme Handlers and Byte-Stream Handlers