ReactOS  0.4.15-dev-1632-g4e289ce
handleapi.cpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  HandleApi.cpp
8 
9 Abstract:
10 
11  This module implements the driver frameworks handle functions.
12 
13 Author:
14 
15 
16 
17 
18 Environment:
19 
20  Both kernel and user mode
21 
22 Revision History:
23 
24 
25 --*/
26 
27 #include "fxobjectpch.hpp"
28 
29 extern "C" {
30 
31 #if defined(EVENT_TRACING)
32 #include "HandleAPI.tmh"
33 #endif
34 
35 }
36 
37 size_t
40  )
41 /*++
42 
43 Routine Description:
44  Get a context size from an object's attributes settings.
45 
46 Arguments:
47  Attributes - attributes which will describe the size requirements for the
48  associated context.
49 
50 Return Value:
51  Size requirements for the associated context.
52 
53  --*/
54 {
55  size_t contextSize = 0;
56 
57  if (Attributes != NULL) {
58  if (Attributes->ContextTypeInfo != NULL) {
59  if (Attributes->ContextSizeOverride != 0) {
60  contextSize = Attributes->ContextSizeOverride;
61  }
62  else {
63  contextSize = Attributes->ContextTypeInfo->ContextSize;
64  }
65  }
66  }
67 
68  return contextSize;
69 }
70 
74  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
75  __in USHORT RawObjectSize,
76  __in USHORT ExtraSize,
77  __in size_t ContextSize,
78  __out size_t* Total
79  )
80 /*++
81 
82 Routine Description:
83  Calculates the size of an allocation for an FxObject that will contain the
84  object, its initial context and any addtional headers.
85 
86 Arguments:
87  FxDriverGlobals - driver's globals
88  RawObjectSize - the size of the FxObject derived object
89  ExtraSize - additional size required by the derived object
90  ContextSize - Size requirements for the associated context (see FxGetContextSize() above).
91  Total - pointer which will receive the final size requirement
92 
93 Return Value:
94  NT_SUCCESS on success, !NT_SUCCESS on failure
95 
96  --*/
97 {
99 
100  *Total = 0;
101 
102  status = RtlSizeTAdd(
105  Total
106  );
107 
108  if (NT_SUCCESS(status)) {
109  if (ContextSize != 0) {
110  size_t alignUp;
111 
112  alignUp = ALIGN_UP(ContextSize, PVOID);
113 
114  //
115  // overflow after aligning up to a pointer boundary;
116  //
117  if (alignUp < ContextSize) {
119  }
120 
121  status = RtlSizeTAdd(*Total, alignUp, Total);
122  }
123  }
124 
125  if (NT_SUCCESS(status) && FxDriverGlobals->IsObjectDebugOn()) {
126  //
127  // Attempt to add in the debug extension
128  //
129  status = RtlSizeTAdd(*Total,
131  Total);
132  }
133 
134  if (!NT_SUCCESS(status)) {
136  FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGOBJECT,
137  "Size overflow, object size 0x%x, extra object size 0x%x, "
138  "context size 0x%I64x, %!STATUS!",
139  RawObjectSize, ExtraSize, ContextSize, status);
140  }
141 
142  return status;
143 }
144 
146 NTSTATUS
148  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
149  __in USHORT RawObjectSize,
150  __in USHORT ExtraSize,
152  __out size_t* Total
153  )
154 {
155  return FxCalculateObjectTotalSize2(FxDriverGlobals,
156  RawObjectSize,
157  ExtraSize,
159  Total);
160 }
161 
162 PVOID
164  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
166  __in size_t Size,
167  __in ULONG Tag,
169  __in USHORT ExtraSize,
171  )
172 /*++
173 
174 Routine Description:
175  Allocates an FxObject derived object, it's associated context, and any
176  framework required headers and footers.
177 
178 Arguments:
179  FxDriverGlobals - caller's globals
180  PoolType - type of pool to be used in allocating the object's memory
181  Size - size of the object (as passed to operator new() by the compiler)
182  Tag - tag to use when allocating the object's memory
183  Attributes - attributes which describe the context to be associated with the
184  object
185  ExtraSize - any addtional storage required by the object itself
186  ObjectType - the type (internal or external) of object being allocated. An
187  internal object is a worker object which will never have an associated
188  type or be Commit()'ed into an external object handle that the client
189  driver will see.
190 
191 Return Value:
192  A valid pointer on success, NULL otherwise
193 
194  --*/
195 {
196  PVOID blob;
197  size_t totalSize;
199 
200  if (Tag == 0) {
201  Tag = FxDriverGlobals->Tag;
202  ASSERT(Tag != 0);
203  }
204 
206  //
207  // An internal object might need the debug extension size added to it,
208  // but that's it. No extra size, no FxContextHeader.
209  //
210  if (FxDriverGlobals->IsObjectDebugOn()) {
211  status = RtlSizeTAdd(Size,
213  &totalSize);
214  }
215  else {
216  totalSize = Size;
218  }
219  }
220  else {
221  status = FxCalculateObjectTotalSize(FxDriverGlobals,
222  (USHORT) Size,
223  ExtraSize,
224  Attributes,
225  &totalSize);
226  }
227 
228  if (!NT_SUCCESS(status)) {
229  return NULL;
230  }
231 
232  blob = FxPoolAllocateWithTag(FxDriverGlobals, PoolType, totalSize, Tag);
233 
234  if (blob != NULL) {
236  FxDriverGlobals,
237  blob,
238  COMPUTE_OBJECT_SIZE((USHORT) Size, ExtraSize),
239  Attributes,
240  ObjectType
241  );
242  }
243 
244  return blob;
245 }
246 
247 VOID
252  )
253 /*++
254 
255 Routine Description:
256  Initializes a context header which describes a typed context.
257 
258 Arguments:
259  Header - the header to initialize
260  Object - the object on which the context is being associated with
261  Attributes - description of the typed context
262 
263  --*/
264 {
266 
267  Header->Object = Object;
268 
269  if (Attributes != NULL) {
270  if (Attributes->ContextTypeInfo != NULL) {
271  size_t contextSize;
272 
273  if (Attributes->ContextSizeOverride != 0) {
274  contextSize = Attributes->ContextSizeOverride;
275 
276  }
277  else {
278  contextSize = Attributes->ContextTypeInfo->ContextSize;
279  }
280 
281  //
282  // Zero initialize the entire context
283  //
284  RtlZeroMemory(&Header->Context[0], ALIGN_UP(contextSize, PVOID));
285  }
286 
287  Header->ContextTypeInfo = Attributes->ContextTypeInfo;
288  }
289 }
290 
291 PVOID
293  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
294  __in PVOID AllocationStart,
295  __in USHORT ObjectSize,
298  )
299 /*++
300 
301 Routine Description:
302  Initialize the object and its associated context.
303 
304 Arguments:
305  FxDriverGlobals - caller's globals
306  AllocationStart - start of the memory block allocated to represent the object.
307  This will not be the same as the pointer which represents the address of
308  the object itself in memory
309  ObjectSize - size of the object
310  Attributes - description of its context
311  ObjectType - type (internal or external) of object being initialized
312 
313 Return Value:
314  The address of the object withing AllocationStart
315 
316  --*/
317 
318 {
319  FxObject* pObject;
320 
321  if (FxDriverGlobals->IsObjectDebugOn()) {
322  FxObjectDebugExtension* pExtension;
323 
324  pExtension = (FxObjectDebugExtension*) AllocationStart;
325 
328 
329  pObject = (FxObject*) &pExtension->AllocationStart[0];
330  }
331  else {
332  pObject = (FxObject*) AllocationStart;
333  }
334 
338  pObject,
339  Attributes
340  );
341  }
342 
343  return pObject;
344 }
345 
346 VOID
349  __out PVOID* PPObject,
351  __in WDFTYPE Type,
353  )
354 /*++
355 
356 Routine Description:
357  Worker function for FxObjectHandleGetPtrXxx which will call
358  FxObject::QueryInterface when the Type does not match the object's built in
359  Type.
360 
361 Arguments:
362  Object - object to query
363  PPObject - pointer which will recieve the queried for object
364  Handle - handle which the caller passed to the framework
365  Type - required object type
366  Offset - offset of the handle within the object. Nearly all handles will have
367  a zero object.
368 
369  --*/
370 {
371  FxQueryInterfaceParams params = { PPObject, Type, Offset };
373 
374  *PPObject = NULL;
375 
376  status = Object->QueryInterface(&params);
377 
378  if (!NT_SUCCESS(status)) {
380  Object->GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGDEVICE,
381  "Object Type Mismatch, Handle 0x%p, Type 0x%x, "
382  "Obj 0x%p, SB 0x%x",
383  Handle, Type, Object, Object->GetType());
384 
385  FxVerifierBugCheck(Object->GetDriverGlobals(),
387  (ULONG_PTR) Handle,
388  Type);
389 
390  /* NOTREACHED */
391  return;
392  }
393 }
394 
396 NTSTATUS
400  __in BOOLEAN AllowCallbacksOnly,
402  )
403 /*++
404 
405 Routine Description:
406  Allocates an additional context on the object if it is in the correct state.
407 
408 Arguments:
409  Object - object on which to add a context
410  Attributes - attributes which describe the type and size of the new context
411  AllowEmptyContext -TRUE to allow logic to allocate the context's header only.
412  Context - optional pointer which will recieve the new context
413 
414 Return Value:
415  STATUS_SUCCESS upon success, STATUS_OBJECT_NAME_EXISTS if the context type
416  is already attached to the handle, and !NT_SUCCESS on failure
417 
418  --*/
419 {
423  size_t size;
424  BOOLEAN relRef;
425  ULONG flags;
426 
427  fxDriverGlobals = Object->GetDriverGlobals();
428  header = NULL;
429  relRef = FALSE;
430 
431  //
432  // Init validation flags.
433  //
437  }
438 
439  //
440  // Basic validations.
441  //
443  if (!NT_SUCCESS(status)) {
444  goto Done;
445  }
446 
447  //
448  // Check for context type!
449  //
450  if (Attributes->ContextTypeInfo == NULL && AllowCallbacksOnly == FALSE) {
454  "Attributes %p ContextTypeInfo is NULL, %!STATUS!",
455  Attributes, status);
456  goto Done;
457  }
458 
459  Object->ADDREF(&status);
460  relRef = TRUE;
461 
462  //
463  // By passing 0's for raw object size and extra size, we can compute the
464  // size of only the header and its contents.
465  //
467  if (!NT_SUCCESS(status)) {
468  goto Done;
469  }
470 
472  FxPoolAllocate(fxDriverGlobals, NonPagedPool, size);
473 
474  if (header == NULL) {
476  goto Done;
477  }
478 
480 
481  status = Object->AddContext(header, Context, Attributes);
482 
483  //
484  // STATUS_OBJECT_NAME_EXISTS will not fail NT_SUCCESS, so check
485  // explicitly for STATUS_SUCCESS.
486  //
487  if (status != STATUS_SUCCESS) {
489  }
490 
491 Done:
492 
493  if (relRef) {
494  Object->RELEASE(&status);
495  }
496 
497  return status;
498 }
499 
500 // extern "C" all APIs
501 extern "C" {
502 
505 WDFAPI
506 NTSTATUS
507 STDCALL
509  __in
511  __in
513  __in
516  PVOID* Context
517  )
518 /*++
519 
520 Routine Description:
521  Allocates an additional context on the handle if the object is in the
522  correct state
523 
524 Arguments:
525  Handle - handle on which to add a context
526  Attributes - attributes which describe the type and size of the new context
527  Context - optional pointer which will recieve the new context
528 
529 Return Value:
530  STATUS_SUCCESS upon success, STATUS_OBJECT_NAME_EXISTS if the context type
531  is already attached to the handle, and !NT_SUCCESS on failure
532 
533  --*/
534 {
536 
540 
542 
543  //
544  // No need to call FxObjectHandleGetPtr( , , FX_TYPE_OBJECT) because
545  // we assume that the object handle will point back to an FxObject. (The
546  // call to FxObjectHandleGetPtr will just make needless virtual call into
547  // FxObject anyways).
548  //
549  offset = 0;
551 
552  if (offset != 0) {
553 
554 
555 
558  object->GetDriverGlobals(), TRACE_LEVEL_WARNING, TRACINGHANDLE,
559  "WDFHANDLE %p cannot have contexts added to it, %!STATUS!",
560  Handle, status);
561  goto Done;
562  }
563 
564  //
565  // Internal helper function does the rest of the work.
566  //
568 
569 Done:
570  return status;
571 }
572 
574 WDFAPI
575 PVOID
576 FASTCALL
578  __in
580  __in
582  __in
584  )
585 /*++
586 
587 Routine Description:
588  Retrieves the requested type from a handle
589 
590 Arguments:
591  Handle - the handle to retrieve the context from
592  TypeInfo - global constant pointer which describes the type. Since the pointer
593  value is unique in all of kernel space, we will perform a pointer compare
594  instead of a deep structure compare
595 
596 Return Value:
597  A valid context pointere or NULL. NULL is not a failure, querying for a type
598  not associated with the handle is a legitimate operation.
599 
600  --*/
601 {
603 
608 
610 
611  //
612  // Do not call FxObjectHandleGetPtr( , , FX_TYPE_OBJECT) because this is a
613  // hot spot / workhorse function that should be as efficient as possible.
614  //
615  // A call to FxObjectHandleGetPtr would :
616  // 1) invoke a virtual call to QueryInterface
617  //
618  // 2) ASSERT that the ref count of the object is > zero. Since this is one
619  // of the few functions that can be called in EvtObjectDestroy where the
620  // ref count is zero, that is not a good side affect.
621  //
622  offset = 0;
624 
625  //
626  // Use the object's globals, not the caller's
627  //
629 
631 
633 
635  if (pHeader->ContextTypeInfo == TypeInfo) {
636  return &pHeader->Context[0];
637  }
638  }
639 
641 
642  if (TypeInfo->ContextName != NULL) {
643  pGivenName = TypeInfo->ContextName;
644  }
645  else {
646  pGivenName = "<no typename given>";
647  }
648 
650  "Attempting to get context type %s from WDFOBJECT 0x%p",
651  pGivenName, Handle);
652 
653  return NULL;
654 }
655 
657 WDFAPI
658 WDFOBJECT
659 FASTCALL
661  __in
663  __in
665  )
666 /*++
667 
668 Routine Description:
669  Reverse of WdfObjectGetTypedContextWorker. Function will return the handle
670  associated with the provided context pointer.
671 
672 Arguments:
673  ContextPointer - context pointer from which to retrieve the owning handle
674 
675 Return Value:
676  A valid WDF handle
677 
678  --*/
679 {
681 
683  FxObject* pObject;
684 
685  //
686  // The context could be one of the chained contexts on the object and not
687  // the first one, so it is easiest to go back to the object and build the
688  // handle value from the FxObject*.
689  //
690  #pragma prefast(push);
691 
692 
693  #pragma prefast(disable:__WARNING_BUFFER_UNDERFLOW, "No way to express that passed in ptr is at an offset");
694 
697 
698  #pragma prefast(pop);
699 
700  return (WDFOBJECT) pObject->GetObjectHandle();
701 }
702 
703 } // extern "C"
signed char * PCHAR
Definition: retypes.h:7
ObjectType
Definition: metafile.c:80
_Must_inspect_result_ __drv_maxIRQL(DISPATCH_LEVEL) WDFAPI NTSTATUS STDCALL WDFEXPORT(WdfObjectAllocateContext)(__in PWDF_DRIVER_GLOBALS DriverGlobals
size_t FxGetContextSize(__in_opt PWDF_OBJECT_ATTRIBUTES Attributes)
Definition: handleapi.cpp:38
#define _Must_inspect_result_
Definition: no_sal2.h:62
__in WDFOBJECT __in PCWDF_OBJECT_CONTEXT_TYPE_INFO TypeInfo
Definition: handleapi.cpp:601
FxContextHeader * NextHeader
Definition: fxhandle.h:71
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_Must_inspect_result_ __in WDFOBJECT __in PWDF_OBJECT_ATTRIBUTES __deref_opt_out PVOID * Context
Definition: handleapi.cpp:534
#define ALIGN_UP(size, type)
Definition: umtypes.h:91
Definition: image.c:133
#define WDF_PTR_ADD_OFFSET(_ptr, _offset)
Definition: wdfcore.h:144
_Must_inspect_result_ NTSTATUS FxObjectAllocateContext(__in FxObject *Object, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in BOOLEAN AllowCallbacksOnly, __deref_opt_out PVOID *Context)
Definition: handleapi.cpp:397
#define __in_opt
Definition: dbghelp.h:38
#define TRUE
Definition: types.h:120
__in PVOID ContextPointer
Definition: handleapi.cpp:679
FxObject * Object
Definition: fxhandle.h:66
LONG NTSTATUS
Definition: precomp.h:26
WDFOBJECT_OFFSET offset
Definition: handleapi.cpp:539
_Must_inspect_result_ NTSTATUS FxCalculateObjectTotalSize2(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in USHORT RawObjectSize, __in USHORT ExtraSize, __in size_t ContextSize, __out size_t *Total)
Definition: handleapi.cpp:73
PCWDF_OBJECT_CONTEXT_TYPE_INFO ContextTypeInfo
Definition: fxhandle.h:87
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
_Must_inspect_result_ __in WDFOBJECT __in PWDF_OBJECT_ATTRIBUTES Attributes
Definition: handleapi.cpp:512
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T ContextSize
Definition: fltkernel.h:1444
DriverGlobals
#define FASTCALL
Definition: nt_native.h:50
#define FxVerifierBugCheck(FxDriverGlobals, Error,...)
Definition: fxverifier.h:58
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: handleapi.cpp:606
FxObjectType
Definition: fxobject.hpp:117
#define FALSE
Definition: types.h:117
GLenum const GLfloat * params
Definition: glext.h:5645
Definition: Header.h:8
#define STATUS_INTEGER_OVERFLOW
Definition: ntstatus.h:385
#define WDFEXPORT(a)
Definition: fxmacros.hpp:157
const DWORD * blob
Definition: effect.c:999
#define WDFAPI
Definition: wdftypes.h:53
FORCEINLINE size_t WDF_ALIGN_SIZE_UP(_In_ size_t Length, _In_ size_t AlignTo)
Definition: wdfcore.h:129
PVOID __inline GetObjectHandle(VOID)
Definition: fxobject.hpp:603
FxContextHeader * pHeader
Definition: handleapi.cpp:604
#define __out
Definition: dbghelp.h:62
#define TRACINGOBJECT
Definition: dbgtrace.h:59
unsigned char BOOLEAN
_Must_inspect_result_ BOOLEAN IsVersionGreaterThanOrEqualTo(__in ULONG Major, __in ULONG Minor)
Definition: globalskm.cpp:92
USHORT WDFOBJECT_OFFSET
Definition: fxobject.hpp:80
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define __deref_opt_out
Definition: dbghelp.h:32
PVOID FxObjectHandleAlloc(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in POOL_TYPE PoolType, __in size_t Size, __in ULONG Tag, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __in USHORT ExtraSize, __in FxObjectType ObjectType)
Definition: handleapi.cpp:163
PCHAR pGivenName
Definition: handleapi.cpp:640
#define COMPUTE_OBJECT_SIZE(_rawObjectSize, _extraSize)
Definition: fxhandle.h:107
#define TRACINGDEVICE
Definition: dbgtrace.h:58
FxObject * object
Definition: handleapi.cpp:538
GLsizeiptr size
Definition: glext.h:5919
#define STDCALL
Definition: wdf.h:45
#define ASSERT(a)
Definition: mode.c:45
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
INT POOL_TYPE
Definition: typedefs.h:78
GLintptr offset
Definition: glext.h:5920
FORCEINLINE WDFOBJECT WdfObjectContextGetObject(_In_ PVOID ContextPointer)
Definition: wdfobject.h:614
Type
Definition: Type.h:6
FxObject * pObject
Definition: handleapi.cpp:605
GLbitfield flags
Definition: glext.h:7161
_Must_inspect_result_ NTSTATUS FxCalculateObjectTotalSize(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in USHORT RawObjectSize, __in USHORT ExtraSize, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out size_t *Total)
Definition: handleapi.cpp:147
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_WARNING, TRACINGHANDLE, "Attempting to get context type %s from WDFOBJECT 0x%p", pGivenName, Handle)
FORCEINLINE PVOID WdfObjectGetTypedContextWorker(_In_ WDFOBJECT Handle, _In_ PCWDF_OBJECT_CONTEXT_TYPE_INFO TypeInfo)
Definition: wdfobject.h:558
VOID FxContextHeaderInit(__in FxContextHeader *Header, __in FxObject *Object, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes)
Definition: handleapi.cpp:248
_Must_inspect_result_ NTSTATUS FxValidateObjectAttributes(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
FORCEINLINE NTSTATUS WdfObjectAllocateContext(_In_ WDFOBJECT Handle, _In_ PWDF_OBJECT_ATTRIBUTES ContextAttributes, _Outptr_opt_ PVOID *Context)
Definition: wdfobject.h:587
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define TRACE_LEVEL_WARNING
Definition: storswtr.h:28
__inline FxContextHeader * GetContextHeader(VOID)
Definition: fxobject.hpp:720
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
#define TRACINGHANDLE
Definition: dbgtrace.h:61
_Must_inspect_result_ __in WDFOBJECT Handle
Definition: handleapi.cpp:512
unsigned short USHORT
Definition: pedump.c:61
PFX_DRIVER_GLOBALS fxDriverGlobals
return NULL
Definition: handleapi.cpp:653
USHORT WDFTYPE
Definition: fxtypes.h:29
#define STATUS_OBJECT_NAME_INVALID
Definition: udferr_usr.h:148
#define STATUS_OBJECT_PATH_INVALID
Definition: ntstatus.h:293
FxPointerNotNull(GetFxDriverGlobals(DriverGlobals), Handle)
static FxObject * _GetObjectFromHandle(__in WDFOBJECT Handle, __inout PWDFOBJECT_OFFSET ObjectOffset)
Definition: fxobject.hpp:613
VOID FxObjectHandleGetPtrQI(__in FxObject *Object, __out PVOID *PPObject, __in WDFOBJECT Handle, __in WDFTYPE Type, __in WDFOBJECT_OFFSET Offset)
Definition: handleapi.cpp:347
NTSTATUS status
Definition: handleapi.cpp:537
PVOID FxObjectAndHandleHeaderInit(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PVOID AllocationStart, __in USHORT ObjectSize, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __in FxObjectType ObjectType)
Definition: handleapi.cpp:292
_In_ HANDLE Handle
Definition: extypes.h:390
#define DDI_ENTRY_IMPERSONATION_OK()
Definition: fxglobalskm.h:55
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3810
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define ULONG_PTR
Definition: config.h:101
#define STATUS_SUCCESS
Definition: shellext.h:65
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
void FxPoolFree(__in_xcount(ptr is at an offset from AllocationStart) PVOID ptr)
Definition: wdfpool.cpp:361
#define __in
Definition: dbghelp.h:35
#define MEMORY_ALLOCATION_ALIGNMENT
Definition: ntbasedef.h:90
#define FX_CONTEXT_HEADER_SIZE
Definition: fxhandle.h:98
struct CFHEADER header
Definition: fdi.c:101
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
Definition: ps.c:97