xref: /reactos/sdk/lib/drivers/wdf/wdfcx.h (revision 53221834)
1 /*
2  * PROJECT:     Kernel Mode Device Framework
3  * LICENSE:     GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE:     Missing headers (wdfcx.h)
5  * COPYRIGHT:   2020 Victor Perevertkin (victor.perevertkin@reactos.org)
6  */
7 
8 #ifndef _WDFCX_H_
9 #define _WDFCX_H_
10 
11 typedef BOOLEAN
12 (STDCALL *PFN_WDFCX_DEVICE_FILE_CREATE) (
13     _In_ WDFDEVICE Device,
14     _In_ WDFREQUEST Request,
15     _In_opt_ WDFFILEOBJECT FileObject);
16 
17 // _WDFCX_FILEOBJECT_CONFIG_V1_17
18 
19 typedef struct _WDFCX_FILEOBJECT_CONFIG {
20     //
21     // Size of this structure in bytes
22     //
23     ULONG Size;
24 
25     //
26     // Event callback for create requests
27     //
28     PFN_WDFCX_DEVICE_FILE_CREATE  EvtCxDeviceFileCreate;
29 
30     //
31     // Event callback for close requests
32     //
33     PFN_WDF_FILE_CLOSE   EvtFileClose;
34 
35     //
36     // Event callback for cleanup requests
37     //
38     PFN_WDF_FILE_CLEANUP EvtFileCleanup;
39 
40     //
41     // If WdfTrue, create/cleanup/close file object related requests will be
42     // sent down the stack.
43     //
44     // If WdfFalse, create/cleanup/close will be completed at this location in
45     // the device stack.
46     //
47     // If WdfDefault, behavior depends on device type
48     // FDO, PDO, Control:  use the WdfFalse behavior
49     // Filter:  use the WdfTrue behavior
50     //
51     WDF_TRI_STATE AutoForwardCleanupClose;
52 
53     //
54     // Specify whether framework should create WDFFILEOBJECT and also
55     // whether it can FsContexts fields in the WDM fileobject to store
56     // WDFFILEOBJECT so that it can avoid table look up and improve perf.
57     //
58     WDF_FILEOBJECT_CLASS FileObjectClass;
59 
60 } WDFCX_FILEOBJECT_CONFIG, *PWDFCX_FILEOBJECT_CONFIG;
61 
62 typedef NTSTATUS
63 (STDCALL *PFN_WDFCXDEVICE_WDM_IRP_PREPROCESS)(
64     _In_ WDFDEVICE Device,
65     _Inout_ PIRP Irp,
66     _In_ PVOID DispatchContext);
67 
68 typedef PWDFCXDEVICE_INIT
69 (STDCALL *PFN_WDFCXDEVICEINITALLOCATE)(
70     _In_ PWDF_DRIVER_GLOBALS DriverGlobals,
71     _In_ PWDFDEVICE_INIT DeviceInit);
72 
73 typedef NTSTATUS
74 (STDCALL *PFN_WDFCXDEVICEINITASSIGNWDMIRPPREPROCESSCALLBACK) (
75     _In_ PWDF_DRIVER_GLOBALS DriverGlobals,
76     _In_ PWDFCXDEVICE_INIT CxDeviceInit,
77     _In_ PFN_WDFCXDEVICE_WDM_IRP_PREPROCESS EvtCxDeviceWdmIrpPreprocess,
78     _In_ UCHAR MajorFunction,
79     _When_(NumMinorFunctions > 0, _In_reads_bytes_(NumMinorFunctions))
80     _When_(NumMinorFunctions == 0, _In_opt_)
81     PUCHAR MinorFunctions,
82     _In_ ULONG NumMinorFunctions);
83 
84 typedef VOID
85 (STDCALL *PFN_WDFCXDEVICEINITSETIOINCALLERCONTEXTCALLBACK)(
86     _In_ PWDF_DRIVER_GLOBALS DriverGlobals,
87     _In_ PWDFCXDEVICE_INIT CxDeviceInit,
88     _In_ PFN_WDF_IO_IN_CALLER_CONTEXT EvtIoInCallerContext);
89 
90 typedef VOID
91 (STDCALL *PFN_WDFCXDEVICEINITSETREQUESTATTRIBUTES)(
92     _In_ PWDF_DRIVER_GLOBALS DriverGlobals,
93     _In_ PWDFCXDEVICE_INIT CxDeviceInit,
94     _In_ PWDF_OBJECT_ATTRIBUTES RequestAttributes);
95 
96 typedef VOID
97 (STDCALL *PFN_WDFCXDEVICEINITSETFILEOBJECTCONFIG)(
98     _In_ PWDF_DRIVER_GLOBALS DriverGlobals,
99     _In_ PWDFCXDEVICE_INIT CxDeviceInit,
100     _In_ PWDFCX_FILEOBJECT_CONFIG CxFileObjectConfig,
101     _In_opt_ PWDF_OBJECT_ATTRIBUTES FileObjectAttributes);
102 
103 typedef VOID
104 (STDCALL *PFN_WDFCXVERIFIERKEBUGCHECK)(
105     _In_ PWDF_DRIVER_GLOBALS DriverGlobals,
106     _In_opt_ WDFOBJECT Object,
107     _In_ ULONG BugCheckCode,
108     _In_ ULONG_PTR BugCheckParameter1,
109     _In_ ULONG_PTR BugCheckParameter2,
110     _In_ ULONG_PTR BugCheckParameter3,
111     _In_ ULONG_PTR BugCheckParameter4);
112 
113 typedef WDFIOTARGET
114 (STDCALL *PFN_WDFDEVICEGETSELFIOTARGET)(
115     _In_ PWDF_DRIVER_GLOBALS DriverGlobals,
116     _In_ WDFDEVICE Device);
117 
118 typedef VOID
119 (STDCALL *PFN_WDFDEVICEINITALLOWSELFIOTARGET)(
120     _In_ PWDF_DRIVER_GLOBALS DriverGlobals,
121     _In_ PWDFDEVICE_INIT DeviceInit);
122 
123 typedef NTSTATUS
124 (STDCALL *PFN_WDFIOTARGETSELFASSIGNDEFAULTIOQUEUE)(
125     _In_ PWDF_DRIVER_GLOBALS DriverGlobals,
126     _In_ WDFIOTARGET IoTarget,
127     _In_ WDFQUEUE Queue);
128 
129 // some other random stuff
130 
131 typedef PVOID PFN_WDF_CLASS_EXTENSIONIN_BIND;
132 typedef PVOID PFN_WDF_CLASS_EXTENSIONIN_UNBIND;
133 typedef PVOID PFN_WDF_CLASS_EXPORT;
134 typedef PVOID PFN_WDF_CLASS_LIBRARY_INITIALIZE;
135 typedef PVOID PFN_WDF_CLASS_LIBRARY_DEINITIALIZE;
136 typedef PVOID PFN_WDF_CLASS_LIBRARY_BIND_CLIENT;
137 typedef PVOID PFN_WDF_CLASS_LIBRARY_UNBIND_CLIENT;
138 typedef PVOID PFN_WDF_CLIENT_BIND_CLASS;
139 typedef PVOID PFN_WDF_CLIENT_UNBIND_CLASS;
140 
141 #endif // _WDFCX_H_
142