mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 05:22:56 +00:00
[WDF] Add Windows Driver Framework files
Takern from Microsoft GitHub repo:
d9c6040fe9
Licensed under MIT
This commit is contained in:
parent
545df81502
commit
8a978a179f
475 changed files with 285099 additions and 0 deletions
66
sdk/lib/drivers/wdf/shared/primitives/um/mxworkitemum.cpp
Normal file
66
sdk/lib/drivers/wdf/shared/primitives/um/mxworkitemum.cpp
Normal file
|
@ -0,0 +1,66 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) Microsoft Corporation
|
||||
|
||||
ModuleName:
|
||||
|
||||
MxWorkItemUm.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Work item callback thunk implementation for user mode
|
||||
|
||||
We need this thunk to wire the um callback to a mode agnostic work item
|
||||
callback.
|
||||
|
||||
Author:
|
||||
|
||||
|
||||
|
||||
Revision History:
|
||||
|
||||
|
||||
|
||||
--*/
|
||||
|
||||
#include "Mx.h"
|
||||
|
||||
VOID
|
||||
CALLBACK
|
||||
MxWorkItem::_WorkerThunk (
|
||||
_Inout_ PTP_CALLBACK_INSTANCE Instance,
|
||||
_Inout_opt_ PVOID Parameter,
|
||||
_Inout_ PTP_WAIT Wait,
|
||||
_In_ TP_WAIT_RESULT WaitResult
|
||||
)
|
||||
{
|
||||
MdWorkItem workItem = (MdWorkItem) Parameter;
|
||||
|
||||
UNREFERENCED_PARAMETER(Instance);
|
||||
UNREFERENCED_PARAMETER(Wait);
|
||||
UNREFERENCED_PARAMETER(WaitResult);
|
||||
|
||||
(*workItem->Callback)(
|
||||
workItem->DeviceObject,
|
||||
workItem->Context
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
VOID
|
||||
MxWorkItem::WaitForCallbacksToComplete(
|
||||
VOID
|
||||
)
|
||||
{
|
||||
Mx::MxAssert(NULL != m_WorkItem->WaitBlock);
|
||||
|
||||
//
|
||||
// Wait for outstanding callbacks to complete.
|
||||
//
|
||||
WaitForThreadpoolWaitCallbacks(m_WorkItem->WaitBlock,
|
||||
FALSE // donot cancel pending waits
|
||||
);
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue