[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 22d1e7a4e4 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 <oleg.dubinskiy@reactos.org>
This commit is contained in:
Carl J. Bialorucki 2025-02-21 17:34:22 -07:00
parent 1acaa988bc
commit 85d6175995

View file

@ -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: