MFAllocateWorkQueueEx function (mfapi.h)

Creates a new work queue. This function extends the capabilities of the MFAllocateWorkQueue function by making it possible to create a work queue that has a message loop.

Syntax

HRESULT MFAllocateWorkQueueEx(
  [in]  MFASYNC_WORKQUEUE_TYPE WorkQueueType,
  [out] DWORD                  *pdwWorkQueue
);

Parameters

[in] WorkQueueType

A member of the MFASYNC_WORKQUEUE_TYPE enumeration, specifying the type of work queue to create.

Value Meaning
MF_MULTITHREADED_WORKQUEUE
Create a multithreaded work queue. Generally, applications should not create private multithreaded queues. Use the platform multithreaded queues instead. For more information, see Work Queue and Threading Improvements.
MF_STANDARD_WORKQUEUE
Create a work queue without a message loop. Using this flag is equivalent to calling MFAllocateWorkQueue.
MF_WINDOW_WORKQUEUE
Create a work queue with a message loop. The thread that dispatches the work items for this queue will also call PeekMessage and DispatchMessage. Use this option if your callback performs any actions that require a message loop.

[out] pdwWorkQueue

Receives an identifier for the work queue that was created.

Return value

The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The function succeeded.
E_FAIL
The application exceeded the maximum number of work queues.
E_INVALIDARG
Invalid argument.
MF_E_SHUTDOWN
The application did not call MFStartup, or the application has already called MFShutdown.

Remarks

When you are done using the work queue, call MFUnlockWorkQueue.

The MFAllocateWorkQueue function is equivalent to calling MFAllocateWorkQueueEx with the value MF_STANDARD_WORKQUEUE for the WorkQueueType parameter.

This function is available on Windows Vista if Platform Update Supplement for Windows Vista is installed.

Requirements

Requirement Value
Minimum supported client Windows 7, Windows Vista and Platform Update Supplement for Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header mfapi.h
Library Mfplat.lib
DLL Mfplat.dll

See also

MFPutWorkItem

MFPutWorkItemEx

Media Foundation Functions

Work Queues