[wdmaudiodev] Re: Virtual Audio Driver: Interacting with user-space application
- From: Tim Roberts <timr@xxxxxxxxx>
- To: wdmaudiodev@xxxxxxxxxxxxx
- Date: Mon, 15 Jun 2020 20:57:00 -0700
On Jun 15, 2020, at 8:32 PM, Oleg Vorobiov <isnullxbh@xxxxxxxxx> wrote:
I usually register my own device interface in the audio driver
Are you talking about the IoRegisterDeviceInterface function?
Yes.
I thought that I could register an additional IO device and use it for
writing audio data to the driver. I was trying to register an IO device as
follows (after PcInitializeAdapterDriver call in the DriverEntry function):
1. IoCreateDevice(DriverObject, ...)
2. IoRegisterDeviceInterface(DeviceObject, &PID_MSVAD, ...)
3. IoSetDeviceInterfaceState
4. IoCreateSymbolicLink(&DosDeviceName, $DeviceName)
but I got a failure in step 2.
It is not necessary to create another device. In fact, it will cause problems.
Remember, you need the device context from the original device in order to get
access to the data. (I assume you aren’t using globals.) You really want the
same device.
IoRegisterDeviceInterface only works with PnP devices. Your IoCreateDevice
call is creating a non-PnP device. That’s why it failed. Also remember that
IoRegisterDeviceInterface needs to be passed a PDO, not an FDO, for reasons
that aren’t clear to me. You get your PDO in AddDevice.
In summary, I'm not sure that I understand correctly how to write data from a
user-space application to the driver based on 'micarray’.
—
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
Other related posts: