Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-19232

[AUDIO] Our implementation of KsRead/WriteFile functions is broken

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 0.4.15
    • Drivers: Other
    • None
    • VirtualBox 7.0.10 with our inbuilt AC97 driver used.

    Description

      When calling KsReadFile or KsWriteFile functions from our Kernel Streaming driver (ks.sys), they are not functioning as expected. After the call is performed, an assert from KspDispatchIrp is appearing, as visisble in ks.log:

      *** Assertion failed: IoStack->FileObject
      ***   Source File: ../drivers/ksfilter/ks/irp.c, line 1971
      Break repeatedly, break Once, Ignore, terminate Process or terminate Thread (boipt)?  

      https://git.reactos.org/?p=reactos.git;a=blob;f=drivers/ksfilter/ks/irp.c;h=91302e67299470371dd047ec642469f71c831098;hb=HEAD#l1955

      The reasons why it's happening are, we actually 1) don't finish IRP initialization correctly (don't fill the rest of its data besides the one is initialized by IoBuildSynchronousFsdRequest), 2) don't setup the appropriate IO_STACK_LOCATION structure for the IRP, before calling the driver's read/write routine.
      Therefore, to fix this problem, we need to do all these things (those are described above).
      I'm going to fix this, and will open a new PR soon.
      I can confirm: after my changes, the issue is fixed, and these functions are working correctly, as expected.
      Discovered this during my audio investigations.

      Attachments

        Activity

          People

            Oleg Dubinskij Oleg Dubinskiy
            Oleg Dubinskij Oleg Dubinskiy
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: