mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 22:13:06 +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
|
@ -0,0 +1,99 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
FxIoQueueCallbacks.h
|
||||
|
||||
Abstract:
|
||||
|
||||
This module implements the I/O package queue object callbacks
|
||||
|
||||
Author:
|
||||
|
||||
|
||||
|
||||
|
||||
Environment:
|
||||
|
||||
Both kernel and user mode
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _FXREQUESTCALLBACKS_H_
|
||||
#define _FXREQUESTCALLBACKS_H_
|
||||
|
||||
|
||||
//
|
||||
// Delegate which contains EvtRequestCancel
|
||||
//
|
||||
class FxRequestCancelCallback : public FxCallback {
|
||||
|
||||
public:
|
||||
PFN_WDF_REQUEST_CANCEL m_Cancel;
|
||||
|
||||
FxRequestCancelCallback(
|
||||
VOID
|
||||
)
|
||||
{
|
||||
m_Cancel = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
InvokeCancel(
|
||||
__in FxCallbackLock* Lock,
|
||||
__in WDFREQUEST Request
|
||||
)
|
||||
{
|
||||
if (m_Cancel != NULL) {
|
||||
PFN_WDF_REQUEST_CANCEL pMethod;
|
||||
KIRQL irql;
|
||||
|
||||
//
|
||||
// Satisfy W4 warning, even though it is technically not necessary to
|
||||
// assign an initial value.
|
||||
//
|
||||
irql = PASSIVE_LEVEL;
|
||||
|
||||
if (Lock != NULL) {
|
||||
Lock->Lock(&irql);
|
||||
}
|
||||
|
||||
//
|
||||
// Clear the value before invoking the routine since the assignment
|
||||
// is invalidated when the routine is run.
|
||||
//
|
||||
pMethod = m_Cancel;
|
||||
m_Cancel = NULL;
|
||||
|
||||
pMethod(Request);
|
||||
|
||||
if (Lock != NULL) {
|
||||
Lock->Unlock(irql);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// Delegate which contains EvtRequestCompletion
|
||||
//
|
||||
class FxRequestCompletionCallback : public FxCallback {
|
||||
|
||||
public:
|
||||
PFN_WDF_REQUEST_COMPLETION_ROUTINE m_Completion;
|
||||
|
||||
FxRequestCompletionCallback(
|
||||
VOID
|
||||
)
|
||||
{
|
||||
m_Completion = NULL;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif // _FXREQUESTCALLBACKS_H_
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue