ReactOS  0.4.15-dev-2703-g05fb0f1
fxrequestcallbacks.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxIoQueueCallbacks.h
8 
9 Abstract:
10 
11  This module implements the I/O package queue object callbacks
12 
13 Author:
14 
15 
16 
17 
18 Environment:
19 
20  Both kernel and user mode
21 
22 Revision History:
23 
24 --*/
25 
26 #ifndef _FXREQUESTCALLBACKS_H_
27 #define _FXREQUESTCALLBACKS_H_
28 
29 
30 //
31 // Delegate which contains EvtRequestCancel
32 //
34 
35 public:
37 
39  VOID
40  )
41  {
42  m_Cancel = NULL;
43  }
44 
45  void
48  __in WDFREQUEST Request
49  )
50  {
51  if (m_Cancel != NULL) {
52  PFN_WDF_REQUEST_CANCEL pMethod;
53  KIRQL irql;
54 
55  //
56  // Satisfy W4 warning, even though it is technically not necessary to
57  // assign an initial value.
58  //
60 
61  if (Lock != NULL) {
62  Lock->Lock(&irql);
63  }
64 
65  //
66  // Clear the value before invoking the routine since the assignment
67  // is invalidated when the routine is run.
68  //
69  pMethod = m_Cancel;
70  m_Cancel = NULL;
71 
72  pMethod(Request);
73 
74  if (Lock != NULL) {
75  Lock->Unlock(irql);
76  }
77  }
78  }
79 };
80 
81 //
82 // Delegate which contains EvtRequestCompletion
83 //
85 
86 public:
88 
90  VOID
91  )
92  {
94  }
95 };
96 
97 
98 #endif // _FXREQUESTCALLBACKS_H_
99 
PFN_WDF_REQUEST_CANCEL m_Cancel
EVT_WDF_REQUEST_CANCEL * PFN_WDF_REQUEST_CANCEL
Definition: wdfrequest.h:130
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
KIRQL irql
Definition: wave.h:1
UCHAR KIRQL
Definition: env_spec_w32.h:591
EVT_WDF_REQUEST_COMPLETION_ROUTINE * PFN_WDF_REQUEST_COMPLETION_ROUTINE
Definition: wdfrequest.h:313
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
PFN_WDF_REQUEST_COMPLETION_ROUTINE m_Completion
#define NULL
Definition: types.h:112
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:124
void InvokeCancel(__in FxCallbackLock *Lock, __in WDFREQUEST Request)
#define __in
Definition: dbghelp.h:35