ReactOS  0.4.15-dev-3165-gdf6fff7
mxgeneral.h
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 ModuleName:
6 
7  MxGeneral.h
8 
9 Abstract:
10 
11  Mode agnostic definitions for general OS
12  functions used in framework code
13 
14  See MxGeneralKm.h and MxGeneralUm.h for mode
15  specific implementations
16 
17 Author:
18 
19 
20 
21 Revision History:
22 
23 
24 
25 --*/
26 
27 #pragma once
28 
29 //
30 // Placeholder macro for a no-op
31 //
32 #define DO_NOTHING() (0)
33 
34 //
35 // We need to make these static functions of the class
36 // to force common definition to apply to um and km versions
37 //
38 // If we don't do this, um and km definitions can diverge
39 //
40 class Mx
41 {
42 public:
43 
44  //
45  // IsUM/IsKM don't change at runtime
46  // but defining them as functions makes it more convenient to check
47  // for UM/KM as compared to using ifdef's in certain places
48  //
49  // Since they are forceinlined and return a constant value,
50  // optimized code is no different than using an ifdef
51  //
52  // See FxPoolAllocator in WdfPool.cpp for example of such usage
53  //
54  __inline
55  static
56  BOOLEAN
57  IsUM(
58  );
59 
60  __inline
61  static
62  BOOLEAN
63  IsKM(
64  );
65 
66  __inline
67  static
68  MxThread
70  );
71 
72  __inline
73  static
74  MdEThread
76  );
77 
78  NTSTATUS
79  static
82  );
83 
84  __inline
85  static
86  KIRQL
88  );
89 
92  __inline
93  static
94  VOID
95  MxRaiseIrql(
98  );
99 
101  __inline
102  static
103  VOID
104  MxLowerIrql(
106  );
107 
108  __inline
109  static
110  VOID
112  __out PLARGE_INTEGER TickCount
113  );
114 
115  __inline
116  static
117  ULONG
119  );
120 
121 
122 
123 
124 
125 
126 
127 
128  static
130  VOID
131  MxBugCheckEx(
132  __in ULONG BugCheckCode,
133  __in ULONG_PTR BugCheckParameter1,
134  __in ULONG_PTR BugCheckParameter2,
135  __in ULONG_PTR BugCheckParameter3,
136  __in ULONG_PTR BugCheckParameter4
137  );
138 
139  __inline
140  static
141  VOID
143  );
144 
145  static
146  VOID
147  MxDbgPrint(
149  __in PCSTR DebugMessage,
150  ...
151  );
152 
153  __inline
154  static
155  VOID
156  MxAssert(
158  );
159 
160  __inline
161  static
162  VOID
163  MxAssertMsg(
166  );
167 
168  _Acquires_lock_(_Global_critical_region_)
169  __inline
170  static
171  VOID
172  MxEnterCriticalRegion(
173  );
174 
175  _Releases_lock_(_Global_critical_region_) //implies _Requires_lock_held_(_Global_critical_region_)
176  __inline
177  static
178  VOID
179  MxLeaveCriticalRegion(
180  );
181 
182  __inline
183  static
184  VOID
186  __in KPROCESSOR_MODE WaitMode,
189  );
190 
191  //
192  // Mode agnostic function to get address of a system function
193  // Should be used only for Rtl* functions applicable both to
194  // kernel mode and user mode
195  //
196  // User mode version is assumed to reside in ntdll.dll
197  //
198  // The argument type is MxFuncName so that it can be defined
199  // as LPCWSTR in kernel mode and LPCSTR in user mode
200  // which is what MmGetSystemRoutineAddress and GetProcAddress
201  // expect respectively
202  //
203  __inline
204  static
205  PVOID
208  );
209 
210  __inline
211  static
212  VOID
215  );
216 
217  __inline
218  static
219  VOID
222  );
223 
224  __inline
225  static
226  VOID
232  );
233 
234  __inline
235  static
236  NTSTATUS
238  __in MdRemoveLock RemoveLock,
240  );
241 
242  __inline
243  static
244  VOID
246  __in MdRemoveLock RemoveLock,
247  __in PVOID Tag
248  );
249 
250  __inline
251  static
252  VOID
254  __in MdRemoveLock RemoveLock,
255  __in PVOID Tag
256  );
257 
258  __inline
259  static
260  BOOLEAN
262  VOID
263  );
264 
265 
266  _Releases_lock_(_Global_cancel_spin_lock_) //implies _Requires_lock_held_(_Global_cancel_spin_lock_)
268  __inline
269  static
270  VOID
271  ReleaseCancelSpinLock(
273  );
274 
275  __inline
276  static
277  NTSTATUS
279  __out PCALLBACK_OBJECT *CallbackObject,
283  );
284 
285  __inline
286  static
287  PVOID
289  __in PCALLBACK_OBJECT CallbackObject,
292  );
293 
294  __inline
295  static
296  VOID
298  __in PVOID CbRegistration
299  );
300 
301  static
302  VOID
303  MxGlobalInit(
304  VOID
305  );
306 
307  __inline
308  static
309  VOID
311  __in PMDL Mdl
312  );
313 
314  __inline
315  static
316  PVOID
318  __inout PMDL Mdl,
320  );
321 
322  __inline
323  static
324  VOID
327  );
328 
329  __inline
330  static
331  PVOID
335  );
336 
337  __inline
338  static
339  NTSTATUS
343  _In_ ULONG DriverObjectExtensionSize,
344  // When successful, this always allocates already-aliased memory.
345  _Post_ _At_(*DriverObjectExtension, _When_(return==0,
347  _When_(return == 0, _Outptr_result_bytebuffer_(DriverObjectExtensionSize))
348  PVOID *DriverObjectExtension
349  );
350 
351  __inline
352  static
356  );
357 
358  __inline
359  static
360  VOID
363  );
364 
365  __inline
366  static
367  VOID
370  );
371 
372  __inline
373  static
374  VOID
377  );
378 
379  __inline
380  static
381  VOID
384  _In_opt_ PALLOCATE_FUNCTION Allocate,
385  _In_opt_ PFREE_FUNCTION Free,
386  _In_ ULONG Flags,
387  _In_ SIZE_T Size,
388  _In_ ULONG Tag,
390  );
391 
392  __inline
393  static
394  VOID
397  _In_opt_ PALLOCATE_FUNCTION Allocate,
398  _In_opt_ PFREE_FUNCTION Free,
399  _In_ ULONG Flags,
400  _In_ SIZE_T Size,
401  _In_ ULONG Tag,
403  );
404 
405  __inline
406  static
407  VOID
410  );
411 
412  static
413  VOID
416  );
417 
418  __inline
419  static
424  );
425 
426  __inline
427  static
428  NTSTATUS
431  _In_ ULONG DeviceExtensionSize,
436  _In_ PCUNICODE_STRING DefaultSDDLString,
439  );
440 
441  __inline
442  static
443  NTSTATUS
446  _In_ ULONG DeviceExtensionSize,
452  );
453 
454  __inline
455  static
456  NTSTATUS
460  );
461 
462  __inline
463  static
464  VOID
466  );
467 
468  __inline
469  static
470  NTSTATUS
471  MxOpenKey(
475  );
476 
477  __inline
478  static
479  NTSTATUS
483  );
484 
485  __inline
486  static
487  NTSTATUS
493  );
494 
495  __inline
496  static
497  NTSTATUS
498  MxDeleteKey(
500  );
501 
502  __inline
503  static
504  VOID
507  _In_ PVOID BaseVa,
509  );
510 
511  __inline
512  static
513  PVOID
515  _In_ PMDL Mdl
516  );
517 
518  __inline
519  static
520  VOID
522  _In_ PMDL SourceMdl,
526  );
527 
528  __inline
529  static
530  VOID
532  _Out_ PLARGE_INTEGER CurrentTime
533  );
534 
535  __inline
536  static
537  NTSTATUS
542  _In_ ULONG Type,
545  );
546 
547  __inline
548  static
549  NTSTATUS
554  _Out_opt_ PVOID KeyValueInformation,
555  _In_ ULONG Length,
557  );
558  __inline
559  static
560  NTSTATUS
566  __out PVOID *Object,
568  );
569 
570  __inline
571  static
572  NTSTATUS
575  );
576 
577  __inline
578  static
579  NTSTATUS
580  MxClose (
582  );
583 
584  __inline
585  static
586  KIRQL
589  );
590 
591  __inline
592  static
593  VOID
597  );
598 
599  __inline
600  static
601  BOOLEAN
606  );
607 };
static __inline PVOID MxGetMdlVirtualAddress(_In_ PMDL Mdl)
Definition: mxgeneralkm.h:654
static __inline NTSTATUS MxAcquireRemoveLock(__in MdRemoveLock RemoveLock, __in_opt PVOID Tag)
Definition: mxgeneralkm.h:268
_Inout_ PMDL TargetMdl
Definition: iofuncs.h:730
static __inline NTSTATUS MxRegisterDeviceInterface(_In_ PDEVICE_OBJECT PhysicalDeviceObject, _In_ const GUID *InterfaceClassGuid, _In_opt_ PUNICODE_STRING ReferenceString, _Out_ PUNICODE_STRING SymbolicLinkName)
Definition: mxgeneralkm.h:619
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
ObjectType
Definition: metafile.c:80
_In_ PVOID _In_ BOOLEAN Alertable
Definition: exfuncs.h:452
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:814
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2654
static __inline NTSTATUS MxCreateSymbolicLink(_In_ PUNICODE_STRING SymbolicLinkName, _In_ PUNICODE_STRING DeviceName)
Definition: mxgeneralkm.h:579
static VOID MxGlobalInit(VOID)
Definition: mxgeneralkm.cpp:51
static __inline NTSTATUS MxReferenceObjectByHandle(__in HANDLE Handle, __in ACCESS_MASK DesiredAccess, __in_opt POBJECT_TYPE ObjectType, __in KPROCESSOR_MODE AccessMode, __out PVOID *Object, __out_opt POBJECT_HANDLE_INFORMATION HandleInformation)
Definition: mxgeneralkm.h:728
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
static ACCESS_MASK const OBJECT_ATTRIBUTES ULONG TitleIndex
Definition: reg.c:130
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR _In_ ULONGLONG _In_ ULONGLONG _In_opt_ PEVENT_FILTER_DESCRIPTOR _Inout_opt_ PVOID CallbackContext
Definition: wmitypes.h:55
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
Definition: wdfdpc.h:107
#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 _Inout_
Definition: ms_sal.h:378
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4711
static __inline VOID MxQueryTickCount(__out PLARGE_INTEGER TickCount)
Definition: mxgeneralkm.h:116
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT _In_ PDEVICE_OBJECT TargetDevice
Definition: iofuncs.h:690
static __inline VOID MxBuildMdlForNonPagedPool(__inout PMDL Mdl)
Definition: mxgeneralkm.h:376
#define _Out_
Definition: ms_sal.h:345
#define _At_(target, annos)
Definition: ms_sal.h:244
#define __in_opt
Definition: dbghelp.h:38
Definition: mxgeneral.h:40
_In_ BOOLEAN Create
Definition: pstypes.h:527
static __inline VOID MxQuerySystemTime(_Out_ PLARGE_INTEGER CurrentTime)
Definition: mxgeneralkm.h:679
#define __drv_restoresIRQL
Definition: driverspecs.h:321
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFINTERRUPT * Interrupt
Definition: wdfinterrupt.h:372
LONG MaxLockedMinutes
Definition: lock.c:35
LONG NTSTATUS
Definition: precomp.h:26
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
static __inline KIRQL MxAcquireInterruptSpinLock(_Inout_ PKINTERRUPT Interrupt)
Definition: mxgeneralkm.h:767
static __inline NTSTATUS MxCreateDevice(_In_ MdDriverObject DriverObject, _In_ ULONG DeviceExtensionSize, _In_opt_ PUNICODE_STRING DeviceName, _In_ DEVICE_TYPE DeviceType, _In_ ULONG DeviceCharacteristics, _In_ BOOLEAN Exclusive, _Out_ MdDeviceObject *DeviceObject)
Definition: mxgeneralkm.h:557
static __inline VOID MxInitializeMdl(_In_ PMDL MemoryDescriptorList, _In_ PVOID BaseVa, _In_ SIZE_T Length)
Definition: mxgeneralkm.h:643
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
static __inline NTSTATUS MxUnRegisterPlugPlayNotification(__in __drv_freesMem(Pool) PVOID NotificationEntry)
Definition: mxgeneralkm.h:748
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT SourceDevice
Definition: iofuncs.h:690
#define _When_(expr, annos)
Definition: ms_sal.h:254
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1155
char * LPSTR
Definition: xmlstorage.h:182
__out __deref __drv_savesIRQL PKIRQL OldIrql
Definition: mxgeneral.h:98
static __inline VOID MxAssert(__in BOOLEAN Condition)
Definition: mxgeneralkm.h:165
_Out_ PKIRQL Irql
Definition: csq.h:179
#define DECLSPEC_NORETURN
Definition: ntbasedef.h:176
static int Link(const char **args)
Definition: vfdcmd.c:2414
_In_ PCALLBACK_FUNCTION CallbackFunction
Definition: exfuncs.h:1034
_In_opt_ PALLOCATE_FUNCTION Allocate
Definition: exfuncs.h:814
static __inline VOID UnregisterCallback(__in PVOID CbRegistration)
Definition: mxgeneralkm.h:348
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:814
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST * PNPAGED_LOOKASIDE_LIST
uint32_t ULONG_PTR
Definition: typedefs.h:65
static __inline VOID MxInitializeNPagedLookasideList(_Out_ PNPAGED_LOOKASIDE_LIST Lookaside, _In_opt_ PALLOCATE_FUNCTION Allocate, _In_opt_ PFREE_FUNCTION Free, _In_ ULONG Flags, _In_ SIZE_T Size, _In_ ULONG Tag, _In_ USHORT Depth)
Definition: mxgeneralkm.h:451
static VOID MxDetachDevice(_Inout_ MdDeviceObject Device)
Definition: mxgeneralkm.h:502
UCHAR KIRQL
Definition: env_spec_w32.h:591
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3272
#define __out_opt
Definition: dbghelp.h:65
_In_ ULONG _In_opt_ PVOID _In_ PDRIVER_OBJECT _In_ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE _Inout_opt_ __drv_aliasesMem PVOID _Outptr_result_nullonfailure_ _At_ * NotificationEntry(return==0, __drv_allocatesMem(Mem))) PVOID *NotificationEntry
static __inline NTSTATUS MxOpenKey(_Out_ PHANDLE KeyHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes)
Definition: mxgeneralkm.h:597
#define __drv_raisesIRQL(irql)
Definition: driverspecs.h:311
static __inline MdDeviceObject MxGetAttachedDeviceReference(__in MdDeviceObject DriverObject)
Definition: mxgeneralkm.h:415
#define _Outptr_result_bytebuffer_(size)
Definition: ms_sal.h:472
_Inout_ PMDL MemoryDescriptorList
Definition: mmfuncs.h:405
static __inline PVOID RegisterCallback(__in PCALLBACK_OBJECT CallbackObject, __in MdCallbackFunction CallbackFunction, __in PVOID CallbackContext)
Definition: mxgeneralkm.h:334
_In_ PEPROCESS _In_ KPROCESSOR_MODE AccessMode
Definition: mmfuncs.h:395
static __inline VOID MxReferenceObject(__in PVOID Object)
Definition: mxgeneralkm.h:238
#define __drv_formatString(kind)
Definition: driverspecs.h:270
#define __drv_aliasesMem
Definition: btrfs_drv.h:205
_In_ WDFDEVICE _In_ ULONG DeviceCharacteristics
Definition: wdfdevice.h:2772
#define __out
Definition: dbghelp.h:62
static __inline NTSTATUS MxDeleteKey(_In_ HANDLE KeyHandle)
Definition: mxgeneralkm.h:634
static __inline NTSTATUS MxClose(__in HANDLE Handle)
Definition: mxgeneralkm.h:758
static __inline VOID MxDeleteSymbolicLink(__in PUNICODE_STRING Link)
Definition: mxgeneralkm.h:424
unsigned char BOOLEAN
static __inline PVOID MxGetSystemRoutineAddress(__in MxFuncName FuncName)
Definition: mxgeneralkm.h:226
static __inline VOID MxDbgBreakPoint()
Definition: mxgeneralkm.h:157
_In_ POBJECT_ATTRIBUTES _In_ BOOLEAN _In_ BOOLEAN AllowMultipleCallbacks
Definition: exfuncs.h:748
static __inline NTSTATUS MxSetValueKey(_In_ HANDLE KeyHandle, _In_ PUNICODE_STRING ValueName, _In_opt_ ULONG TitleIndex, _In_ ULONG Type, _In_opt_ PVOID Data, _In_ ULONG DataSize)
Definition: mxgeneralkm.h:688
#define _In_
Definition: ms_sal.h:308
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
DeviceType
Definition: mmdrv.h:41
IN ULONG IN UCHAR Condition
__drv_aliasesMem _In_ PVOID ClientIdentificationAddress
Definition: iofuncs.h:1028
_Acquires_lock_(_Global_critical_region_) __inline static VOID MxEnterCriticalRegion()
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
static __inline MdDeviceObject MxAttachDeviceToDeviceStack(_In_ MdDeviceObject SourceDevice, _In_ MdDeviceObject TargetDevice)
Definition: mxgeneralkm.h:511
DWORD Interval
Definition: netstat.c:33
static NTSTATUS MxTerminateCurrentThread(__in NTSTATUS Status)
Definition: mxgeneralkm.h:77
Status
Definition: gdiplustypes.h:24
static __inline NTSTATUS MxAllocateDriverObjectExtension(_In_ MdDriverObject DriverObject, _In_ PVOID ClientIdentificationAddress, _In_ ULONG DriverObjectExtensionSize, _Post_ _At_(*DriverObjectExtension, _When_(return==0, __drv_aliasesMem __drv_allocatesMem(Mem) _Post_notnull_)) _When_(return==0, _Outptr_result_bytebuffer_(DriverObjectExtensionSize)) PVOID *DriverObjectExtension)
Definition: mxgeneralkm.h:396
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:675
#define __drv_useCancelIRQL
Definition: driverspecs.h:331
static __inline BOOLEAN IsUM()
Definition: mxgeneralkm.h:45
#define __drv_allocatesMem(kind)
Definition: driverspecs.h:256
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define __drv_nonConstant
Definition: driverspecs.h:305
macro IMPORT Name endm macro EXPORT Name global &Name endm macro TEXTAREA section rx align endm macro DATAAREA section rw endm macro RODATAAREA section rw endm macro NESTED_ENTRY Name FuncName equ &Name PrologName equ &Name &_Prolog FuncEndName equ &Name &_end global &FuncName align func &FuncName & FuncName
Definition: kxarm.h:185
#define __drv_requiresIRQL(irql)
Definition: driverspecs.h:320
static __inline PVOID MxGetSystemAddressForMdlSafe(__inout PMDL Mdl, __in ULONG Priority)
Definition: mxgeneralkm.h:366
CALLBACK_FUNCTION * MdCallbackFunction
Definition: mxgeneralkm.h:35
static __inline VOID MxInitializePagedLookasideList(_Out_ PPAGED_LOOKASIDE_LIST Lookaside, _In_opt_ PALLOCATE_FUNCTION Allocate, _In_opt_ PFREE_FUNCTION Free, _In_ ULONG Flags, _In_ SIZE_T Size, _In_ ULONG Tag, _In_ USHORT Depth)
Definition: mxgeneralkm.h:472
#define _Post_notnull_
Definition: ms_sal.h:701
Definition: bufpool.h:50
Type
Definition: Type.h:6
__in PWDFDEVICE_INIT __in BOOLEAN Exclusive
_In_ ACCESS_MASK _In_opt_ POBJECT_TYPE _In_ KPROCESSOR_MODE _Out_ PVOID _Out_opt_ POBJECT_HANDLE_INFORMATION HandleInformation
Definition: obfuncs.h:40
static __inline VOID MxReleaseRemoveLockAndWait(__in MdRemoveLock RemoveLock, __in PVOID Tag)
Definition: mxgeneralkm.h:288
static __inline KIRQL MxGetCurrentIrql()
Definition: mxgeneralkm.h:86
static __inline VOID MxBuildPartialMdl(_In_ PMDL SourceMdl, _Inout_ PMDL TargetMdl, _In_ PVOID VirtualAddress, _In_ ULONG Length)
Definition: mxgeneralkm.h:663
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
CHAR Message[80]
Definition: alive.c:5
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:240
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY Priority
Definition: wdfinterrupt.h:651
static __inline NTSTATUS MxSetDeviceInterfaceState(_In_ PUNICODE_STRING SymbolicLinkName, _In_ BOOLEAN Enable)
Definition: mxgeneralkm.h:608
Definition: ketypes.h:687
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:454
KIRQL * PKIRQL
Definition: env_spec_w32.h:592
#define __inout
Definition: dbghelp.h:50
static __inline VOID MxReleaseInterruptSpinLock(_Inout_ PKINTERRUPT Interrupt, _In_ KIRQL OldIrql)
Definition: mxgeneralkm.h:776
LPCWSTR MxFuncName
Definition: mxgeneralkm.h:27
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
static __inline MdEThread GetCurrentEThread()
Definition: mxgeneralkm.h:69
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
static VOID MxDbgPrint(__drv_formatString(printf) __in PCSTR DebugMessage,...)
Definition: mxgeneralkm.cpp:7
static __inline VOID MxAssertMsg(__in LPSTR Message, __in BOOLEAN Condition)
Definition: mxgeneralkm.h:176
static __inline VOID MxDeleteNPagedLookasideList(_In_ PNPAGED_LOOKASIDE_LIST LookasideList)
Definition: mxgeneralkm.h:433
static __inline NTSTATUS MxCreateDeviceSecure(_In_ MdDriverObject DriverObject, _In_ ULONG DeviceExtensionSize, _In_opt_ PUNICODE_STRING DeviceName, _In_ DEVICE_TYPE DeviceType, _In_ ULONG DeviceCharacteristics, _In_ BOOLEAN Exclusive, _In_ PCUNICODE_STRING DefaultSDDLString, _In_opt_ LPCGUID DeviceClassGuid, _Out_ MdDeviceObject *DeviceObject)
Definition: mxgeneralkm.h:521
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:675
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
ULONG_PTR SIZE_T
Definition: typedefs.h:80
static __inline VOID MxReleaseRemoveLock(__in MdRemoveLock RemoveLock, __in PVOID Tag)
Definition: mxgeneralkm.h:278
#define HIGH_LEVEL
Definition: env_spec_w32.h:703
static __inline MxThread MxGetCurrentThread()
Definition: mxgeneralkm.h:61
static __inline VOID MxFlushQueuedDpcs()
Definition: mxgeneralkm.h:589
static __inline VOID MxInitializeRemoveLock(__in MdRemoveLock Lock, __in ULONG AllocateTag, __in ULONG MaxLockedMinutes, __in ULONG HighWatermark)
Definition: mxgeneralkm.h:256
_In_ PWDFDEVICE_INIT _In_ CONST GUID * DeviceClassGuid
Definition: wdfdevice.h:3333
static __inline VOID MxUnlockPages(__in PMDL Mdl)
Definition: mxgeneralkm.h:357
_Must_inspect_result_ _In_ WDFDEVICE _In_ CONST GUID _In_opt_ PCUNICODE_STRING ReferenceString
Definition: wdfdevice.h:3625
unsigned short USHORT
Definition: pedump.c:61
_In_ ULONG AllocateTag
Definition: iofuncs.h:1067
#define DEVICE_TYPE
Definition: guid.c:10
#define __deref
Definition: ms_sal.h:2629
#define _Out_opt_
Definition: ms_sal.h:346
_In_ CONST GUID * InterfaceClassGuid
Definition: iofuncs.h:1136
unsigned int * PULONG
Definition: retypes.h:1
#define __drv_savesIRQL
Definition: driverspecs.h:325
static DECLSPEC_NORETURN VOID MxBugCheckEx(__in ULONG BugCheckCode, __in ULONG_PTR BugCheckParameter1, __in ULONG_PTR BugCheckParameter2, __in ULONG_PTR BugCheckParameter3, __in ULONG_PTR BugCheckParameter4)
Definition: mxgeneralkm.h:133
#define __drv_freesMem(kind)
Definition: driverspecs.h:271
#define _Post_
Definition: ms_sal.h:620
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
static __inline NTSTATUS MxQueryValueKey(_In_ HANDLE KeyHandle, _In_ PUNICODE_STRING ValueName, _In_ KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, _Out_opt_ PVOID KeyValueInformation, _In_ ULONG Length, _Out_ PULONG ResultLength)
Definition: mxgeneralkm.h:708
_In_ HANDLE Handle
Definition: extypes.h:390
static __inline BOOLEAN MxHasEnoughRemainingThreadStack(VOID)
Definition: mxgeneralkm.h:298
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:124
unsigned int ULONG
Definition: retypes.h:1
static __inline VOID MxDeleteDevice(_In_ MdDeviceObject Device)
Definition: mxgeneralkm.h:493
static __inline NTSTATUS CreateCallback(__out PCALLBACK_OBJECT *CallbackObject, __in POBJECT_ATTRIBUTES ObjectAttributes, __in BOOLEAN Create, __in BOOLEAN AllowMultipleCallbacks)
Definition: mxgeneralkm.h:318
static __inline BOOLEAN IsKM()
Definition: mxgeneralkm.h:53
static __inline PVOID MxGetDriverObjectExtension(__in MdDriverObject DriverObject, __in PVOID ClientIdentificationAddress)
Definition: mxgeneralkm.h:385
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
const char * PCSTR
Definition: typedefs.h:52
static __inline ULONG MxQueryTimeIncrement()
Definition: mxgeneralkm.h:125
_In_ ULONG _In_ KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass
Definition: cmfuncs.h:93
static __inline VOID MxDeletePagedLookasideList(_In_ PPAGED_LOOKASIDE_LIST LookasideList)
Definition: mxgeneralkm.h:442
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST * PPAGED_LOOKASIDE_LIST
_In_ ULONG _In_ ULONG _In_ ULONG HighWatermark
Definition: iofuncs.h:1067
static __inline VOID MxDereferenceObject(__in PVOID Object)
Definition: mxgeneralkm.h:247
#define __in
Definition: dbghelp.h:35
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4751
ULONG ACCESS_MASK
Definition: nt_native.h:40
static __inline BOOLEAN MxInsertQueueDpc(__inout PRKDPC Dpc, __in_opt PVOID SystemArgument1, __in_opt PVOID SystemArgument2)
Definition: mxgeneralkm.h:786
enum _KEY_VALUE_INFORMATION_CLASS KEY_VALUE_INFORMATION_CLASS
Definition: reg.c:135
static __inline VOID MxDelayExecutionThread(__in KPROCESSOR_MODE WaitMode, __in BOOLEAN Alertable, __in PLARGE_INTEGER Interval)
Definition: mxgeneralkm.h:209
__drv_maxIRQL(HIGH_LEVEL) __drv_raisesIRQL(NewIrql) __inline static VOID MxRaiseIrql(__in KIRQL NewIrql
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING SymbolicLinkName
Definition: wdfdevice.h:3736
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _In_ _IRQL_restores_ KIRQL NewIrql
Definition: ke.h:114
#define printf
Definition: config.h:203
_Must_inspect_result_ _In_ LPCGUID _In_ ULONG _In_ FSRTL_ALLOCATE_ECP_FLAGS _In_opt_ PFSRTL_EXTRA_CREATE_PARAMETER_CLEANUP_CALLBACK _Inout_ PVOID LookasideList
Definition: fltkernel.h:2550
_Releases_lock_(_Global_critical_region_) __inline static VOID MxLeaveCriticalRegion()