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 |
---|---|
|
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. |
|
Create a work queue without a message loop. Using this flag is equivalent to calling MFAllocateWorkQueue. |
|
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 |
---|---|
|
The function succeeded. |
|
The application exceeded the maximum number of work queues. |
|
Invalid argument. |
|
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 |