xref: /reactos/sdk/include/wdf/kmdf/1.17/wdfcontrol.h (revision 545df815)
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 STDCALL
57 EVT_WDF_DEVICE_SHUTDOWN_NOTIFICATION(
58     _In_
59     WDFDEVICE Device
60     );
61 
62 typedef EVT_WDF_DEVICE_SHUTDOWN_NOTIFICATION *PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION;
63 
64 typedef enum _WDF_DEVICE_SHUTDOWN_FLAGS {
65     WdfDeviceShutdown = 0x01,
66     WdfDeviceLastChanceShutdown = 0x02,
67 } WDF_DEVICE_SHUTDOWN_FLAGS;
68 
69 
70 
71 //
72 // WDF Function: WdfControlDeviceInitAllocate
73 //
74 typedef
75 _Must_inspect_result_
76 _IRQL_requires_max_(PASSIVE_LEVEL)
77 WDFAPI
78 PWDFDEVICE_INIT
79 (STDCALL *PFN_WDFCONTROLDEVICEINITALLOCATE)(
80     _In_
81     PWDF_DRIVER_GLOBALS DriverGlobals,
82     _In_
83     WDFDRIVER Driver,
84     _In_
85     CONST UNICODE_STRING* SDDLString
86     );
87 
88 _Must_inspect_result_
_IRQL_requires_max_(PASSIVE_LEVEL)89 _IRQL_requires_max_(PASSIVE_LEVEL)
90 FORCEINLINE
91 PWDFDEVICE_INIT
92 WdfControlDeviceInitAllocate(
93     _In_
94     WDFDRIVER Driver,
95     _In_
96     CONST UNICODE_STRING* SDDLString
97     )
98 {
99     return ((PFN_WDFCONTROLDEVICEINITALLOCATE) WdfFunctions[WdfControlDeviceInitAllocateTableIndex])(WdfDriverGlobals, Driver, SDDLString);
100 }
101 
102 //
103 // WDF Function: WdfControlDeviceInitSetShutdownNotification
104 //
105 typedef
106 _IRQL_requires_max_(PASSIVE_LEVEL)
107 WDFAPI
108 VOID
109 (STDCALL *PFN_WDFCONTROLDEVICEINITSETSHUTDOWNNOTIFICATION)(
110     _In_
111     PWDF_DRIVER_GLOBALS DriverGlobals,
112     _In_
113     PWDFDEVICE_INIT DeviceInit,
114     _In_
115     PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification,
116     _In_
117     UCHAR Flags
118     );
119 
_IRQL_requires_max_(PASSIVE_LEVEL)120 _IRQL_requires_max_(PASSIVE_LEVEL)
121 FORCEINLINE
122 VOID
123 WdfControlDeviceInitSetShutdownNotification(
124     _In_
125     PWDFDEVICE_INIT DeviceInit,
126     _In_
127     PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification,
128     _In_
129     UCHAR Flags
130     )
131 {
132     ((PFN_WDFCONTROLDEVICEINITSETSHUTDOWNNOTIFICATION) WdfFunctions[WdfControlDeviceInitSetShutdownNotificationTableIndex])(WdfDriverGlobals, DeviceInit, Notification, Flags);
133 }
134 
135 //
136 // WDF Function: WdfControlFinishInitializing
137 //
138 typedef
139 _IRQL_requires_max_(DISPATCH_LEVEL)
140 WDFAPI
141 VOID
142 (STDCALL *PFN_WDFCONTROLFINISHINITIALIZING)(
143     _In_
144     PWDF_DRIVER_GLOBALS DriverGlobals,
145     _In_
146     WDFDEVICE Device
147     );
148 
_IRQL_requires_max_(DISPATCH_LEVEL)149 _IRQL_requires_max_(DISPATCH_LEVEL)
150 FORCEINLINE
151 VOID
152 WdfControlFinishInitializing(
153     _In_
154     WDFDEVICE Device
155     )
156 {
157     ((PFN_WDFCONTROLFINISHINITIALIZING) WdfFunctions[WdfControlFinishInitializingTableIndex])(WdfDriverGlobals, Device);
158 }
159 
160 
161 
162 #endif // (NTDDI_VERSION >= NTDDI_WIN2K)
163 
164 
165 
166 WDF_EXTERN_C_END
167 
168 #endif // _WDFCONTROL_H_
169 
170