ReactOS 0.4.15-dev-5666-gc548b97
mxgeneralkm.h
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5ModuleName:
6
7 MxGeneralKm.h
8
9Abstract:
10
11 Kernel mode implementation for general OS
12 functions defined in MxGeneral.h
13
14Author:
15
16
17
18Revision History:
19
20
21
22--*/
23
24#pragma once
25
26#define MAKE_MX_FUNC_NAME(x) L##x
39
40#include "mxgeneral.h"
41#include <ntstrsafe.h>
42
43__inline
46 )
47{
48 return FALSE;
49}
50
51__inline
54 )
55{
56 return TRUE;
57}
58
59__inline
62 )
63{
64 return KeGetCurrentThread();
65}
66
67__inline
70 )
71{
72 return PsGetCurrentThread();
73}
74
75__inline
79 )
80{
82}
83
84__inline
87 )
88{
89 return KeGetCurrentIrql();
90}
91
94__inline
95VOID
96Mx::MxRaiseIrql(
99 )
100{
102}
103
105__inline
106VOID
107Mx::MxLowerIrql(
109 )
110{
112}
113
114__inline
115VOID
117 __out PLARGE_INTEGER TickCount
118 )
119{
120 KeQueryTickCount(TickCount);
121}
122
123__inline
124ULONG
126 )
127{
128 return KeQueryTimeIncrement();
129}
130
131__inline
132VOID
134 __in ULONG BugCheckCode,
135 __in ULONG_PTR BugCheckParameter1,
136 __in ULONG_PTR BugCheckParameter2,
137 __in ULONG_PTR BugCheckParameter3,
138 __in ULONG_PTR BugCheckParameter4
139)
140{
141#ifdef _MSC_VER
142 #pragma prefast(suppress:__WARNING_USE_OTHER_FUNCTION, "KeBugCheckEx is the intent.");
143#endif
145 BugCheckCode,
146 BugCheckParameter1,
147 BugCheckParameter2,
148 BugCheckParameter3,
149 BugCheckParameter4
150 );
151
153}
154
155__inline
156VOID
158 )
159{
161}
162
163__inline
164VOID
167 )
168{
170
171 ASSERT(Condition); //this get defined as RtlAssert
172}
173
174__inline
175VOID
179 )
180{
183
185
186 // ASSERTMSG(Message, Condition); TODO: wtf
187}
188
189_Acquires_lock_(_Global_critical_region_)
190__inline
191VOID
192Mx::MxEnterCriticalRegion(
193 )
194{
196}
197
198_Releases_lock_(_Global_critical_region_)
199__inline
200VOID
201Mx::MxLeaveCriticalRegion(
202 )
203{
205}
206
207__inline
208VOID
210 __in KPROCESSOR_MODE WaitMode,
213 )
214{
215 ASSERTMSG("Interval must be relative\n", Interval->QuadPart <= 0);
216
218 WaitMode,
219 Alertable,
221 );
222}
223
224__inline
225PVOID
228 )
229{
230 UNICODE_STRING funcName;
231
232 RtlInitUnicodeString(&funcName, FuncName);
233 return MmGetSystemRoutineAddress(&funcName);
234}
235
236__inline
237VOID
240 )
241{
243}
244
245__inline
246VOID
249 )
250{
252}
253
254__inline
255VOID
261 )
262{
264}
265
266__inline
269 __in MdRemoveLock RemoveLock,
271 )
272{
273 return IoAcquireRemoveLock(RemoveLock, Tag);
274}
275
276__inline
277VOID
279 __in MdRemoveLock RemoveLock,
281 )
282{
283 IoReleaseRemoveLock(RemoveLock, Tag);
284}
285
286__inline
287VOID
289 __in MdRemoveLock RemoveLock,
291 )
292{
293 IoReleaseRemoveLockAndWait(RemoveLock, Tag);
294}
295
296__inline
299 VOID
300 )
301{
302 return (IoGetRemainingStackSize() < KERNEL_STACK_SIZE/2) ? FALSE : TRUE;
303}
304
305_Releases_lock_(_Global_cancel_spin_lock_)
307__inline
308VOID
309Mx::ReleaseCancelSpinLock(
311 )
312{
314}
315
316__inline
319 __out PCALLBACK_OBJECT *CallbackObject,
323 )
324{
325 return ExCreateCallback(
326 CallbackObject,
328 Create,
330}
331
332__inline
333PVOID
335 __in PCALLBACK_OBJECT CallbackObject,
338 )
339{
340 return ExRegisterCallback(
341 CallbackObject,
344}
345
346__inline
347VOID
349 __in PVOID CbRegistration
350 )
351{
352 ExUnregisterCallback(CbRegistration);
353}
354
355__inline
356VOID
359 )
360{
362}
363
364__inline
365PVOID
369 )
370{
372}
373
374__inline
375VOID
378 )
379{
381}
382
383__inline
384PVOID
388 )
389{
392}
393
394__inline
399 _In_ ULONG DriverObjectExtensionSize,
400 // When successful, this always allocates already-aliased memory.
401 _Post_ _At_(*DriverObjectExtension, _When_(return==0,
403 _When_(return == 0, _Outptr_result_bytebuffer_(DriverObjectExtensionSize))
404 PVOID *DriverObjectExtension
405 )
406{
409 DriverObjectExtensionSize,
410 DriverObjectExtension);
411}
412
413__inline
417 )
418{
420}
421
422__inline
423VOID
426 )
427{
429}
430
431__inline
432VOID
435 )
436{
438}
439
440__inline
441VOID
444 )
445{
447}
448
449__inline
450VOID
453 _In_opt_ PALLOCATE_FUNCTION Allocate,
454 _In_opt_ PFREE_FUNCTION Free,
457 _In_ ULONG Tag,
459 )
460{
462 Allocate,
463 Free,
464 Flags,
465 Size,
466 Tag,
467 Depth);
468}
469
470__inline
471VOID
474 _In_opt_ PALLOCATE_FUNCTION Allocate,
475 _In_opt_ PFREE_FUNCTION Free,
478 _In_ ULONG Tag,
480 )
481{
483 Allocate,
484 Free,
485 Flags,
486 Size,
487 Tag,
488 Depth);
489}
490
491__inline
492VOID
495 )
496{
498}
499
500__inline
501VOID
504 )
505{
507}
508
509__inline
514 )
515{
517}
518
519__inline
523 _In_ ULONG DeviceExtensionSize,
528 _In_ PCUNICODE_STRING DefaultSDDLString,
531 )
532{
533#ifndef __REACTOS__ // we don't have wdmsec.lib
534 return IoCreateDeviceSecure(DriverObject,
535 DeviceExtensionSize,
539 Exclusive,
540 DefaultSDDLString,
543#else
544 return IoCreateDevice(
546 DeviceExtensionSize,
550 Exclusive,
552#endif
553}
554
555__inline
559 _In_ ULONG DeviceExtensionSize,
565)
566{
568 DeviceExtensionSize,
572 Exclusive,
574
575}
576
577__inline
582 )
583{
585}
586
587__inline
588VOID
590 )
591{
593}
594
595__inline
601 )
602{
603 return ZwOpenKey(KeyHandle, DesiredAccess, ObjectAttributes);
604}
605
606__inline
611 )
612{
614}
615
616
617__inline
624 )
625{
630}
631
632__inline
636 )
637{
638 return ZwDeleteKey(KeyHandle);
639}
640
641__inline
642VOID
645 _In_ PVOID BaseVa,
647 )
648{
650}
651
652__inline
653PVOID
656 )
657{
659}
660
661__inline
662VOID
664 _In_ PMDL SourceMdl,
668 )
669{
670 IoBuildPartialMdl(SourceMdl,
671 TargetMdl,
673 Length
674 );
675}
676
677__inline
678VOID
680 _Out_ PLARGE_INTEGER CurrentTime
681 )
682{
683 KeQuerySystemTime(CurrentTime);
684}
685
686__inline
695 )
696{
697 return ZwSetValueKey(KeyHandle,
698 ValueName,
700 Type,
701 Data,
703 );
704}
705
706__inline
712 _Out_opt_ PVOID KeyValueInformation,
715)
716{
717 return ZwQueryValueKey(KeyHandle,
718 ValueName,
720 KeyValueInformation,
721 Length,
723 );
724}
725
726__inline
735 )
736{
738 Handle,
742 Object,
744}
745
746__inline
750 )
751{
753}
754
755
756__inline
760 )
761{
762 return ZwClose(Handle);
763}
764
765__inline
766KIRQL
769 )
770{
772}
773
774__inline
775VOID
779 )
780{
782}
783
784__inline
790)
791{
793}
794
795
unsigned char BOOLEAN
Type
Definition: Type.h:7
LONG NTSTATUS
Definition: precomp.h:26
@ Create
Definition: registry.c:563
#define __drv_aliasesMem
Definition: btrfs_drv.h:203
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1157
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
static __inline VOID MxBuildPartialMdl(_In_ PMDL SourceMdl, _Inout_ PMDL TargetMdl, _In_ PVOID VirtualAddress, _In_ ULONG Length)
Definition: mxgeneralkm.h:663
static __inline VOID MxQueryTickCount(__out PLARGE_INTEGER TickCount)
Definition: mxgeneralkm.h:116
static __inline VOID MxDeletePagedLookasideList(_In_ PPAGED_LOOKASIDE_LIST LookasideList)
Definition: mxgeneralkm.h:442
static __inline KIRQL MxAcquireInterruptSpinLock(_Inout_ PKINTERRUPT Interrupt)
Definition: mxgeneralkm.h:767
static __inline NTSTATUS MxDeleteKey(_In_ HANDLE KeyHandle)
Definition: mxgeneralkm.h:634
static __inline VOID MxDbgBreakPoint()
Definition: mxgeneralkm.h:157
static __inline VOID MxReleaseRemoveLockAndWait(__in MdRemoveLock RemoveLock, __in PVOID Tag)
Definition: mxgeneralkm.h:288
static __inline PVOID MxGetDriverObjectExtension(__in MdDriverObject DriverObject, __in PVOID ClientIdentificationAddress)
Definition: mxgeneralkm.h:385
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
static __inline VOID MxReleaseInterruptSpinLock(_Inout_ PKINTERRUPT Interrupt, _In_ KIRQL OldIrql)
Definition: mxgeneralkm.h:776
static __inline NTSTATUS MxAcquireRemoveLock(__in MdRemoveLock RemoveLock, __in_opt PVOID Tag)
Definition: mxgeneralkm.h:268
static __inline VOID MxAssertMsg(__in LPSTR Message, __in BOOLEAN Condition)
Definition: mxgeneralkm.h:176
__out __deref __drv_savesIRQL PKIRQL OldIrql
Definition: mxgeneral.h:98
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
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
static __inline PVOID MxGetSystemRoutineAddress(__in MxFuncName FuncName)
Definition: mxgeneralkm.h:226
static __inline VOID MxInitializeRemoveLock(__in MdRemoveLock Lock, __in ULONG AllocateTag, __in ULONG MaxLockedMinutes, __in ULONG HighWatermark)
Definition: mxgeneralkm.h:256
static __inline MdEThread GetCurrentEThread()
Definition: mxgeneralkm.h:69
static __inline MdDeviceObject MxGetAttachedDeviceReference(__in MdDeviceObject DriverObject)
Definition: mxgeneralkm.h:415
static VOID MxDetachDevice(_Inout_ MdDeviceObject Device)
Definition: mxgeneralkm.h:502
static __inline VOID MxUnlockPages(__in PMDL Mdl)
Definition: mxgeneralkm.h:357
static NTSTATUS MxTerminateCurrentThread(__in NTSTATUS Status)
Definition: mxgeneralkm.h:77
static __inline PVOID MxGetMdlVirtualAddress(_In_ PMDL Mdl)
Definition: mxgeneralkm.h:654
static __inline BOOLEAN MxHasEnoughRemainingThreadStack(VOID)
Definition: mxgeneralkm.h:298
static __inline VOID MxDeleteSymbolicLink(__in PUNICODE_STRING Link)
Definition: mxgeneralkm.h:424
static __inline VOID UnregisterCallback(__in PVOID CbRegistration)
Definition: mxgeneralkm.h:348
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 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
static __inline VOID MxAssert(__in BOOLEAN Condition)
Definition: mxgeneralkm.h:165
static __inline VOID MxReleaseRemoveLock(__in MdRemoveLock RemoveLock, __in PVOID Tag)
Definition: mxgeneralkm.h:278
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
static __inline NTSTATUS MxOpenKey(_Out_ PHANDLE KeyHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes)
Definition: mxgeneralkm.h:597
static __inline NTSTATUS CreateCallback(__out PCALLBACK_OBJECT *CallbackObject, __in POBJECT_ATTRIBUTES ObjectAttributes, __in BOOLEAN Create, __in BOOLEAN AllowMultipleCallbacks)
Definition: mxgeneralkm.h:318
static __inline NTSTATUS MxUnRegisterPlugPlayNotification(__in __drv_freesMem(Pool) PVOID NotificationEntry)
Definition: mxgeneralkm.h:748
static __inline VOID MxFlushQueuedDpcs()
Definition: mxgeneralkm.h:589
static __inline BOOLEAN IsKM()
Definition: mxgeneralkm.h:53
static __inline VOID MxDereferenceObject(__in PVOID Object)
Definition: mxgeneralkm.h:247
static __inline VOID MxDeleteNPagedLookasideList(_In_ PNPAGED_LOOKASIDE_LIST LookasideList)
Definition: mxgeneralkm.h:433
static __inline NTSTATUS MxCreateSymbolicLink(_In_ PUNICODE_STRING SymbolicLinkName, _In_ PUNICODE_STRING DeviceName)
Definition: mxgeneralkm.h:579
static __inline BOOLEAN MxInsertQueueDpc(__inout PRKDPC Dpc, __in_opt PVOID SystemArgument1, __in_opt PVOID SystemArgument2)
Definition: mxgeneralkm.h:786
static __inline VOID MxDeleteDevice(_In_ MdDeviceObject Device)
Definition: mxgeneralkm.h:493
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
static __inline VOID MxQuerySystemTime(_Out_ PLARGE_INTEGER CurrentTime)
Definition: mxgeneralkm.h:679
static __inline MxThread MxGetCurrentThread()
Definition: mxgeneralkm.h:61
static __inline ULONG MxQueryTimeIncrement()
Definition: mxgeneralkm.h:125
static __inline VOID MxReferenceObject(__in PVOID Object)
Definition: mxgeneralkm.h:238
static __inline KIRQL MxGetCurrentIrql()
Definition: mxgeneralkm.h:86
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 __inline BOOLEAN IsUM()
Definition: mxgeneralkm.h:45
static __inline VOID MxBuildMdlForNonPagedPool(__inout PMDL Mdl)
Definition: mxgeneralkm.h:376
static __inline NTSTATUS MxClose(__in HANDLE Handle)
Definition: mxgeneralkm.h:758
static __inline PVOID RegisterCallback(__in PCALLBACK_OBJECT CallbackObject, __in MdCallbackFunction CallbackFunction, __in PVOID CallbackContext)
Definition: mxgeneralkm.h:334
static __inline PVOID MxGetSystemAddressForMdlSafe(__inout PMDL Mdl, __in ULONG Priority)
Definition: mxgeneralkm.h:366
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
static __inline VOID MxDelayExecutionThread(__in KPROCESSOR_MODE WaitMode, __in BOOLEAN Alertable, __in PLARGE_INTEGER Interval)
Definition: mxgeneralkm.h:209
static __inline MdDeviceObject MxAttachDeviceToDeviceStack(_In_ MdDeviceObject SourceDevice, _In_ MdDeviceObject TargetDevice)
Definition: mxgeneralkm.h:511
static __inline NTSTATUS MxSetDeviceInterfaceState(_In_ PUNICODE_STRING SymbolicLinkName, _In_ BOOLEAN Enable)
Definition: mxgeneralkm.h:608
static __inline VOID MxInitializeMdl(_In_ PMDL MemoryDescriptorList, _In_ PVOID BaseVa, _In_ SIZE_T Length)
Definition: mxgeneralkm.h:643
Definition: bufpool.h:50
#define _Acquires_lock_(lock)
#define _Releases_lock_(lock)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
_Out_ PKIRQL Irql
Definition: csq.h:179
#define __out_opt
Definition: dbghelp.h:65
#define __in
Definition: dbghelp.h:35
#define __inout
Definition: dbghelp.h:50
#define __in_opt
Definition: dbghelp.h:38
#define __out
Definition: dbghelp.h:62
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define DEVICE_TYPE
Definition: guid.c:10
static const WCHAR Message[]
Definition: register.c:74
BOOLEAN NTAPI KeInsertQueueDpc(IN PKDPC Dpc, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
Definition: dpc.c:725
VOID NTAPI KeFlushQueuedDpcs(VOID)
Definition: dpc.c:919
LONG MaxLockedMinutes
Definition: lock.c:35
#define __drv_savesIRQL
Definition: driverspecs.h:325
#define __drv_freesMem(kind)
Definition: driverspecs.h:271
#define __drv_restoresIRQL
Definition: driverspecs.h:321
#define __drv_requiresIRQL(irql)
Definition: driverspecs.h:320
#define __drv_allocatesMem(kind)
Definition: driverspecs.h:256
#define __drv_useCancelIRQL
Definition: driverspecs.h:331
#define __drv_raisesIRQL(irql)
Definition: driverspecs.h:311
#define __drv_maxIRQL(irql)
Definition: driverspecs.h:290
#define __drv_nonConstant
Definition: driverspecs.h:305
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define PsGetCurrentThread()
Definition: env_spec_w32.h:81
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define HIGH_LEVEL
Definition: env_spec_w32.h:703
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
KIRQL * PKIRQL
Definition: env_spec_w32.h:592
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define KeDelayExecutionThread(mode, foo, t)
Definition: env_spec_w32.h:484
_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:2554
__in PWDFDEVICE_INIT __in BOOLEAN Exclusive
ULONG Handle
Definition: gdb_input.c:15
Status
Definition: gdiplustypes.h:25
#define KeGetCurrentThread
Definition: hal.h:55
static LPWSTR ClientIdentificationAddress
Definition: hidclass.c:16
NTSYSAPI void WINAPI DbgBreakPoint(void)
VOID NTAPI IoBuildPartialMdl(IN PMDL SourceMdl, IN PMDL TargetMdl, IN PVOID VirtualAddress, IN ULONG Length)
Definition: iomdl.c:96
#define KeLeaveCriticalRegion()
Definition: ke_x.h:119
#define KeEnterCriticalRegion()
Definition: ke_x.h:88
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:221
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1
VOID NTAPI ExInitializePagedLookasideList(IN PPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
Definition: lookas.c:270
VOID NTAPI ExDeletePagedLookasideList(IN PPAGED_LOOKASIDE_LIST Lookaside)
Definition: lookas.c:194
VOID NTAPI ExDeleteNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside)
Definition: lookas.c:170
VOID NTAPI ExInitializeNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
Definition: lookas.c:218
VOID NTAPI MmUnlockPages(IN PMDL Mdl)
Definition: mdlsup.c:1435
VOID NTAPI MmBuildMdlForNonPagedPool(IN PMDL Mdl)
Definition: mdlsup.c:424
DeviceType
Definition: mmdrv.h:42
#define CALLBACK_FUNCTION
Definition: mmsystem.h:150
#define ASSERT(a)
Definition: mode.c:44
ObjectType
Definition: metafile.c:81
static ACCESS_MASK const OBJECT_ATTRIBUTES ULONG TitleIndex
Definition: reg.c:131
#define _Outptr_result_bytebuffer_(size)
Definition: ms_sal.h:472
#define _Out_opt_
Definition: ms_sal.h:346
#define _Inout_
Definition: ms_sal.h:378
#define _Post_notnull_
Definition: ms_sal.h:701
#define _Post_
Definition: ms_sal.h:620
#define _At_(target, annos)
Definition: ms_sal.h:244
#define _Out_
Definition: ms_sal.h:345
#define _When_(expr, annos)
Definition: ms_sal.h:254
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
#define __deref
Definition: ms_sal.h:2629
PKINTERRUPT MdInterrupt
Definition: mxgeneralkm.h:36
CALLBACK_FUNCTION * MdCallbackFunction
Definition: mxgeneralkm.h:35
PKTHREAD MxThread
Definition: mxgeneralkm.h:28
KSYNCHRONIZE_ROUTINE * MdInterruptSynchronizeRoutine
Definition: mxgeneralkm.h:38
KSERVICE_ROUTINE MdInterruptServiceRoutineType
Definition: mxgeneralkm.h:37
PETHREAD MdEThread
Definition: mxgeneralkm.h:29
KSYNCHRONIZE_ROUTINE MdInterruptSynchronizeRoutineType
Definition: mxgeneralkm.h:38
PFILE_OBJECT MdFileObject
Definition: mxgeneralkm.h:32
LPCWSTR MxFuncName
Definition: mxgeneralkm.h:27
PDEVICE_OBJECT MdDeviceObject
Definition: mxgeneralkm.h:30
PIO_REMOVE_LOCK MdRemoveLock
Definition: mxgeneralkm.h:33
KSERVICE_ROUTINE * MdInterruptServiceRoutine
Definition: mxgeneralkm.h:37
PCALLBACK_OBJECT MdCallbackObject
Definition: mxgeneralkm.h:34
CALLBACK_FUNCTION MdCallbackFunctionType
Definition: mxgeneralkm.h:35
PDRIVER_OBJECT MdDriverObject
Definition: mxgeneralkm.h:31
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4755
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4715
_In_ ULONG _In_ KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass
Definition: cmfuncs.h:94
_In_ PVOID _In_ BOOLEAN Alertable
Definition: exfuncs.h:453
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
DWORD Interval
Definition: netstat.c:33
ULONG ACCESS_MASK
Definition: nt_native.h:40
#define ASSERTMSG(msg, exp)
Definition: nt_native.h:431
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
enum _KEY_VALUE_INFORMATION_CLASS KEY_VALUE_INFORMATION_CLASS
Definition: reg.c:135
#define UNREACHABLE
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
IN ULONG IN UCHAR Condition
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
VOID NTAPI ExUnregisterCallback(IN PVOID CallbackRegistrationHandle)
Definition: callback.c:636
PVOID NTAPI ExRegisterCallback(IN PCALLBACK_OBJECT CallbackObject, IN PCALLBACK_FUNCTION CallbackFunction, IN PVOID CallbackContext)
Definition: callback.c:556
NTSTATUS NTAPI ExCreateCallback(OUT PCALLBACK_OBJECT *CallbackObject, IN POBJECT_ATTRIBUTES ObjectAttributes, IN BOOLEAN Create, IN BOOLEAN AllowMultipleCallbacks)
Definition: callback.c:361
PDEVICE_OBJECT NTAPI IoAttachDeviceToDeviceStack(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:966
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:1296
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
PDEVICE_OBJECT NTAPI IoGetAttachedDeviceReference(PDEVICE_OBJECT DeviceObject)
Definition: device.c:1406
NTSTATUS NTAPI IoRegisterDeviceInterface(IN PDEVICE_OBJECT PhysicalDeviceObject, IN CONST GUID *InterfaceClassGuid, IN PUNICODE_STRING ReferenceString OPTIONAL, OUT PUNICODE_STRING SymbolicLinkName)
Definition: deviface.c:955
NTSTATUS NTAPI IoSetDeviceInterfaceState(IN PUNICODE_STRING SymbolicLinkName, IN BOOLEAN Enable)
Definition: deviface.c:1311
PVOID NTAPI IoGetDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress)
Definition: driver.c:1889
NTSTATUS NTAPI IoAllocateDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress, IN ULONG DriverObjectExtensionSize, OUT PVOID *DriverObjectExtension)
Definition: driver.c:1811
VOID NTAPI IoReleaseCancelSpinLock(IN KIRQL Irql)
Definition: util.c:150
ULONG NTAPI KeQueryTimeIncrement(VOID)
Definition: clock.c:153
KIRQL NTAPI KeAcquireInterruptSpinLock(IN PKINTERRUPT Interrupt)
Definition: spinlock.c:154
VOID NTAPI KeReleaseInterruptSpinLock(IN PKINTERRUPT Interrupt, IN KIRQL OldIrql)
Definition: spinlock.c:171
NTSTATUS NTAPI PsTerminateSystemThread(IN NTSTATUS ExitStatus)
Definition: kill.c:1145
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:494
unsigned short USHORT
Definition: pedump.c:61
NTSTATUS NTAPI IoUnregisterPlugPlayNotification(_In_ PVOID NotificationEntry)
Definition: pnpnotify.c:479
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
Definition: rtlcompat.c:108
#define KeQueryTickCount(CurrentCount)
Definition: ke.h:43
#define KERNEL_STACK_SIZE
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _In_ _IRQL_restores_ KIRQL NewIrql
Definition: ke.h:114
Definition: ketypes.h:687
PVOID NTAPI MmGetSystemRoutineAddress(IN PUNICODE_STRING SystemRoutineName)
Definition: sysldr.c:3551
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t ULONG_PTR
Definition: typedefs.h:65
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4065
_Must_inspect_result_ _In_ WDFDEVICE _In_ CONST GUID _In_opt_ PCUNICODE_STRING ReferenceString
Definition: wdfdevice.h:3630
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING SymbolicLinkName
Definition: wdfdevice.h:3739
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_In_ PWDFDEVICE_INIT _In_ CONST GUID * DeviceClassGuid
Definition: wdfdevice.h:3336
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
_In_ WDFDEVICE _In_ ULONG DeviceCharacteristics
Definition: wdfdevice.h:2775
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
Definition: wdfdpc.h:112
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY Priority
Definition: wdfinterrupt.h:655
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFINTERRUPT * Interrupt
Definition: wdfinterrupt.h:379
_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
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:243
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR _In_ ULONGLONG _In_ ULONGLONG _In_opt_ PEVENT_FILTER_DESCRIPTOR _Inout_opt_ PVOID CallbackContext
Definition: wmitypes.h:60
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_In_opt_ PALLOCATE_FUNCTION Allocate
Definition: exfuncs.h:814
_In_ POBJECT_ATTRIBUTES _In_ BOOLEAN _In_ BOOLEAN AllowMultipleCallbacks
Definition: exfuncs.h:750
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:819
_In_ PCALLBACK_FUNCTION CallbackFunction
Definition: exfuncs.h:1034
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:815
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST * PNPAGED_LOOKASIDE_LIST
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST * PPAGED_LOOKASIDE_LIST
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT SourceDevice
Definition: iofuncs.h:690
#define IoAcquireRemoveLock(RemoveLock, Tag)
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT _In_ PDEVICE_OBJECT TargetDevice
Definition: iofuncs.h:691
_In_ CONST GUID * InterfaceClassGuid
Definition: iofuncs.h:1136
#define IoReleaseRemoveLockAndWait(_RemoveLock, _Tag)
Definition: iofuncs.h:2774
_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
_Inout_ PMDL TargetMdl
Definition: iofuncs.h:730
_In_ ULONG _In_ ULONG _In_ ULONG HighWatermark
Definition: iofuncs.h:1069
#define IoReleaseRemoveLock(_RemoveLock, _Tag)
Definition: iofuncs.h:2764
#define IoInitializeRemoveLock(Lock, AllocateTag, MaxLockedMinutes, HighWatermark)
Definition: iofuncs.h:2833
_In_ ULONG AllocateTag
Definition: iofuncs.h:1067
* PFILE_OBJECT
Definition: iotypes.h:1998
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:792
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:676
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:677
#define MmGetMdlVirtualAddress(_Mdl)
_Inout_ PMDL MemoryDescriptorList
Definition: mmfuncs.h:405
#define MmInitializeMdl(_MemoryDescriptorList, _BaseVa, _Length)
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)
_In_ PEPROCESS _In_ KPROCESSOR_MODE AccessMode
Definition: mmfuncs.h:396
_In_ ACCESS_MASK _In_opt_ POBJECT_TYPE _In_ KPROCESSOR_MODE _Out_ PVOID _Out_opt_ POBJECT_HANDLE_INFORMATION HandleInformation
Definition: obfuncs.h:44
#define ObDereferenceObject
Definition: obfuncs.h:203
#define ObReferenceObject
Definition: obfuncs.h:204
char * LPSTR
Definition: xmlstorage.h:182
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185