MFAllocateWorkQueueEx function
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
- WorkQueueType [in]
-
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.
- pdwWorkQueue [out]
-
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
|
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] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also