ReactOS  0.4.15-dev-2703-g05fb0f1
fxdrivercallbacks.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxDriverCallbacks.h
8 
9 Abstract:
10 
11  This module implements the FxDriver 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 _FXDRIVERCALLBACKS_H_
27 #define _FXDRIVERCALLBACKS_H_
28 
29 //
30 // These delegates are in a seperate file
31 //
32 
33 //
34 // DrvDeviceInitialize callback delegate
35 //
37 
38 public:
40 
42  VOID
43  ) :
45  {
46  Method = NULL;
47  }
48 
50  NTSTATUS
52  __in WDFDRIVER Driver,
54  )
55  {
56  if (Method != NULL) {
58  KIRQL irql = 0;
59 
63 
64  return status;
65  }
66  else {
67  return STATUS_UNSUCCESSFUL;
68  }
69  }
70 };
71 
72 //
73 // DrvUnload callback delegate
74 //
75 class FxDriverUnload : public FxCallback {
76 
77 public:
78 
80 
82  VOID
83  ) :
84  FxCallback()
85  {
86  Method = NULL;
87  }
88 
89  void
91  __in WDFDRIVER Driver
92  )
93  {
94  if (Method != NULL) {
95 
96  CallbackStart();
97  Method(Driver);
98  CallbackEnd();
99  return;
100  }
101  else {
102  return;
103  }
104  }
105 };
106 
107 #endif // _FXDRIVERCALLBACKS_H_
PFN_WDF_DRIVER_DEVICE_ADD Method
#define _Must_inspect_result_
Definition: no_sal2.h:62
__inline void CallbackStart(__out PKIRQL PreviousIrql)
Definition: fxcallback.hpp:115
EVT_WDF_DRIVER_DEVICE_ADD * PFN_WDF_DRIVER_DEVICE_ADD
Definition: wdfdriver.h:78
LONG NTSTATUS
Definition: precomp.h:26
KIRQL irql
Definition: wave.h:1
UCHAR KIRQL
Definition: env_spec_w32.h:591
EVT_WDF_DRIVER_UNLOAD * PFN_WDF_DRIVER_UNLOAD
Definition: wdfdriver.h:91
PFN_WDF_DRIVER_UNLOAD Method
__inline void CallbackEnd(__in KIRQL PreviousIrql)
Definition: fxcallback.hpp:126
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define NULL
Definition: types.h:112
void Invoke(__in WDFDRIVER Driver)
_Must_inspect_result_ NTSTATUS Invoke(__in WDFDRIVER Driver, __in PWDFDEVICE_INIT DeviceInit)
_In_ PWDFDEVICE_INIT DeviceInit
Definition: wdfcontrol.h:113
void __inline CallbackStart(VOID)
Definition: fxcallback.hpp:64
#define __in
Definition: dbghelp.h:35
_Must_inspect_result_ _In_ WDFDRIVER Driver
Definition: wdfcontrol.h:83
static SERVICE_STATUS status
Definition: service.c:31
void __inline CallbackEnd(VOID)
Definition: fxcallback.hpp:74
Definition: ps.c:97