13#define NDEBUG_USBPORT_CORE
14#define NDEBUG_USBPORT_INTERRUPT
15#define NDEBUG_USBPORT_TIMER
35 DPRINT(
"USBPORT_FindUSB2Controller: FdoDevice - %p\n", FdoDevice);
56 USB2FdoEntry = USB2FdoEntry->
Flink;
70 DPRINT(
"USBPORT_AddUSB1Fdo: FdoDevice - %p\n", FdoDevice);
86 DPRINT(
"USBPORT_AddUSB2Fdo: FdoDevice - %p\n", FdoDevice);
103 DPRINT(
"USBPORT_RemoveUSBxFdo: FdoDevice - %p\n", FdoDevice);
124 DPRINT(
"USBPORT_IsCompanionFdoExtension: USB2Fdo - %p, USB1FdoExtension - %p\n",
128 USB2FdoExtension = USB2FdoDevice->DeviceExtension;
130 return USB2FdoExtension->
BusNumber == USB1FdoExtension->BusNumber &&
131 USB2FdoExtension->
PciDeviceNumber == USB1FdoExtension->PciDeviceNumber;
142 ULONG NumControllers = 0;
147 DPRINT(
"USBPORT_FindCompanionControllers: USB2Fdo - %p, IsObRefer - %x, IsFDOs - %x\n",
171 DPRINT(
"USBPORT_FindCompanionControllers: NumControllers - %x\n",
183 if (!ControllersList)
190 ControllersList->
Count = NumControllers;
227 return ControllersList;
234 DPRINT(
"USBPORT_NtStatusToMpStatus: NtStatus - %x\n", NtStatus);
259 DPRINT(
"USBPORT_SetRegistryKeyValue: ValueNameString - %S\n",
310 DPRINT(
"USBPORT_GetRegistryKeyValue: UseDriverKey - %x, SourceString - %S, LengthStr - %x, Buffer - %p, BufferLength - %x\n",
384 DPRINT(
"USBPORT_GetMiniportRegistryKeyValue: MiniPortExtension - %p, UseDriverKey - %x, SourceString - %S, LengthStr - %x, Buffer - %p, BufferLength - %x\n",
417 ULONG BytesReadWrite;
419 DPRINT(
"USBPORT_GetSetConfigSpaceData ...\n");
429 BytesReadWrite = (*
FdoExtension->BusInterface.GetBusData)
438 BytesReadWrite = (*
FdoExtension->BusInterface.SetBusData)
446 if (BytesReadWrite ==
Length)
466 DPRINT(
"USBPORT_ReadWriteConfigSpace: ...\n");
492 DPRINT1(
"USBPORT_USBDStatusToNtStatus: Urb - %p, USBDStatus - %x\n",
498 Urb->UrbHeader.Status = USBDStatus;
548 DPRINT(
"USBPORT_Wait: Milliseconds - %x\n", Milliseconds);
563 DPRINT_INT(
"USBPORT_MiniportInterrupts: IsEnable - %p\n", IsEnable);
598 DPRINT_INT(
"USBPORT_SoftInterruptDpc: ...\n");
640 DPRINT_CORE(
"USBPORT_InvalidateControllerHandler: Invalidate Type - %x\n",
648 DPRINT1(
"USBPORT_InvalidateControllerHandler: INVALIDATE_CONTROLLER_RESET UNIMPLEMENTED. FIXME.\n");
652 DPRINT1(
"USBPORT_InvalidateControllerHandler: INVALIDATE_CONTROLLER_SURPRISE_REMOVE UNIMPLEMENTED. FIXME.\n");
676 DPRINT(
"USBPORT_InvalidateController: Invalidate Type - %x\n",
Type);
695 DPRINT1(
"USBPORT_NotifyDoubleBuffer: UNIMPLEMENTED. FIXME.\n");
709 DPRINT(
"USBPORT_WorkerRequestDpc: ...\n");
734 DPRINT_CORE(
"USBPORT_DoneTransfer: Transfer - %p\n", Transfer);
736 Endpoint = Transfer->Endpoint;
810 if (IsHasTransfers && !TransferCount)
845 DPRINT_CORE(
"USBPORT_QueueDoneTransfer: Transfer - %p, USBDStatus - %p\n",
849 FdoDevice = Transfer->Endpoint->FdoDevice;
853 Transfer->USBDStatus = USBDStatus;
856 &Transfer->TransferLink,
952 DPRINT_CORE(
"USBPORT_IsrDpcHandler: IsDpcHandler - %x\n", IsDpcHandler);
974 DPRINT_CORE(
"USBPORT_IsrDpcHandler: Endpoint - %p\n", Endpoint);
982 if (FrameNumber <= Endpoint->FrameNumber &&
1004 DPRINT_CORE(
"USBPORT_IsrDpcHandler: Endpoint->StateLast - %x\n",
1041 DPRINT_INT(
"USBPORT_IsrDpc: DeferredContext - %p, SystemArgument2 - %p\n",
1089 DPRINT_INT(
"USBPORT_InterruptService: FdoExtension[%p]->Flags - %08X\n",
1137 DPRINT_CORE(
"USBPORT_WorkerThreadHandler: ...\n");
1169 DPRINT_CORE(
"USBPORT_WorkerThreadHandler: Endpoint - %p\n", Endpoint);
1228 PVOID RootHubInitContext;
1232 DPRINT(
"USBPORT_DoRootHubCallback: FdoDevice - %p\n", FdoDevice);
1241 RootHubInitCallback =
PdoExtension->RootHubInitCallback;
1246 if (RootHubInitCallback)
1248 RootHubInitCallback(RootHubInitContext);
1252 DPRINT(
"USBPORT_DoRootHubCallback: exit\n");
1268 DPRINT(
"USBPORT_SynchronizeRootHubCallback: FdoDevice - %p, Usb2FdoDevice - %p\n",
1275 if (Usb2FdoDevice ==
NULL &&
1284 DPRINT(
"USBPORT_SynchronizeRootHubCallback: exit\n");
1290 DPRINT(
"USBPORT_SynchronizeRootHubCallback: FdoExtension->Flags - %p\n",
1310 FdoExtension->Flags &= ~USBPORT_FLAG_PWR_AND_CHIRP_LOCK;
1321 if (CompanionControllersList)
1325 for (ix = 0; ix < CompanionControllersList->
Count; ++ix)
1327 CompanionFdoExtension = ((*Entry)->DeviceExtension);
1346 Usb2FdoExtension = Usb2FdoDevice->DeviceExtension;
1363 DPRINT(
"USBPORT_SynchronizeRootHubCallback: exit\n");
1378 FdoDevice = StartContext;
1432 DPRINT(
"USBPORT_CreateWorkerThread ...\n");
1460 DPRINT(
"USBPORT_StopWorkerThread ...\n");
1481 DPRINT_TIMER(
"USBPORT_SynchronizeControllersStart: FdoDevice - %p\n",
1501 DPRINT_TIMER(
"USBPORT_SynchronizeControllersStart: Flags - %p\n",
1510 DPRINT_TIMER(
"USBPORT_SynchronizeControllersStart: USB2FdoDevice - %p\n",
1529 USB2FdoDevice =
NULL;
1551 DPRINT_TIMER(
"USBPORT_SynchronizeControllersStart: exit\n");
1570 DPRINT_TIMER(
"USBPORT_TimerDpc: Dpc - %p, DeferredContext - %p\n",
1582 DPRINT_TIMER(
"USBPORT_TimerDpc: Flags - %p, TimerFlags - %p\n",
1621 DPRINT_TIMER(
"USBPORT_TimerDpc: USBPORT_TimeoutAllEndpoints UNIMPLEMENTED.\n");
1623 DPRINT_TIMER(
"USBPORT_TimerDpc: USBPORT_CheckIdleEndpoints UNIMPLEMENTED.\n");
1635 DPRINT(
"USBPORT_TimerDpc: IdleLockCounter - %x, IdleQueueItem - %p\n",
1680 ULONG TimeIncrement;
1683 DPRINT_TIMER(
"USBPORT_StartTimer: FdoDevice - %p, Time - %x\n",
1697 DueTime.QuadPart -= 10000 *
Time + (TimeIncrement - 1);
1721 ULONG StartBufferPA;
1723 DPRINT(
"USBPORT_AllocateCommonBuffer: FdoDevice - %p, BufferLength - %p\n",
1747 StartBufferVA = BaseVA & ~(
PAGE_SIZE - 1);
1755 HeaderBuffer->
BaseVA = BaseVA;
1765 return HeaderBuffer;
1777 DPRINT(
"USBPORT_FreeCommonBuffer: ...\n");
1785 HeaderBuffer->Length,
1786 HeaderBuffer->LogicalAddress,
1787 (
PVOID)HeaderBuffer->VirtualAddress,
1800 DPRINT(
"USBPORT_FindMiniPort: ...\n");
1814 DPRINT(
"USBPORT_FindMiniPort: find MiniPortInterface - %p\n",
1825 return MiniPortInterface;
1839 WCHAR CharDeviceName[64];
1847 DPRINT(
"USBPORT_AddDevice: DriverObject - %p, PhysicalDeviceObject - %p\n",
1853 if (!MiniPortInterface)
1855 DPRINT(
"USBPORT_AddDevice: USBPORT_FindMiniPort not found MiniPortInterface\n");
1863 sizeof(CharDeviceName),
1864 L"\\Device\\USBFDO-%d",
1899 DPRINT1(
"USBPORT_AddDevice: failed to create %wZ, Status %x\n",
1907 DPRINT(
"USBPORT_AddDevice: created device %p <%wZ>, Status %x\n",
1937 DPRINT(
"USBPORT_AddDevice: Usb2Extension - %p\n",
1974 DPRINT1(
"USBPORT_Unload: FIXME!\n");
1978 if (!MiniPortInterface)
1980 DPRINT(
"USBPORT_Unload: CRITICAL ERROR!!! Not found MiniPortInterface\n");
1984 DPRINT1(
"USBPORT_Unload: UNIMPLEMENTED. FIXME.\n");
2003 DPRINT_CORE(
"USBPORT_MiniportCompleteTransfer: USBDStatus - %x, TransferLength - %x\n",
2009 TransferParameters);
2040 DPRINT1(
"USBPORT_MiniportCompleteTransfer: SplitTransfer->Flags - %X\n",
2041 SplitTransfer->
Flags);
2065 DPRINT(
"USBPORT_AsyncTimerDpc: ...\n");
2068 FdoDevice = AsyncCallbackData->
FdoDevice;
2090 DPRINT(
"USBPORT_RequestAsyncCallback: ...\n");
2101 if (!AsyncCallbackData)
2103 DPRINT1(
"USBPORT_RequestAsyncCallback: Not allocated AsyncCallbackData!\n");
2115 AsyncCallbackData->
FdoDevice = FdoDevice;
2144 DPRINT_CORE(
"USBPORT_GetMappedVirtualAddress ...\n");
2178 if (!MiniPortEndpoint)
2217 DPRINT(
"USBPORT_CompleteTransfer: Urb - %p, TransferStatus - %X\n",
2221 UrbTransfer = &Urb->UrbControlTransfer;
2222 Transfer = UrbTransfer->
hca.Reserved8[0];
2234 DmaOperations =
FdoExtension->DmaAdapter->DmaOperations;
2248 if (!IsFlushSuccess)
2250 DPRINT(
"USBPORT_CompleteTransfer: no FlushAdapterBuffers !!!\n");
2266 Urb->UrbHeader.UsbdFlags |= ~USBD_FLAG_ALLOCATED_MDL;
2269 Urb->UrbControlTransfer.hca.Reserved8[0] =
NULL;
2270 Urb->UrbHeader.UsbdFlags |= ~USBD_FLAG_ALLOCATED_TRANSFER;
2279 DPRINT1(
"USBPORT_CompleteTransfer: Irp - %p complete with Status - %lx\n",
2287 Irp->IoStatus.Information = 0;
2326 ULONG TransferLength;
2343 Urb = Transfer->
Urb;
2350 sgList = &Transfer->
SgList;
2366 PhAddress = DmaOperations->
MapTransfer(DmaAdapter,
2373 DPRINT_CORE(
"USBPORT_MapTransfer: PhAddress.LowPart - %p, PhAddress.HighPart - %x, TransferLength - %x\n",
2379 SgCurrentLength = TransferLength;
2385 if (ElementLength > SgCurrentLength)
2386 ElementLength = SgCurrentLength;
2388 DPRINT_CORE(
"USBPORT_MapTransfer: PhAddress.LowPart - %p, HighPart - %x, ElementLength - %x\n",
2396 (TransferLength - SgCurrentLength);
2398 PhAddress.
LowPart += ElementLength;
2399 SgCurrentLength -= ElementLength;
2403 while (SgCurrentLength);
2407 DPRINT1(
"USBPORT_MapTransfer: PhAddr == PhAddress\n");
2413 CurrentLength += TransferLength;
2414 CurrentVa += TransferLength;
2488 ULONG NumMapRegisters;
2499 DmaOperations =
FdoExtension->DmaAdapter->DmaOperations;
2553 ULONG PagesNeed = 0;
2554 SIZE_T PortTransferLength;
2555 SIZE_T FullTransferLength;
2561 DPRINT_CORE(
"USBPORT_AllocateTransfer: FdoDevice - %p, Urb - %p, DeviceHandle - %p, Irp - %p, Event - %p\n",
2570 TransferLength = Urb->UrbControlTransfer.TransferBufferLength;
2571 PipeHandle = Urb->UrbControlTransfer.PipeHandle;
2575 Mdl = Urb->UrbControlTransfer.TransferBufferMDL;
2588 DPRINT1(
"USBPORT_AllocateTransfer: ISOCH_TRANSFER UNIMPLEMENTED. FIXME\n");
2599 FullTransferLength = PortTransferLength +
2600 FdoExtension->MiniPortInterface->Packet.MiniPortTransferSize;
2608 DPRINT1(
"USBPORT_AllocateTransfer: Transfer not allocated!\n");
2615 Transfer->
Urb = Urb;
2627 PortTransferLength - IsoBlockLen);
2634 PortTransferLength);
2638 Urb->UrbControlTransfer.hca.Reserved8[0] = Transfer;
2643 DPRINT_CORE(
"USBPORT_AllocateTransfer: return USBDStatus - %x\n",
2663 DPRINT1(
"USBPORT_Dispatch: USBPORT_PNP_STATE_FAILED\n");
2670 if (DeviceExtension->
IsPDO)
2672 DPRINT(
"USBPORT_Dispatch: PDO IRP_MJ_DEVICE_CONTROL. Major - %d, Minor - %d\n",
2680 DPRINT(
"USBPORT_Dispatch: FDO IRP_MJ_DEVICE_CONTROL. Major - %d, Minor - %d\n",
2690 if (DeviceExtension->
IsPDO)
2692 DPRINT(
"USBPORT_Dispatch: PDO IRP_MJ_INTERNAL_DEVICE_CONTROL. Major - %d, Minor - %d\n",
2700 DPRINT(
"USBPORT_Dispatch: FDO IRP_MJ_INTERNAL_DEVICE_CONTROL. Major - %d, Minor - %d\n",
2710 if (DeviceExtension->
IsPDO)
2712 DPRINT(
"USBPORT_Dispatch: PDO IRP_MJ_POWER. Major - %d, Minor - %d\n",
2720 DPRINT(
"USBPORT_Dispatch: FDO IRP_MJ_POWER. Major - %d, Minor - %d\n",
2730 if (DeviceExtension->
IsPDO)
2732 DPRINT(
"USBPORT_Dispatch: PDO IRP_MJ_SYSTEM_CONTROL. Major - %d, Minor - %d\n",
2741 DPRINT(
"USBPORT_Dispatch: FDO IRP_MJ_SYSTEM_CONTROL. Major - %d, Minor - %d\n",
2752 if (DeviceExtension->
IsPDO)
2754 DPRINT(
"USBPORT_Dispatch: PDO IRP_MJ_PNP. Major - %d, Minor - %d\n",
2762 DPRINT(
"USBPORT_Dispatch: FDO IRP_MJ_PNP. Major - %d, Minor - %d\n",
2773 DPRINT(
"USBPORT_Dispatch: IRP_MJ_CREATE | IRP_MJ_CLOSE\n");
2779 if (DeviceExtension->
IsPDO)
2781 DPRINT(
"USBPORT_Dispatch: PDO unhandled IRP_MJ_???. Major - %d, Minor - %d\n",
2787 DPRINT(
"USBPORT_Dispatch: FDO unhandled IRP_MJ_???. Major - %d, Minor - %d\n",
2817 DPRINT(
"USBPORT_RegisterUSBPortDriver: DriverObject - %p, Version - %p, RegPacket - %p\n",
2822 DPRINT(
"USBPORT_RegisterUSBPortDriver: sizeof(USBPORT_MINIPORT_INTERFACE) - %x\n",
2825 DPRINT(
"USBPORT_RegisterUSBPortDriver: sizeof(USBPORT_DEVICE_EXTENSION) - %x\n",
2846 if (!MiniPortInterface)
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define InterlockedIncrement
#define InterlockedDecrement
PDEVICE_OBJECT PhysicalDeviceObject
_In_ PSCSI_REQUEST_BLOCK _In_opt_ PVOID _In_ ULONG _In_ BOOLEAN WriteToDevice
_In_ PCHAR _In_ ULONG DeviceNumber
#define STATUS_NOT_SUPPORTED
#define NT_SUCCESS(StatCode)
BOOLEAN NTAPI KeInsertQueueDpc(IN PKDPC Dpc, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
VOID NTAPI KeInitializeDpc(IN PKDPC Dpc, IN PKDEFERRED_ROUTINE DeferredRoutine, IN PVOID DeferredContext)
DRIVER_INITIALIZE DriverEntry
VOID NTAPI USBPORT_DumpingURB(IN PURB Urb)
ULONG NTAPI USBPORT_LogEntry(IN PVOID MiniPortExtension, IN ULONG DriverTag, IN ULONG EnumTag, IN ULONG P1, IN ULONG P2, IN ULONG P3)
VOID NTAPI USBPORT_BugCheck(IN PVOID MiniPortExtension)
ULONG NTAPI USBPORT_AssertFailure(PVOID MiniPortExtension, PVOID FailedAssertion, PVOID FileName, ULONG LineNumber, PCHAR Message)
ULONG NTAPI USBPORT_TestDebugBreak(IN PVOID MiniPortExtension)
ULONG USBPORT_DbgPrint(IN PVOID MiniPortExtension, IN ULONG Level, IN PCH Format,...)
NTSTATUS NTAPI USBPORT_FdoInternalDeviceControl(IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp)
NTSTATUS NTAPI USBPORT_FdoDeviceControl(IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp)
NTSTATUS NTAPI USBPORT_PdoInternalDeviceControl(IN PDEVICE_OBJECT PdoDevice, IN PIRP Irp)
NTSTATUS NTAPI USBPORT_PdoDeviceControl(IN PDEVICE_OBJECT PdoDevice, IN PIRP Irp)
USBD_STATUS NTAPI USBPORT_InitializeIsoTransfer(PDEVICE_OBJECT FdoDevice, struct _URB_ISOCH_TRANSFER *Urb, PUSBPORT_TRANSFER Transfer)
ULONG NTAPI USBPORT_CompleteIsoTransfer(IN PVOID MiniPortExtension, IN PVOID MiniPortEndpoint, IN PVOID TransferParameters, IN ULONG TransferLength)
NTSTATUS NTAPI USBPORT_PdoPnP(IN PDEVICE_OBJECT PdoDevice, IN PIRP Irp)
NTSTATUS NTAPI USBPORT_FdoPnP(IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp)
VOID NTAPI USBPORT_DoSetPowerD0(IN PDEVICE_OBJECT FdoDevice)
NTSTATUS NTAPI USBPORT_FdoPower(IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp)
NTSTATUS NTAPI USBPORT_PdoPower(IN PDEVICE_OBJECT PdoDevice, IN PIRP Irp)
VOID NTAPI USBPORT_CompletePdoWaitWake(IN PDEVICE_OBJECT FdoDevice)
VOID NTAPI USBPORT_DoIdleNotificationCallback(IN PVOID Context)
VOID NTAPI USBPORT_FlushPendingTransfers(IN PUSBPORT_ENDPOINT Endpoint)
VOID NTAPI USBPORT_FlushAllEndpoints(IN PDEVICE_OBJECT FdoDevice)
PIRP NTAPI USBPORT_RemoveActiveTransferIrp(IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp)
VOID NTAPI USBPORT_BadRequestFlush(IN PDEVICE_OBJECT FdoDevice)
BOOLEAN NTAPI USBPORT_EndpointWorker(IN PUSBPORT_ENDPOINT Endpoint, IN BOOLEAN LockNotChecked)
VOID NTAPI USBPORT_InvalidateEndpointHandler(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_ENDPOINT Endpoint, IN ULONG Type)
BOOLEAN NTAPI USBPORT_EndpointHasQueuedTransfers(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_ENDPOINT Endpoint, IN PULONG TransferCount)
VOID NTAPI USBPORT_FlushClosedEndpointList(IN PDEVICE_OBJECT FdoDevice)
ULONG NTAPI USBPORT_GetEndpointState(IN PUSBPORT_ENDPOINT Endpoint)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define IsListEmpty(ListHead)
#define KeRaiseIrql(irql, oldIrql)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeReleaseSpinLock(sl, irql)
#define KeLowerIrql(oldIrql)
#define KeSetEvent(pEvt, foo, foo2)
#define KeAcquireSpinLock(sl, irql)
#define KeQuerySystemTime(t)
#define KeGetCurrentIrql()
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
#define KeDelayExecutionThread(mode, foo, t)
#define KeInitializeSpinLock(sl)
VOID NTAPI KeClearEvent(IN PKEVENT Event)
#define KeGetCurrentThread
_Inout_ PUSB_DEVICE_HANDLE DeviceHandle
RH_INIT_CALLBACK * PRH_INIT_CALLBACK
NTSYSAPI void WINAPI DbgBreakPoint(void)
#define LOW_REALTIME_PRIORITY
PLIST_ENTRY NTAPI ExInterlockedInsertHeadList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
PLIST_ENTRY NTAPI ExInterlockedInsertTailList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
PLIST_ENTRY NTAPI ExInterlockedRemoveHeadList(IN OUT PLIST_ENTRY ListHead, IN OUT PKSPIN_LOCK Lock)
#define InterlockedCompareExchange
IoSetCancelRoutine(Irp, CancelRoutine)
#define ExFreePoolWithTag(_P, _T)
static PLARGE_INTEGER Time
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
#define THREAD_ALL_ACCESS
struct _KEY_VALUE_FULL_INFORMATION KEY_VALUE_FULL_INFORMATION
@ KeyValueFullInformation
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define STANDARD_RIGHTS_ALL
_In_ ULONG _In_ ULONG Offset
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define IoSkipCurrentIrpStackLocation(Irp)
PDEVICE_OBJECT NTAPI IoAttachDeviceToDeviceStack(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice)
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
#define IoCompleteRequest
VOID NTAPI IoReleaseCancelSpinLock(IN KIRQL Irql)
VOID NTAPI IoAcquireCancelSpinLock(OUT PKIRQL Irql)
ULONG NTAPI KeQueryTimeIncrement(VOID)
NTSTATUS NTAPI PsTerminateSystemThread(IN NTSTATUS ExitStatus)
NTSTATUS NTAPI PsCreateSystemThread(OUT PHANDLE ThreadHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN HANDLE ProcessHandle, IN PCLIENT_ID ClientId, IN PKSTART_ROUTINE StartRoutine, IN PVOID StartContext)
#define STATUS_OBJECT_NAME_EXISTS
NTSTRSAFEVAPI RtlStringCbPrintfW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
NTSTATUS NTAPI IoOpenDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject, IN ULONG DevInstKeyType, IN ACCESS_MASK DesiredAccess, OUT PHANDLE DevInstRegKey)
#define FILE_DEVICE_CONTROLLER
#define IRP_MJ_DEVICE_CONTROL
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
#define KeAcquireSpinLockAtDpcLevel(SpinLock)
#define KeReleaseSpinLockFromDpcLevel(SpinLock)
VOID NTAPI KeInitializeSemaphore(IN PKSEMAPHORE Semaphore, IN LONG Count, IN LONG Limit)
LONG NTAPI KeReleaseSemaphore(IN PKSEMAPHORE Semaphore, IN KPRIORITY Increment, IN LONG Adjustment, IN BOOLEAN Wait)
base of all file and directory entries
PDEVICE_OBJECT Objects[1]
struct _DMA_OPERATIONS * DmaOperations
PALLOCATE_COMMON_BUFFER AllocateCommonBuffer
PFREE_COMMON_BUFFER FreeCommonBuffer
PALLOCATE_ADAPTER_CHANNEL AllocateAdapterChannel
PFLUSH_ADAPTER_BUFFERS FlushAdapterBuffers
PFREE_MAP_REGISTERS FreeMapRegisters
PMAP_TRANSFER MapTransfer
struct _LIST_ENTRY * Blink
struct _LIST_ENTRY * Flink
ULONG TransferBufferLength
struct _URB_ISOCH_TRANSFER UrbIsochronousTransfer
struct _URB_CONTROL_TRANSFER UrbControlTransfer
struct _URB_HEADER UrbHeader
ASYNC_TIMER_CALLBACK * CallbackFunction
DEVICE_POWER_STATE DevicePowerState
PDEVICE_OBJECT LowerPdoDevice
PDEVICE_OBJECT LowerDevice
PDEVICE_OBJECT SelfDevice
USBPORT_COMMON_DEVICE_EXTENSION CommonExtension
LIST_ENTRY ControllerLink
USB_DEVICE_SPEED DeviceSpeed
KSPIN_LOCK StateChangeSpinLock
LIST_ENTRY StateChangeLink
LIST_ENTRY FlushAbortLink
KSPIN_LOCK EndpointSpinLock
USBPORT_ENDPOINT_PROPERTIES EndpointProperties
PUSBPORT_COMMON_BUFFER_HEADER HeaderBuffer
USBPORT_REGISTRATION_PACKET Packet
PDRIVER_OBJECT DriverObject
PDRIVER_UNLOAD DriverUnload
PUSBPORT_GET_MINIPORT_REGISTRY_KEY_VALUE UsbPortGetMiniportRegistryKeyValue
PUSBPORT_INVALIDATE_CONTROLLER UsbPortInvalidateController
PUSBPORT_REQUEST_ASYNC_CALLBACK UsbPortRequestAsyncCallback
PUSBPORT_TEST_DEBUG_BREAK UsbPortTestDebugBreak
PUSBPORT_LOG_ENTRY UsbPortLogEntry
PUSBPORT_BUG_CHECK UsbPortBugCheck
SIZE_T MiniPortExtensionSize
PUSBPORT_NOTIFY_DOUBLE_BUFFER UsbPortNotifyDoubleBuffer
PUSBPORT_INVALIDATE_ROOT_HUB UsbPortInvalidateRootHub
PUSBPORT_COMPLETE_ISO_TRANSFER UsbPortCompleteIsoTransfer
PUSBPORT_DBG_PRINT UsbPortDbgPrint
PUSBPORT_WAIT UsbPortWait
PUSBPORT_COMPLETE_TRANSFER UsbPortCompleteTransfer
PUSBPORT_READ_WRITE_CONFIG_SPACE UsbPortReadWriteConfigSpace
PUSBPORT_ASSERT_FAILURE UsbPortAssertFailure
PUSBPORT_GET_MAPPED_VIRTUAL_ADDRESS UsbPortGetMappedVirtualAddress
PUSBPORT_INVALIDATE_ENDPOINT UsbPortInvalidateEndpoint
PHYSICAL_ADDRESS SgPhysicalAddress
USBPORT_SCATTER_GATHER_ELEMENT SgElement[2]
ULONG TransferBufferLength
SIZE_T PortTransferLength
ULONG CompletedTransferLen
PUSBPORT_ISO_BLOCK IsoBlockPtr
ULONG NumberOfMapRegisters
KSPIN_LOCK TransferSpinLock
struct _USBPORT_TRANSFER * ParentTransfer
LIST_ENTRY SplitTransfersList
USBPORT_TRANSFER_PARAMETERS TransferParameters
PUSBPORT_ENDPOINT Endpoint
SIZE_T FullTransferLength
USBPORT_SCATTER_GATHER_LIST SgList
PWORKER_THREAD_ROUTINE WorkerRoutine
BOOLEAN NTAPI KeSetTimer(IN OUT PKTIMER Timer, IN LARGE_INTEGER DueTime, IN PKDPC Dpc OPTIONAL)
VOID NTAPI KeInitializeTimer(OUT PKTIMER Timer)
VOID NTAPI USBPORT_DoneSplitTransfer(IN PUSBPORT_TRANSFER SplitTransfer)
VOID NTAPI USBPORT_SplitTransfer(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_ENDPOINT Endpoint, IN PUSBPORT_TRANSFER Transfer, IN PLIST_ENTRY List)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_DEVICE_NOT_CONNECTED
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define STATUS_OBJECT_NAME_COLLISION
#define STATUS_INSUFFICIENT_RESOURCES
VOID NTAPI USB2_InitController(IN PUSB2_HC_EXTENSION HcExtension)
#define USBD_STATUS_DEVICE_GONE
#define USBD_STATUS_INVALID_PIPE_HANDLE
#define USBD_STATUS_CANCELED
#define USBD_ERROR(Status)
#define USBD_STATUS_SUCCESS
#define USBD_STATUS_NOT_SUPPORTED
#define USBD_STATUS_INSUFFICIENT_RESOURCES
#define USBD_STATUS_INVALID_PARAMETER
#define USBD_STATUS_INVALID_URB_FUNCTION
#define USBD_STATUS_BAD_START_FRAME
#define URB_FUNCTION_ISOCH_TRANSFER
#define PLUGPLAY_REGKEY_DRIVER
#define DPRINT_TIMER(...)
USBPORT_REGISTRATION_PACKET RegPacket
#define USBPORT_ENDPOINT_ACTIVE
#define USB_MINIPORT_FLAGS_USB2
#define MP_STATUS_UNSUCCESSFUL
#define USBPORT_INVALIDATE_CONTROLLER_RESET
#define USB_MINIPORT_FLAGS_NOT_LOCK_INT
#define USBPORT_INVALIDATE_CONTROLLER_SURPRISE_REMOVE
#define MP_STATUS_SUCCESS
#define USB10_MINIPORT_INTERFACE_VERSION
#define USBPORT_INVALIDATE_CONTROLLER_SOFT_INTERRUPT
ULONG NTAPI USBPORT_InvalidateRootHub(PVOID MiniPortExtension)
VOID NTAPI USBPORT_RootHubPowerAndChirpAllCcPorts(IN PDEVICE_OBJECT FdoDevice)
BOOLEAN USBPORT_Initialized
VOID NTAPI USBPORT_SynchronizeControllersStart(IN PDEVICE_OBJECT FdoDevice)
USBD_STATUS NTAPI USBPORT_AllocateTransfer(IN PDEVICE_OBJECT FdoDevice, IN PURB Urb, IN PUSBPORT_DEVICE_HANDLE DeviceHandle, IN PIRP Irp, IN PRKEVENT Event)
BOOLEAN NTAPI USBPORT_QueueDoneTransfer(IN PUSBPORT_TRANSFER Transfer, IN USBD_STATUS USBDStatus)
VOID NTAPI USBPORT_TransferFlushDpc(IN PRKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
MPSTATUS NTAPI USBPORT_GetMiniportRegistryKeyValue(IN PVOID MiniPortExtension, IN BOOL UseDriverKey, IN PCWSTR SourceString, IN SIZE_T LengthStr, IN PVOID Buffer, IN SIZE_T BufferLength)
MPSTATUS NTAPI USBPORT_ReadWriteConfigSpace(IN PVOID MiniPortExtension, IN BOOLEAN IsReadData, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
VOID NTAPI USBPORT_WorkerThread(IN PVOID StartContext)
KSPIN_LOCK USBPORT_SpinLock
VOID NTAPI USBPORT_DoneTransfer(IN PUSBPORT_TRANSFER Transfer)
VOID NTAPI USBPORT_FlushDoneTransfers(IN PDEVICE_OBJECT FdoDevice)
NTSTATUS NTAPI USBPORT_AddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject)
VOID NTAPI USBPORT_SynchronizeRootHubCallback(IN PDEVICE_OBJECT FdoDevice, IN PDEVICE_OBJECT Usb2FdoDevice)
ULONG NTAPI USBPORT_GetHciMn(VOID)
ULONG NTAPI USBPORT_InvalidateController(IN PVOID MiniPortExtension, IN ULONG Type)
LIST_ENTRY USBPORT_USB2FdoList
VOID NTAPI USBPORT_AddUSB2Fdo(IN PDEVICE_OBJECT FdoDevice)
ULONG NTAPI USBPORT_InvalidateEndpoint(IN PVOID MiniPortExtension, IN PVOID MiniPortEndpoint)
VOID NTAPI USBPORT_AddUSB1Fdo(IN PDEVICE_OBJECT FdoDevice)
VOID NTAPI USBPORT_RemoveUSBxFdo(IN PDEVICE_OBJECT FdoDevice)
VOID NTAPI USBPORT_IsrDpcHandler(IN PDEVICE_OBJECT FdoDevice, IN BOOLEAN IsDpcHandler)
PUSBPORT_MINIPORT_INTERFACE NTAPI USBPORT_FindMiniPort(IN PDRIVER_OBJECT DriverObject)
VOID NTAPI USBPORT_SoftInterrupt(IN PDEVICE_OBJECT FdoDevice)
PUSBPORT_COMMON_BUFFER_HEADER NTAPI USBPORT_AllocateCommonBuffer(IN PDEVICE_OBJECT FdoDevice, IN SIZE_T BufferLength)
IO_ALLOCATION_ACTION NTAPI USBPORT_MapTransfer(IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp, IN PVOID MapRegisterBase, IN PVOID Context)
BOOLEAN NTAPI USBPORT_IsCompanionFdoExtension(IN PDEVICE_OBJECT USB2FdoDevice, IN PUSBPORT_DEVICE_EXTENSION USB1FdoExtension)
VOID NTAPI USBPORT_IsrDpc(IN PRKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
PDEVICE_OBJECT NTAPI USBPORT_FindUSB2Controller(IN PDEVICE_OBJECT FdoDevice)
VOID NTAPI USBPORT_StopWorkerThread(IN PDEVICE_OBJECT FdoDevice)
VOID NTAPI USBPORT_InvalidateControllerHandler(IN PDEVICE_OBJECT FdoDevice, IN ULONG Type)
BOOLEAN NTAPI USBPORT_InterruptService(IN PKINTERRUPT Interrupt, IN PVOID ServiceContext)
LIST_ENTRY USBPORT_MiniPortDrivers
NTSTATUS NTAPI USBPORT_GetRegistryKeyValueFullInfo(IN PDEVICE_OBJECT FdoDevice, IN PDEVICE_OBJECT PdoDevice, IN BOOL UseDriverKey, IN PCWSTR SourceString, IN ULONG LengthStr, IN PVOID Buffer, IN ULONG BufferLength)
VOID NTAPI USBPORT_FreeCommonBuffer(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_COMMON_BUFFER_HEADER HeaderBuffer)
ULONG NTAPI USBPORT_NotifyDoubleBuffer(IN PVOID MiniPortExtension, IN PVOID MiniPortTransfer, IN PVOID Buffer, IN SIZE_T Length)
NTSTATUS NTAPI USBPORT_RegisterUSBPortDriver(IN PDRIVER_OBJECT DriverObject, IN ULONG Version, IN PUSBPORT_REGISTRATION_PACKET RegPacket)
VOID NTAPI USBPORT_SignalWorkerThread(IN PDEVICE_OBJECT FdoDevice)
NTSTATUS NTAPI USBPORT_SetRegistryKeyValue(IN PDEVICE_OBJECT DeviceObject, IN BOOL UseDriverKey, IN ULONG Type, IN PCWSTR ValueNameString, IN PVOID Data, IN ULONG DataSize)
VOID NTAPI USBPORT_FlushMapTransfers(IN PDEVICE_OBJECT FdoDevice)
VOID NTAPI USBPORT_TimerDpc(IN PRKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
PDEVICE_RELATIONS NTAPI USBPORT_FindCompanionControllers(IN PDEVICE_OBJECT USB2FdoDevice, IN BOOLEAN IsObRefer, IN BOOLEAN IsFDOsReturned)
MPSTATUS NTAPI USBPORT_NtStatusToMpStatus(NTSTATUS NtStatus)
NTSTATUS NTAPI USBPORT_GetSetConfigSpaceData(IN PDEVICE_OBJECT FdoDevice, IN BOOLEAN IsReadData, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
NTSTATUS NTAPI USBPORT_CreateWorkerThread(IN PDEVICE_OBJECT FdoDevice)
PVOID NTAPI USBPORT_GetMappedVirtualAddress(IN ULONG PhysicalAddress, IN PVOID MiniPortExtension, IN PVOID MiniPortEndpoint)
VOID NTAPI USBPORT_MiniportInterrupts(IN PDEVICE_OBJECT FdoDevice, IN BOOLEAN IsEnable)
VOID NTAPI USBPORT_SoftInterruptDpc(IN PRKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
NTSTATUS NTAPI USBPORT_Dispatch(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
ULONG NTAPI USBPORT_RequestAsyncCallback(IN PVOID MiniPortExtension, IN ULONG TimerValue, IN PVOID Buffer, IN SIZE_T Length, IN ASYNC_TIMER_CALLBACK *Callback)
VOID NTAPI USBPORT_AsyncTimerDpc(IN PRKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
VOID NTAPI USBPORT_WorkerThreadHandler(IN PDEVICE_OBJECT FdoDevice)
VOID NTAPI USBPORT_CompleteTransfer(IN PURB Urb, IN USBD_STATUS TransferStatus)
VOID NTAPI USBPORT_WorkerRequestDpc(IN PRKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
VOID NTAPI USBPORT_Unload(IN PDRIVER_OBJECT DriverObject)
LIST_ENTRY USBPORT_USB1FdoList
VOID NTAPI USBPORT_DoRootHubCallback(IN PDEVICE_OBJECT FdoDevice)
NTSTATUS NTAPI USBPORT_Wait(IN PVOID MiniPortExtension, IN ULONG Milliseconds)
NTSTATUS NTAPI USBPORT_USBDStatusToNtStatus(IN PURB Urb, IN USBD_STATUS USBDStatus)
VOID NTAPI USBPORT_DpcHandler(IN PDEVICE_OBJECT FdoDevice)
BOOLEAN NTAPI USBPORT_StartTimer(IN PDEVICE_OBJECT FdoDevice, IN ULONG Time)
VOID NTAPI USBPORT_MiniportCompleteTransfer(IN PVOID MiniPortExtension, IN PVOID MiniPortEndpoint, IN PVOID TransferParameters, IN USBD_STATUS USBDStatus, IN ULONG TransferLength)
#define USBPORT_FLAG_WORKER_THREAD_ON
#define TRANSFER_FLAG_DMA_MAPPED
#define USBPORT_FLAG_WORKER_THREAD_EXIT
#define USBPORT_FLAG_RH_INIT_CALLBACK
#define USBPORT_FLAG_HC_WAKE_SUPPORT
#define USBPORT_DMA_DIRECTION_TO_DEVICE
#define USBPORT_MPFLAG_INTERRUPTS_ENABLED
struct _USBPORT_ENDPOINT * PUSBPORT_ENDPOINT
#define USBPORT_FLAG_HC_POLLING
#define USBPORT_FLAG_PWR_AND_CHIRP_LOCK
#define USBPORT_TMFLAG_WAKE
#define USBPORT_TMFLAG_HC_SUSPENDED
#define USBPORT_FLAG_NO_HACTION
#define ENDPOINT_FLAG_ROOTHUB_EP0
struct _USBPORT_COMMON_BUFFER_HEADER * PUSBPORT_COMMON_BUFFER_HEADER
#define TRANSFER_FLAG_HIGH_SPEED
struct _USBPORT_DEVICE_EXTENSION * PUSBPORT_DEVICE_EXTENSION
struct _USBPORT_TRANSFER USBPORT_TRANSFER
#define USBD_FLAG_ALLOCATED_TRANSFER
#define INVALIDATE_ENDPOINT_WORKER_THREAD
#define USBPORT_FLAG_HC_SUSPEND
struct _USBPORT_DEVICE_EXTENSION USBPORT_DEVICE_EXTENSION
#define TRANSFER_FLAG_SUBMITED
struct _USBPORT_COMMON_BUFFER_HEADER USBPORT_COMMON_BUFFER_HEADER
#define TRANSFER_FLAG_ISO
#define USBPORT_FLAG_POWER_AND_CHIRP_OK
#define USBPORT_PNP_STATE_STARTED
#define USBPORT_PNP_STATE_FAILED
#define USBPORT_FLAG_COMPANION_HC
#define USBPORT_TMFLAG_TIMER_QUEUED
#define TRANSFER_FLAG_COMPLETED
#define USBPORT_TMFLAG_HC_RESUME
struct _USBPORT_ENDPOINT USBPORT_ENDPOINT
#define USBPORT_FLAG_REGISTERED_FDO
#define ENDPOINT_FLAG_NUKE
#define INVALIDATE_ENDPOINT_ONLY
#define USBD_FLAG_ALLOCATED_MDL
#define TRANSFER_FLAG_SPLITED
struct _USB2_HC_EXTENSION * PUSB2_HC_EXTENSION
#define USBPORT_TMFLAG_IDLE_QUEUEITEM_ON
struct _USB2_HC_EXTENSION USB2_HC_EXTENSION
#define INVALIDATE_ENDPOINT_WORKER_DPC
#define USBPORT_FLAG_INTERRUPT_ENABLED
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFINTERRUPT * Interrupt
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_Must_inspect_result_ _In_ WDFCMRESLIST List
_In_ WDFTIMER _In_ LONGLONG DueTime
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
_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
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID ServiceContext
#define PLUGPLAY_REGKEY_DEVICE
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
#define PCI_WHICHSPACE_CONFIG
_Inout_ struct _IRP _In_ PVOID MapRegisterBase
enum _IO_ALLOCATION_ACTION IO_ALLOCATION_ACTION
@ DeallocateObjectKeepRegisters
#define IRP_MJ_SYSTEM_CONTROL
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
_In_opt_ PVOID DeferredContext
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
#define ROUND_TO_PAGES(Size)
#define MmGetMdlVirtualAddress(_Mdl)
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)
#define ADDRESS_AND_SIZE_TO_SPAN_PAGES(_Va, _Size)
#define ObReferenceObject