32#define DO_NOTHING() (0)
172 MxEnterCriticalRegion(
179 MxLeaveCriticalRegion(
271 ReleaseCancelSpinLock(
348 PVOID *DriverObjectExtension
PDEVICE_OBJECT PhysicalDeviceObject
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)
static __inline VOID MxBuildPartialMdl(_In_ PMDL SourceMdl, _Inout_ PMDL TargetMdl, _In_ PVOID VirtualAddress, _In_ ULONG Length)
_Releases_lock_(_Global_cancel_spin_lock_) __drv_requiresIRQL(DISPATCH_LEVEL) __inline static VOID ReleaseCancelSpinLock(__in __drv_restoresIRQL __drv_useCancelIRQL KIRQL Irql)
static __inline VOID MxQueryTickCount(__out PLARGE_INTEGER TickCount)
_Acquires_lock_(_Global_critical_region_) __inline static VOID MxEnterCriticalRegion()
static __inline VOID MxDeletePagedLookasideList(_In_ PPAGED_LOOKASIDE_LIST LookasideList)
static __inline KIRQL MxAcquireInterruptSpinLock(_Inout_ PKINTERRUPT Interrupt)
static __inline NTSTATUS MxDeleteKey(_In_ HANDLE KeyHandle)
static __inline VOID MxDbgBreakPoint()
static __inline VOID MxReleaseRemoveLockAndWait(__in MdRemoveLock RemoveLock, __in PVOID Tag)
static __inline PVOID MxGetDriverObjectExtension(__in MdDriverObject DriverObject, __in PVOID ClientIdentificationAddress)
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)
static __inline VOID MxReleaseInterruptSpinLock(_Inout_ PKINTERRUPT Interrupt, _In_ KIRQL OldIrql)
static __inline NTSTATUS MxAcquireRemoveLock(__in MdRemoveLock RemoveLock, __in_opt PVOID Tag)
static __inline VOID MxAssertMsg(__in LPSTR Message, __in BOOLEAN Condition)
__out __deref __drv_savesIRQL PKIRQL OldIrql
static __inline NTSTATUS MxRegisterDeviceInterface(_In_ PDEVICE_OBJECT PhysicalDeviceObject, _In_ const GUID *InterfaceClassGuid, _In_opt_ PUNICODE_STRING ReferenceString, _Out_ PUNICODE_STRING SymbolicLinkName)
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)
static VOID MxGlobalInit(VOID)
static __inline PVOID MxGetSystemRoutineAddress(__in MxFuncName FuncName)
static __inline VOID MxInitializeRemoveLock(__in MdRemoveLock Lock, __in ULONG AllocateTag, __in ULONG MaxLockedMinutes, __in ULONG HighWatermark)
static __inline MdEThread GetCurrentEThread()
static __inline MdDeviceObject MxGetAttachedDeviceReference(__in MdDeviceObject DriverObject)
static VOID MxDetachDevice(_Inout_ MdDeviceObject Device)
static __inline VOID MxUnlockPages(__in PMDL Mdl)
static NTSTATUS MxTerminateCurrentThread(__in NTSTATUS Status)
static __inline PVOID MxGetMdlVirtualAddress(_In_ PMDL Mdl)
static __inline BOOLEAN MxHasEnoughRemainingThreadStack(VOID)
static __inline VOID MxDeleteSymbolicLink(__in PUNICODE_STRING Link)
static __inline VOID UnregisterCallback(__in PVOID CbRegistration)
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)
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)
static __inline VOID MxAssert(__in BOOLEAN Condition)
static __inline VOID MxReleaseRemoveLock(__in MdRemoveLock RemoveLock, __in PVOID Tag)
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)
_Releases_lock_(_Global_critical_region_) __inline static VOID MxLeaveCriticalRegion()
static __inline NTSTATUS MxOpenKey(_Out_ PHANDLE KeyHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes)
static __inline NTSTATUS CreateCallback(__out PCALLBACK_OBJECT *CallbackObject, __in POBJECT_ATTRIBUTES ObjectAttributes, __in BOOLEAN Create, __in BOOLEAN AllowMultipleCallbacks)
static __inline NTSTATUS MxUnRegisterPlugPlayNotification(__in __drv_freesMem(Pool) PVOID NotificationEntry)
static __inline VOID MxFlushQueuedDpcs()
static __inline BOOLEAN IsKM()
static __inline VOID MxDereferenceObject(__in PVOID Object)
static __inline VOID MxDeleteNPagedLookasideList(_In_ PNPAGED_LOOKASIDE_LIST LookasideList)
static __inline NTSTATUS MxCreateSymbolicLink(_In_ PUNICODE_STRING SymbolicLinkName, _In_ PUNICODE_STRING DeviceName)
static __inline BOOLEAN MxInsertQueueDpc(__inout PRKDPC Dpc, __in_opt PVOID SystemArgument1, __in_opt PVOID SystemArgument2)
__drv_maxIRQL(HIGH_LEVEL) __drv_raisesIRQL(NewIrql) __inline static VOID MxRaiseIrql(__in KIRQL NewIrql
static __inline VOID MxDeleteDevice(_In_ MdDeviceObject Device)
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)
static __inline VOID MxQuerySystemTime(_Out_ PLARGE_INTEGER CurrentTime)
static __inline MxThread MxGetCurrentThread()
static __inline ULONG MxQueryTimeIncrement()
__drv_maxIRQL(HIGH_LEVEL) __inline static VOID MxLowerIrql(__in __drv_restoresIRQL __drv_nonConstant KIRQL NewIrql)
static __inline VOID MxReferenceObject(__in PVOID Object)
static __inline KIRQL MxGetCurrentIrql()
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)
static __inline BOOLEAN IsUM()
static __inline VOID MxBuildMdlForNonPagedPool(__inout PMDL Mdl)
static __inline NTSTATUS MxClose(__in HANDLE Handle)
static __inline PVOID RegisterCallback(__in PCALLBACK_OBJECT CallbackObject, __in MdCallbackFunction CallbackFunction, __in PVOID CallbackContext)
static __inline PVOID MxGetSystemAddressForMdlSafe(__inout PMDL Mdl, __in ULONG Priority)
static DECLSPEC_NORETURN VOID MxBugCheckEx(__in ULONG BugCheckCode, __in ULONG_PTR BugCheckParameter1, __in ULONG_PTR BugCheckParameter2, __in ULONG_PTR BugCheckParameter3, __in ULONG_PTR BugCheckParameter4)
static VOID MxDbgPrint(__drv_formatString(printf) __in PCSTR DebugMessage,...)
static __inline VOID MxDelayExecutionThread(__in KPROCESSOR_MODE WaitMode, __in BOOLEAN Alertable, __in PLARGE_INTEGER Interval)
static __inline MdDeviceObject MxAttachDeviceToDeviceStack(_In_ MdDeviceObject SourceDevice, _In_ MdDeviceObject TargetDevice)
static __inline NTSTATUS MxSetDeviceInterfaceState(_In_ PUNICODE_STRING SymbolicLinkName, _In_ BOOLEAN Enable)
static __inline VOID MxInitializeMdl(_In_ PMDL MemoryDescriptorList, _In_ PVOID BaseVa, _In_ SIZE_T Length)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
static const WCHAR Message[]
#define __drv_freesMem(kind)
#define __drv_formatString(kind)
#define __drv_restoresIRQL
#define __drv_requiresIRQL(irql)
#define __drv_allocatesMem(kind)
#define __drv_useCancelIRQL
#define __drv_raisesIRQL(irql)
#define __drv_nonConstant
_Must_inspect_result_ _In_ LPCGUID _In_ ULONG _In_ FSRTL_ALLOCATE_ECP_FLAGS _In_opt_ PFSRTL_EXTRA_CREATE_PARAMETER_CLEANUP_CALLBACK _Inout_ PVOID LookasideList
__in PWDFDEVICE_INIT __in BOOLEAN Exclusive
static LPWSTR ClientIdentificationAddress
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
static ACCESS_MASK const OBJECT_ATTRIBUTES ULONG TitleIndex
CALLBACK_FUNCTION * MdCallbackFunction
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
_In_ ULONG _In_ KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass
_In_ PVOID _In_ BOOLEAN Alertable
#define _Outptr_result_bytebuffer_(s)
enum _KEY_VALUE_INFORMATION_CLASS KEY_VALUE_INFORMATION_CLASS
#define DECLSPEC_NORETURN
IN ULONG IN UCHAR Condition
_In_ ULONG _In_ ULONG _In_ ULONG Length
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
_Requires_lock_held_ SpinLock _Releases_lock_ SpinLock _In_ _IRQL_restores_ KIRQL NewIrql
static int Link(const char **args)
_Must_inspect_result_ _In_ WDFDEVICE Device
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
_Must_inspect_result_ _In_ WDFDEVICE _In_ CONST GUID _In_opt_ PCUNICODE_STRING ReferenceString
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING SymbolicLinkName
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_In_ PWDFDEVICE_INIT _In_ CONST GUID * DeviceClassGuid
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
_In_ WDFDEVICE _In_ ULONG DeviceCharacteristics
_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
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY Priority
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFINTERRUPT * Interrupt
_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
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR _In_ ULONGLONG _In_ ULONGLONG _In_opt_ PEVENT_FILTER_DESCRIPTOR _Inout_opt_ PVOID CallbackContext
_Must_inspect_result_ _In_ ULONG Flags
_In_opt_ PALLOCATE_FUNCTION Allocate
_In_ POBJECT_ATTRIBUTES _In_ BOOLEAN _In_ BOOLEAN AllowMultipleCallbacks
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
_In_ PCALLBACK_FUNCTION CallbackFunction
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
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
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT _In_ PDEVICE_OBJECT TargetDevice
_In_ CONST GUID * InterfaceClassGuid
_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
_In_ ULONG _In_ ULONG _In_ ULONG HighWatermark
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
_Inout_ PMDL MemoryDescriptorList
_In_ PEPROCESS _In_ KPROCESSOR_MODE AccessMode
_In_ ACCESS_MASK _In_opt_ POBJECT_TYPE _In_ KPROCESSOR_MODE _Out_ PVOID _Out_opt_ POBJECT_HANDLE_INFORMATION HandleInformation