Hi Tim, after some work I had a little progress about
communication between user-mode app and virtual driver
I’was possible to get the sub-device handle calling CreateFile.
I also created a dispatcher function in the virtual driver
to handle this class of IRPs:
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = NREngineHandler;
My first naive approach was, send a custom IOCTL from user-mode app to virtual driver and copy a chunk of data from the cyclic buffer represented by m_pDmaBuffer to a buffer allocated from user-mode app and then save it in a wav file:
bRc = DeviceIoControl(hDevice, (DWORD)IOCTL_NRIOCTL_METHOD_IN_BUFFERED, NULL, 0, &outputBuffer, outputBufferSize, &bytesReturned, NULL );
Of course, it does not work :)
I read in other threads from this forum that some additional cyclic buffers need to be created to hold copies from the original ones and then, send IOCTLs from user-mode app to copy from these auxiliary buffers instead of the original ones.
And also, the buffers copied along with notifications need to be enqueued in a mechanism like Inverted call model as describe here:
https://www.osr.com/nt-insider/2013-issue1/inverted-call-model-kmdf/
to notify the application that buffers were filled by audio engine and are "ready" to be read or written to/from user-mode application.
I was thinking to create a copy of cyclic buffers and then read/write then from:
CMiniportWaveRTStream::ReadBytes and CMiniportWaveRTStream::WriteBytes functions
but I'm not sure if it's the right way.
If you could provide some more details about this communication mechanism would help me a lot,
Thanks