ReactOS  0.4.15-dev-5461-g062a8f2
fxglobalsum.h
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxGlobalsUm.h
8 
9 Abstract:
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 
17 Author:
18 
19 Environment:
20 
21  kernel mode only
22 
23 Revision History:
24 
25 
26 --*/
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #include "FxGlobals.h"
32 
33 extern IUMDFPlatform *g_IUMDFPlatform;
34 extern IWudfHost2 *g_IWudfHost2;
35 
37 __inline
38 BOOLEAN
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
51 VOID
53  __in PFX_DRIVER_GLOBALS FxDriverGlobals
54  )
55 {
56  UNREFERENCED_PARAMETER(FxDriverGlobals);
57  //
58  // Not yet supported for UMDF
59  //
60 }
61 
63 __inline
64 PVOID
67  )
68 {
70  ASSERTMSG("Not implemented for UMDF!\n", FALSE);
71  return NULL;
72 }
73 
74 __inline
75 PVOID
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
93 PVOID
96  )
97 {
99  ASSERTMSG("Not implemented for UMDF!\n", FALSE);
100  return NULL;
101 }
102 
103 __inline
104 VOID
108  )
109 {
112  ASSERTMSG("Not implemented for UMDF!\n", FALSE);
113 }
114 
115 __inline
116 VOID
120  )
121 {
124  ASSERTMSG("Not implemented for UMDF!\n", FALSE);
125 }
126 
127 __inline
128 VOID
132  )
133 {
135 
137 }
138 
139 __inline
140 BOOL
142 {
143  return g_IWudfHost2->IsCurrentThreadImpersonated();
144 }
145 
146 __inline
147 PWDF_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
_Must_inspect_result_ __inline PVOID FxAllocateFromNPagedLookasideListNoTracking(__in PNPAGED_LOOKASIDE_LIST Lookaside)
Definition: fxglobalsum.h:65
#define _In_opt_
Definition: ms_sal.h:309
_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:407
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
__inline VOID FxFreeToPagedLookasideList(__in PPAGED_LOOKASIDE_LIST Lookaside, __in PVOID Entry)
Definition: fxglobalsum.h:117
__inline PVOID FxAllocateFromPagedLookasideList(__in PPAGED_LOOKASIDE_LIST Lookaside)
Definition: fxglobalsum.h:94
__inline PWDF_ACTIVATION_FRAME * GetActivationList(VOID)
Definition: fxglobalsum.h:148
IWudfHost2 * g_IWudfHost2
Definition: framework.cpp:48
__inline VOID FxFreeToNPagedLookasideListNoTracking(__in PNPAGED_LOOKASIDE_LIST Lookaside, __in PVOID Entry)
Definition: fxglobalsum.h:105
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST * PNPAGED_LOOKASIDE_LIST
_Must_inspect_result_ __inline BOOLEAN FxIsProcessorGroupSupported(VOID)
Definition: fxglobalsum.h:39
static __inline VOID MxFreePool(__in PVOID Ptr)
Definition: mxmemorykm.h:41
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static __inline PVOID MxAllocatePoolWithTag(__in POOL_TYPE PoolType, __in SIZE_T NumberOfBytes, __in ULONG Tag)
Definition: mxmemorykm.h:30
#define ASSERTMSG(msg, exp)
Definition: nt_native.h:431
unsigned char BOOLEAN
#define _In_
Definition: ms_sal.h:308
__inline VOID FxFreeToNPagedLookasideList(__in PNPAGED_LOOKASIDE_LIST Lookaside, __in PVOID Entry)
Definition: fxglobalsum.h:129
__inline PVOID FxAllocateFromNPagedLookasideList(_In_ PNPAGED_LOOKASIDE_LIST Lookaside, _In_opt_ size_t ElementSize=0)
Definition: fxglobalsum.h:76
#define _Must_inspect_result_
Definition: ms_sal.h:558
__inline VOID FX_TRACK_DRIVER(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
Definition: fxglobalsum.h:52
#define NULL
Definition: types.h:112
IUMDFPlatform * g_IUMDFPlatform
Definition: mxgeneralum.cpp:29
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST * PPAGED_LOOKASIDE_LIST
#define __in
Definition: dbghelp.h:35
__inline BOOL IsCurrentThreadImpersonated()
Definition: fxglobalsum.h:141
base of all file and directory entries
Definition: entries.h:82