From 85d6175995fbad766129e6681eae5b3ae99fe383 Mon Sep 17 00:00:00 2001 From: "Carl J. Bialorucki" Date: Fri, 21 Feb 2025 17:34:22 -0700 Subject: [PATCH] [0.4.15][KS] Restore old hack for MS portcls Hackfix for CORE-17237. Restores an old hack required by MS portcls driver. Replaces the current hack from 22d1e7a4e4175b2d579428493434eaab28323cca with an old one that was removed in 563682ad9a5751a7d5c3f9ffb4ac4f67bf0adc71 This allows ReactOS to boot and play sound properly with the portcls.sys driver from Windows XP/2003. Co-Authored-By: Oleg Dubinskiy --- drivers/ksfilter/ks/irp.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/ksfilter/ks/irp.c b/drivers/ksfilter/ks/irp.c index 01ee18c2832..e97384b2ebd 100644 --- a/drivers/ksfilter/ks/irp.c +++ b/drivers/ksfilter/ks/irp.c @@ -940,6 +940,9 @@ ProbeMdl: goto ProbeMdl; } + // HACK for MS portcls + HeaderSize = Length; + /* probe user mode buffers */ if (Length && ( (!HeaderSize) || (Length % HeaderSize == 0) || ((ProbeFlags & KSPROBE_ALLOWFORMATCHANGE) && (Length == sizeof(KSSTREAM_HEADER))) ) ) { @@ -1683,18 +1686,6 @@ KsAddIrpToCancelableQueue( DPRINT("KsAddIrpToCancelableQueue QueueHead %p SpinLock %p Irp %p ListLocation %x DriverCancel %p\n", QueueHead, SpinLock, Irp, ListLocation, DriverCancel); - // HACK for ms portcls - if (IoStack->MajorFunction == IRP_MJ_CREATE) - { - // complete the request - DPRINT1("MS HACK\n"); - Irp->IoStatus.Status = STATUS_SUCCESS; - CompleteRequest(Irp, IO_NO_INCREMENT); - - return; - } - - if (!DriverCancel) { /* default to KsCancelRoutine */ @@ -2053,6 +2044,9 @@ KsSetMajorFunctionHandler( { DPRINT("KsSetMajorFunctionHandler Function %x\n", MajorFunction); + // HACK for MS portcls + DriverObject->MajorFunction[IRP_MJ_CREATE] = KspCreate; + switch ( MajorFunction ) { case IRP_MJ_CREATE: