ReactOS 0.4.16-dev-319-g6cf4263
iofuncs.h File Reference
#include <section_attribs.h>
Include dependency graph for iofuncs.h:

Go to the source code of this file.

Macros

#define IoAcquireRemoveLock(RemoveLock, Tag)    IoAcquireRemoveLockEx(RemoveLock, Tag, "", 1, sizeof (IO_REMOVE_LOCK))
 
#define IoAdjustPagingPathCount(_Count, _Increment)
 
#define IoAssignArcName(_ArcName, _DeviceName)
 
#define IoDeassignArcName   IoDeleteSymbolicLink
 
#define IoIsFileOpenedExclusively(FileObject)
 
#define IoCallDriver   IofCallDriver
 
#define IoCompleteRequest   IofCompleteRequest
 
#define IoForwardAndCatchIrp   IoForwardIrpSynchronously
 
#define IoCallDriverStackSafeDefault(a, b)   IoCallDriver(a, b)
 
#define IoWMIDeviceObjectToProviderId(DeviceObject)   ((ULONG)(DeviceObject))
 
#define IoSizeOfIrp(_StackSize)    ((USHORT) (sizeof(IRP) + ((_StackSize) * (sizeof(IO_STACK_LOCATION)))))
 
#define IoReleaseRemoveLock(_RemoveLock, _Tag)    IoReleaseRemoveLockEx(_RemoveLock, _Tag, sizeof(IO_REMOVE_LOCK))
 
#define IoReleaseRemoveLockAndWait(_RemoveLock, _Tag)    IoReleaseRemoveLockAndWaitEx(_RemoveLock, _Tag, sizeof(IO_REMOVE_LOCK))
 
#define PLUGPLAY_REGKEY_DEVICE   1
 
#define PLUGPLAY_REGKEY_DRIVER   2
 
#define PLUGPLAY_REGKEY_CURRENT_HWPROFILE   4
 
#define IoIsErrorUserInduced(Status)
 
#define IoInitializeRemoveLock(Lock, AllocateTag, MaxLockedMinutes, HighWatermark)
 
#define DEVICE_INTERFACE_INCLUDE_NONACTIVE   0x00000001
 
#define IoGetFunctionCodeFromCtlCode(_ControlCode)    (((_ControlCode) >> 2) & 0x00000FFF)
 

Functions

 $if (_WDMDDK_) NTHALAPI VOID NTAPI READ_PORT_BUFFER_UCHAR(IN PUCHAR Port
 
NTHALAPI VOID NTAPI READ_PORT_BUFFER_ULONG (IN PULONG Port, IN PULONG Buffer, IN ULONG Count)
 
NTHALAPI VOID NTAPI READ_PORT_BUFFER_USHORT (IN PUSHORT Port, IN PUSHORT Buffer, IN ULONG Count)
 
NTHALAPI UCHAR NTAPI READ_PORT_UCHAR (IN PUCHAR Port)
 
NTHALAPI ULONG NTAPI READ_PORT_ULONG (IN PULONG Port)
 
NTHALAPI USHORT NTAPI READ_PORT_USHORT (IN PUSHORT Port)
 
NTKERNELAPI VOID NTAPI READ_REGISTER_BUFFER_UCHAR (IN PUCHAR Register, IN PUCHAR Buffer, IN ULONG Count)
 
NTKERNELAPI VOID NTAPI READ_REGISTER_BUFFER_ULONG (IN PULONG Register, IN PULONG Buffer, IN ULONG Count)
 
NTKERNELAPI VOID NTAPI READ_REGISTER_BUFFER_USHORT (IN PUSHORT Register, IN PUSHORT Buffer, IN ULONG Count)
 
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR (IN PUCHAR Register)
 
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG (IN PULONG Register)
 
NTKERNELAPI USHORT NTAPI READ_REGISTER_USHORT (IN PUSHORT Register)
 
NTHALAPI VOID NTAPI WRITE_PORT_BUFFER_UCHAR (IN PUCHAR Port, IN PUCHAR Buffer, IN ULONG Count)
 
NTHALAPI VOID NTAPI WRITE_PORT_BUFFER_ULONG (IN PULONG Port, IN PULONG Buffer, IN ULONG Count)
 
NTHALAPI VOID NTAPI WRITE_PORT_BUFFER_USHORT (IN PUSHORT Port, IN PUSHORT Buffer, IN ULONG Count)
 
NTHALAPI VOID NTAPI WRITE_PORT_UCHAR (IN PUCHAR Port, IN UCHAR Value)
 
NTHALAPI VOID NTAPI WRITE_PORT_ULONG (IN PULONG Port, IN ULONG Value)
 
NTHALAPI VOID NTAPI WRITE_PORT_USHORT (IN PUSHORT Port, IN USHORT Value)
 
NTKERNELAPI VOID NTAPI WRITE_REGISTER_BUFFER_UCHAR (IN PUCHAR Register, IN PUCHAR Buffer, IN ULONG Count)
 
NTKERNELAPI VOID NTAPI WRITE_REGISTER_BUFFER_ULONG (IN PULONG Register, IN PULONG Buffer, IN ULONG Count)
 
NTKERNELAPI VOID NTAPI WRITE_REGISTER_BUFFER_USHORT (IN PUSHORT Register, IN PUSHORT Buffer, IN ULONG Count)
 
NTKERNELAPI VOID NTAPI WRITE_REGISTER_UCHAR (IN PUCHAR Register, IN UCHAR Value)
 
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG (IN PULONG Register, IN ULONG Value)
 
NTKERNELAPI VOID NTAPI WRITE_REGISTER_USHORT (IN PUSHORT Register, IN USHORT Value)
 
 $endif (_WDMDDK_) $if(_NTDDK_) FORCEINLINE VOID NTAPI IoInitializeDriverCreateContext(PIO_DRIVER_CREATE_CONTEXT DriverContext)
 
 $endif (_NTDDK_) $if(_NTIFS_) NTKERNELAPI NTSTATUS NTAPI IoRegisterFsRegistrationChangeEx(_In_ PDRIVER_OBJECT DriverObject
 
 $endif (_NTIFS_) $if(_WDMDDK_) _Acquires_lock_(_Global_cancel_spin_lock_) _Requires_lock_not_held_(_Global_cancel_spin_lock_) _IRQL_requires_max_(DISPATCH_LEVEL) _IRQL_raises_(DISPATCH_LEVEL) NTKERNELAPI VOID NTAPI IoAcquireCancelSpinLock(_Out_ _At_(*Irql
 
 _IRQL_requires_max_ (DISPATCH_LEVEL) NTKERNELAPI NTSTATUS NTAPI IoAcquireRemoveLockEx(_Inout_ PIO_REMOVE_LOCK RemoveLock
 
NTKERNELAPI NTSTATUS NTAPI IoAllocateDriverObjectExtension (_In_ PDRIVER_OBJECT 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)
 
 __drv_allocatesMem (Mem) _IRQL_requires_max_(DISPATCH_LEVEL) NTKERNELAPI PIO_WORKITEM NTAPI IoAllocateWorkItem(_In_ PDEVICE_OBJECT DeviceObject)
 
 _IRQL_requires_max_ (APC_LEVEL) _Ret_range_(<
 Probes and locks virtual pages in memory for the specified process.
 
NTKERNELAPI NTSTATUS NTAPI IoAttachDevice (_In_ _Kernel_requires_resource_held_(Memory) _When_(return==0, __drv_aliasesMem) PDEVICE_OBJECT SourceDevice, _In_ PUNICODE_STRING TargetDevice, _Out_ PDEVICE_OBJECT *AttachedDevice)
 
_Must_inspect_result_ __drv_aliasesMem _IRQL_requires_max_ (PASSIVE_LEVEL) NTKERNELAPI PIRP NTAPI IoBuildDeviceIoControlRequest(_In_ ULONG IoControlCode
 Queries information details about a security descriptor.
 
NTKERNELAPI NTSTATUS NTAPI IoCreateDevice (_In_ PDRIVER_OBJECT DriverObject, _In_ ULONG DeviceExtensionSize, _In_opt_ PUNICODE_STRING DeviceName, _In_ DEVICE_TYPE DeviceType, _In_ ULONG DeviceCharacteristics, _In_ BOOLEAN Exclusive, _Outptr_result_nullonfailure_ _At_(*DeviceObject, __drv_allocatesMem(Mem) _When_(((_In_function_class_(DRIVER_INITIALIZE))||(_In_function_class_(DRIVER_DISPATCH))), __drv_aliasesMem)) PDEVICE_OBJECT *DeviceObject)
 
 __drv_freesMem (Mem) _IRQL_requires_max_(DISPATCH_LEVEL) NTKERNELAPI VOID NTAPI IoFreeIrp(_In_ PIRP Irp)
 
NTKERNELAPI PDEVICE_OBJECT NTAPI IoGetAttachedDevice (IN PDEVICE_OBJECT DeviceObject)
 
NTKERNELAPI NTSTATUS NTAPI IoGetBootDiskInformation (_Inout_ PBOOTDISK_INFORMATION BootDiskInformation, _In_ ULONG Size)
 
_In_ CONST GUID _Out_ _When_ (return==0, _At_(AliasSymbolicLinkName->Buffer, __drv_allocatesMem(Mem))) PUNICODE_STRING AliasSymbolicLinkName)
 
NTKERNELAPI PEPROCESS NTAPI IoGetCurrentProcess (VOID)
 
_In_opt_ PDEVICE_OBJECT _In_ ULONG _Outptr_result_nullonfailure_ _At_SymbolicLinkList (return==0, __drv_allocatesMem(Mem))) PZZWSTR *SymbolicLinkList
 
 _IRQL_requires_max_ (PASSIVE_LEVEL) _When_((DeviceProperty &__string_type)
 
 _At_ (PropertyBuffer, _Post_z_)) _When_((DeviceProperty &__multiString_type)
 
 _At_ (PropertyBuffer, _Post_ _NullNull_terminated_)) NTKERNELAPI NTSTATUS NTAPI IoGetDeviceProperty(_In_ PDEVICE_OBJECT DeviceObject
 
_In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_writes_bytes_opt_ (BufferLength) PVOID PropertyBuffer
 
_In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Deref_out_range_ (<=, BufferLength) PULONG ResultLength)
 
_Must_inspect_result_ _In_ PDEVICE_DESCRIPTION _Out_ _When_ (return!=0, _Kernel_IoGetDmaAdapter_ _At_(*NumberOfMapRegisters, _Must_inspect_result_)) PULONG NumberOfMapRegisters)
 
NTKERNELAPI PDEVICE_OBJECT NTAPI IoGetRelatedDeviceObject (_In_ PFILE_OBJECT FileObject)
 
_In_ __drv_reportError ("MajorVersion must be 1 or 6")) UCHAR MajorVersion
 
_In_ _In_ _When_ (MinorVersion!=0 &&MinorVersion!=5 &&MinorVersion!=16 &&MinorVersion!=32 &&MinorVersion!=48, __drv_reportError("MinorVersion must be 0, 0x5, 0x10, 0x20, or 0x30")) UCHAR MinorVersion)
 
_In_ CONST GUID _In_opt_ PUNICODE_STRING _Out_ _When_ (return==0, _At_(SymbolicLinkName->Buffer, __drv_allocatesMem(Mem))) PUNICODE_STRING SymbolicLinkName)
 
_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
 
 _Requires_lock_held_ (_Global_cancel_spin_lock_) _Releases_lock_(_Global_cancel_spin_lock_) _IRQL_requires_max_(DISPATCH_LEVEL) _IRQL_requires_min_(DISPATCH_LEVEL) NTKERNELAPI VOID NTAPI IoReleaseCancelSpinLock(_In_ _IRQL_restores_ _IRQL_uses_cancel_ KIRQL Irql)
 
NTKERNELAPI VOID NTAPI IoReleaseRemoveLockEx (_Inout_ PIO_REMOVE_LOCK RemoveLock, _In_opt_ PVOID Tag, _In_ ULONG RemlockSize)
 
NTKERNELAPI VOID NTAPI IoSetShareAccess (_In_ ACCESS_MASK DesiredAccess, _In_ ULONG DesiredShareAccess, _Inout_ PFILE_OBJECT FileObject, _Out_ PSHARE_ACCESS ShareAccess)
 
NTKERNELAPI NTSTATUS NTAPI IoWMIQuerySingleInstanceMultiple (_In_reads_(ObjectCount) PVOID *DataBlockObjectList, _In_reads_(ObjectCount) PUNICODE_STRING InstanceNames, _In_ ULONG ObjectCount, _Inout_ ULONG *InOutBufferSize, _Out_writes_bytes_opt_(*InOutBufferSize) PVOID OutBuffer)
 
NTKERNELAPI NTSTATUS NTAPI IoWMISuggestInstanceName (_In_opt_ PDEVICE_OBJECT PhysicalDeviceObject, _In_opt_ PUNICODE_STRING SymbolicLinkName, _In_ BOOLEAN CombineNames, _Out_ PUNICODE_STRING SuggestedInstanceName)
 
_Must_inspect_result_ NTKERNELAPI NTSTATUS NTAPI IoWMIWriteEvent (_Inout_ _When_(return==0, __drv_aliasesMem) PVOID WnodeEventItem)
 
NTKERNELAPI PIRP NTAPI IoGetTopLevelIrp (VOID)
 
NTKERNELAPI VOID NTAPI IoSetTopLevelIrp (_In_opt_ PIRP Irp)
 
NTHALAPI PHYSICAL_ADDRESS NTAPI IoMapTransfer (_In_ PADAPTER_OBJECT AdapterObject, _In_ PMDL Mdl, _In_ PVOID MapRegisterBase, _In_ PVOID CurrentVa, _Inout_ PULONG Length, _In_ BOOLEAN WriteToDevice)
 
NTKERNELAPI VOID NTAPI IoCancelFileOpen (_In_ PDEVICE_OBJECT DeviceObject, _In_ PFILE_OBJECT FileObject)
 
NTKERNELAPI NTSTATUS NTAPI IoQueryDeviceDescription (_In_opt_ PINTERFACE_TYPE BusType, _In_opt_ PULONG BusNumber, _In_opt_ PCONFIGURATION_TYPE ControllerType, _In_opt_ PULONG ControllerNumber, _In_opt_ PCONFIGURATION_TYPE PeripheralType, _In_opt_ PULONG PeripheralNumber, _In_ PIO_QUERY_DEVICE_ROUTINE CalloutRoutine, _In_opt_ PVOID Context)
 Reads and returns Hardware information from the appropriate hardware registry key.
 
NTKERNELAPI NTSTATUS NTAPI IoAttachDeviceByPointer (_In_ PDEVICE_OBJECT SourceDevice, _In_ PDEVICE_OBJECT TargetDevice)
 
NTKERNELAPI NTSTATUS NTAPI IoReportResourceForDetection (_In_ PDRIVER_OBJECT DriverObject, _In_reads_bytes_opt_(DriverListSize) PCM_RESOURCE_LIST DriverList, _In_opt_ ULONG DriverListSize, _In_opt_ PDEVICE_OBJECT DeviceObject, _In_reads_bytes_opt_(DeviceListSize) PCM_RESOURCE_LIST DeviceList, _In_opt_ ULONG DeviceListSize, _Out_ PBOOLEAN ConflictDetected)
 
NTKERNELAPI NTSTATUS NTAPI IoReportResourceUsage (_In_opt_ PUNICODE_STRING DriverClassName, _In_ PDRIVER_OBJECT DriverObject, _In_reads_bytes_opt_(DriverListSize) PCM_RESOURCE_LIST DriverList, _In_opt_ ULONG DriverListSize, _In_opt_ PDEVICE_OBJECT DeviceObject, _In_reads_bytes_opt_(DeviceListSize) PCM_RESOURCE_LIST DeviceList, _In_opt_ ULONG DeviceListSize, _In_ BOOLEAN OverrideConflict, _Out_ PBOOLEAN ConflictDetected)
 Reports hardware resources in the \Registry\Machine\Hardware\ResourceMap tree, so that a subsequently loaded driver cannot attempt to use the same resources.
 
NTKERNELAPI NTSTATUS NTAPI IoAssignResources (_In_ PUNICODE_STRING RegistryPath, _In_opt_ PUNICODE_STRING DriverClassName, _In_ PDRIVER_OBJECT DriverObject, _In_opt_ PDEVICE_OBJECT DeviceObject, _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST RequestedResources, _Inout_ PCM_RESOURCE_LIST *AllocatedResources)
 
NTKERNELAPI NTSTATUS NTAPI IoCheckDesiredAccess (_Inout_ PACCESS_MASK DesiredAccess, _In_ ACCESS_MASK GrantedAccess)
 
NTKERNELAPI NTSTATUS NTAPI IoCheckEaBufferValidity (_In_ PFILE_FULL_EA_INFORMATION EaBuffer, _In_ ULONG EaLength, _Out_ PULONG ErrorOffset)
 
NTKERNELAPI NTSTATUS NTAPI IoCheckFunctionAccess (_In_ ACCESS_MASK GrantedAccess, _In_ UCHAR MajorFunction, _In_ UCHAR MinorFunction, _In_ ULONG IoControlCode, _In_opt_ PVOID Argument1, _In_opt_ PVOID Argument2)
 
NTKERNELAPI NTSTATUS NTAPI IoCheckQuerySetFileInformation (_In_ FILE_INFORMATION_CLASS FileInformationClass, _In_ ULONG Length, _In_ BOOLEAN SetOperation)
 
NTKERNELAPI NTSTATUS NTAPI IoCheckQuerySetVolumeInformation (_In_ FS_INFORMATION_CLASS FsInformationClass, _In_ ULONG Length, _In_ BOOLEAN SetOperation)
 
NTKERNELAPI NTSTATUS NTAPI IoCheckQuotaBufferValidity (_In_ PFILE_QUOTA_INFORMATION QuotaBuffer, _In_ ULONG QuotaLength, _Out_ PULONG ErrorOffset)
 
NTKERNELAPI PFILE_OBJECT NTAPI IoCreateStreamFileObject (_In_opt_ PFILE_OBJECT FileObject, _In_opt_ PDEVICE_OBJECT DeviceObject)
 
NTKERNELAPI PFILE_OBJECT NTAPI IoCreateStreamFileObjectLite (_In_opt_ PFILE_OBJECT FileObject, _In_opt_ PDEVICE_OBJECT DeviceObject)
 
NTKERNELAPI BOOLEAN NTAPI IoFastQueryNetworkAttributes (_In_ POBJECT_ATTRIBUTES ObjectAttributes, _In_ ACCESS_MASK DesiredAccess, _In_ ULONG OpenOptions, _Out_ PIO_STATUS_BLOCK IoStatus, _Out_ PFILE_NETWORK_OPEN_INFORMATION Buffer)
 
NTKERNELAPI NTSTATUS NTAPI IoPageRead (_In_ PFILE_OBJECT FileObject, _In_ PMDL Mdl, _In_ PLARGE_INTEGER Offset, _In_ PKEVENT Event, _Out_ PIO_STATUS_BLOCK IoStatusBlock)
 
NTKERNELAPI PDEVICE_OBJECT NTAPI IoGetBaseFileSystemDeviceObject (_In_ PFILE_OBJECT FileObject)
 
NTKERNELAPI ULONG NTAPI IoGetRequestorProcessId (_In_ PIRP Irp)
 
NTKERNELAPI PEPROCESS NTAPI IoGetRequestorProcess (_In_ PIRP Irp)
 
NTKERNELAPI BOOLEAN NTAPI IoIsOperationSynchronous (_In_ PIRP Irp)
 
NTKERNELAPI BOOLEAN NTAPI IoIsSystemThread (_In_ PETHREAD Thread)
 
NTKERNELAPI BOOLEAN NTAPI IoIsValidNameGraftingBuffer (_In_ PIRP Irp, _In_ PREPARSE_DATA_BUFFER ReparseBuffer)
 
NTKERNELAPI NTSTATUS NTAPI IoQueryFileInformation (_In_ PFILE_OBJECT FileObject, _In_ FILE_INFORMATION_CLASS FileInformationClass, _In_ ULONG Length, _Out_ PVOID FileInformation, _Out_ PULONG ReturnedLength)
 
NTKERNELAPI NTSTATUS NTAPI IoQueryVolumeInformation (_In_ PFILE_OBJECT FileObject, _In_ FS_INFORMATION_CLASS FsInformationClass, _In_ ULONG Length, _Out_ PVOID FsInformation, _Out_ PULONG ReturnedLength)
 
NTKERNELAPI VOID NTAPI IoQueueThreadIrp (_In_ PIRP Irp)
 
NTKERNELAPI VOID NTAPI IoRegisterFileSystem (_In_ __drv_aliasesMem PDEVICE_OBJECT DeviceObject)
 
NTKERNELAPI NTSTATUS NTAPI IoRegisterFsRegistrationChange (_In_ PDRIVER_OBJECT DriverObject, _In_ PDRIVER_FS_NOTIFICATION DriverNotificationRoutine)
 
NTKERNELAPI VOID NTAPI IoReleaseVpbSpinLock (_In_ KIRQL Irql)
 
NTKERNELAPI VOID NTAPI IoSetDeviceToVerify (_In_ PETHREAD Thread, _In_opt_ PDEVICE_OBJECT DeviceObject)
 
NTKERNELAPI NTSTATUS NTAPI IoSetInformation (_In_ PFILE_OBJECT FileObject, _In_ FILE_INFORMATION_CLASS FileInformationClass, _In_ ULONG Length, _In_ PVOID FileInformation)
 
NTKERNELAPI NTSTATUS NTAPI IoSynchronousPageWrite (_In_ PFILE_OBJECT FileObject, _In_ PMDL Mdl, _In_ PLARGE_INTEGER FileOffset, _In_ PKEVENT Event, _Out_ PIO_STATUS_BLOCK IoStatusBlock)
 
NTKERNELAPI PEPROCESS NTAPI IoThreadToProcess (_In_ PETHREAD Thread)
 
NTKERNELAPI VOID NTAPI IoUnregisterFileSystem (_In_ PDEVICE_OBJECT DeviceObject)
 
NTKERNELAPI VOID NTAPI IoUnregisterFsRegistrationChange (_In_ PDRIVER_OBJECT DriverObject, _In_ PDRIVER_FS_NOTIFICATION DriverNotificationRoutine)
 
NTKERNELAPI NTSTATUS NTAPI IoVerifyVolume (_In_ PDEVICE_OBJECT DeviceObject, _In_ BOOLEAN AllowRawMount)
 
NTKERNELAPI NTSTATUS NTAPI IoGetRequestorSessionId (_In_ PIRP Irp, _Out_ PULONG pSessionId)
 
NTKERNELAPI NTSTATUS NTAPI IoSetFileOrigin (_In_ PFILE_OBJECT FileObject, _In_ BOOLEAN Remote)
 
NTKERNELAPI VOID NTAPI IoCsqInsertIrp (_Inout_ PIO_CSQ Csq, _Inout_ PIRP Irp, _Out_opt_ PIO_CSQ_IRP_CONTEXT Context)
 Insert an IRP into the CSQ.
 
NTKERNELAPI PIRP NTAPI IoCsqRemoveIrp (_Inout_ PIO_CSQ Csq, _Inout_ PIO_CSQ_IRP_CONTEXT Context)
 Remove anb IRP from the queue.
 
NTKERNELAPI PIRP NTAPI IoCsqRemoveNextIrp (_Inout_ PIO_CSQ Csq, _In_opt_ PVOID PeekContext)
 IoCsqRemoveNextIrp - Removes the next IRP from the queue.
 
NTKERNELAPI BOOLEAN NTAPI IoForwardIrpSynchronously (_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp)
 
NTKERNELAPI VOID NTAPI IoFreeErrorLogEntry (_In_ PVOID ElEntry)
 
VOID NTAPI IoSetStartIoAttributes (_In_ PDEVICE_OBJECT DeviceObject, _In_ BOOLEAN DeferredStartIo, _In_ BOOLEAN NonCancelable)
 
NTKERNELAPI NTSTATUS NTAPI IoWMIDeviceObjectToInstanceName (_In_ PVOID DataBlockObject, _In_ PDEVICE_OBJECT DeviceObject, _Out_ PUNICODE_STRING InstanceName)
 
NTKERNELAPI NTSTATUS NTAPI IoWMIExecuteMethod (_In_ PVOID DataBlockObject, _In_ PUNICODE_STRING InstanceName, _In_ ULONG MethodId, _In_ ULONG InBufferSize, _Inout_ PULONG OutBufferSize, _Inout_updates_bytes_to_opt_(*OutBufferSize, InBufferSize) PUCHAR InOutBuffer)
 
NTKERNELAPI NTSTATUS NTAPI IoWMIHandleToInstanceName (_In_ PVOID DataBlockObject, _In_ HANDLE FileHandle, _Out_ PUNICODE_STRING InstanceName)
 
NTKERNELAPI NTSTATUS NTAPI IoWMIOpenBlock (_In_ LPCGUID DataBlockGuid, _In_ ULONG DesiredAccess, _Out_ PVOID *DataBlockObject)
 
NTKERNELAPI NTSTATUS NTAPI IoWMIQueryAllData (_In_ PVOID DataBlockObject, _Inout_ ULONG *InOutBufferSize, _Out_writes_bytes_opt_(*InOutBufferSize) PVOID OutBuffer)
 
NTKERNELAPI NTSTATUS NTAPI IoWMIQueryAllDataMultiple (_In_reads_(ObjectCount) PVOID *DataBlockObjectList, _In_ ULONG ObjectCount, _Inout_ ULONG *InOutBufferSize, _Out_writes_bytes_opt_(*InOutBufferSize) PVOID OutBuffer)
 
NTKERNELAPI NTSTATUS NTAPI IoWMIQuerySingleInstance (_In_ PVOID DataBlockObject, _In_ PUNICODE_STRING InstanceName, _Inout_ ULONG *InOutBufferSize, _Out_writes_bytes_opt_(*InOutBufferSize) PVOID OutBuffer)
 
NTKERNELAPI NTSTATUS NTAPI IoWMISetNotificationCallback (_Inout_ PVOID Object, _In_ WMI_NOTIFICATION_CALLBACK Callback, _In_opt_ PVOID Context)
 
NTKERNELAPI NTSTATUS NTAPI IoWMISetSingleInstance (_In_ PVOID DataBlockObject, _In_ PUNICODE_STRING InstanceName, _In_ ULONG Version, _In_ ULONG ValueBufferSize, _In_reads_bytes_(ValueBufferSize) PVOID ValueBuffer)
 
NTKERNELAPI NTSTATUS NTAPI IoWMISetSingleItem (_In_ PVOID DataBlockObject, _In_ PUNICODE_STRING InstanceName, _In_ ULONG DataItemId, _In_ ULONG Version, _In_ ULONG ValueBufferSize, _In_reads_bytes_(ValueBufferSize) PVOID ValueBuffer)
 
NTKERNELAPI NTSTATUS NTAPI IoCreateDisk (_In_ PDEVICE_OBJECT DeviceObject, _In_opt_ struct _CREATE_DISK *Disk)
 
NTKERNELAPI NTSTATUS NTAPI IoReadDiskSignature (_In_ PDEVICE_OBJECT DeviceObject, _In_ ULONG BytesPerSector, _Out_ PDISK_SIGNATURE Signature)
 
NTKERNELAPI NTSTATUS NTAPI IoSetSystemPartition (_In_ PUNICODE_STRING VolumeNameString)
 
NTKERNELAPI NTSTATUS NTAPI IoVerifyPartitionTable (_In_ PDEVICE_OBJECT DeviceObject, _In_ BOOLEAN FixErrors)
 
NTKERNELAPI NTSTATUS NTAPI IoVolumeDeviceToDosName (_In_ PVOID VolumeDeviceObject, _Out_ _When_(return==0, _At_(DosName->Buffer, __drv_allocatesMem(Mem))) PUNICODE_STRING DosName)
 
 _In_reads_ (_Inexpressible_(FIELD_OFFSET(DRIVE_LAYOUT_INFORMATION_EX, PartitionEntry[0]))) struct _DRIVE_LAYOUT_INFORMATION_EX *DriveLayout)
 
NTKERNELAPI NTSTATUS NTAPI IoCreateFileSpecifyDeviceObjectHint (_Out_ PHANDLE FileHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _Out_ PIO_STATUS_BLOCK IoStatusBlock, _In_opt_ PLARGE_INTEGER AllocationSize, _In_ ULONG FileAttributes, _In_ ULONG ShareAccess, _In_ ULONG Disposition, _In_ ULONG CreateOptions, _In_opt_ PVOID EaBuffer, _In_ ULONG EaLength, _In_ CREATE_FILE_TYPE CreateFileType, _In_opt_ PVOID InternalParameters, _In_ ULONG Options, _In_opt_ PVOID DeviceObject)
 
NTKERNELAPI NTSTATUS NTAPI IoAttachDeviceToDeviceStackSafe (_In_ PDEVICE_OBJECT SourceDevice, _In_ PDEVICE_OBJECT TargetDevice, _Outptr_ PDEVICE_OBJECT *AttachedToDeviceObject)
 
NTKERNELAPI NTSTATUS NTAPI IoQueryFileDosDeviceName (_In_ PFILE_OBJECT FileObject, _Out_ POBJECT_NAME_INFORMATION *ObjectNameInformation)
 
NTKERNELAPI NTSTATUS NTAPI IoEnumerateDeviceObjectList (_In_ PDRIVER_OBJECT DriverObject, _Out_writes_bytes_to_opt_(DeviceObjectListSize,(*ActualNumberDeviceObjects) *sizeof(PDEVICE_OBJECT)) PDEVICE_OBJECT *DeviceObjectList, _In_ ULONG DeviceObjectListSize, _Out_ PULONG ActualNumberDeviceObjects)
 
NTKERNELAPI PDEVICE_OBJECT NTAPI IoGetLowerDeviceObject (_In_ PDEVICE_OBJECT DeviceObject)
 
NTKERNELAPI PDEVICE_OBJECT NTAPI IoGetDeviceAttachmentBaseRef (_In_ PDEVICE_OBJECT DeviceObject)
 
NTKERNELAPI NTSTATUS NTAPI IoGetDiskDeviceObject (_In_ PDEVICE_OBJECT FileSystemDeviceObject, _Out_ PDEVICE_OBJECT *DiskDeviceObject)
 
NTKERNELAPI NTSTATUS NTAPI IoCsqInsertIrpEx (_Inout_ PIO_CSQ Csq, _Inout_ PIRP Irp, _Out_opt_ PIO_CSQ_IRP_CONTEXT Context, _In_opt_ PVOID InsertContext)
 Insert an IRP into the CSQ, with additional tracking context.
 
ActualNumberDriverObjectssizeof (PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
 
NTKERNELAPI NTSTATUS NTAPI IoCheckShareAccessEx (_In_ ACCESS_MASK DesiredAccess, _In_ ULONG DesiredShareAccess, _Inout_ PFILE_OBJECT FileObject, _Inout_ PSHARE_ACCESS ShareAccess, _In_ BOOLEAN Update, _In_ PBOOLEAN WritePermission)
 
NTKERNELAPI NTSTATUS NTAPI IoConnectInterruptEx (_Inout_ PIO_CONNECT_INTERRUPT_PARAMETERS Parameters)
 
NTKERNELAPI VOID NTAPI IoDisconnectInterruptEx (_In_ PIO_DISCONNECT_INTERRUPT_PARAMETERS Parameters)
 
LOGICAL NTAPI IoWithinStackLimits (_In_ ULONG_PTR RegionStart, _In_ SIZE_T RegionSize)
 
NTKERNELAPI VOID NTAPI IoSetShareAccessEx (_In_ ACCESS_MASK DesiredAccess, _In_ ULONG DesiredShareAccess, _Inout_ PFILE_OBJECT FileObject, _Out_ PSHARE_ACCESS ShareAccess, _In_ PBOOLEAN WritePermission)
 
ULONG NTAPI IoSizeofWorkItem (VOID)
 
VOID NTAPI IoInitializeWorkItem (_In_ PVOID IoObject, _Out_ PIO_WORKITEM IoWorkItem)
 
VOID NTAPI IoUninitializeWorkItem (_Inout_ PIO_WORKITEM IoWorkItem)
 
NTKRNLVISTAAPI IO_PRIORITY_HINT NTAPI IoGetIoPriorityHint (_In_ PIRP Irp)
 
NTSTATUS NTAPI IoSetIoPriorityHint (_In_ PIRP Irp, _In_ IO_PRIORITY_HINT PriorityHint)
 
NTSTATUS NTAPI IoAllocateSfioStreamIdentifier (_In_ PFILE_OBJECT FileObject, _In_ ULONG Length, _In_ PVOID Signature, _Out_ PVOID *StreamIdentifier)
 
PVOID NTAPI IoGetSfioStreamIdentifier (_In_ PFILE_OBJECT FileObject, _In_ PVOID Signature)
 
NTSTATUS NTAPI IoFreeSfioStreamIdentifier (_In_ PFILE_OBJECT FileObject, _In_ PVOID Signature)
 
PTXN_PARAMETER_BLOCK NTAPI IoGetTransactionParameterBlock (_In_ PFILE_OBJECT FileObject)
 
NTKERNELAPI NTSTATUS NTAPI IoCreateFileEx (_Out_ PHANDLE FileHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _Out_ PIO_STATUS_BLOCK IoStatusBlock, _In_opt_ PLARGE_INTEGER AllocationSize, _In_ ULONG FileAttributes, _In_ ULONG ShareAccess, _In_ ULONG Disposition, _In_ ULONG CreateOptions, _In_opt_ PVOID EaBuffer, _In_ ULONG EaLength, _In_ CREATE_FILE_TYPE CreateFileType, _In_opt_ PVOID InternalParameters, _In_ ULONG Options, _In_opt_ PIO_DRIVER_CREATE_CONTEXT DriverContext)
 
NTSTATUS NTAPI IoSetIrpExtraCreateParameter (_Inout_ PIRP Irp, _In_ struct _ECP_LIST *ExtraCreateParameter)
 
VOID NTAPI IoClearIrpExtraCreateParameter (_Inout_ PIRP Irp)
 
NTKRNLVISTAAPI NTSTATUS NTAPI IoGetIrpExtraCreateParameter (_In_ PIRP Irp, _Outptr_result_maybenull_ struct _ECP_LIST **ExtraCreateParameter)
 
BOOLEAN NTAPI IoIsFileObjectIgnoringSharing (_In_ PFILE_OBJECT FileObject)
 
NTSTATUS NTAPI IoGetContainerInformation (_In_ IO_CONTAINER_INFORMATION_CLASS InformationClass, _In_opt_ PVOID ContainerObject, _Inout_updates_bytes_opt_(BufferLength) PVOID Buffer, _In_ ULONG BufferLength)
 
NTSTATUS NTAPI IoRegisterContainerNotification (_In_ IO_CONTAINER_NOTIFICATION_CLASS NotificationClass, _In_ PIO_CONTAINER_NOTIFICATION_FUNCTION CallbackFunction, _In_reads_bytes_opt_(NotificationInformationLength) PVOID NotificationInformation, _In_ ULONG NotificationInformationLength, _Out_ PVOID CallbackRegistration)
 
VOID NTAPI IoUnregisterContainerNotification (_In_ PVOID CallbackRegistration)
 
NTKERNELAPI NTSTATUS NTAPI IoReplaceFileObjectName (_In_ PFILE_OBJECT FileObject, _In_reads_bytes_(FileNameLength) PWSTR NewFileName, _In_ USHORT FileNameLength)
 
_In_ CONST DEVPROPKEY _In_ LCID _In_ ULONG _In_ DEVPROPTYPE _In_ ULONG _In_reads_bytes_opt_ (Size) PVOID Data)
 
_In_ CONST DEVPROPKEY _In_ LCID _Reserved_ ULONG _In_ ULONG _Out_writes_bytes_to_ (Size, *RequiredSize) PVOID Data
 
FORCEINLINE VOID IoSetNextIrpStackLocation (_Inout_ PIRP Irp)
 
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation (_In_ PIRP Irp)
 
 ASSERT ((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
 
 if (InvokeOnSuccess)
 
 if (InvokeOnError)
 
 if (InvokeOnCancel)
 
FORCEINLINE VOID IoRequestDpc (_Inout_ PDEVICE_OBJECT DeviceObject, _In_opt_ PIRP Irp, _In_opt_ __drv_aliasesMem PVOID Context)
 
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation (_In_ PIRP Irp)
 
FORCEINLINE VOID IoMarkIrpPending (_Inout_ PIRP Irp)
 
FORCEINLINE VOID IoInitializeDpcRequest (_In_ PDEVICE_OBJECT DeviceObject, _In_ PIO_DPC_ROUTINE DpcRoutine)
 
FORCEINLINE VOID IoCopyCurrentIrpStackLocationToNext (_Inout_ PIRP Irp)
 
FORCEINLINE VOID IoInitializeThreadedDpcRequest (_In_ PDEVICE_OBJECT DeviceObject, _In_ PIO_DPC_ROUTINE DpcRoutine)
 

Variables

IN PUCHAR Buffer
 
IN PUCHAR IN ULONG Count
 
_In_ PDRIVER_FS_NOTIFICATION DriverNotificationRoutine
 
_IRQL_saves_ PKIRQL Irql
 
_In_opt_ PVOID Tag
 
_In_opt_ PVOID _In_ PCSTR File
 
_In_opt_ PVOID _In_ PCSTR _In_ ULONG Line
 
_In_opt_ PVOID _In_ PCSTR _In_ ULONG _In_ ULONG RemlockSize
 
_In_ UCHAR EntrySize
 
_Must_inspect_result_ _In_ BOOLEAN ChargeQuota
 
_In_ ULONG Length
 
_In_ ULONG _In_ BOOLEAN SecondaryBuffer
 
_In_ ULONG _In_ BOOLEAN _In_ BOOLEAN _Inout_opt_ PIRP Irp
 
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT SourceDevice
 
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT _In_ PDEVICE_OBJECT TargetDevice
 
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT DeviceObject
 
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _Inout_opt_ PVOID _In_opt_ ULONG _In_opt_ PLARGE_INTEGER StartingOffset
 
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _Inout_opt_ PVOID _In_opt_ ULONG _In_opt_ PLARGE_INTEGER _In_opt_ PIO_STATUS_BLOCK IoStatusBlock
 
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID InputBuffer
 
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG InputBufferLength
 
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID OutputBuffer
 
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID _In_ ULONG OutputBufferLength
 
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID _In_ ULONG _In_ BOOLEAN InternalDeviceIoControl
 
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID _In_ ULONG _In_ BOOLEAN _In_opt_ PKEVENT Event
 
_Inout_ PMDL TargetMdl
 
_Inout_ PMDL _In_ PVOID VirtualAddress
 
_In_ CCHAR PriorityBoost
 
_In_ ULONG DesiredShareAccess
 
_In_ ULONG _Inout_ PFILE_OBJECT FileObject
 
_In_ ULONG _Inout_ PFILE_OBJECT _Inout_ PSHARE_ACCESS ShareAccess
 
_In_ ULONG _Inout_ PFILE_OBJECT _Inout_ PSHARE_ACCESS _In_ BOOLEAN Update
 
_In_ PKSERVICE_ROUTINE ServiceRoutine
 
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID ServiceContext
 
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK SpinLock
 
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK _In_ ULONG Vector
 
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK _In_ ULONG _In_ KIRQL _In_ KIRQL SynchronizeIrql
 
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK _In_ ULONG _In_ KIRQL _In_ KIRQL _In_ KINTERRUPT_MODE InterruptMode
 
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK _In_ ULONG _In_ KIRQL _In_ KIRQL _In_ KINTERRUPT_MODE _In_ BOOLEAN ShareVector
 
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK _In_ ULONG _In_ KIRQL _In_ KIRQL _In_ KINTERRUPT_MODE _In_ BOOLEAN _In_ KAFFINITY ProcessorEnableMask
 
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK _In_ ULONG _In_ KIRQL _In_ KIRQL _In_ KINTERRUPT_MODE _In_ BOOLEAN _In_ KAFFINITY _In_ BOOLEAN FloatingSave
 
_In_ ACCESS_MASK DesiredAccess
 
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES ObjectAttributes
 
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER AllocationSize
 
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG FileAttributes
 
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG Disposition
 
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG CreateOptions
 
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG _In_opt_ PVOID EaBuffer
 
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG _In_opt_ PVOID _In_ ULONG EaLength
 
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG _In_opt_ PVOID _In_ ULONG _In_ CREATE_FILE_TYPE CreateFileType
 
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG _In_opt_ PVOID _In_ ULONG _In_ CREATE_FILE_TYPE _In_opt_ PVOID InternalParameters
 
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG _In_opt_ PVOID _In_ ULONG _In_ CREATE_FILE_TYPE _In_opt_ PVOID _In_ ULONG Options
 
_Out_ PHANDLE EventHandle
 
_In_ PUNICODE_STRING DeviceName
 
_In_ CONST GUIDAliasInterfaceClassGuid
 
_In_opt_ PDEVICE_OBJECT PhysicalDeviceObject
 
_In_opt_ PDEVICE_OBJECT _In_ ULONG Flags
 
_In_ DEVICE_REGISTRY_PROPERTY DeviceProperty
 
_In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
 
_Must_inspect_result_ _In_ PDEVICE_DESCRIPTION DeviceDescription
 
__drv_aliasesMem _In_ PVOID ClientIdentificationAddress
 
_In_ PIO_WORKITEM_ROUTINE WorkerRoutine
 
_In_ PIO_WORKITEM_ROUTINE _In_ WORK_QUEUE_TYPE QueueType
 
_In_ PIO_WORKITEM_ROUTINE _In_ WORK_QUEUE_TYPE _In_opt_ __drv_aliasesMem PVOID Context = Context
 
_In_ USHORT PacketSize
 
_In_ USHORT _In_ CCHAR StackSize
 
_In_ ULONG AllocateTag
 
_In_ ULONG _In_ ULONG MaxLockedMinutes
 
_In_ ULONG _In_ ULONG _In_ ULONG HighWatermark
 
_In_ PIO_TIMER_ROUTINE TimerRoutine
 
_In_ DEVICE_RELATION_TYPE Type
 
_In_ ACCESS_MASK _Out_ PHANDLE DeviceInterfaceKey
 
_In_ ULONG DevInstKeyType
 
_In_ ULONG _In_ ACCESS_MASK _Out_ PHANDLE DevInstRegKey
 
_In_ CONST GUIDInterfaceClassGuid
 
_In_ CONST GUID _In_opt_ PUNICODE_STRING ReferenceString
 
_In_ ULONG EventCategoryFlags
 
_In_ ULONG _In_opt_ PVOID EventCategoryData
 
_In_ ULONG _In_opt_ PVOID _In_ PDRIVER_OBJECT DriverObject
 
_In_ ULONG _In_opt_ PVOID _In_ PDRIVER_OBJECT _In_ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE CallbackRoutine
 
_In_ PVOID NotificationStructure
 
_In_ PVOID _In_opt_ PDEVICE_CHANGE_COMPLETE_CALLBACK Callback
 
_In_ NTSTATUS Status
 
_In_ BOOLEAN Enable
 
_In_ BOOLEAN Cancelable
 
_In_ BOOLEAN _In_ ULONG Key
 
_In_ PIRP _In_opt_ PULONG _In_opt_ PDRIVER_CANCEL CancelFunction
 
_In_ ULONG InstanceCount
 
_In_ ULONG _Out_ ULONGFirstInstanceId
 
_In_ ULONG Action
 
_In_ PDEVICE_OBJECT _In_ ULONG NumberOfMapRegisters
 
_In_ PDEVICE_OBJECT _In_ ULONG _In_ PDRIVER_CONTROL ExecutionRoutine
 
_In_opt_ PVPB Vpb
 
_In_opt_ PVPB _In_ PDEVICE_OBJECT RealDeviceObject
 
_In_opt_ PUNICODE_STRING String
 
_In_opt_ PUNICODE_STRING _In_opt_ PKTHREAD Thread
 
_In_ PDRIVER_REINITIALIZE DriverReinitializationRoutine
 
_In_ INTERFACE_TYPE LegacyBusType
 
_In_ INTERFACE_TYPE _In_ ULONG BusNumber
 
_In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG SlotNumber
 
_In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG _In_opt_ PCM_RESOURCE_LIST ResourceList
 
_In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG _In_opt_ PCM_RESOURCE_LIST _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements
 
_In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG _In_opt_ PCM_RESOURCE_LIST _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST _In_ BOOLEAN ResourceAssigned
 
_In_ PIO_CSQ_INSERT_IRP CsqInsertIrp
 
_In_ PIO_CSQ_INSERT_IRP _In_ PIO_CSQ_REMOVE_IRP CsqRemoveIrp
 
_In_ PIO_CSQ_INSERT_IRP _In_ PIO_CSQ_REMOVE_IRP _In_ PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp
 
_In_ PIO_CSQ_INSERT_IRP _In_ PIO_CSQ_REMOVE_IRP _In_ PIO_CSQ_PEEK_NEXT_IRP _In_ PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock
 
_In_ PIO_CSQ_INSERT_IRP _In_ PIO_CSQ_REMOVE_IRP _In_ PIO_CSQ_PEEK_NEXT_IRP _In_ PIO_CSQ_ACQUIRE_LOCK _In_ PIO_CSQ_RELEASE_LOCK CsqReleaseLock
 
_In_ PIO_CSQ_INSERT_IRP _In_ PIO_CSQ_REMOVE_IRP _In_ PIO_CSQ_PEEK_NEXT_IRP _In_ PIO_CSQ_ACQUIRE_LOCK _In_ PIO_CSQ_RELEASE_LOCK _In_ PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp
 
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE CompletionRoutine = CompletionRoutine
 
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_opt_ PVOID _In_ BOOLEAN InvokeOnSuccess
 
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_opt_ PVOID _In_ BOOLEAN _In_ BOOLEAN InvokeOnError
 
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_opt_ PVOID _In_ BOOLEAN _In_ BOOLEAN _In_ BOOLEAN InvokeOnCancel
 
_In_ ULONG SectorSize
 
_In_ ULONG _In_ BOOLEAN ReturnRecognizedPartitions
 
_In_ ULONG _In_ BOOLEAN _Out_ struct _DRIVE_LAYOUT_INFORMATION ** PartitionBuffer
 
_In_ ULONG _In_ ULONG PartitionNumber
 
_In_ ULONG _In_ ULONG _In_ ULONG PartitionType
 
_In_ ULONG _In_ ULONG SectorsPerTrack
 
_In_ ULONG _In_ ULONG _In_ ULONG NumberOfHeads
 
_In_ ULONG _In_ struct _SET_PARTITION_INFORMATION_EX * PartitionInfo
 
_In_opt_ PDEVICE_OBJECT _Out_opt_ PHANDLE FileObjectHandle
 
_In_ ULONG RequiredAccess
 
_In_ ULONG _In_ PHYSICAL_ADDRESS BusAddress
 
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
 
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG _Out_ PPHYSICAL_ADDRESS TranslatedAddress
 
ActualNumberDriverObjects _In_ ULONG DriverObjectListSize
 
ActualNumberDriverObjects _In_ ULONG _Out_ PULONG ActualNumberDriverObjects
 
_In_ CONST DEVPROPKEYPropertyKey
 
_In_ CONST DEVPROPKEY _In_ LCID Lcid
 
_In_ CONST DEVPROPKEY _In_ LCID _In_ ULONG _In_ DEVPROPTYPE _In_ ULONG Size
 
_In_ CONST DEVPROPKEY _In_ LCID _In_ ULONG _In_ DEVPROPTYPE _In_ ULONG _In_opt_ PVOID Data
 
_In_ CONST DEVPROPKEY _In_ LCID _Reserved_ ULONG _In_ ULONG _Out_ PVOID _Out_ PULONG RequiredSize
 
_In_ struct _DISK_GEOMETRY_EXOldDiskGeometry
 
_In_ struct _DISK_GEOMETRY_EX _In_ struct _DISK_GEOMETRY_EXNewDiskGeometry
 
_In_ PDEVICE_OBJECT SparePdo
 
_Out_ PGROUP_AFFINITY GroupAffinity
 
_Out_ PUSHORT NodeNumber
 
_In_ PDRIVER_FS_NOTIFICATION _In_ BOOLEAN SynchronizeWithMounts
 
 irpSp = IoGetNextIrpStackLocation(Irp)
 
irpSp Control = 0
 
_In_opt_ PDRIVER_CANCEL CancelRoutine
 
_Out_ PULONG_PTR HighLimit
 

Macro Definition Documentation

◆ DEVICE_INTERFACE_INCLUDE_NONACTIVE

#define DEVICE_INTERFACE_INCLUDE_NONACTIVE   0x00000001

Definition at line 2856 of file iofuncs.h.

◆ IoAcquireRemoveLock

#define IoAcquireRemoveLock (   RemoveLock,
  Tag 
)     IoAcquireRemoveLockEx(RemoveLock, Tag, "", 1, sizeof (IO_REMOVE_LOCK))

◆ IoAdjustPagingPathCount

#define IoAdjustPagingPathCount (   _Count,
  _Increment 
)
Value:
{ \
if (_Increment) \
{ \
InterlockedIncrement(_Count); \
} \
else \
{ \
InterlockedDecrement(_Count); \
} \
}
_Check_return_ _Ret_maybenull_ _In_ size_t _Count
Definition: malloc.h:108

◆ IoAssignArcName

#define IoAssignArcName (   _ArcName,
  _DeviceName 
)
Value:
( \
IoCreateSymbolicLink((_ArcName), (_DeviceName)))

◆ IoCallDriver

#define IoCallDriver   IofCallDriver

Definition at line 757 of file iofuncs.h.

◆ IoCallDriverStackSafeDefault

#define IoCallDriverStackSafeDefault (   a,
  b 
)    IoCallDriver(a, b)

◆ IoCompleteRequest

#define IoCompleteRequest   IofCompleteRequest

Definition at line 766 of file iofuncs.h.

◆ IoDeassignArcName

#define IoDeassignArcName   IoDeleteSymbolicLink

◆ IoForwardAndCatchIrp

#define IoForwardAndCatchIrp   IoForwardIrpSynchronously

Definition at line 1924 of file iofuncs.h.

◆ IoGetFunctionCodeFromCtlCode

#define IoGetFunctionCodeFromCtlCode (   _ControlCode)     (((_ControlCode) >> 2) & 0x00000FFF)

Definition at line 2863 of file iofuncs.h.

◆ IoInitializeRemoveLock

#define IoInitializeRemoveLock (   Lock,
  AllocateTag,
  MaxLockedMinutes,
  HighWatermark 
)
Value:
VOID NTAPI IoInitializeRemoveLockEx(IN PIO_REMOVE_LOCK RemoveLock, IN ULONG AllocateTag, IN ULONG MaxLockedMinutes, IN ULONG HighWatermark, IN ULONG RemlockSize)
Definition: remlock.c:33
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127
_In_ ULONG _In_ ULONG MaxLockedMinutes
Definition: iofuncs.h:1068
_In_ ULONG _In_ ULONG _In_ ULONG HighWatermark
Definition: iofuncs.h:1069
_In_ ULONG AllocateTag
Definition: iofuncs.h:1067

Definition at line 2833 of file iofuncs.h.

◆ IoIsErrorUserInduced

#define IoIsErrorUserInduced (   Status)
Value:
Status
Definition: gdiplustypes.h:25
#define BOOLEAN
Definition: pedump.c:73
#define STATUS_DEVICE_NOT_READY
Definition: shellext.h:70
#define STATUS_UNRECOGNIZED_MEDIA
Definition: udferr_usr.h:142
#define STATUS_MEDIA_WRITE_PROTECTED
Definition: udferr_usr.h:161
#define STATUS_IO_TIMEOUT
Definition: udferr_usr.h:163
#define STATUS_WRONG_VOLUME
Definition: udferr_usr.h:140
#define STATUS_NO_MEDIA_IN_DEVICE
Definition: udferr_usr.h:141
#define STATUS_VERIFY_REQUIRED
Definition: udferr_usr.h:130
_In_ NTSTATUS Status
Definition: iofuncs.h:1231

Definition at line 2817 of file iofuncs.h.

◆ IoIsFileOpenedExclusively

#define IoIsFileOpenedExclusively (   FileObject)
Value:
( \
(BOOLEAN) !( \
(FileObject)->SharedRead || \
(FileObject)->SharedWrite || \
(FileObject)->SharedDelete \
) \
)
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_In_ ULONG _Inout_ PFILE_OBJECT FileObject
Definition: iofuncs.h:782

◆ IoReleaseRemoveLock

#define IoReleaseRemoveLock (   _RemoveLock,
  _Tag 
)     IoReleaseRemoveLockEx(_RemoveLock, _Tag, sizeof(IO_REMOVE_LOCK))

Definition at line 2764 of file iofuncs.h.

◆ IoReleaseRemoveLockAndWait

#define IoReleaseRemoveLockAndWait (   _RemoveLock,
  _Tag 
)     IoReleaseRemoveLockAndWaitEx(_RemoveLock, _Tag, sizeof(IO_REMOVE_LOCK))

Definition at line 2774 of file iofuncs.h.

◆ IoSizeOfIrp

#define IoSizeOfIrp (   _StackSize)     ((USHORT) (sizeof(IRP) + ((_StackSize) * (sizeof(IO_STACK_LOCATION)))))

◆ IoWMIDeviceObjectToProviderId

#define IoWMIDeviceObjectToProviderId (   DeviceObject)    ((ULONG)(DeviceObject))

◆ PLUGPLAY_REGKEY_CURRENT_HWPROFILE

#define PLUGPLAY_REGKEY_CURRENT_HWPROFILE   4

Definition at line 2788 of file iofuncs.h.

◆ PLUGPLAY_REGKEY_DEVICE

#define PLUGPLAY_REGKEY_DEVICE   1

Definition at line 2786 of file iofuncs.h.

◆ PLUGPLAY_REGKEY_DRIVER

#define PLUGPLAY_REGKEY_DRIVER   2

Definition at line 2787 of file iofuncs.h.

Function Documentation

◆ $endif() [1/3]

$endif ( _NTDDK_  )

Definition at line 2494 of file iofuncs.h.

2502{
2503 PriorityInfo->Size = sizeof(IO_PRIORITY_INFO);
2504 PriorityInfo->ThreadPriority = 0xffff;
2505 PriorityInfo->IoPriority = IoPriorityNormal;
2506 PriorityInfo->PagePriority = 0;
2507}
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD _Inout_ PIO_PRIORITY_INFO PriorityInfo
Definition: fltkernel.h:2654
struct _IO_PRIORITY_INFO IO_PRIORITY_INFO
@ IoPriorityNormal
Definition: iotypes.h:1233

◆ $endif() [2/3]

$endif ( _NTIFS_  )

Definition at line 396 of file rtlfuncs.h.

2856{
2858 ret.QuadPart = SignedInteger;
2859 return ret;
2860}
return ret
Definition: rtlfuncs.h:3107

◆ $endif() [3/3]

$endif ( _WDMDDK_  )

Definition at line 552 of file iofuncs.h.

574{
577}
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_In_ UCHAR _In_ UCHAR _In_ ULONG _In_ WDFCONTEXT DriverContext
Definition: wdfdevice.h:1703
struct _IO_DRIVER_CREATE_CONTEXT IO_DRIVER_CREATE_CONTEXT

◆ $if()

$if ( _WDMDDK_  )

Kernel definitions for ARM64

Kernel definitions for AMD64

Kernel definitions for ARM

Definition at line 1 of file ke.h.

31{
32 ULONG Dummy;
KFLOATING_SAVE
Definition: ke.h:33
* PKFLOATING_SAVE
Definition: ke.h:33
uint32_t ULONG
Definition: typedefs.h:59

◆ __drv_allocatesMem()

__drv_allocatesMem ( Mem  )

Definition at line 55 of file gui.c.

58{
59 return NULL;
60}
#define NULL
Definition: types.h:112

◆ __drv_freesMem()

__drv_freesMem ( Mem  )

Definition at line 1523 of file exfuncs.h.

1524{
1525 Lookaside->L.TotalFrees++;
1526#ifdef NONAMELESSUNION
1527 if (ExQueryDepthSList(&Lookaside->L.u.ListHead) >= Lookaside->L.Depth) {
1528 Lookaside->L.u3.FreeMisses++;
1529 (Lookaside->L.u5.Free)(Entry);
1530 } else {
1531#if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_)
1534 &Lookaside->Lock__ObsoleteButDoNotDelete);
1535#else
1537#endif
1538 }
1539#else /* NONAMELESSUNION */
1540 if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) {
1541 Lookaside->L.FreeMisses++;
1542 (Lookaside->L.Free)(Entry);
1543 } else {
1544#if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_)
1547 &Lookaside->Lock__ObsoleteButDoNotDelete);
1548#else
1550#endif
1551 }
1552#endif /* NONAMELESSUNION */
1553}
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
#define ExInterlockedPushEntrySList(SListHead, SListEntry, Lock)
Definition: exfuncs.h:163
FORCEINLINE USHORT ExQueryDepthSList(_In_ PSLIST_HEADER SListHead)
Definition: exfuncs.h:153
#define InterlockedPushEntrySList(SListHead, SListEntry)
Definition: rtlfuncs.h:3406
#define PSLIST_ENTRY
Definition: rtltypes.h:134

◆ __drv_reportError()

_In_ __drv_reportError ( "MajorVersion must be 1 or 6"  )

◆ _At_() [1/2]

_At_ ( PropertyBuffer  ,
_Post_  _NullNull_terminated_ 
)

◆ _At_() [2/2]

_At_ ( PropertyBuffer  ,
_Post_z_   
) &

◆ _Deref_out_range_()

_In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Deref_out_range_ ( <=  ,
BufferLength   
)

Definition at line 4359 of file vfwdfdynamics.cpp.

4362{
4364#pragma prefast(suppress: __WARNING_HIGH_PRIORITY_OVERFLOW_POSTCONDITION, "This is a verifier DDI hook routine and all it does is call original routine.")
4366}
DriverGlobals
_Must_inspect_result_ _In_ WDFDEVICE _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIOTARGET * IoTarget
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
WDFVERSION WdfVersion
PAGED_CODE_LOCKED()
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY DeviceProperty
PropertyBuffer
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
PFN_WDFIOTARGETQUERYTARGETPROPERTY pfnWdfIoTargetQueryTargetProperty
Definition: fxdynamics.h:226
WDFFUNCTIONS Functions
Definition: fxdynamics.h:594

◆ _In_reads_()

_In_reads_ ( _Inexpressible_(FIELD_OFFSET(DRIVE_LAYOUT_INFORMATION_EX, PartitionEntry[0]))  )

◆ _In_reads_bytes_opt_()

◆ _IRQL_requires_max_() [1/4]

_IRQL_requires_max_ ( APC_LEVEL  )

Probes and locks virtual pages in memory for the specified process.

Parameters
[in,out]MemoryDescriptorListMemory Descriptor List (MDL) containing the buffer to be probed and locked.
[in]ProcessThe process for which the buffer should be probed and locked.
[in]AccessModeAccess mode for probing the pages. Can be KernelMode or UserMode.
[in]LockOperationThe type of the probing and locking operation. Can be IoReadAccess, IoWriteAccess or IoModifyAccess.
Returns
Nothing.
See also
MmProbeAndLockPages
Remarks
Must be called at IRQL <= APC_LEVEL

Probes and locks virtual pages in memory for the specified process.

Frees previously reserved amount of memory in system virtual address space.

Parameters
[in]NumberOfBytesSize, in bytes, of memory to reserve.
[in]PoolTagPool Tag identifying the buffer. Usually consists from 4 characters in reversed order.
Returns
A pointer to the 1st memory block of the reserved buffer in case of success, NULL otherwise.
Remarks
Must be called at IRQL <= APC_LEVEL
Parameters
[in]BaseAddressA pointer to the 1st memory block of the reserved buffer.
[in]PoolTagPool Tag identifying the buffer. Usually consists from 4 characters in reversed order.
Returns
Nothing.
See also
MmAllocateMappingAddress
Remarks
Must be called at IRQL <= APC_LEVEL

Definition at line 2887 of file iofuncs.h.

2891{
2892 ULONG_PTR End, Begin;
2894
2895 IoGetStackLimits(&Begin, &End);
2896 Result = (ULONG_PTR)(&End) - Begin;
2897 return Result;
2898}
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 const char BOOLEAN Begin
Definition: acpixf.h:1301
#define ULONG_PTR
Definition: config.h:101
VOID NTAPI IoGetStackLimits(OUT PULONG_PTR LowLimit, OUT PULONG_PTR HighLimit)
Definition: util.c:78
uint32_t ULONG_PTR
Definition: typedefs.h:65
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

◆ _IRQL_requires_max_() [2/4]

_IRQL_requires_max_ ( DISPATCH_LEVEL  )

Definition at line 347 of file common.c.

3587{
3589 BOOLEAN requestSent = FALSE;
3590
3591 BOOLEAN shouldRetry = TRUE;
3592 PCDB cdb = (PCDB)DeviceExtension->PowerContext.Srb.Cdb;
3593 ULONG timeoutValue = DeviceExtension->TimeOutValue;
3594 ULONG retryCount = 1;
3595
3596 // reset some fields.
3597 DeviceExtension->PowerContext.RetryIntervalIn100ns = 0;
3598 status = PowerContextReuseRequest(DeviceExtension);
3599 RequestClearSendTime(DeviceExtension->PowerContext.PowerRequest);
3600
3601 if (!NT_SUCCESS(status))
3602 {
3603 return status;
3604 }
3605
3606 // set proper timeout value and max retry count.
3607 switch(DeviceExtension->PowerContext.PowerChangeState.PowerDown)
3608 {
3612 break;
3613
3615 // Case of issuing SYNC CACHE command. Do not use power irp timeout remaining time in this case
3616 // as we want to give best try on SYNC CACHE command.
3617 retryCount = MAXIMUM_RETRIES;
3618 timeoutValue = DeviceExtension->TimeOutValue;
3619 break;
3620
3622 {
3623 // Case of issuing STOP UNIT command
3624 // As "Imme" bit is set to '1', this command should be completed in short time.
3625 // This command is at low importance, failure of this command has very small impact.
3626 ULONG secondsRemaining = 0;
3627
3628#if (WINVER >= 0x0601)
3629 // this API is introduced in Windows7
3630 PoQueryWatchdogTime(DeviceExtension->LowerPdo, &secondsRemaining);
3631#endif
3632
3633 if (secondsRemaining == 0)
3634 {
3635 // not able to retrieve remaining time from PoQueryWatchdogTime API, use default values.
3636 retryCount = MAXIMUM_RETRIES;
3637 timeoutValue = SCSI_CDROM_TIMEOUT;
3638 }
3639 else
3640 {
3641 // plan to leave about 30 seconds to lower level drivers if possible.
3642 if (secondsRemaining >= 32)
3643 {
3644 retryCount = (secondsRemaining - 30)/SCSI_CDROM_TIMEOUT + 1;
3645 timeoutValue = SCSI_CDROM_TIMEOUT;
3646
3647 if (retryCount > MAXIMUM_RETRIES)
3648 {
3649 retryCount = MAXIMUM_RETRIES;
3650 }
3651
3652 if (retryCount == 1)
3653 {
3654 timeoutValue = secondsRemaining - 30;
3655 }
3656 }
3657 else
3658 {
3659 // issue the command with minimal timeout value and do not retry on it.
3660 retryCount = 1;
3661 timeoutValue = 2;
3662 }
3663 }
3664 }
3665 break;
3666 default:
3667 NT_ASSERT( FALSE );
3669 return status;
3670 }
3671
3672 DeviceExtension->PowerContext.RetryCount = retryCount;
3673
3674 // issue command.
3675 while (shouldRetry)
3676 {
3677
3678 // set SRB fields.
3679 DeviceExtension->PowerContext.Srb.SrbFlags = SRB_FLAGS_NO_DATA_TRANSFER |
3684
3685 DeviceExtension->PowerContext.Srb.Function = SRB_FUNCTION_EXECUTE_SCSI;
3686 DeviceExtension->PowerContext.Srb.TimeOutValue = timeoutValue;
3687
3688 if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceInitial)
3689 {
3690 DeviceExtension->PowerContext.Srb.Function = SRB_FUNCTION_LOCK_QUEUE;
3691 }
3692 else if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceLocked)
3693 {
3694 DeviceExtension->PowerContext.Srb.Function = SRB_FUNCTION_QUIESCE_DEVICE;
3695 }
3696 else if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceQuiesced)
3697 {
3698 // Case of issuing SYNC CACHE command.
3699 DeviceExtension->PowerContext.Srb.CdbLength = 10;
3700 cdb->SYNCHRONIZE_CACHE10.OperationCode = SCSIOP_SYNCHRONIZE_CACHE;
3701 }
3702 else if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceFlushed)
3703 {
3704 // Case of issuing STOP UNIT command.
3705 DeviceExtension->PowerContext.Srb.CdbLength = 6;
3706 cdb->START_STOP.OperationCode = SCSIOP_START_STOP_UNIT;
3707 cdb->START_STOP.Start = 0;
3708 cdb->START_STOP.Immediate = 1;
3709 }
3710 else if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceStopped)
3711 {
3712 DeviceExtension->PowerContext.Srb.Function = SRB_FUNCTION_UNLOCK_QUEUE;
3713 }
3714
3715 // Set up completion routine and context if requested
3717 {
3718 WdfRequestSetCompletionRoutine(DeviceExtension->PowerContext.PowerRequest,
3720 Context);
3721 }
3722
3723 status = RequestSend(DeviceExtension,
3724 DeviceExtension->PowerContext.PowerRequest,
3725 DeviceExtension->IoTarget,
3727 &requestSent);
3728
3729 if (requestSent)
3730 {
3731 if ((CompletionRoutine == NULL) &&
3732 (SRB_STATUS(DeviceExtension->PowerContext.Srb.SrbStatus) != SRB_STATUS_SUCCESS))
3733 {
3734 TracePrint((TRACE_LEVEL_ERROR,
3735 TRACE_FLAG_POWER,
3736 "%p\tError occured when issuing %s command to device. Srb %p, Status %x\n",
3737 DeviceExtension->PowerContext.PowerRequest,
3738 (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceQuiesced) ? "SYNC CACHE" : "STOP UNIT",
3739 &DeviceExtension->PowerContext.Srb,
3740 DeviceExtension->PowerContext.Srb.SrbStatus));
3741
3742 NT_ASSERT(!(TEST_FLAG(DeviceExtension->PowerContext.Srb.SrbStatus, SRB_STATUS_QUEUE_FROZEN)));
3743
3744 shouldRetry = RequestSenseInfoInterpret(DeviceExtension,
3745 DeviceExtension->PowerContext.PowerRequest,
3746 &(DeviceExtension->PowerContext.Srb),
3747 retryCount - DeviceExtension->PowerContext.RetryCount,
3748 &status,
3749 &(DeviceExtension->PowerContext.RetryIntervalIn100ns));
3750
3751 if (shouldRetry && (DeviceExtension->PowerContext.RetryCount-- == 0))
3752 {
3753 shouldRetry = FALSE;
3754 }
3755 }
3756 else
3757 {
3758 // succeeded, do not need to retry.
3759 shouldRetry = FALSE;
3760 }
3761
3762 }
3763 else
3764 {
3765 // request failed to be sent
3766 shouldRetry = FALSE;
3767 }
3768
3769 if (shouldRetry)
3770 {
3772 t.QuadPart = -DeviceExtension->PowerContext.RetryIntervalIn100ns;
3774
3775 status = PowerContextReuseRequest(DeviceExtension);
3776 if (!NT_SUCCESS(status))
3777 {
3778 shouldRetry = FALSE;
3779 }
3780 }
3781 }
3782
3783 if (DeviceExtension->PowerContext.PowerChangeState.PowerDown == PowerDownDeviceQuiesced)
3784 {
3785 // record SYNC CACHE command completion time stamp.
3786 KeQueryTickCount(&DeviceExtension->PowerContext.Step1CompleteTime);
3787 }
3788
3789 return status;
3790}
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define MAXIMUM_RETRIES
Definition: cdrom.h:124
#define SCSI_CDROM_TIMEOUT
Definition: cdrom.h:680
BOOLEAN RequestSenseInfoInterpret(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ WDFREQUEST Request, _In_ PSCSI_REQUEST_BLOCK Srb, _In_ ULONG RetriedCount, _Out_ NTSTATUS *Status, _Out_opt_ _Deref_out_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) LONGLONG *RetryIntervalIn100ns)
Definition: sense.c:2467
#define TEST_FLAG(Flags, Bit)
Definition: cdrom.h:1495
@ PowerDownDeviceStopped
Definition: cdrom.h:412
@ PowerDownDeviceQuiesced
Definition: cdrom.h:410
@ PowerDownDeviceInitial
Definition: cdrom.h:408
@ PowerDownDeviceLocked
Definition: cdrom.h:409
@ PowerDownDeviceFlushed
Definition: cdrom.h:411
union _CDB * PCDB
#define SCSIOP_START_STOP_UNIT
Definition: cdrw_hw.h:897
#define SCSIOP_SYNCHRONIZE_CACHE
Definition: cdrw_hw.h:918
#define STATUS_NOT_IMPLEMENTED
Definition: d3dkmdt.h:42
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
NTSTATUS RequestSend(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ WDFREQUEST Request, _In_ WDFIOTARGET IoTarget, _In_ ULONG Flags, _Out_opt_ PBOOLEAN RequestSent)
Definition: common.c:3793
VOID RequestClearSendTime(_In_ WDFREQUEST Request)
Definition: common.c:111
#define SRB_FUNCTION_EXECUTE_SCSI
Definition: srb.h:315
#define SRB_FLAGS_NO_DATA_TRANSFER
Definition: srb.h:402
#define SRB_FUNCTION_LOCK_QUEUE
Definition: srb.h:332
#define SRB_FUNCTION_UNLOCK_QUEUE
Definition: srb.h:333
#define SRB_FLAGS_BYPASS_LOCKED_QUEUE
Definition: srb.h:410
#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER
Definition: srb.h:397
#define SRB_STATUS(Status)
Definition: srb.h:389
#define SRB_STATUS_QUEUE_FROZEN
Definition: srb.h:386
#define SRB_FLAGS_NO_QUEUE_FREEZE
Definition: srb.h:404
#define SRB_STATUS_SUCCESS
Definition: srb.h:341
#define KeDelayExecutionThread(mode, foo, t)
Definition: env_spec_w32.h:484
GLdouble GLdouble t
Definition: gl.h:2047
#define KernelMode
Definition: asm.h:34
#define SRB_FLAGS_D3_PROCESSING
Definition: srb.h:165
#define SRB_FUNCTION_QUIESCE_DEVICE
Definition: srb.h:99
#define KeQueryTickCount(CurrentCount)
Definition: ke.h:43
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
Definition: ps.c:97
Definition: cdrw_hw.h:28
struct _CDB::_START_STOP START_STOP
struct _CDB::_SYNCHRONIZE_CACHE10 SYNCHRONIZE_CACHE10
@ WDF_REQUEST_SEND_OPTION_SYNCHRONOUS
Definition: wdfrequest.h:109
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine
Definition: wdfrequest.h:895
#define NT_ASSERT
Definition: rtlfuncs.h:3327

◆ _IRQL_requires_max_() [3/4]

_IRQL_requires_max_ ( PASSIVE_LEVEL  ) &

◆ _IRQL_requires_max_() [4/4]

Queries information details about a security descriptor.

Computes the quota size of a security descriptor.

Assigns a security descriptor for a new object.

An extended function that assigns a security descriptor for a new object.

Frees a security descriptor.

An extended function that sets new information data to a security descriptor.

Modifies some information data about a security descriptor.

Parameters
[in]SecurityInformationSecurity information details to be queried from a security descriptor.
[out]SecurityDescriptorThe returned security descriptor with security information data.
[in,out]LengthThe returned length of a security descriptor.
[in,out]ObjectsSecurityDescriptorThe returned object security descriptor.
Returns
Returns STATUS_SUCCESS if the operations have been completed successfully and that the specific information about the security descriptor has been queried. STATUS_BUFFER_TOO_SMALL is returned if the buffer size is too small to contain the queried info about the security descriptor.
Parameters
[in]ObjectIf specified, the function will use this arbitrary object that points to an object security descriptor.
[in]SecurityInformationSecurity information details to be set.
[in]SecurityDescriptorA security descriptor where its info is to be changed.
[in,out]ObjectsSecurityDescriptorThe returned pointer to security descriptor objects.
[in]PoolTypePool type for the new security descriptor to allocate.
[in]GenericMappingThe generic mapping of access rights masks.
Returns
See SeSetSecurityDescriptorInfoEx.
Parameters
[in]ObjectIf specified, the function will use this arbitrary object that points to an object security descriptor.
[in]SecurityInformationSecurity information details to be set.
[in]SecurityDescriptorA security descriptor where its info is to be changed.
[in,out]ObjectsSecurityDescriptorThe returned pointer to security descriptor objects.
[in]AutoInheritFlagsFlags bitmask inheritation, influencing how the security descriptor can be inherited and if it can be in the first place.
[in]PoolTypePool type for the new security descriptor to allocate.
[in]GenericMappingThe generic mapping of access rights masks.
Returns
Returns STATUS_SUCCESS if the operations have been completed without problems and that new info has been set to the security descriptor. STATUS_NO_SECURITY_ON_OBJECT is returned if the object does not have a security descriptor. STATUS_INSUFFICIENT_RESOURCES is returned if memory pool allocation for the new security descriptor with new info set has failed.
Parameters
[in]SecurityDescriptorA security descriptor to be freed from memory.
Returns
Returns STATUS_SUCCESS.
Parameters
[in]_ParentDescriptorA security descriptor of the parent object that is being created.
[in]_ExplicitDescriptorAn explicit security descriptor that is applied to a new object.
[out]NewDescriptorThe new allocated security descriptor.
[in]ObjectTypeThe type of the new object.
[in]IsDirectoryObjectSet this to TRUE if the newly created object is a directory object, otherwise set this to FALSE.
[in]AutoInheritFlagsAutomatic inheritance flags that influence how access control entries within ACLs from security descriptors are inherited.
[in]SubjectContextSecurity subject context of the new object.
[in]GenericMappingGeneric mapping of access mask rights.
[in]PoolTypeThis parameter is unused.
Returns
Returns STATUS_SUCCESS if the operations have been completed successfully and that the security descriptor has been assigned to the new object. STATUS_NO_TOKEN is returned if the caller hasn't supplied a valid argument to a security subject context. STATUS_INVALID_OWNER is returned if the caller hasn't supplied a parent descriptor that belongs to the main user (owner). STATUS_INVALID_PRIMARY_GROUP is returned by the same reason as with the previous NTSTATUS code. The two NTSTATUS codes are returned if the calling thread stated that the owner and/or group is defaulted to the parent descriptor (SEF_DEFAULT_OWNER_FROM_PARENT and/or SEF_DEFAULT_GROUP_FROM_PARENT respectively). STATUS_INSUFFICIENT_RESOURCES is returned if memory pool allocation for the descriptor buffer has failed. A failure NTSTATUS is returned otherwise.
Parameters
[in]ParentDescriptorA security descriptor of the parent object that is being created.
[in]ExplicitDescriptorAn explicit security descriptor that is applied to a new object.
[out]NewDescriptorThe new allocated security descriptor.
[in]IsDirectoryObjectSet this to TRUE if the newly created object is a directory object, otherwise set this to FALSE.
[in]SubjectContextSecurity subject context of the new object.
[in]GenericMappingGeneric mapping of access mask rights.
[in]PoolTypeThis parameter is unused.
Returns
See SeAssignSecurityEx.
Parameters
[in]SecurityDescriptorA security descriptor.
[out]QuotaInfoSizeThe returned quota size of the given security descriptor to the caller. The function may return 0 to this parameter if the descriptor doesn't have a group or a discretionary access control list (DACL) even.
Returns
Returns STATUS_SUCCESS if the quota size of a security descriptor has been computed successfully. STATUS_UNKNOWN_REVISION is returned if the security descriptor has an invalid revision.

Definition at line 923 of file Messaging.c.

75{
76 PFLT_SERVER_PORT_OBJECT PortObject;
78
79 /* The caller must allow at least one connection */
80 if (MaxConnections == 0)
81 {
83 }
84
85 /* The request must be for a kernel handle */
86 if (!(ObjectAttributes->Attributes & OBJ_KERNEL_HANDLE))
87 {
89 }
90
91 /*
92 * Get rundown protection on the target to stop the owner
93 * from unloading whilst this port object is open. It gets
94 * removed in the FltpServerPortClose callback
95 */
97 if (!NT_SUCCESS(Status))
98 {
99 return Status;
100 }
101
102 /* Create the server port object for this filter */
107 NULL,
109 0,
110 0,
111 (PVOID *)&PortObject);
112 if (NT_SUCCESS(Status))
113 {
114 /* Zero out the struct */
115 RtlZeroMemory(PortObject, sizeof(FLT_SERVER_PORT_OBJECT));
116
117 /* Increment the ref count on the target filter */
119
120 /* Setup the filter port object */
121 PortObject->Filter = Filter;
125 PortObject->Cookie = ServerPortCookie;
126 PortObject->MaxConnections = MaxConnections;
127
128 /* Insert the object */
129 Status = ObInsertObject(PortObject,
130 NULL,
132 0,
133 NULL,
135 if (NT_SUCCESS(Status))
136 {
137 /* Lock the connection list */
139
140 /* Add the new port object to the connection list and increment the count */
143
144 /* Unlock the connection list*/
146 }
147 }
148
149 if (!NT_SUCCESS(Status))
150 {
151 /* Allow the filter to be cleaned up */
153 }
154
155 return Status;
156}
static const INTERNET_PORT ServerPort
Definition: CWebService.cpp:11
POBJECT_TYPE ServerPortObjectType
Definition: Messaging.c:24
VOID FLTAPI FltObjectDereference(_Inout_ PVOID Object)
Definition: Object.c:53
NTSTATUS FLTAPI FltObjectReference(_Inout_ PVOID Object)
Definition: Object.c:41
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define InsertTailList(ListHead, Entry)
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1801
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY _In_opt_ PFLT_MESSAGE_NOTIFY MessageNotifyCallback
Definition: fltkernel.h:1877
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY ConnectNotifyCallback
Definition: fltkernel.h:1875
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID ServerPortCookie
Definition: fltkernel.h:1874
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY DisconnectNotifyCallback
Definition: fltkernel.h:1876
ULONG FltpObjectPointerReference(_In_ PFLT_OBJECT Object)
Definition: Object.c:322
VOID FASTCALL ExAcquireFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:23
VOID FASTCALL ExReleaseFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:31
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
static LONG MaxConnections
#define FILE_READ_DATA
Definition: nt_native.h:628
#define STANDARD_RIGHTS_ALL
Definition: nt_native.h:69
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
NTSTATUS NTAPI ObInsertObject(IN PVOID Object, IN PACCESS_STATE AccessState OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG ObjectPointerBias, OUT PVOID *NewObject OPTIONAL, OUT PHANDLE Handle)
Definition: obhandle.c:2935
NTSTATUS NTAPI ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL, IN POBJECT_TYPE Type, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN KPROCESSOR_MODE AccessMode, IN OUT PVOID ParseContext OPTIONAL, IN ULONG ObjectSize, IN ULONG PagedPoolCharge OPTIONAL, IN ULONG NonPagedPoolCharge OPTIONAL, OUT PVOID *Object)
Definition: oblife.c:1039
FLT_MUTEX_LIST_HEAD ConnectionList
Definition: fltmgrint.h:121
LIST_ENTRY mList
Definition: fltmgrint.h:56
FAST_MUTEX mLock
Definition: fltmgrint.h:55
PFLT_DISCONNECT_NOTIFY DisconnectNotify
Definition: fltmgrint.h:192
PFLT_MESSAGE_NOTIFY MessageNotify
Definition: fltmgrint.h:193
PFLT_CONNECT_NOTIFY ConnectNotify
Definition: fltmgrint.h:191
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135

◆ _Out_writes_bytes_opt_()

_In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_writes_bytes_opt_ ( BufferLength  )

◆ _Out_writes_bytes_to_()

_In_ CONST DEVPROPKEY _In_ LCID _Reserved_ ULONG _In_ ULONG _Out_writes_bytes_to_ ( Size  ,
RequiredSize 
)

◆ _Requires_lock_held_()

_Requires_lock_held_ ( _Global_cancel_spin_lock_  )

◆ _When_() [1/4]

_In_ _In_ _When_ ( MinorVersion!  = 0 &&MinorVersion!=5 &&MinorVersion!=16 &&MinorVersion!=32 &&MinorVersion!=48,
__drv_reportError("MinorVersion must be 0, 0x5, 0x10, 0x20, or 0x30")   
)

◆ _When_() [2/4]

_Must_inspect_result_ _In_ PDEVICE_DESCRIPTION _Out_ _When_ ( return!  = 0,
_Kernel_IoGetDmaAdapter_ _At_ *,  _Must_inspect_result_ 
)

◆ _When_() [3/4]

_In_ CONST GUID _Out_ _When_ ( return  = =0,
_At_(AliasSymbolicLinkName->Buffer, __drv_allocatesMem(Mem))   
)

◆ _When_() [4/4]

◆ ASSERT()

◆ if() [1/3]

if ( InvokeOnCancel  )

Definition at line 2732 of file iofuncs.h.

2732 {
2733 irpSp->Control |= SL_INVOKE_ON_CANCEL;
2734 }
irpSp
Definition: iofuncs.h:2719
#define SL_INVOKE_ON_CANCEL
Definition: iotypes.h:3327

◆ if() [2/3]

if ( InvokeOnError  )

Definition at line 2728 of file iofuncs.h.

2728 {
2729 irpSp->Control |= SL_INVOKE_ON_ERROR;
2730 }
#define SL_INVOKE_ON_ERROR
Definition: iotypes.h:3329

◆ if() [3/3]

if ( InvokeOnSuccess  )

Definition at line 2724 of file iofuncs.h.

2724 {
2725 irpSp->Control = SL_INVOKE_ON_SUCCESS;
2726 }
#define SL_INVOKE_ON_SUCCESS
Definition: iotypes.h:3328

◆ IoAllocateDriverObjectExtension()

NTKERNELAPI NTSTATUS NTAPI IoAllocateDriverObjectExtension ( _In_ PDRIVER_OBJECT  DriverObject,
_In_ PVOID  ClientIdentificationAddress,
_In_ ULONG  DriverObjectExtensionSize,
_Post_ _At_(*,(==0, Mem  _Post_notnull_ 
)

◆ IoAllocateSfioStreamIdentifier()

NTSTATUS NTAPI IoAllocateSfioStreamIdentifier ( _In_ PFILE_OBJECT  FileObject,
_In_ ULONG  Length,
_In_ PVOID  Signature,
_Out_ PVOID StreamIdentifier 
)

◆ IoAssignResources()

NTKERNELAPI NTSTATUS NTAPI IoAssignResources ( _In_ PUNICODE_STRING  RegistryPath,
_In_opt_ PUNICODE_STRING  DriverClassName,
_In_ PDRIVER_OBJECT  DriverObject,
_In_opt_ PDEVICE_OBJECT  DeviceObject,
_In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST  RequestedResources,
_Inout_ PCM_RESOURCE_LIST AllocatedResources 
)

Definition at line 1134 of file iorsrce.c.

1141{
1143
1146
1147 /* Do we have a DO? */
1148 if (DeviceObject)
1149 {
1150 /* Get its device node */
1153 {
1154 /* New drivers should not call this API */
1155 KeBugCheckEx(PNP_DETECTED_FATAL_ERROR,
1156 0x2,
1159 0);
1160 }
1161 }
1162
1163 /* Did the driver supply resources? */
1164 if (RequestedResources)
1165 {
1166 /* Make sure there's actually something useful in them */
1167 if (!(RequestedResources->AlternativeLists) || !(RequestedResources->List[0].Count))
1168 {
1169 /* Empty resources are no resources */
1170 RequestedResources = NULL;
1171 }
1172 }
1173
1174 /* Initialize output if given */
1177
1178 /* Call internal helper function */
1182 RequestedResources,
1184}
@ DeviceNode
Definition: Node.h:9
static NTSTATUS IopLegacyResourceAllocation(_In_ ARBITER_REQUEST_SOURCE AllocationType, _In_ PDRIVER_OBJECT DriverObject, _In_opt_ PDEVICE_OBJECT DeviceObject, _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements, _Inout_ PCM_RESOURCE_LIST *AllocatedResources)
Definition: iorsrce.c:1093
_Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PCM_RESOURCE_LIST * AllocatedResources
Definition: ndis.h:4643
#define DNF_LEGACY_RESOURCE_DEVICENODE
Definition: iotypes.h:187
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
PDEVICE_NODE FASTCALL IopGetDeviceNode(IN PDEVICE_OBJECT DeviceObject)
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
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_In_opt_ PUNICODE_STRING DriverClassName
Definition: halfuncs.h:156
@ ArbiterRequestLegacyAssigned
Definition: iotypes.h:4616

Referenced by PciAssignSlotResources(), and VideoPortGetAccessRanges().

◆ IoAttachDevice()

◆ IoAttachDeviceByPointer()

NTKERNELAPI NTSTATUS NTAPI IoAttachDeviceByPointer ( _In_ PDEVICE_OBJECT  SourceDevice,
_In_ PDEVICE_OBJECT  TargetDevice 
)

◆ IoAttachDeviceToDeviceStackSafe()

NTKERNELAPI NTSTATUS NTAPI IoAttachDeviceToDeviceStackSafe ( _In_ PDEVICE_OBJECT  SourceDevice,
_In_ PDEVICE_OBJECT  TargetDevice,
_Outptr_ PDEVICE_OBJECT AttachedToDeviceObject 
)

◆ IoCancelFileOpen()

NTKERNELAPI VOID NTAPI IoCancelFileOpen ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ PFILE_OBJECT  FileObject 
)

◆ IoCheckDesiredAccess()

NTKERNELAPI NTSTATUS NTAPI IoCheckDesiredAccess ( _Inout_ PACCESS_MASK  DesiredAccess,
_In_ ACCESS_MASK  GrantedAccess 
)

◆ IoCheckEaBufferValidity()

NTKERNELAPI NTSTATUS NTAPI IoCheckEaBufferValidity ( _In_ PFILE_FULL_EA_INFORMATION  EaBuffer,
_In_ ULONG  EaLength,
_Out_ PULONG  ErrorOffset 
)

◆ IoCheckFunctionAccess()

NTKERNELAPI NTSTATUS NTAPI IoCheckFunctionAccess ( _In_ ACCESS_MASK  GrantedAccess,
_In_ UCHAR  MajorFunction,
_In_ UCHAR  MinorFunction,
_In_ ULONG  IoControlCode,
_In_opt_ PVOID  Argument1,
_In_opt_ PVOID  Argument2 
)

◆ IoCheckQuerySetFileInformation()

NTKERNELAPI NTSTATUS NTAPI IoCheckQuerySetFileInformation ( _In_ FILE_INFORMATION_CLASS  FileInformationClass,
_In_ ULONG  Length,
_In_ BOOLEAN  SetOperation 
)

◆ IoCheckQuerySetVolumeInformation()

NTKERNELAPI NTSTATUS NTAPI IoCheckQuerySetVolumeInformation ( _In_ FS_INFORMATION_CLASS  FsInformationClass,
_In_ ULONG  Length,
_In_ BOOLEAN  SetOperation 
)

◆ IoCheckQuotaBufferValidity()

NTKERNELAPI NTSTATUS NTAPI IoCheckQuotaBufferValidity ( _In_ PFILE_QUOTA_INFORMATION  QuotaBuffer,
_In_ ULONG  QuotaLength,
_Out_ PULONG  ErrorOffset 
)

◆ IoCheckShareAccessEx()

NTKERNELAPI NTSTATUS NTAPI IoCheckShareAccessEx ( _In_ ACCESS_MASK  DesiredAccess,
_In_ ULONG  DesiredShareAccess,
_Inout_ PFILE_OBJECT  FileObject,
_Inout_ PSHARE_ACCESS  ShareAccess,
_In_ BOOLEAN  Update,
_In_ PBOOLEAN  WritePermission 
)

◆ IoClearIrpExtraCreateParameter()

VOID NTAPI IoClearIrpExtraCreateParameter ( _Inout_ PIRP  Irp)

◆ IoConnectInterruptEx()

NTKERNELAPI NTSTATUS NTAPI IoConnectInterruptEx ( _Inout_ PIO_CONNECT_INTERRUPT_PARAMETERS  Parameters)

Definition at line 198 of file irq.c.

200{
201 PAGED_CODE();
202
203 switch (Parameters->Version)
204 {
208 //TODO: We don't do anything for the group type
211 DPRINT1("FIXME: Message based interrupts are UNIMPLEMENTED\n");
212 break;
214 DPRINT1("FIXME: Line based interrupts are UNIMPLEMENTED\n");
215 break;
216 }
217
218 return STATUS_SUCCESS;
219}
#define PAGED_CODE()
#define DPRINT1
Definition: precomp.h:8
NTSTATUS IopConnectInterruptExFullySpecific(_Inout_ PIO_CONNECT_INTERRUPT_PARAMETERS Parameters)
Definition: irq.c:173
#define STATUS_SUCCESS
Definition: shellext.h:65
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:869
#define CONNECT_FULLY_SPECIFIED_GROUP
#define CONNECT_LINE_BASED
#define CONNECT_FULLY_SPECIFIED
#define CONNECT_MESSAGE_BASED

◆ IoCopyCurrentIrpStackLocationToNext()

FORCEINLINE VOID IoCopyCurrentIrpStackLocationToNext ( _Inout_ PIRP  Irp)

Definition at line 2868 of file iofuncs.h.

2870{
2872 PIO_STACK_LOCATION nextIrpSp;
2874 nextIrpSp = IoGetNextIrpStackLocation(Irp);
2876 nextIrpSp->Control = 0;
2877}
_In_ PIRP Irp
Definition: csq.h:116
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2695
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793

◆ IoCreateDevice()

NTKERNELAPI NTSTATUS NTAPI IoCreateDevice ( _In_ PDRIVER_OBJECT  DriverObject,
_In_ ULONG  DeviceExtensionSize,
_In_opt_ PUNICODE_STRING  DeviceName,
_In_ DEVICE_TYPE  DeviceType,
_In_ ULONG  DeviceCharacteristics,
_In_ BOOLEAN  Exclusive,
_Outptr_result_nullonfailure_   _At_*, Mem _When_(((_In_function_class_(DRIVER_INITIALIZE))||(_In_function_class_(DRIVER_DISPATCH))), __drv_aliasesMem 
)

◆ IoCreateDisk()

NTKERNELAPI NTSTATUS NTAPI IoCreateDisk ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_opt_ struct _CREATE_DISK *  Disk 
)

◆ IoCreateFileEx()

NTKERNELAPI NTSTATUS NTAPI IoCreateFileEx ( _Out_ PHANDLE  FileHandle,
_In_ ACCESS_MASK  DesiredAccess,
_In_ POBJECT_ATTRIBUTES  ObjectAttributes,
_Out_ PIO_STATUS_BLOCK  IoStatusBlock,
_In_opt_ PLARGE_INTEGER  AllocationSize,
_In_ ULONG  FileAttributes,
_In_ ULONG  ShareAccess,
_In_ ULONG  Disposition,
_In_ ULONG  CreateOptions,
_In_opt_ PVOID  EaBuffer,
_In_ ULONG  EaLength,
_In_ CREATE_FILE_TYPE  CreateFileType,
_In_opt_ PVOID  InternalParameters,
_In_ ULONG  Options,
_In_opt_ PIO_DRIVER_CREATE_CONTEXT  DriverContext 
)

◆ IoCreateFileSpecifyDeviceObjectHint()

NTKERNELAPI NTSTATUS NTAPI IoCreateFileSpecifyDeviceObjectHint ( _Out_ PHANDLE  FileHandle,
_In_ ACCESS_MASK  DesiredAccess,
_In_ POBJECT_ATTRIBUTES  ObjectAttributes,
_Out_ PIO_STATUS_BLOCK  IoStatusBlock,
_In_opt_ PLARGE_INTEGER  AllocationSize,
_In_ ULONG  FileAttributes,
_In_ ULONG  ShareAccess,
_In_ ULONG  Disposition,
_In_ ULONG  CreateOptions,
_In_opt_ PVOID  EaBuffer,
_In_ ULONG  EaLength,
_In_ CREATE_FILE_TYPE  CreateFileType,
_In_opt_ PVOID  InternalParameters,
_In_ ULONG  Options,
_In_opt_ PVOID  DeviceObject 
)

◆ IoCreateStreamFileObject()

NTKERNELAPI PFILE_OBJECT NTAPI IoCreateStreamFileObject ( _In_opt_ PFILE_OBJECT  FileObject,
_In_opt_ PDEVICE_OBJECT  DeviceObject 
)

◆ IoCreateStreamFileObjectLite()

NTKERNELAPI PFILE_OBJECT NTAPI IoCreateStreamFileObjectLite ( _In_opt_ PFILE_OBJECT  FileObject,
_In_opt_ PDEVICE_OBJECT  DeviceObject 
)

◆ IoCsqInsertIrp()

NTKERNELAPI VOID NTAPI IoCsqInsertIrp ( _Inout_ PIO_CSQ  Csq,
_Inout_ PIRP  Irp,
_Out_opt_ PIO_CSQ_IRP_CONTEXT  Context 
)

Insert an IRP into the CSQ.

Parameters
Csq- Pointer to the initialized CSQ
Irp- Pointer to the IRP to queue
Context- Context record to track the IRP while queued
Returns
  • Just passes through to IoCsqInsertIrpEx, with no InsertContext

Definition at line 177 of file csq.c.

181{
183}
NTSTATUS NTAPI IoCsqInsertIrpEx(_Inout_ PIO_CSQ Csq, _Inout_ PIRP Irp, _Out_opt_ PIO_CSQ_IRP_CONTEXT Context, _In_opt_ PVOID InsertContext)
Insert an IRP into the CSQ, with additional tracking context.
Definition: csq.c:205
IO_CSQ Csq
Definition: csqrtns.c:46

◆ IoCsqInsertIrpEx()

NTKERNELAPI NTSTATUS NTAPI IoCsqInsertIrpEx ( _Inout_ PIO_CSQ  Csq,
_Inout_ PIRP  Irp,
_Out_opt_ PIO_CSQ_IRP_CONTEXT  Context,
_In_opt_ PVOID  InsertContext 
)

Insert an IRP into the CSQ, with additional tracking context.

Parameters
Csq- Pointer to the initialized CSQ
Irp- Pointer to the IRP to queue
Context- Context record to track the IRP while queued
InsertContext- additional data that is passed through to CsqInsertIrpEx
Note
  • Passes the additional context through to the driver-supplied callback, which can be used with more sophistocated queues
  • Marks the IRP pending in all cases
  • Guaranteed to not queue a canceled IRP
  • This is complicated logic, and is patterend after the Microsoft library. I'm sure I have gotten the details wrong on a fine point or two, but basically this works with the MS-supplied samples.

Definition at line 205 of file csq.c.

210{
211 NTSTATUS Retval = STATUS_SUCCESS;
212 KIRQL Irql;
213
215
216 do
217 {
218 /* mark all irps pending -- says so in the cancel sample */
220
221 /* set up the context if we have one */
222 if(Context)
223 {
225 Context->Irp = Irp;
226 Context->Csq = Csq;
227 Irp->Tail.Overlay.DriverContext[3] = Context;
228 }
229 else
230 Irp->Tail.Overlay.DriverContext[3] = Csq;
231
232 /*
233 * NOTE! This is very sensitive to order. If you set the cancel routine
234 * *before* you queue the IRP, our cancel routine will get called back for
235 * an IRP that isn't in its queue.
236 *
237 * There are three possibilities:
238 * 1) We get an IRP, we queue it, and it is valid the whole way
239 * 2) We get an IRP, and the IO manager cancels it before we're done here
240 * 3) We get an IRP, queue it, and the IO manager cancels it.
241 *
242 * #2 is is a booger.
243 *
244 * When the IO manger receives a request to cancel an IRP, it sets the cancel
245 * bit in the IRP's control byte to TRUE. Then, it looks to see if a cancel
246 * routine is set. If it isn't, the IO manager just returns to the caller.
247 * If there *is* a routine, it gets called.
248 *
249 * If we test for cancel first and then set the cancel routine, there is a spot
250 * between test and set that the IO manager can cancel us without our knowledge,
251 * so we miss a cancel request. That is bad.
252 *
253 * If we set a routine first and then test for cancel, we race with our completion
254 * routine: We set the routine, the IO Manager sets cancel, we test cancel and find
255 * it is TRUE. Meanwhile the IO manager has called our cancel routine already, so
256 * we can't complete the IRP because it'll rip it out from under the cancel routine.
257 *
258 * The IO manager does us a favor though: it nulls out the cancel routine in the IRP
259 * before calling it. Therefore, if we test to see if the cancel routine is NULL
260 * (after we have just set it), that means our own cancel routine is already working
261 * on the IRP, and we can just return quietly. Otherwise, we have to de-queue the
262 * IRP and cancel it ourselves.
263 *
264 * We have to go through all of this mess because this API guarantees that we will
265 * never return having left a canceled IRP in the queue.
266 */
267
268 /* Step 1: Queue the IRP */
269 if(Csq->Type == IO_TYPE_CSQ)
271 else
272 {
274 Retval = pCsqInsertIrpEx(Csq, Irp, InsertContext);
275 if(Retval != STATUS_SUCCESS)
276 break;
277 }
278
279 /* Step 2: Set our cancel routine */
280 (void)IoSetCancelRoutine(Irp, IopCsqCancelRoutine);
281
282 /* Step 3: Deal with an IRP that is already canceled */
283 if(!Irp->Cancel)
284 break;
285
286 /*
287 * Since we're canceled, see if our cancel routine is already running
288 * If this is NULL, the IO Manager has already called our cancel routine
289 */
291 break;
292
293
294 Irp->Tail.Overlay.DriverContext[3] = 0;
295
296 /* OK, looks like we have to de-queue and complete this ourselves */
299
300 if(Context)
301 Context->Irp = NULL;
302 }
303 while(0);
304
306
307 return Retval;
308}
_In_ PIRP _In_ PVOID InsertContext
Definition: csq.h:258
_Out_ PKIRQL Irql
Definition: csq.h:179
IO_CSQ_INSERT_IRP_EX * PIO_CSQ_INSERT_IRP_EX
Definition: csq.h:259
#define IO_TYPE_CSQ
Definition: csq.h:79
#define IO_TYPE_CSQ_IRP_CONTEXT
Definition: csq.h:78
UCHAR KIRQL
Definition: env_spec_w32.h:591
IoMarkIrpPending(Irp)
IoSetCancelRoutine(Irp, CancelRoutine)
PIO_CSQ_RELEASE_LOCK CsqReleaseLock
Definition: csq.h:228
PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock
Definition: csq.h:227
PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp
Definition: csq.h:229
PIO_CSQ_REMOVE_IRP CsqRemoveIrp
Definition: csq.h:225
ULONG Type
Definition: csq.h:223
PIO_CSQ_INSERT_IRP CsqInsertIrp
Definition: csq.h:224

Referenced by IoCsqInsertIrp().

◆ IoCsqRemoveIrp()

NTKERNELAPI PIRP NTAPI IoCsqRemoveIrp ( _Inout_ PIO_CSQ  Csq,
_Inout_ PIO_CSQ_IRP_CONTEXT  Context 
)

Remove anb IRP from the queue.

Parameters
Csq- Queue to remove the IRP from
Context- Context record containing the IRP to be dequeued
Returns
  • Pointer to an IRP if we found it
Note
  • Don't forget that we can be canceled any time up to the point where we unset our cancel routine

Definition at line 326 of file csq.c.

329{
330 KIRQL Irql;
331 PIRP Irp = NULL;
332
334
335 do
336 {
337 /* It's possible that this IRP could have been canceled */
338 Irp = Context->Irp;
339
340 if(!Irp)
341 break;
342
343 ASSERT(Context->Csq == Csq);
344
345 /* Unset the cancel routine and see if it has already been canceled */
347 {
348 /*
349 * already gone, return NULL --> NOTE that we cannot touch this IRP *or* the context,
350 * since the context is being simultaneously twiddled by the cancel routine
351 */
352 Irp = NULL;
353 break;
354 }
355
356 ASSERT(Context == Irp->Tail.Overlay.DriverContext[3]);
357
358 /* This IRP is valid and is ours. Dequeue it, fix it up, and return */
360
361 Context = (PIO_CSQ_IRP_CONTEXT)InterlockedExchangePointer(&Irp->Tail.Overlay.DriverContext[3], NULL);
362
364 {
365 Context->Irp = NULL;
366
367 ASSERT(Context->Csq == Csq);
368 }
369
370 Irp->Tail.Overlay.DriverContext[3] = 0;
371 }
372 while(0);
373
375
376 return Irp;
377}
struct _IO_CSQ_IRP_CONTEXT * PIO_CSQ_IRP_CONTEXT
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45
#define ASSERT(a)
Definition: mode.c:44

◆ IoCsqRemoveNextIrp()

NTKERNELAPI PIRP NTAPI IoCsqRemoveNextIrp ( _Inout_ PIO_CSQ  Csq,
_In_opt_ PVOID  PeekContext 
)

IoCsqRemoveNextIrp - Removes the next IRP from the queue.

Parameters
Csq- Queue to remove the IRP from
PeekContext- Identifier of the IRP to be removed
Returns
Pointer to the IRP that was removed, or NULL if one could not be found
Note
  • This function is sensitive to yet another race condition. The basic idea is that we have to return the first IRP that we get that matches the PeekContext >that is not already canceled<. Therefore, we have to do a trick similar to the one done in Insert above.

Definition at line 398 of file csq.c.

401{
402 KIRQL Irql;
403 PIRP Irp = NULL;
405
407
408 while((Irp = Csq->CsqPeekNextIrp(Csq, Irp, PeekContext)))
409 {
410 /*
411 * If the cancel routine is gone, we're already canceled,
412 * and are spinning on the queue lock in our own cancel
413 * routine. Move on to the next candidate. It'll get
414 * removed by the cance routine.
415 */
417 continue;
418
420
421 /* Unset the context stuff and return */
422 Context = (PIO_CSQ_IRP_CONTEXT)InterlockedExchangePointer(&Irp->Tail.Overlay.DriverContext[3], NULL);
423
425 {
426 Context->Irp = NULL;
427
428 ASSERT(Context->Csq == Csq);
429 }
430
431 Irp->Tail.Overlay.DriverContext[3] = 0;
432
433 break;
434 }
435
437
438 return Irp;
439}
_In_opt_ PIRP _In_opt_ PVOID PeekContext
Definition: csq.h:160
PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp
Definition: csq.h:226

◆ IoDisconnectInterruptEx()

NTKERNELAPI VOID NTAPI IoDisconnectInterruptEx ( _In_ PIO_DISCONNECT_INTERRUPT_PARAMETERS  Parameters)

Definition at line 223 of file irq.c.

225{
226 PAGED_CODE();
227
228 //FIXME: This eventually will need to handle more cases
229 if (Parameters->ConnectionContext.InterruptObject)
230 IoDisconnectInterrupt(Parameters->ConnectionContext.InterruptObject);
231}
VOID NTAPI IoDisconnectInterrupt(PKINTERRUPT InterruptObject)
Definition: irq.c:142

◆ IoEnumerateDeviceObjectList()

NTKERNELAPI NTSTATUS NTAPI IoEnumerateDeviceObjectList ( _In_ PDRIVER_OBJECT  DriverObject,
_Out_writes_bytes_to_opt_(DeviceObjectListSize,(*ActualNumberDeviceObjects) *sizeof(PDEVICE_OBJECT)) PDEVICE_OBJECT DeviceObjectList,
_In_ ULONG  DeviceObjectListSize,
_Out_ PULONG  ActualNumberDeviceObjects 
)

◆ IoFastQueryNetworkAttributes()

NTKERNELAPI BOOLEAN NTAPI IoFastQueryNetworkAttributes ( _In_ POBJECT_ATTRIBUTES  ObjectAttributes,
_In_ ACCESS_MASK  DesiredAccess,
_In_ ULONG  OpenOptions,
_Out_ PIO_STATUS_BLOCK  IoStatus,
_Out_ PFILE_NETWORK_OPEN_INFORMATION  Buffer 
)

◆ IoForwardIrpSynchronously()

NTKERNELAPI BOOLEAN NTAPI IoForwardIrpSynchronously ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ PIRP  Irp 
)

◆ IoFreeErrorLogEntry()

NTKERNELAPI VOID NTAPI IoFreeErrorLogEntry ( _In_ PVOID  ElEntry)

◆ IoFreeSfioStreamIdentifier()

NTSTATUS NTAPI IoFreeSfioStreamIdentifier ( _In_ PFILE_OBJECT  FileObject,
_In_ PVOID  Signature 
)

◆ IoGetAttachedDevice()

NTKERNELAPI PDEVICE_OBJECT NTAPI IoGetAttachedDevice ( IN PDEVICE_OBJECT  DeviceObject)

◆ IoGetBaseFileSystemDeviceObject()

NTKERNELAPI PDEVICE_OBJECT NTAPI IoGetBaseFileSystemDeviceObject ( _In_ PFILE_OBJECT  FileObject)

◆ IoGetBootDiskInformation()

NTKERNELAPI NTSTATUS NTAPI IoGetBootDiskInformation ( _Inout_ PBOOTDISK_INFORMATION  BootDiskInformation,
_In_ ULONG  Size 
)

◆ IoGetContainerInformation()

NTSTATUS NTAPI IoGetContainerInformation ( _In_ IO_CONTAINER_INFORMATION_CLASS  InformationClass,
_In_opt_ PVOID  ContainerObject,
_Inout_updates_bytes_opt_(BufferLength) PVOID  Buffer,
_In_ ULONG  BufferLength 
)

◆ IoGetCurrentIrpStackLocation()

__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation ( _In_ PIRP  Irp)

Definition at line 2793 of file iofuncs.h.

2795{
2796 ASSERT(Irp->CurrentLocation <= Irp->StackCount + 1);
2797#ifdef NONAMELESSUNION
2798 return Irp->Tail.Overlay.s.u.CurrentStackLocation;
2799#else
2800 return Irp->Tail.Overlay.CurrentStackLocation;
2801#endif
2802}

Referenced by IoCopyCurrentIrpStackLocationToNext(), and IoMarkIrpPending().

◆ IoGetCurrentProcess()

NTKERNELAPI PEPROCESS NTAPI IoGetCurrentProcess ( VOID  )

Definition at line 139 of file util.c.

140{
141 /* Return the current thread's process */
142 return (PEPROCESS)PsGetCurrentThread()->Tcb.ApcState.Process;
143}
#define PsGetCurrentThread()
Definition: env_spec_w32.h:81

Referenced by DbgP(), InitializeDeviceData(), nfs41_CreateSrvCall(), print_error(), print_hexbuf(), RxDriverEntry(), RxFinalizeSrvCall(), and RxInitializeDispatcher().

◆ IoGetDeviceAttachmentBaseRef()

NTKERNELAPI PDEVICE_OBJECT NTAPI IoGetDeviceAttachmentBaseRef ( _In_ PDEVICE_OBJECT  DeviceObject)

◆ IoGetDiskDeviceObject()

NTKERNELAPI NTSTATUS NTAPI IoGetDiskDeviceObject ( _In_ PDEVICE_OBJECT  FileSystemDeviceObject,
_Out_ PDEVICE_OBJECT DiskDeviceObject 
)

◆ IoGetIoPriorityHint()

◆ IoGetIrpExtraCreateParameter()

NTKRNLVISTAAPI NTSTATUS NTAPI IoGetIrpExtraCreateParameter ( _In_ PIRP  Irp,
_Outptr_result_maybenull_ struct _ECP_LIST **  ExtraCreateParameter 
)

Referenced by FsRtlGetEcpListFromIrp().

◆ IoGetLowerDeviceObject()

NTKERNELAPI PDEVICE_OBJECT NTAPI IoGetLowerDeviceObject ( _In_ PDEVICE_OBJECT  DeviceObject)

◆ IoGetNextIrpStackLocation()

__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation ( _In_ PIRP  Irp)

Definition at line 2695 of file iofuncs.h.

2697{
2698 ASSERT(Irp->CurrentLocation > 0);
2699#ifdef NONAMELESSUNION
2700 return ((Irp)->Tail.Overlay.s.u.CurrentStackLocation - 1 );
2701#else
2702 return ((Irp)->Tail.Overlay.CurrentStackLocation - 1 );
2703#endif
2704}

Referenced by __attribute__(), FxQueryInterface::_FormatIrp(), FxIrp::_GetAndClearNextStackLocation(), _IRQL_requires_(), _IRQL_requires_max_(), _Success_(), BuildAndSubmitIrp(), Bus_GetDeviceCapabilities(), CallUSBD(), CaptureInitializeUrbAndIrp(), CdCommonDevControl(), CdHijackIrpAndFlushDevice(), CdMultipleXAAsync(), CdPerformDevIoCtrlEx(), CdReadSectors(), ClassDeviceControl(), ClassInternalIoControl(), ClassIoCompleteAssociated(), ClasspBuildRequestEx(), ClasspMediaChangeDetectionCompletion(), ClasspPowerDownCompletion(), ClasspPowerHandler(), ClasspPowerUpCompletion(), ClasspPrepareMcnIrp(), ClasspReleaseQueue(), ClassSendDeviceIoControlSynchronous(), ClassSendSrbSynchronous(), ClassSendStartUnit(), clean_space_cache(), CmBattGetAcpiInterfaces(), CompBattAddNewBattery(), dev_ioctl(), DeviceSendIoctlAsynchronously(), DiskFlushDispatch(), DiskInfoExceptionCheck(), DiskInfoExceptionComplete(), DiskPerformSmartCommand(), DiskShutdownFlush(), Ext2DeviceControlNormal(), Ext2Flush(), Ext2IsMediaWriteProtected(), Ext2ReadSync(), Ext2ReadWriteBlocks(), FatHijackIrpAndFlushDevice(), FatIsMediaWriteProtected(), FatMultipleAsync(), FatPagingFileIo(), FatPerformDevIoCtrl(), FatPerformVerifyDiskRead(), FatSingleAsync(), FatSingleNonAlignedSync(), FDO_QueryCapabilities(), FdoSendInquiry(), flush_disk_caches(), FreeBT_DispatchRead(), FreeBT_DispatchWrite(), FreeBT_GetHCIEvent(), FreeBT_GetPortStatus(), FreeBT_HCIEventCompletion(), FreeBT_ResetParentPort(), FreeBT_SendHCICommand(), FreeBT_WriteCompletion(), FsRecGetDeviceSectors(), FsRecGetDeviceSectorSize(), FsRecReadBlock(), FstubReadSector(), FstubWriteSector(), GetDeviceId(), Hid_DispatchUrb(), HidClass_BuildIrp(), HidClassFDO_GetDescriptors(), HidClassFDO_QueryCapabilities(), HidUsb_GetPortStatus(), HidUsb_ReadReport(), InitCapturePin(), InitStreamPin(), IoBuildAsynchronousFsdRequest(), IoBuildDeviceIoControlRequest(), IoCancelFileOpen(), IoCopyCurrentIrpStackLocationToNext(), IofCallDriver(), IoPageRead(), IopCloseFile(), IopDeleteFile(), IopDeviceFsIoControl(), IopGetFileInformation(), IopGetSetSecurityObject(), IopInitiatePnpIrp(), IopLoadFileSystemDriver(), IopMountVolume(), IopOpenLinkOrRenameTarget(), IopParseDevice(), IopQueryDeviceInformation(), IopSynchronousCall(), IoSetInformation(), IoSynchronousPageWrite(), IoVerifyVolume(), IssueUniqueIdChangeNotifyWorker(), KbdHid_Flush(), KbdHid_InitiateRead(), KspDeviceSetGetBusData(), KsQueryInformationFile(), KsReadFile(), KsSetInformationFile(), KsStreamIo(), KsSynchronousIoControlDevice(), KsWriteFile(), MiSimpleRead(), MouHid_Flush(), MouHid_InitiateRead(), MountMgrNotifyNameChange(), MupBuildIoControlRequest(), NpTransceive(), NtFlushBuffersFile(), NtfsDeviceIoControl(), NtfsReadDisk(), NtLockFile(), NtNotifyChangeDirectoryFile(), NtQueryDirectoryFile(), NtQueryInformationFile(), NtQueryVolumeInformationFile(), NtReadFile(), NtSetInformationFile(), NtSetVolumeInformationFile(), NtUnlockFile(), NtWriteFile(), PciGetDeviceCapabilities(), PciIdeXPdoRepeatRequest(), PciIdeXQueryInterface(), PciQueryForPciBusInterface(), pdo_device_usage_notification(), Pin_fnWrite(), PopPassivePowerCall(), PopSendQuerySystemPowerState(), PopSendSetSystemPowerState(), PoRequestPowerIrp(), PortSendInquiry(), QueryBusInterface(), RawReadWriteDeviceControl(), read_data(), RenderInitializeUrbAndIrp(), RequestProcessInternalDeviceControl(), RequestSetupMcnSyncIrp(), ResetBus(), RetryPowerRequest(), RetryRequest(), ScratchBuffer_SetupReadWriteSrb(), scrub_chunk_raid56_stripe_run(), scrub_extent(), ScsiFlopProcessError(), SpiSendRequestSense(), SpiSenseCompletionRoutine(), SubmitIdleRequestIrp(), SubmitTransferPacket(), SubmitUrbSync(), sync_read_phys(), TdiQueryDeviceControl(), UDFCommonFlush(), UDFPhReadSynchronous(), UDFPhSendIOCTL(), UDFPhWriteSynchronous(), USBCCGP_QueryInterface(), USBCCGP_SyncUrbRequest(), USBH_ChangeIndicationAckChange(), USBH_ChangeIndicationQueryChange(), USBH_FdoSubmitIdleRequestIrp(), USBH_GetPortStatus(), USBH_QueryCapabilities(), USBH_SubmitStatusChangeTransfer(), USBH_SyncGetDeviceHandle(), USBH_SyncGetHubCount(), USBH_SyncGetRootHubPdo(), USBH_SyncSubmitUrb(), USBHUB_GetBusInterface(), USBHUB_GetBusInterfaceUSBDI(), USBPORT_IsCompanionController(), USBPORT_QueryCapabilities(), USBPORT_QueryPciBusInterface(), USBSTOR_AllocateIrp(), USBSTOR_CBWCompletionRoutine(), USBSTOR_GetBusInterface(), USBSTOR_IssueBulkOrInterruptRequest(), USBSTOR_SendCBW(), USBSTOR_SendCSW(), USBSTOR_SendInternalCdb(), USBSTOR_SyncUrbRequest(), VfatBlockDeviceIoControl(), VfatReadDisk(), VfatReadDiskPartial(), VfatWriteDisk(), VfatWriteDiskPartial(), ViReadFile(), vol_ioctl_passthrough(), vol_read(), vol_write(), WdmAudReadWrite(), write_data_phys(), write_superblock(), xHalExamineMBR(), xHalIoReadPartitionTable(), xHalIoSetPartitionInformation(), and xHalIoWritePartitionTable().

◆ IoGetRelatedDeviceObject()

NTKERNELAPI PDEVICE_OBJECT NTAPI IoGetRelatedDeviceObject ( _In_ PFILE_OBJECT  FileObject)

◆ IoGetRequestorProcess()

NTKERNELAPI PEPROCESS NTAPI IoGetRequestorProcess ( _In_ PIRP  Irp)

◆ IoGetRequestorProcessId()

NTKERNELAPI ULONG NTAPI IoGetRequestorProcessId ( _In_ PIRP  Irp)

◆ IoGetRequestorSessionId()

NTKERNELAPI NTSTATUS NTAPI IoGetRequestorSessionId ( _In_ PIRP  Irp,
_Out_ PULONG  pSessionId 
)

◆ IoGetSfioStreamIdentifier()

PVOID NTAPI IoGetSfioStreamIdentifier ( _In_ PFILE_OBJECT  FileObject,
_In_ PVOID  Signature 
)

◆ IoGetTopLevelIrp()

◆ IoGetTransactionParameterBlock()

PTXN_PARAMETER_BLOCK NTAPI IoGetTransactionParameterBlock ( _In_ PFILE_OBJECT  FileObject)

◆ IoInitializeDpcRequest()

FORCEINLINE VOID IoInitializeDpcRequest ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ PIO_DPC_ROUTINE  DpcRoutine 
)

Definition at line 2840 of file iofuncs.h.

2843{
2844#ifdef _MSC_VER
2845#pragma warning(push)
2846#pragma warning(disable:28024)
2847#endif
2850 DeviceObject);
2851#ifdef _MSC_VER
2852#pragma warning(pop)
2853#endif
2854}
VOID NTAPI KeInitializeDpc(IN PKDPC Dpc, IN PKDEFERRED_ROUTINE DeferredRoutine, IN PVOID DeferredContext)
Definition: dpc.c:712
VOID NTAPI DpcRoutine(IN PKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
Definition: fbtpnp.c:1298
KDEFERRED_ROUTINE * PKDEFERRED_ROUTINE
Definition: ketypes.h:690

Referenced by AddControllers(), DriverEntry(), HDA_AddDevice(), InPortAddDevice(), and ScsiPortInitialize().

◆ IoInitializeThreadedDpcRequest()

FORCEINLINE VOID IoInitializeThreadedDpcRequest ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ PIO_DPC_ROUTINE  DpcRoutine 
)

Definition at line 2903 of file iofuncs.h.

2906{
2907#ifdef _MSC_VER
2908#pragma warning(push)
2909#pragma warning(disable:28024)
2910#pragma warning(disable:28128)
2911#endif
2914 DeviceObject );
2915#ifdef _MSC_VER
2916#pragma warning(pop)
2917#endif
2918}
VOID NTAPI KeInitializeThreadedDpc(IN PKDPC Dpc, IN PKDEFERRED_ROUTINE DeferredRoutine, IN PVOID DeferredContext)
Definition: dpc.c:699

◆ IoInitializeWorkItem()

VOID NTAPI IoInitializeWorkItem ( _In_ PVOID  IoObject,
_Out_ PIO_WORKITEM  IoWorkItem 
)

◆ IoIsFileObjectIgnoringSharing()

BOOLEAN NTAPI IoIsFileObjectIgnoringSharing ( _In_ PFILE_OBJECT  FileObject)

◆ IoIsOperationSynchronous()

NTKERNELAPI BOOLEAN NTAPI IoIsOperationSynchronous ( _In_ PIRP  Irp)

◆ IoIsSystemThread()

NTKERNELAPI BOOLEAN NTAPI IoIsSystemThread ( _In_ PETHREAD  Thread)

◆ IoIsValidNameGraftingBuffer()

NTKERNELAPI BOOLEAN NTAPI IoIsValidNameGraftingBuffer ( _In_ PIRP  Irp,
_In_ PREPARSE_DATA_BUFFER  ReparseBuffer 
)

◆ IoMapTransfer()

NTHALAPI PHYSICAL_ADDRESS NTAPI IoMapTransfer ( _In_ PADAPTER_OBJECT  AdapterObject,
_In_ PMDL  Mdl,
_In_ PVOID  MapRegisterBase,
_In_ PVOID  CurrentVa,
_Inout_ PULONG  Length,
_In_ BOOLEAN  WriteToDevice 
)

◆ IoMarkIrpPending()

FORCEINLINE VOID IoMarkIrpPending ( _Inout_ PIRP  Irp)

Definition at line 2806 of file iofuncs.h.

2808{
2810}
#define SL_PENDING_RETURNED
Definition: iotypes.h:3325

◆ IoPageRead()

NTKERNELAPI NTSTATUS NTAPI IoPageRead ( _In_ PFILE_OBJECT  FileObject,
_In_ PMDL  Mdl,
_In_ PLARGE_INTEGER  Offset,
_In_ PKEVENT  Event,
_Out_ PIO_STATUS_BLOCK  IoStatusBlock 
)

◆ IoQueryDeviceDescription()

NTKERNELAPI NTSTATUS NTAPI IoQueryDeviceDescription ( _In_opt_ PINTERFACE_TYPE  BusType,
_In_opt_ PULONG  BusNumber,
_In_opt_ PCONFIGURATION_TYPE  ControllerType,
_In_opt_ PULONG  ControllerNumber,
_In_opt_ PCONFIGURATION_TYPE  PeripheralType,
_In_opt_ PULONG  PeripheralNumber,
_In_ PIO_QUERY_DEVICE_ROUTINE  CalloutRoutine,
_In_opt_ PVOID  Context 
)

Reads and returns Hardware information from the appropriate hardware registry key.

Parameters
[in]BusTypeSpecifies the bus type, for example: MCA, ISA, EISA, etc.
[in]BusNumberThe number of the specified bus type to query.
[in]ControllerTypeSpecifies the controller type
[in]ControllerNumberThe number of the specified controller type to query.
[in]CalloutRoutineA user-provided callback function to call for each valid query.
[in]ContextA callback-specific context value.
Returns
A status code.

Definition at line 1213 of file iorsrce.c.

1222{
1224 ULONG BusLoopNumber = -1; /* Root Bus */
1226 UNICODE_STRING RootRegKey;
1227 HANDLE RootRegHandle;
1229
1230 IORSRCTRACE("\nIoQueryDeviceDescription()\n"
1231 " BusType: 0x%p (%lu)\n"
1232 " BusNumber: 0x%p (%lu)\n"
1233 " ControllerType: 0x%p (%lu)\n"
1234 " ControllerNumber: 0x%p (%lu)\n"
1235 " PeripheralType: 0x%p (%lu)\n"
1236 " PeripheralNumber: 0x%p (%lu)\n"
1237 " CalloutRoutine: 0x%p\n"
1238 " Context: 0x%p\n"
1239 "--> Query: 0x%p\n",
1240 BusType, BusType ? *BusType : -1,
1241 BusNumber, BusNumber ? *BusNumber : -1,
1242 ControllerType, ControllerType ? *ControllerType : -1,
1243 ControllerNumber, ControllerNumber ? *ControllerNumber : -1,
1244 PeripheralType, PeripheralType ? *PeripheralType : -1,
1245 PeripheralNumber, PeripheralNumber ? *PeripheralNumber : -1,
1246 CalloutRoutine, Context,
1247 &Query);
1248
1249 if (!BusType)
1251
1252 /* Set up the string */
1253 RootRegKey.Length = 0;
1254 RootRegKey.MaximumLength = 2048;
1256 if (!RootRegKey.Buffer)
1258
1259 RtlAppendUnicodeToString(&RootRegKey, L"\\REGISTRY\\MACHINE\\HARDWARE\\DESCRIPTION\\SYSTEM");
1260
1261 /* Open a handle to the Root Registry Key */
1263 &RootRegKey,
1265 NULL,
1266 NULL);
1267
1268 Status = ZwOpenKey(&RootRegHandle, KEY_READ, &ObjectAttributes);
1269
1270 if (NT_SUCCESS(Status))
1271 {
1272 /* Use a helper function to loop though this key and get the information */
1273 Query.BusType = BusType;
1274 Query.BusNumber = BusNumber;
1275 Query.ControllerType = ControllerType;
1276 Query.ControllerNumber = ControllerNumber;
1277 Query.PeripheralType = PeripheralType;
1278 Query.PeripheralNumber = PeripheralNumber;
1279 Query.CalloutRoutine = CalloutRoutine;
1280 Query.Context = Context;
1282 RootRegKey,
1283 RootRegHandle,
1284 &BusLoopNumber,
1285 TRUE);
1286
1287 /* Close registry key */
1288 ZwClose(RootRegHandle);
1289 }
1290
1291 /* Cleanup */
1293
1294 return Status;
1295}
BOOL Query(LPCTSTR *ServiceArgs, DWORD ArgCount, BOOL bExtended)
Definition: query.c:292
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
Definition: string_lib.cpp:62
#define PagedPool
Definition: env_spec_w32.h:308
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
static NTSTATUS IopQueryBusDescription(_In_ PIO_QUERY Query, _In_ UNICODE_STRING RootKey, _In_ HANDLE RootKeyHandle, _Inout_ PULONG Bus, _In_ BOOLEAN KeyIsRoot)
Reads and returns Hardware information from the appropriate hardware registry key....
Definition: iorsrce.c:566
#define IORSRCTRACE(...)
Definition: iorsrce.c:24
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define KEY_READ
Definition: nt_native.h:1023
#define L(x)
Definition: ntvdm.h:50
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define TAG_IO_RESOURCE
Definition: tag.h:93
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:160
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE BusType
Definition: halfuncs.h:159

Referenced by AddControllers(), FdcFdoQueryBusRelations(), IntVideoPortEnumBuses(), and SpiCreatePortConfig().

◆ IoQueryFileDosDeviceName()

NTKERNELAPI NTSTATUS NTAPI IoQueryFileDosDeviceName ( _In_ PFILE_OBJECT  FileObject,
_Out_ POBJECT_NAME_INFORMATION ObjectNameInformation 
)

◆ IoQueryFileInformation()

NTKERNELAPI NTSTATUS NTAPI IoQueryFileInformation ( _In_ PFILE_OBJECT  FileObject,
_In_ FILE_INFORMATION_CLASS  FileInformationClass,
_In_ ULONG  Length,
_Out_ PVOID  FileInformation,
_Out_ PULONG  ReturnedLength 
)

◆ IoQueryVolumeInformation()

NTKERNELAPI NTSTATUS NTAPI IoQueryVolumeInformation ( _In_ PFILE_OBJECT  FileObject,
_In_ FS_INFORMATION_CLASS  FsInformationClass,
_In_ ULONG  Length,
_Out_ PVOID  FsInformation,
_Out_ PULONG  ReturnedLength 
)

◆ IoQueueThreadIrp()

NTKERNELAPI VOID NTAPI IoQueueThreadIrp ( _In_ PIRP  Irp)

◆ IoReadDiskSignature()

NTKERNELAPI NTSTATUS NTAPI IoReadDiskSignature ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ ULONG  BytesPerSector,
_Out_ PDISK_SIGNATURE  Signature 
)

◆ IoRegisterContainerNotification()

NTSTATUS NTAPI IoRegisterContainerNotification ( _In_ IO_CONTAINER_NOTIFICATION_CLASS  NotificationClass,
_In_ PIO_CONTAINER_NOTIFICATION_FUNCTION  CallbackFunction,
_In_reads_bytes_opt_(NotificationInformationLength) PVOID  NotificationInformation,
_In_ ULONG  NotificationInformationLength,
_Out_ PVOID  CallbackRegistration 
)

◆ IoRegisterFileSystem()

NTKERNELAPI VOID NTAPI IoRegisterFileSystem ( _In_ __drv_aliasesMem PDEVICE_OBJECT  DeviceObject)

◆ IoRegisterFsRegistrationChange()

NTKERNELAPI NTSTATUS NTAPI IoRegisterFsRegistrationChange ( _In_ PDRIVER_OBJECT  DriverObject,
_In_ PDRIVER_FS_NOTIFICATION  DriverNotificationRoutine 
)

◆ IoReleaseRemoveLockEx()

NTKERNELAPI VOID NTAPI IoReleaseRemoveLockEx ( _Inout_ PIO_REMOVE_LOCK  RemoveLock,
_In_opt_ PVOID  Tag,
_In_ ULONG  RemlockSize 
)

◆ IoReleaseVpbSpinLock()

NTKERNELAPI VOID NTAPI IoReleaseVpbSpinLock ( _In_ KIRQL  Irql)

◆ IoReplaceFileObjectName()

NTKERNELAPI NTSTATUS NTAPI IoReplaceFileObjectName ( _In_ PFILE_OBJECT  FileObject,
_In_reads_bytes_(FileNameLength) PWSTR  NewFileName,
_In_ USHORT  FileNameLength 
)

◆ IoReportResourceForDetection()

NTKERNELAPI NTSTATUS NTAPI IoReportResourceForDetection ( _In_ PDRIVER_OBJECT  DriverObject,
_In_reads_bytes_opt_(DriverListSize) PCM_RESOURCE_LIST  DriverList,
_In_opt_ ULONG  DriverListSize,
_In_opt_ PDEVICE_OBJECT  DeviceObject,
_In_reads_bytes_opt_(DeviceListSize) PCM_RESOURCE_LIST  DeviceList,
_In_opt_ ULONG  DeviceListSize,
_Out_ PBOOLEAN  ConflictDetected 
)

◆ IoReportResourceUsage()

NTKERNELAPI NTSTATUS NTAPI IoReportResourceUsage ( _In_opt_ PUNICODE_STRING  DriverClassName,
_In_ PDRIVER_OBJECT  DriverObject,
_In_reads_bytes_opt_(DriverListSize) PCM_RESOURCE_LIST  DriverList,
_In_opt_ ULONG  DriverListSize,
_In_opt_ PDEVICE_OBJECT  DeviceObject,
_In_reads_bytes_opt_(DeviceListSize) PCM_RESOURCE_LIST  DeviceList,
_In_opt_ ULONG  DeviceListSize,
_In_ BOOLEAN  OverrideConflict,
_Out_ PBOOLEAN  ConflictDetected 
)

Reports hardware resources in the \Registry\Machine\Hardware\ResourceMap tree, so that a subsequently loaded driver cannot attempt to use the same resources.

@halfplemented

Parameters
[in]DriverClassNameThe driver class under which the resource information should be stored.
[in]DriverObjectThe driver object that was provided to the DriverEntry routine.
[in]DriverListResources claimed for the all the driver's devices, rather than per-device.
[in]DriverListSizeSize in bytes of the DriverList.
[in]DeviceObjectThe device object for which resources should be claimed.
[in]DeviceListList of resources that should be claimed for the device.
[in]DeviceListSizeSize of the per-device resource list in bytes.
[in]OverrideConflictTRUE if the resources should be claimed even if a conflict is found.
[out]ConflictDetectedPoints to a variable that receives TRUE if a conflict is detected with another driver.

Definition at line 1041 of file iorsrce.c.

1051{
1054
1055 DPRINT1("IoReportResourceUsage is halfplemented!\n");
1056
1057 if (!DriverList && !DeviceList)
1059
1060 if (DeviceList)
1062 else
1063 ResourceList = DriverList;
1064
1067 {
1068 *ConflictDetected = TRUE;
1069
1070 if (!OverrideConflict)
1071 {
1072 DPRINT1("Denying an attempt to claim resources currently in use by another device!\n");
1074 }
1075 else
1076 {
1077 DPRINT1("Proceeding with conflicting resources\n");
1078 }
1079 }
1080 else if (!NT_SUCCESS(Status))
1081 {
1082 return Status;
1083 }
1084
1085 /* TODO: Claim resources in registry */
1086
1087 *ConflictDetected = FALSE;
1088
1089 return STATUS_SUCCESS;
1090}
PDEVICE_LIST DeviceList
Definition: utils.c:27
NTSTATUS NTAPI IopDetectResourceConflict(IN PCM_RESOURCE_LIST ResourceList, IN BOOLEAN Silent, OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor)
Definition: pnpres.c:1255
#define STATUS_CONFLICTING_ADDRESSES
Definition: ntstatus.h:261
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:309

◆ IoRequestDpc()

FORCEINLINE VOID IoRequestDpc ( _Inout_ PDEVICE_OBJECT  DeviceObject,
_In_opt_ PIRP  Irp,
_In_opt_ __drv_aliasesMem PVOID  Context 
)

Definition at line 2750 of file iofuncs.h.

2754{
2756}
BOOLEAN NTAPI KeInsertQueueDpc(IN PKDPC Dpc, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
Definition: dpc.c:725

Referenced by HDA_InterruptService(), InPortIsr(), ScsiPortIsr(), ScsiPortStartIo(), ScsiPortStartPacket(), SpiProcessTimeout(), and SpiResetBus().

◆ IoSetDeviceToVerify()

NTKERNELAPI VOID NTAPI IoSetDeviceToVerify ( _In_ PETHREAD  Thread,
_In_opt_ PDEVICE_OBJECT  DeviceObject 
)

◆ IoSetFileOrigin()

NTKERNELAPI NTSTATUS NTAPI IoSetFileOrigin ( _In_ PFILE_OBJECT  FileObject,
_In_ BOOLEAN  Remote 
)

◆ IoSetInformation()

NTKERNELAPI NTSTATUS NTAPI IoSetInformation ( _In_ PFILE_OBJECT  FileObject,
_In_ FILE_INFORMATION_CLASS  FileInformationClass,
_In_ ULONG  Length,
_In_ PVOID  FileInformation 
)

◆ IoSetIoPriorityHint()

NTSTATUS NTAPI IoSetIoPriorityHint ( _In_ PIRP  Irp,
_In_ IO_PRIORITY_HINT  PriorityHint 
)

◆ IoSetIrpExtraCreateParameter()

NTSTATUS NTAPI IoSetIrpExtraCreateParameter ( _Inout_ PIRP  Irp,
_In_ struct _ECP_LIST ExtraCreateParameter 
)

◆ IoSetNextIrpStackLocation()

FORCEINLINE VOID IoSetNextIrpStackLocation ( _Inout_ PIRP  Irp)

◆ IoSetShareAccess()

NTKERNELAPI VOID NTAPI IoSetShareAccess ( _In_ ACCESS_MASK  DesiredAccess,
_In_ ULONG  DesiredShareAccess,
_Inout_ PFILE_OBJECT  FileObject,
_Out_ PSHARE_ACCESS  ShareAccess 
)

◆ IoSetShareAccessEx()

NTKERNELAPI VOID NTAPI IoSetShareAccessEx ( _In_ ACCESS_MASK  DesiredAccess,
_In_ ULONG  DesiredShareAccess,
_Inout_ PFILE_OBJECT  FileObject,
_Out_ PSHARE_ACCESS  ShareAccess,
_In_ PBOOLEAN  WritePermission 
)

◆ IoSetStartIoAttributes()

VOID NTAPI IoSetStartIoAttributes ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ BOOLEAN  DeferredStartIo,
_In_ BOOLEAN  NonCancelable 
)

◆ IoSetSystemPartition()

NTKERNELAPI NTSTATUS NTAPI IoSetSystemPartition ( _In_ PUNICODE_STRING  VolumeNameString)

◆ IoSetTopLevelIrp()

NTKERNELAPI VOID NTAPI IoSetTopLevelIrp ( _In_opt_ PIRP  Irp)

◆ IoSizeofWorkItem()

ULONG NTAPI IoSizeofWorkItem ( VOID  )

◆ IoSynchronousPageWrite()

NTKERNELAPI NTSTATUS NTAPI IoSynchronousPageWrite ( _In_ PFILE_OBJECT  FileObject,
_In_ PMDL  Mdl,
_In_ PLARGE_INTEGER  FileOffset,
_In_ PKEVENT  Event,
_Out_ PIO_STATUS_BLOCK  IoStatusBlock 
)

◆ IoThreadToProcess()

NTKERNELAPI PEPROCESS NTAPI IoThreadToProcess ( _In_ PETHREAD  Thread)

◆ IoUninitializeWorkItem()

VOID NTAPI IoUninitializeWorkItem ( _Inout_ PIO_WORKITEM  IoWorkItem)

◆ IoUnregisterContainerNotification()

VOID NTAPI IoUnregisterContainerNotification ( _In_ PVOID  CallbackRegistration)

◆ IoUnregisterFileSystem()

NTKERNELAPI VOID NTAPI IoUnregisterFileSystem ( _In_ PDEVICE_OBJECT  DeviceObject)

◆ IoUnregisterFsRegistrationChange()

NTKERNELAPI VOID NTAPI IoUnregisterFsRegistrationChange ( _In_ PDRIVER_OBJECT  DriverObject,
_In_ PDRIVER_FS_NOTIFICATION  DriverNotificationRoutine 
)

◆ IoVerifyPartitionTable()

NTKERNELAPI NTSTATUS NTAPI IoVerifyPartitionTable ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ BOOLEAN  FixErrors 
)

◆ IoVerifyVolume()

NTKERNELAPI NTSTATUS NTAPI IoVerifyVolume ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ BOOLEAN  AllowRawMount 
)

◆ IoVolumeDeviceToDosName()

NTKERNELAPI NTSTATUS NTAPI IoVolumeDeviceToDosName ( _In_ PVOID  VolumeDeviceObject,
_Out_ _When_(return==0, _At_(DosName->Buffer, __drv_allocatesMem(Mem))) PUNICODE_STRING  DosName 
)

◆ IoWithinStackLimits()

LOGICAL NTAPI IoWithinStackLimits ( _In_ ULONG_PTR  RegionStart,
_In_ SIZE_T  RegionSize 
)

Referenced by CdSetThreadContext().

◆ IoWMIDeviceObjectToInstanceName()

NTKERNELAPI NTSTATUS NTAPI IoWMIDeviceObjectToInstanceName ( _In_ PVOID  DataBlockObject,
_In_ PDEVICE_OBJECT  DeviceObject,
_Out_ PUNICODE_STRING  InstanceName 
)

◆ IoWMIExecuteMethod()

NTKERNELAPI NTSTATUS NTAPI IoWMIExecuteMethod ( _In_ PVOID  DataBlockObject,
_In_ PUNICODE_STRING  InstanceName,
_In_ ULONG  MethodId,
_In_ ULONG  InBufferSize,
_Inout_ PULONG  OutBufferSize,
_Inout_updates_bytes_to_opt_ *, InBufferSize PUCHAR  InOutBuffer 
)

◆ IoWMIHandleToInstanceName()

NTKERNELAPI NTSTATUS NTAPI IoWMIHandleToInstanceName ( _In_ PVOID  DataBlockObject,
_In_ HANDLE  FileHandle,
_Out_ PUNICODE_STRING  InstanceName 
)

◆ IoWMIOpenBlock()

NTKERNELAPI NTSTATUS NTAPI IoWMIOpenBlock ( _In_ LPCGUID  DataBlockGuid,
_In_ ULONG  DesiredAccess,
_Out_ PVOID DataBlockObject 
)

Definition at line 140 of file wmi.c.

144{
145 HANDLE GuidObjectHandle;
147
148 /* Open the GIOD object */
149 Status = WmipOpenGuidObject(DataBlockGuid,
152 &GuidObjectHandle,
153 DataBlockObject);
154 if (!NT_SUCCESS(Status))
155 {
156 DPRINT1("WmipOpenGuidObject failed: 0x%lx\n", Status);
157 return Status;
158 }
159
160
161 return STATUS_SUCCESS;
162}
NTSTATUS NTAPI WmipOpenGuidObject(_In_ LPCGUID Guid, _In_ ACCESS_MASK DesiredAccess, _In_ KPROCESSOR_MODE AccessMode, _Out_ PHANDLE OutGuidObjectHandle, _Outptr_ PVOID *OutGuidObject)
Definition: guidobj.c:217
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658

Referenced by ExpGetRawSMBiosTable(), and i8042InitializeHwHacks().

◆ IoWMIQueryAllData()

NTKERNELAPI NTSTATUS NTAPI IoWMIQueryAllData ( _In_ PVOID  DataBlockObject,
_Inout_ ULONG InOutBufferSize,
_Out_writes_bytes_opt_ *InOutBufferSize PVOID  OutBuffer 
)

◆ IoWMIQueryAllDataMultiple()

NTKERNELAPI NTSTATUS NTAPI IoWMIQueryAllDataMultiple ( _In_reads_(ObjectCount) PVOID DataBlockObjectList,
_In_ ULONG  ObjectCount,
_Inout_ ULONG InOutBufferSize,
_Out_writes_bytes_opt_ *InOutBufferSize PVOID  OutBuffer 
)

◆ IoWMIQuerySingleInstance()

NTKERNELAPI NTSTATUS NTAPI IoWMIQuerySingleInstance ( _In_ PVOID  DataBlockObject,
_In_ PUNICODE_STRING  InstanceName,
_Inout_ ULONG InOutBufferSize,
_Out_writes_bytes_opt_ *InOutBufferSize PVOID  OutBuffer 
)

◆ IoWMIQuerySingleInstanceMultiple()

NTKERNELAPI NTSTATUS NTAPI IoWMIQuerySingleInstanceMultiple ( _In_reads_(ObjectCount) PVOID DataBlockObjectList,
_In_reads_(ObjectCount) PUNICODE_STRING  InstanceNames,
_In_ ULONG  ObjectCount,
_Inout_ ULONG InOutBufferSize,
_Out_writes_bytes_opt_ *InOutBufferSize PVOID  OutBuffer 
)

◆ IoWMISetNotificationCallback()

NTKERNELAPI NTSTATUS NTAPI IoWMISetNotificationCallback ( _Inout_ PVOID  Object,
_In_ WMI_NOTIFICATION_CALLBACK  Callback,
_In_opt_ PVOID  Context 
)

◆ IoWMISetSingleInstance()

NTKERNELAPI NTSTATUS NTAPI IoWMISetSingleInstance ( _In_ PVOID  DataBlockObject,
_In_ PUNICODE_STRING  InstanceName,
_In_ ULONG  Version,
_In_ ULONG  ValueBufferSize,
_In_reads_bytes_(ValueBufferSize) PVOID  ValueBuffer 
)

◆ IoWMISetSingleItem()

NTKERNELAPI NTSTATUS NTAPI IoWMISetSingleItem ( _In_ PVOID  DataBlockObject,
_In_ PUNICODE_STRING  InstanceName,
_In_ ULONG  DataItemId,
_In_ ULONG  Version,
_In_ ULONG  ValueBufferSize,
_In_reads_bytes_(ValueBufferSize) PVOID  ValueBuffer 
)

◆ IoWMISuggestInstanceName()

NTKERNELAPI NTSTATUS NTAPI IoWMISuggestInstanceName ( _In_opt_ PDEVICE_OBJECT  PhysicalDeviceObject,
_In_opt_ PUNICODE_STRING  SymbolicLinkName,
_In_ BOOLEAN  CombineNames,
_Out_ PUNICODE_STRING  SuggestedInstanceName 
)

◆ IoWMIWriteEvent()

◆ NotificationEntry()

◆ READ_PORT_BUFFER_ULONG()

NTHALAPI VOID NTAPI READ_PORT_BUFFER_ULONG ( IN PULONG  Port,
IN PULONG  Buffer,
IN ULONG  Count 
)

◆ READ_PORT_BUFFER_USHORT()

NTHALAPI VOID NTAPI READ_PORT_BUFFER_USHORT ( IN PUSHORT  Port,
IN PUSHORT  Buffer,
IN ULONG  Count 
)

◆ READ_PORT_UCHAR()

NTHALAPI UCHAR NTAPI READ_PORT_UCHAR ( IN PUCHAR  Port)

Definition at line 56 of file portio.c.

57{
59}
CPPORT Port[4]
Definition: headless.c:35
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR(IN PUCHAR Register)

◆ READ_PORT_ULONG()

◆ READ_PORT_USHORT()

◆ READ_REGISTER_BUFFER_UCHAR()

NTKERNELAPI VOID NTAPI READ_REGISTER_BUFFER_UCHAR ( IN PUCHAR  Register,
IN PUCHAR  Buffer,
IN ULONG  Count 
)

◆ READ_REGISTER_BUFFER_ULONG()

NTKERNELAPI VOID NTAPI READ_REGISTER_BUFFER_ULONG ( IN PULONG  Register,
IN PULONG  Buffer,
IN ULONG  Count 
)

◆ READ_REGISTER_BUFFER_USHORT()

NTKERNELAPI VOID NTAPI READ_REGISTER_BUFFER_USHORT ( IN PUSHORT  Register,
IN PUSHORT  Buffer,
IN ULONG  Count 
)

◆ READ_REGISTER_UCHAR()

◆ READ_REGISTER_ULONG()

NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG ( IN PULONG  Register)

◆ READ_REGISTER_USHORT()

NTKERNELAPI USHORT NTAPI READ_REGISTER_USHORT ( IN PUSHORT  Register)

◆ sizeof()

Referenced by __rpcb_findaddr_timed(), __xdrrec_getrec(), _bdf_parse_glyphs(), _bdf_parse_start(), AcpiEvaluateObject(), AcpiEvCreateGpeInfoBlocks(), AcpiExExtractFromField(), AcpiExFieldDatumIo(), AcpiExInsertIntoField(), AcpiExLoadOp(), AcpiGetObjectInfo(), AcpiGetStatistics(), AcpiGetTableHeader(), AcpiNsExecuteTable(), AcpiNsInitializeDevices(), AcpiNsOneCompleteParse(), AcpiPsGetAmlOpcode(), AcpiResourceToAddress64(), AcpiTbCreateLocalFadt(), AcpiTbParseRootTable(), AcpiTbResizeRootTableList(), AcpiUtCopyIelementToEelement(), AcpiUtCopyIpackageToIpackage(), add_call(), add_message(), af_axis_hints_new_edge(), af_axis_hints_new_segment(), af_face_globals_new(), afm_parse_kern_pairs(), assign_file_addresses(), AtapiFindNativeModeController(), attach_dot_entries(), authdes_marshal(), authdes_validate(), btrfs_chunk_item_size(), Bus_FDO_PnP(), cf2_decoder_parse_charstrings(), cf2_font_setup(), cf2_glyphpath_init(), cf2_hintmask_setAll(), cf2_interpT2CharString(), cff_blend_build_vector(), cff_blend_check_vector(), check_pointers(), codeview_snarf_linetab2(), DeviceZPODDGetPowerupReason(), DiskIoctlGetDriveGeometryEx(), elf_hash_symtab(), EnumPrinterDataExA(), EnumResourceNamesW(), EnumResourceTypesW(), EnumThemeColors(), EnumThemeSizes(), EstimateStripByteCounts(), evd_write(), event_client(), ext4_ext_space_block(), ext4_ext_space_block_idx(), ext4_fs_get_xattr_ref(), FATGetNextDirEntry(), FsRtlNotifyFilterReportChange(), ft_lzwstate_prefix_grow(), FT_Set_Debug_Hook(), ftc_inode_weight(), get_ifaceps_datalen(), get_joliet_vol_desc(), get_nt_header(), get_progid_datalen(), get_section_header(), get_torito_desc(), GetLastInputInfo(), GetMenuItemInfoA(), GetMenuItemInfoW(), GetMonitorInfoA(), gray_convert_glyph(), gxv_bsln_LookupFmt4_transit(), gxv_lcar_LookupFmt4_transit(), gxv_mort_subtable_type4_lookupfmt4_transit(), gxv_morx_subtable_type1_LookupFmt4_transit(), gxv_opbd_LookupFmt4_transit(), gxv_prop_LookupFmt4_transit(), gxv_XClassTable_lookupfmt4_transit(), InitVGA(), linear_reset(), linear_set_converter(), Main_DDrawSurface_Blt(), merge_isofs(), merge_old_directory_into_tree(), merge_remaining_entries(), mp_exptmod_fast(), mp_grow(), mp_montgomery_reduce(), mp_mul(), mp_shrink(), mp_zero(), NDRCContextMarshall(), NtfsMakeFCBFromDirEntry(), oob_client(), DriveVolume::Open(), OpenControlConnection(), OpenDataConnection(), parse_rr(), prepare_data(), pvd_write(), read_merging_directory(), REBAR_GetBarInfo(), REBAR_SetBarInfo(), record_to_row(), resource_dup_string(), RpnpPopStack(), RpnpPushStack(), RpnpTopStack(), s_mp_mul_digs(), s_mp_mul_high_digs(), server_start(), SetupDiGetClassImageListExW(), simple_client(), simple_mixed_client(), sinc_reset(), sort_n_finish(), sunlabel_write(), svc_unreg(), T1_Get_MM_Var(), T1_Read_PFM(), testPropsHelper(), TIFFClientOpen(), TIFFFetchDirectory(), TIFFGrowStrips(), TIFFSetupStrips(), TRACKBAR_RecalculateTics(), TRACKBAR_SetTic(), TT_Load_Simple_Glyph(), TT_Process_Composite_Glyph(), UniformResourceLocatorW_InvokeCommand(), UXTHEME_BackupSystemMetrics(), vfatInitFCBFromDirEntry(), VideoPortDDCMonitorHelper(), vring_control_block_size_packed(), woff_open_font(), write_resources(), xdr_rpcbs_addrlist(), xdr_rpcbs_rmtcalllist(), xdr_unixcred(), zoh_reset(), and zoh_set_converter().

◆ SymbolicLinkList()

◆ WRITE_PORT_BUFFER_UCHAR()

NTHALAPI VOID NTAPI WRITE_PORT_BUFFER_UCHAR ( IN PUCHAR  Port,
IN PUCHAR  Buffer,
IN ULONG  Count 
)

Definition at line 77 of file portio.c.

80{
82 while (TRUE);
83}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15

Referenced by ScsiPortWritePortBufferUchar(), StorPortWritePortBufferUchar(), and x86IoWrite().

◆ WRITE_PORT_BUFFER_ULONG()

NTHALAPI VOID NTAPI WRITE_PORT_BUFFER_ULONG ( IN PULONG  Port,
IN PULONG  Buffer,
IN ULONG  Count 
)

Definition at line 97 of file portio.c.

100{
102 while (TRUE);
103}

Referenced by ScsiPortWritePortBufferUlong(), StorPortWritePortBufferUlong(), and x86IoWrite().

◆ WRITE_PORT_BUFFER_USHORT()

NTHALAPI VOID NTAPI WRITE_PORT_BUFFER_USHORT ( IN PUSHORT  Port,
IN PUSHORT  Buffer,
IN ULONG  Count 
)

Definition at line 87 of file portio.c.

90{
92 while (TRUE);
93}

Referenced by ScsiPortWritePortBufferUshort(), StorPortWritePortBufferUshort(), VgaInterpretCmdStream(), and x86IoWrite().

◆ WRITE_PORT_UCHAR()

NTHALAPI VOID NTAPI WRITE_PORT_UCHAR ( IN PUCHAR  Port,
IN UCHAR  Value 
)

Definition at line 107 of file portio.c.

109{
111}
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
NTKERNELAPI VOID NTAPI WRITE_REGISTER_UCHAR(IN PUCHAR Register, IN UCHAR Value)

◆ WRITE_PORT_ULONG()

◆ WRITE_PORT_USHORT()

◆ WRITE_REGISTER_BUFFER_UCHAR()

NTKERNELAPI VOID NTAPI WRITE_REGISTER_BUFFER_UCHAR ( IN PUCHAR  Register,
IN PUCHAR  Buffer,
IN ULONG  Count 
)

◆ WRITE_REGISTER_BUFFER_ULONG()

NTKERNELAPI VOID NTAPI WRITE_REGISTER_BUFFER_ULONG ( IN PULONG  Register,
IN PULONG  Buffer,
IN ULONG  Count 
)

◆ WRITE_REGISTER_BUFFER_USHORT()

NTKERNELAPI VOID NTAPI WRITE_REGISTER_BUFFER_USHORT ( IN PUSHORT  Register,
IN PUSHORT  Buffer,
IN ULONG  Count 
)

◆ WRITE_REGISTER_UCHAR()

◆ WRITE_REGISTER_ULONG()

NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG ( IN PULONG  Register,
IN ULONG  Value 
)

◆ WRITE_REGISTER_USHORT()

NTKERNELAPI VOID NTAPI WRITE_REGISTER_USHORT ( IN PUSHORT  Register,
IN USHORT  Value 
)

Variable Documentation

◆ Action

Definition at line 1342 of file iofuncs.h.

◆ ActualNumberDriverObjects

ActualNumberDriverObjects _In_ ULONG _Out_ PULONG ActualNumberDriverObjects

Definition at line 2286 of file iofuncs.h.

Referenced by IoEnumerateRegisteredFiltersList().

◆ AddressSpace