xref: /reactos/sdk/include/wdf/kmdf/1.17/wdfcontrol.h (revision 40462c92)
1 /*++
2 
3 Copyright (c) Microsoft Corporation.  All rights reserved.
4 
5 _WdfVersionBuild_
6 
7 Module Name:
8 
9     wdfcontrol.h
10 
11 Abstract:
12 
13     Defines functions for controller and creating a "controller" NT4 style
14     WDFDEVICE handle.
15 
16 Environment:
17 
18     kernel mode only
19 
20 Revision History:
21 
22 --*/
23 
24 //
25 // NOTE: This header is generated by stubwork.  Please make any
26 //       modifications to the corresponding template files
27 //       (.x or .y) and use stubwork to regenerate the header
28 //
29 
30 #ifndef _WDFCONTROL_H_
31 #define _WDFCONTROL_H_
32 
33 #ifndef WDF_EXTERN_C
34   #ifdef __cplusplus
35     #define WDF_EXTERN_C       extern "C"
36     #define WDF_EXTERN_C_START extern "C" {
37     #define WDF_EXTERN_C_END   }
38   #else
39     #define WDF_EXTERN_C
40     #define WDF_EXTERN_C_START
41     #define WDF_EXTERN_C_END
42   #endif
43 #endif
44 
45 WDF_EXTERN_C_START
46 
47 
48 
49 #if (NTDDI_VERSION >= NTDDI_WIN2K)
50 
51 typedef
52 _Function_class_(EVT_WDF_DEVICE_SHUTDOWN_NOTIFICATION)
53 _IRQL_requires_same_
54 _IRQL_requires_max_(PASSIVE_LEVEL)
55 VOID
56 EVT_WDF_DEVICE_SHUTDOWN_NOTIFICATION(
57     _In_
58     WDFDEVICE Device
59     );
60 
61 typedef EVT_WDF_DEVICE_SHUTDOWN_NOTIFICATION *PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION;
62 
63 typedef enum _WDF_DEVICE_SHUTDOWN_FLAGS {
64     WdfDeviceShutdown = 0x01,
65     WdfDeviceLastChanceShutdown = 0x02,
66 } WDF_DEVICE_SHUTDOWN_FLAGS;
67 
68 
69 
70 //
71 // WDF Function: WdfControlDeviceInitAllocate
72 //
73 typedef
74 _Must_inspect_result_
75 _IRQL_requires_max_(PASSIVE_LEVEL)
76 WDFAPI
77 PWDFDEVICE_INIT
78 (*PFN_WDFCONTROLDEVICEINITALLOCATE)(
79     _In_
80     PWDF_DRIVER_GLOBALS DriverGlobals,
81     _In_
82     WDFDRIVER Driver,
83     _In_
84     CONST UNICODE_STRING* SDDLString
85     );
86 
87 _Must_inspect_result_
88 _IRQL_requires_max_(PASSIVE_LEVEL)
89 PWDFDEVICE_INIT
90 FORCEINLINE
91 WdfControlDeviceInitAllocate(
92     _In_
93     WDFDRIVER Driver,
94     _In_
95     CONST UNICODE_STRING* SDDLString
96     )
97 {
98     return ((PFN_WDFCONTROLDEVICEINITALLOCATE) WdfFunctions[WdfControlDeviceInitAllocateTableIndex])(WdfDriverGlobals, Driver, SDDLString);
99 }
100 
101 //
102 // WDF Function: WdfControlDeviceInitSetShutdownNotification
103 //
104 typedef
105 _IRQL_requires_max_(PASSIVE_LEVEL)
106 WDFAPI
107 VOID
108 (*PFN_WDFCONTROLDEVICEINITSETSHUTDOWNNOTIFICATION)(
109     _In_
110     PWDF_DRIVER_GLOBALS DriverGlobals,
111     _In_
112     PWDFDEVICE_INIT DeviceInit,
113     _In_
114     PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification,
115     _In_
116     UCHAR Flags
117     );
118 
119 _IRQL_requires_max_(PASSIVE_LEVEL)
120 VOID
121 FORCEINLINE
122 WdfControlDeviceInitSetShutdownNotification(
123     _In_
124     PWDFDEVICE_INIT DeviceInit,
125     _In_
126     PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification,
127     _In_
128     UCHAR Flags
129     )
130 {
131     ((PFN_WDFCONTROLDEVICEINITSETSHUTDOWNNOTIFICATION) WdfFunctions[WdfControlDeviceInitSetShutdownNotificationTableIndex])(WdfDriverGlobals, DeviceInit, Notification, Flags);
132 }
133 
134 //
135 // WDF Function: WdfControlFinishInitializing
136 //
137 typedef
138 _IRQL_requires_max_(DISPATCH_LEVEL)
139 WDFAPI
140 VOID
141 (*PFN_WDFCONTROLFINISHINITIALIZING)(
142     _In_
143     PWDF_DRIVER_GLOBALS DriverGlobals,
144     _In_
145     WDFDEVICE Device
146     );
147 
148 _IRQL_requires_max_(DISPATCH_LEVEL)
149 VOID
150 FORCEINLINE
151 WdfControlFinishInitializing(
152     _In_
153     WDFDEVICE Device
154     )
155 {
156     ((PFN_WDFCONTROLFINISHINITIALIZING) WdfFunctions[WdfControlFinishInitializingTableIndex])(WdfDriverGlobals, Device);
157 }
158 
159 
160 
161 #endif // (NTDDI_VERSION >= NTDDI_WIN2K)
162 
163 
164 
165 WDF_EXTERN_C_END
166 
167 #endif // _WDFCONTROL_H_
168 
169