[NTOS:IO] Implement IoConnectInterruptEx for fully specified interrupt types (#5416)

Implement IoConnectInterruptEx() for CONNECT_FULLY_SPECIFIED.
This gives ability to load various modern drivers that use IoConnectInterruptEx.

Various drivers work after this change, such as serial.sys MS sample driver when compiled with the reactos tree and many more KMDF drivers from later Windows versions.

Co-authored-by: Victor Perevertkin <victor@perevertkin.ru>
This commit is contained in:
Justin Miller 2023-07-14 16:17:27 -07:00 committed by GitHub
parent 8ce4b73920
commit dabe7fba46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 60 additions and 0 deletions

View file

@ -166,4 +166,62 @@ IoDisconnectInterrupt(PKINTERRUPT InterruptObject)
ExFreePool(IoInterrupt); // ExFreePoolWithTag(IoInterrupt, TAG_KINTERRUPT);
}
NTSTATUS
IopConnectInterruptExFullySpecific(
_Inout_ PIO_CONNECT_INTERRUPT_PARAMETERS Parameters)
{
NTSTATUS Status;
PAGED_CODE();
/* Fallback to standard IoConnectInterrupt */
Status = IoConnectInterrupt(Parameters->FullySpecified.InterruptObject,
Parameters->FullySpecified.ServiceRoutine,
Parameters->FullySpecified.ServiceContext,
Parameters->FullySpecified.SpinLock,
Parameters->FullySpecified.Vector,
Parameters->FullySpecified.Irql,
Parameters->FullySpecified.SynchronizeIrql,
Parameters->FullySpecified.InterruptMode,
Parameters->FullySpecified.ShareVector,
Parameters->FullySpecified.ProcessorEnableMask,
Parameters->FullySpecified.FloatingSave);
DPRINT("IopConnectInterruptEx_FullySpecific: has failed with status %X", Status);
return Status;
}
NTSTATUS
NTAPI
IoConnectInterruptEx(
_Inout_ PIO_CONNECT_INTERRUPT_PARAMETERS Parameters)
{
PAGED_CODE();
switch (Parameters->Version)
{
case CONNECT_FULLY_SPECIFIED:
return IopConnectInterruptExFullySpecific(Parameters);
case CONNECT_FULLY_SPECIFIED_GROUP:
//TODO: We don't do anything for the group type
return IopConnectInterruptExFullySpecific(Parameters);
case CONNECT_MESSAGE_BASED:
DPRINT1("FIXME: Message based interrupts are UNIMPLEMENTED\n");
break;
case CONNECT_LINE_BASED:
DPRINT1("FIXME: Line based interrupts are UNIMPLEMENTED\n");
break;
}
return STATUS_SUCCESS;
}
VOID
NTAPI
IoDisconnectInterruptEx(
_In_ PIO_DISCONNECT_INTERRUPT_PARAMETERS Parameters)
{
PAGED_CODE();
//FIXME: This eventually will need to handle more cases
if (Parameters->ConnectionContext.InterruptObject)
IoDisconnectInterrupt(Parameters->ConnectionContext.InterruptObject);
}
/* EOF */

View file

@ -362,6 +362,7 @@
@ stdcall IoCheckShareAccess(long long ptr ptr long)
@ stdcall IoCompleteRequest(ptr long)
@ stdcall IoConnectInterrupt(ptr ptr ptr ptr long long long long long long long)
@ stdcall -version=0x600+ IoConnectInterruptEx(ptr)
@ stdcall IoCreateController(long)
@ stdcall IoCreateDevice(ptr long ptr long long long ptr)
@ stdcall IoCreateDisk(ptr ptr)
@ -390,6 +391,7 @@
@ extern IoDeviceHandlerObjectType
@ extern IoDeviceObjectType
@ stdcall IoDisconnectInterrupt(ptr)
@ stdcall -version=0x600+ IoDisconnectInterruptEx(ptr)
@ extern IoDriverObjectType
@ stdcall IoEnqueueIrp(ptr)
@ stdcall IoEnumerateDeviceObjectList(ptr ptr long ptr)