MFCancelWorkItem

Attempts to cancel an asynchronous operation that was scheduled with MFScheduleWorkItem or MFScheduleWorkItemEx.

Syntax

HRESULT MFCancelWorkItem(
         MFWORKITEM_KEY Key
)  

Parameters

Key
Type: MFWORKITEM_KEY 

The key that was received in the pKey parameter of the MFScheduleWorkItem or MFScheduleWorkItemEx function.

Return value

Type: HRESULT 

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

Refer to Media Foundation return codes.

Remarks

Because work items are asynchronous, the work-item callback might still be invoked after MFCancelWorkItem is called.

Requirements

Header: Declared in mfapi.h.

Library: Use Mfplat.lib.