ReactOS 0.4.15-dev-8145-ga541a46
fxglobalsum.h
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxGlobalsUm.h
8
9Abstract:
10
11 This module contains user-mode specific globals definitions
12 for the frameworks.
13
14 For common definitions common between km and um please see
15 FxGlobals.h
16
17Author:
18
19Environment:
20
21 kernel mode only
22
23Revision History:
24
25
26--*/
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#include "FxGlobals.h"
32
33extern IUMDFPlatform *g_IUMDFPlatform;
34extern IWudfHost2 *g_IWudfHost2;
35
37__inline
40 VOID
41 )
42{
43 //
44 // UMDF 2.0 is targeted for platforms that support processor groups.
45 //
46 return TRUE;
47}
48
49
50__inline
51VOID
53 __in PFX_DRIVER_GLOBALS FxDriverGlobals
54 )
55{
56 UNREFERENCED_PARAMETER(FxDriverGlobals);
57 //
58 // Not yet supported for UMDF
59 //
60}
61
63__inline
67 )
68{
70 ASSERTMSG("Not implemented for UMDF!\n", FALSE);
71 return NULL;
72}
73
74__inline
78 _In_opt_ size_t ElementSize = 0
79 )
80{
82
83 //
84 // UMDF doesn't yet use a look-aside list, so just alloc memory from pool.
85 //
87 ElementSize,
88 0 // not used
89 );
90}
91
92__inline
96 )
97{
99 ASSERTMSG("Not implemented for UMDF!\n", FALSE);
100 return NULL;
101}
102
103__inline
104VOID
108 )
109{
112 ASSERTMSG("Not implemented for UMDF!\n", FALSE);
113}
114
115__inline
116VOID
120 )
121{
124 ASSERTMSG("Not implemented for UMDF!\n", FALSE);
125}
126
127__inline
128VOID
132 )
133{
135
137}
138
139__inline
140BOOL
142{
143 return g_IWudfHost2->IsCurrentThreadImpersonated();
144}
145
146__inline
147PWDF_ACTIVATION_FRAME *
149 VOID
150 )
151{
152 return g_IUMDFPlatform->GetActivationListHead();
153}
154
155//
156// This has to be a macro (as opposed an inline function) beacause of the activation frame is
157// allocated in the caller's stack.
158//
159// NOTE: This must not be wrapped in {}'s since that puts the activation frame in a very
160// short lived scope. It's destructor will be called when control leaves the block
161// rather than when the function returns and that defeats the entire purpose of the
162// activation frame (which is to live for the life of the DDI call).
163//
164// NOTE 2:
165// WDF_ACTIVATION constructor includes a default argument which is the _ReturnAddress()
166// instrinsic. This macro should be placed in methods such that the _ReturnAddress
167// points to calling driver code.
168//
169
170#define DDI_ENTRY_IMPERSONATION_OK() \
171 WDF_ACTIVATION activationFrame(GetActivationList()); \
172
173#define DDI_ENTRY() \
174 DDI_ENTRY_IMPERSONATION_OK() \
175 FX_VERIFY( \
176 DRIVER(BadArgument, TODO), \
177 CHECK("It is illegal to invoke this DDI while " \
178 "thread is impersonated", \
179 (FALSE == IsCurrentThreadImpersonated())) \
180 );
181
182#ifdef __cplusplus
183}
184#endif
unsigned char BOOLEAN
static __inline VOID MxFreePool(__in PVOID Ptr)
Definition: mxmemorykm.h:41
static __inline PVOID MxAllocatePoolWithTag(__in POOL_TYPE PoolType, __in SIZE_T NumberOfBytes, __in ULONG Tag)
Definition: mxmemorykm.h:30
#define __in
Definition: dbghelp.h:35
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NonPagedPool
Definition: env_spec_w32.h:307
unsigned int BOOL
Definition: ntddk_ex.h:94
__inline PVOID FxAllocateFromNPagedLookasideList(_In_ PNPAGED_LOOKASIDE_LIST Lookaside, _In_opt_ size_t ElementSize=0)
Definition: fxglobalsum.h:76
__inline VOID FxFreeToNPagedLookasideList(__in PNPAGED_LOOKASIDE_LIST Lookaside, __in PVOID Entry)
Definition: fxglobalsum.h:129
__inline BOOL IsCurrentThreadImpersonated()
Definition: fxglobalsum.h:141
IUMDFPlatform * g_IUMDFPlatform
Definition: mxgeneralum.cpp:29
__inline VOID FxFreeToNPagedLookasideListNoTracking(__in PNPAGED_LOOKASIDE_LIST Lookaside, __in PVOID Entry)
Definition: fxglobalsum.h:105
__inline VOID FX_TRACK_DRIVER(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: fxglobalsum.h:52
__inline VOID FxFreeToPagedLookasideList(__in PPAGED_LOOKASIDE_LIST Lookaside, __in PVOID Entry)
Definition: fxglobalsum.h:117
__inline PWDF_ACTIVATION_FRAME * GetActivationList(VOID)
Definition: fxglobalsum.h:148
_Must_inspect_result_ __inline PVOID FxAllocateFromNPagedLookasideListNoTracking(__in PNPAGED_LOOKASIDE_LIST Lookaside)
Definition: fxglobalsum.h:65
IWudfHost2 * g_IWudfHost2
Definition: framework.cpp:48
__inline PVOID FxAllocateFromPagedLookasideList(__in PPAGED_LOOKASIDE_LIST Lookaside)
Definition: fxglobalsum.h:94
_Must_inspect_result_ __inline BOOLEAN FxIsProcessorGroupSupported(VOID)
Definition: fxglobalsum.h:39
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
#define ASSERTMSG(msg, exp)
Definition: nt_native.h:431
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
base of all file and directory entries
Definition: entries.h:83
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_opt_ ULONG _Out_ WDFLOOKASIDE * Lookaside
Definition: wdfmemory.h:414
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST * PNPAGED_LOOKASIDE_LIST
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST * PPAGED_LOOKASIDE_LIST