ReactOS  0.4.15-dev-1638-gc0caa5c
wdfcommonbuffer.h
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation. All rights reserved.
4 
5 _WdfVersionBuild_
6 
7 Module Name:
8 
9  WdfCommonBuffer.h
10 
11 Abstract:
12 
13  WDF CommonBuffer support
14 
15 Environment:
16 
17  Kernel mode only.
18 
19 Notes:
20 
21 Revision History:
22 
23 --*/
24 
25 //
26 // NOTE: This header is generated by stubwork. Please make any
27 // modifications to the corresponding template files
28 // (.x or .y) and use stubwork to regenerate the header
29 //
30 
31 #ifndef _WDFCOMMONBUFFER_H_
32 #define _WDFCOMMONBUFFER_H_
33 
34 #ifndef WDF_EXTERN_C
35  #ifdef __cplusplus
36  #define WDF_EXTERN_C extern "C"
37  #define WDF_EXTERN_C_START extern "C" {
38  #define WDF_EXTERN_C_END }
39  #else
40  #define WDF_EXTERN_C
41  #define WDF_EXTERN_C_START
42  #define WDF_EXTERN_C_END
43  #endif
44 #endif
45 
47 
48 
49 
50 #if (NTDDI_VERSION >= NTDDI_WIN2K)
51 
52 
53 
54 typedef struct _WDF_COMMON_BUFFER_CONFIG {
55  //
56  // Size of this structure in bytes
57  //
59 
60  //
61  // Alignment requirement of the buffer address
62  //
64 
66 
68 VOID
72  )
73 {
75 
76  Config->Size = sizeof(WDF_COMMON_BUFFER_CONFIG);
77  Config->AlignmentRequirement = AlignmentRequirement;
78 }
79 
80 //
81 // WDF Function: WdfCommonBufferCreate
82 //
83 typedef
86 WDFAPI
88 (STDCALL *PFN_WDFCOMMONBUFFERCREATE)(
89  _In_
91  _In_
92  WDFDMAENABLER DmaEnabler,
93  _In_
95  size_t Length,
96  _In_opt_
98  _Out_
99  WDFCOMMONBUFFER* CommonBuffer
100  );
101 
105 NTSTATUS
106 WdfCommonBufferCreate(
107  _In_
108  WDFDMAENABLER DmaEnabler,
109  _In_
110  _When_(Length == 0, __drv_reportError(Length cannot be zero))
111  size_t Length,
112  _In_opt_
114  _Out_
115  WDFCOMMONBUFFER* CommonBuffer
116  )
117 {
119 }
120 
121 //
122 // WDF Function: WdfCommonBufferCreateWithConfig
123 //
124 typedef
127 WDFAPI
128 NTSTATUS
129 (STDCALL *PFN_WDFCOMMONBUFFERCREATEWITHCONFIG)(
130  _In_
132  _In_
133  WDFDMAENABLER DmaEnabler,
134  _In_
135  _When_(Length == 0, __drv_reportError(Length cannot be zero))
136  size_t Length,
137  _In_
139  _In_opt_
141  _Out_
142  WDFCOMMONBUFFER* CommonBuffer
143  );
144 
148 NTSTATUS
149 WdfCommonBufferCreateWithConfig(
150  _In_
151  WDFDMAENABLER DmaEnabler,
152  _In_
153  _When_(Length == 0, __drv_reportError(Length cannot be zero))
154  size_t Length,
155  _In_
157  _In_opt_
159  _Out_
160  WDFCOMMONBUFFER* CommonBuffer
161  )
162 {
164 }
165 
166 //
167 // WDF Function: WdfCommonBufferGetAlignedVirtualAddress
168 //
169 typedef
171 WDFAPI
172 PVOID
173 (STDCALL *PFN_WDFCOMMONBUFFERGETALIGNEDVIRTUALADDRESS)(
174  _In_
176  _In_
177  WDFCOMMONBUFFER CommonBuffer
178  );
179 
182 PVOID
183 WdfCommonBufferGetAlignedVirtualAddress(
184  _In_
185  WDFCOMMONBUFFER CommonBuffer
186  )
187 {
188  return ((PFN_WDFCOMMONBUFFERGETALIGNEDVIRTUALADDRESS) WdfFunctions[WdfCommonBufferGetAlignedVirtualAddressTableIndex])(WdfDriverGlobals, CommonBuffer);
189 }
190 
191 //
192 // WDF Function: WdfCommonBufferGetAlignedLogicalAddress
193 //
194 typedef
196 WDFAPI
198 (STDCALL *PFN_WDFCOMMONBUFFERGETALIGNEDLOGICALADDRESS)(
199  _In_
201  _In_
202  WDFCOMMONBUFFER CommonBuffer
203  );
204 
208 WdfCommonBufferGetAlignedLogicalAddress(
209  _In_
210  WDFCOMMONBUFFER CommonBuffer
211  )
212 {
213  return ((PFN_WDFCOMMONBUFFERGETALIGNEDLOGICALADDRESS) WdfFunctions[WdfCommonBufferGetAlignedLogicalAddressTableIndex])(WdfDriverGlobals, CommonBuffer);
214 }
215 
216 //
217 // WDF Function: WdfCommonBufferGetLength
218 //
219 typedef
221 WDFAPI
222 size_t
223 (STDCALL *PFN_WDFCOMMONBUFFERGETLENGTH)(
224  _In_
226  _In_
227  WDFCOMMONBUFFER CommonBuffer
228  );
229 
232 size_t
233 WdfCommonBufferGetLength(
234  _In_
235  WDFCOMMONBUFFER CommonBuffer
236  )
237 {
238  return ((PFN_WDFCOMMONBUFFERGETLENGTH) WdfFunctions[WdfCommonBufferGetLengthTableIndex])(WdfDriverGlobals, CommonBuffer);
239 }
240 
241 
242 
243 #endif // (NTDDI_VERSION >= NTDDI_WIN2K)
244 
245 
247 
248 #endif // _WDFCOMMONBUFFER_H_
249 
#define _Must_inspect_result_
Definition: no_sal2.h:62
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define __drv_reportError(why)
Definition: driverspecs.h:302
WDF_EXTERN_C_START struct _WDF_COMMON_BUFFER_CONFIG * PWDF_COMMON_BUFFER_CONFIG
LONG NTSTATUS
Definition: precomp.h:26
#define WDF_EXTERN_C_END
DriverGlobals
#define _In_opt_
Definition: no_sal2.h:212
#define WdfFunctions
Definition: wdf.h:66
_In_ WDFDEVICE _In_ ULONG AlignmentRequirement
Definition: wdfdevice.h:2851
#define WDFAPI
Definition: wdftypes.h:53
#define WDF_EXTERN_C_START
int zero
Definition: sehframes.cpp:29
#define _Out_
Definition: no_sal2.h:160
void * PVOID
Definition: retypes.h:9
__kernel_size_t size_t
Definition: linux.h:237
PWDF_DRIVER_GLOBALS WdfDriverGlobals
#define STDCALL
Definition: wdf.h:45
_Must_inspect_result_ _IRQL_requires_max_(PASSIVE_LEVEL) WDFAPI NTSTATUS(STDCALL *PFN_WDFCOMMONBUFFERCREATE)(_In_ PWDF_DRIVER_GLOBALS DriverGlobals
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_ PWDF_COMMON_BUFFER_CONFIG Config
#define NTSTATUS
Definition: precomp.h:20
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:474
WDF_EXTERN_C_START struct _WDF_COMMON_BUFFER_CONFIG WDF_COMMON_BUFFER_CONFIG
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define _In_
Definition: no_sal2.h:158
FORCEINLINE VOID WDF_COMMON_BUFFER_CONFIG_INIT(_Out_ PWDF_COMMON_BUFFER_CONFIG Config, _In_ ULONG AlignmentRequirement)
#define FORCEINLINE
Definition: wdftypes.h:67
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFCOMMONBUFFER * CommonBuffer
#define PHYSICAL_ADDRESS
Definition: env_spec_w32.h:53
_Must_inspect_result_ _In_ WDFDMAENABLER DmaEnabler
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _When_(Length==0, __drv_reportError(Length cannot be zero)) size_t Length
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes