ReactOS 0.4.16-dev-125-g798ea90
handleapi.cpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 HandleApi.cpp
8
9Abstract:
10
11 This module implements the driver frameworks handle functions.
12
13Author:
14
15
16
17
18Environment:
19
20 Both kernel and user mode
21
22Revision History:
23
24
25--*/
26
27#include "fxobjectpch.hpp"
28
29extern "C" {
30
31#if defined(EVENT_TRACING)
32#include "HandleAPI.tmh"
33#endif
34
35}
36
37size_t
40 )
41/*++
42
43Routine Description:
44 Get a context size from an object's attributes settings.
45
46Arguments:
47 Attributes - attributes which will describe the size requirements for the
48 associated context.
49
50Return 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
82Routine 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
86Arguments:
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
93Return 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
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
162PVOID
164 __in PFX_DRIVER_GLOBALS FxDriverGlobals,
166 __in size_t Size,
167 __in ULONG Tag,
169 __in USHORT ExtraSize,
171 )
172/*++
173
174Routine Description:
175 Allocates an FxObject derived object, it's associated context, and any
176 framework required headers and footers.
177
178Arguments:
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
191Return 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,
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),
241 );
242 }
243
244 return blob;
245}
246
247VOID
252 )
253/*++
254
255Routine Description:
256 Initializes a context header which describes a typed context.
257
258Arguments:
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
291PVOID
293 __in PFX_DRIVER_GLOBALS FxDriverGlobals,
294 __in PVOID AllocationStart,
295 __in USHORT ObjectSize,
298 )
299/*++
300
301Routine Description:
302 Initialize the object and its associated context.
303
304Arguments:
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
313Return Value:
314 The address of the object withing AllocationStart
315
316 --*/
317
318{
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,
340 );
341 }
342
343 return pObject;
344}
345
346VOID
349 __out PVOID* PPObject,
353 )
354/*++
355
356Routine 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
361Arguments:
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(),
388 Type);
389
390 /* NOTREACHED */
391 return;
392 }
393}
394
400 __in BOOLEAN AllowCallbacksOnly,
402 )
403/*++
404
405Routine Description:
406 Allocates an additional context on the object if it is in the correct state.
407
408Arguments:
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
414Return 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!",
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
491Done:
492
493 if (relRef) {
494 Object->RELEASE(&status);
495 }
496
497 return status;
498}
499
500// extern "C" all APIs
501extern "C" {
502
505WDFAPI
509 __in
511 __in
513 __in
517 )
518/*++
519
520Routine Description:
521 Allocates an additional context on the handle if the object is in the
522 correct state
523
524Arguments:
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
529Return 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
569Done:
570 return status;
571}
572
574WDFAPI
575PVOID
578 __in
580 __in
582 __in
584 )
585/*++
586
587Routine Description:
588 Retrieves the requested type from a handle
589
590Arguments:
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
596Return 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
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",
652
653 return NULL;
654}
655
657WDFAPI
661 __in
663 __in
665 )
666/*++
667
668Routine Description:
669 Reverse of WdfObjectGetTypedContextWorker. Function will return the handle
670 associated with the provided context pointer.
671
672Arguments:
673 ContextPointer - context pointer from which to retrieve the owning handle
674
675Return Value:
676 A valid WDF handle
677
678 --*/
679{
681
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
701}
702
703} // extern "C"
unsigned char BOOLEAN
Type
Definition: Type.h:7
LONG NTSTATUS
Definition: precomp.h:26
static FxObject * _GetObjectFromHandle(__in WDFOBJECT Handle, __inout PWDFOBJECT_OFFSET ObjectOffset)
Definition: fxobject.hpp:613
PVOID __inline GetObjectHandle(VOID)
Definition: fxobject.hpp:603
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
__inline FxContextHeader * GetContextHeader(VOID)
Definition: fxobject.hpp:720
Definition: Header.h:9
#define __in
Definition: dbghelp.h:35
#define __in_opt
Definition: dbghelp.h:38
#define __out
Definition: dbghelp.h:62
#define __deref_opt_out
Definition: dbghelp.h:32
#define TRACINGOBJECT
Definition: dbgtrace.h:59
#define TRACINGHANDLE
Definition: dbgtrace.h:61
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define __drv_maxIRQL(irql)
Definition: driverspecs.h:291
#define NonPagedPool
Definition: env_spec_w32.h:307
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T ContextSize
Definition: fltkernel.h:1444
PFX_DRIVER_GLOBALS fxDriverGlobals
DriverGlobals
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
#define DDI_ENTRY_IMPERSONATION_OK()
Definition: fxglobalskm.h:55
#define FX_CONTEXT_HEADER_SIZE
Definition: fxhandle.h:98
#define COMPUTE_OBJECT_SIZE(_rawObjectSize, _extraSize)
Definition: fxhandle.h:107
#define WDFEXPORT(a)
Definition: fxmacros.hpp:157
#define FxPointerNotNull(FxDriverGlobals, Ptr)
Definition: fxmacros.hpp:253
@ FxObjectDebugExtensionSignature
Definition: fxobject.hpp:227
@ FxObjectDebugExtensionSize
Definition: fxobject.hpp:226
FxObjectType
Definition: fxobject.hpp:117
@ FxObjectTypeExternal
Definition: fxobject.hpp:120
@ FxObjectTypeInternal
Definition: fxobject.hpp:119
USHORT WDFOBJECT_OFFSET
Definition: fxobject.hpp:80
void FxPoolFree(__in_xcount(ptr is at an offset from AllocationStart) PVOID ptr)
Definition: wdfpool.cpp:361
USHORT WDFTYPE
Definition: fxtypes.h:29
@ FX_VALIDATE_OPTION_ATTRIBUTES_REQUIRED
@ FX_VALIDATE_OPTION_PARENT_NOT_ALLOWED
_Must_inspect_result_ NTSTATUS FxValidateObjectAttributes(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
#define FxVerifierBugCheck(FxDriverGlobals, Error,...)
Definition: fxverifier.h:58
GLsizeiptr size
Definition: glext.h:5919
GLenum const GLfloat * params
Definition: glext.h:5645
GLbitfield flags
Definition: glext.h:7161
GLintptr offset
Definition: glext.h:5920
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
PCHAR pGivenName
Definition: handleapi.cpp:640
_Must_inspect_result_ __in WDFOBJECT __in PWDF_OBJECT_ATTRIBUTES __deref_opt_out PVOID * Context
Definition: handleapi.cpp:534
return NULL
Definition: handleapi.cpp:653
__in WDFOBJECT __in PCWDF_OBJECT_CONTEXT_TYPE_INFO TypeInfo
Definition: handleapi.cpp:601
size_t FxGetContextSize(__in_opt PWDF_OBJECT_ATTRIBUTES Attributes)
Definition: handleapi.cpp:38
FxObject * pObject
Definition: handleapi.cpp:605
_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
FxContextHeader * pHeader
Definition: handleapi.cpp:604
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
WDFOBJECT_OFFSET offset
Definition: handleapi.cpp:539
_Must_inspect_result_ __in WDFOBJECT __in PWDF_OBJECT_ATTRIBUTES Attributes
Definition: handleapi.cpp:514
_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
_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
_Must_inspect_result_ __in WDFOBJECT Handle
Definition: handleapi.cpp:512
VOID FxObjectHandleGetPtrQI(__in FxObject *Object, __out PVOID *PPObject, __in WDFOBJECT Handle, __in WDFTYPE Type, __in WDFOBJECT_OFFSET Offset)
Definition: handleapi.cpp:347
__in PVOID ContextPointer
Definition: handleapi.cpp:679
FxObject * object
Definition: handleapi.cpp:538
VOID FxContextHeaderInit(__in FxContextHeader *Header, __in FxObject *Object, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes)
Definition: handleapi.cpp:248
PFX_DRIVER_GLOBALS pFxDriverGlobals
Definition: handleapi.cpp:606
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_WARNING, TRACINGHANDLE, "Attempting to get context type %s from WDFOBJECT 0x%p", pGivenName, Handle)
#define ASSERT(a)
Definition: mode.c:44
ObjectType
Definition: metafile.c:81
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define FASTCALL
Definition: nt_native.h:50
#define MEMORY_ALLOCATION_ALIGNMENT
Definition: ntbasedef.h:90
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define STATUS_OBJECT_PATH_INVALID
Definition: ntstatus.h:293
#define STATUS_INTEGER_OVERFLOW
Definition: ntstatus.h:385
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TRACE_LEVEL_WARNING
Definition: storswtr.h:28
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
FxContextHeader * NextHeader
Definition: fxhandle.h:71
FxObject * Object
Definition: fxhandle.h:66
PCWDF_OBJECT_CONTEXT_TYPE_INFO ContextTypeInfo
Definition: fxhandle.h:87
_Must_inspect_result_ BOOLEAN IsVersionGreaterThanOrEqualTo(__in ULONG Major, __in ULONG Minor)
Definition: globalskm.cpp:92
Definition: image.c:134
Definition: ps.c:97
INT POOL_TYPE
Definition: typedefs.h:78
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
#define STATUS_OBJECT_NAME_INVALID
Definition: udferr_usr.h:148
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define ALIGN_UP(size, type)
Definition: umtypes.h:91
#define STDCALL
Definition: wdf.h:45
@ WDF_INVALID_HANDLE
Definition: wdfbugcodes.h:62
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
FORCEINLINE size_t WDF_ALIGN_SIZE_UP(_In_ size_t Length, _In_ size_t AlignTo)
Definition: wdfcore.h:129
#define WDF_PTR_ADD_OFFSET(_ptr, _offset)
Definition: wdfcore.h:144
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4065
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3815
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
FORCEINLINE WDFOBJECT WdfObjectContextGetObject(_In_ PVOID ContextPointer)
Definition: wdfobject.h:614
FORCEINLINE PVOID WdfObjectGetTypedContextWorker(_In_ WDFOBJECT Handle, _In_ PCWDF_OBJECT_CONTEXT_TYPE_INFO TypeInfo)
Definition: wdfobject.h:558
FORCEINLINE NTSTATUS WdfObjectAllocateContext(_In_ WDFOBJECT Handle, _In_ PWDF_OBJECT_ATTRIBUTES ContextAttributes, _Outptr_opt_ PVOID *Context)
Definition: wdfobject.h:587
#define WDFAPI
Definition: wdftypes.h:53