KM->UM->KM ?

First off, my application is a VAD that shall stream audio via a UM appl to a target sound device. Ultimately, the VAD’s
“capabilities” should reflect those of the target sound device.

So I had an idea that I’d do something like this: In NewStream handler (WaveCyclic impl), I check for a pending IRP (that the
appl has enqueued), if there is none I return failure. Otherwise I complete the IRP with the WAVEFORMATEX of the client trying
to open the stream, then I sit and wait upon a device internal event (with timeout). Now:

  1. The appl handles the overlapped event and checks with the target device if the format is supported or not,
    and do a DeviceIoCtrl to the device indicating which. This sets the internal event in the device, and NewStream can continue
    processing and return success or failure.
  2. The event times out, in which case NewStream returns failure.

Is it a feasible approach ? Or can it be done simpler ?

TIA
/Rob

Quite feasible. Instead of waiting on an event and blocking a thread, i would set a timer. When the 2nd ioctl comes in, you attempt to cancel the timer.

d

dent from a phpne with no keynoard

-----Original Message-----
From: Robert Bielik
Sent: November 06, 2010 11:52 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] KM->UM->KM ?

First off, my application is a VAD that shall stream audio via a UM appl to a target sound device. Ultimately, the VAD’s
“capabilities” should reflect those of the target sound device.

So I had an idea that I’d do something like this: In NewStream handler (WaveCyclic impl), I check for a pending IRP (that the
appl has enqueued), if there is none I return failure. Otherwise I complete the IRP with the WAVEFORMATEX of the client trying
to open the stream, then I sit and wait upon a device internal event (with timeout). Now:
1. The appl handles the overlapped event and checks with the target device if the format is supported or not,
and do a DeviceIoCtrl to the device indicating which. This sets the internal event in the device, and NewStream can continue
processing and return success or failure.
2. The event times out, in which case NewStream returns failure.

Is it a feasible approach ? Or can it be done simpler ?

TIA
/Rob


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Doron Holan skrev 2010-11-07 16:55:

Quite feasible. Instead of waiting on an event and blocking a thread, i would set a timer. When the 2nd ioctl comes in, you attempt to cancel the timer.

But the NewStream function is synchronous and returns a status, so I need to block in it, don’t I ? Or are you suggesting to mark the Irp
pending ? Seems a bit fragile to do that since I don’t know what the PortCls port driver does after I return from the function. Besides I
don’t know how to get to the Irp in the first place in the context of the NewStream function…

/Rob

d

dent from a phpne with no keynoard

-----Original Message-----
From: Robert Bielik
> Sent: November 06, 2010 11:52 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] KM->UM->KM ?
>
>
> First off, my application is a VAD that shall stream audio via a UM appl to a target sound device. Ultimately, the VAD’s
> “capabilities” should reflect those of the target sound device.
>
> So I had an idea that I’d do something like this: In NewStream handler (WaveCyclic impl), I check for a pending IRP (that the
> appl has enqueued), if there is none I return failure. Otherwise I complete the IRP with the WAVEFORMATEX of the client trying
> to open the stream, then I sit and wait upon a device internal event (with timeout). Now:
> 1. The appl handles the overlapped event and checks with the target device if the format is supported or not,
> and do a DeviceIoCtrl to the device indicating which. This sets the internal event in the device, and NewStream can continue
> processing and return success or failure.
> 2. The event times out, in which case NewStream returns failure.
>
> Is it a feasible approach ? Or can it be done simpler ?
>
> TIA
> /Rob
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Doron Holan skrev 2010-11-07 16:55:

Quite feasible. Instead of waiting on an event and blocking a thread, i would set a timer. When the 2nd ioctl comes in, you attempt to cancel the timer.

Since the NewStream call is synchronous (I need to return success/failure), I went with the event approach and it seems to be working nicely :slight_smile:

/Rob