[wdmaudiodev] [Q] Vendor-specific command to USB audio device (Win2k)

  • From: "rai" <rai.nuaa@xxxxxxx>
  • To: "wdmaudiodev" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Wed, 31 Aug 2005 11:00:04 +0800

Hi There,
I want to send vendor-specific commands to an USB audio device.
My current method is: write an upper filter driver attached to "USB Composite 
Device" or "USB Audio Device",
application send user-defined io-control command to the filter driver,
then the filter build an URB to lower device.
It can work under WinXP, but fail under Win2K.
Each time when the filter call IoCallDriver, lower device always return 
c0000001 (STATUS_UNSUCCESSFUL)

"USB Composite Device" and "USB Audio Device" on Win2K do not support 
vendor-specific commands?
Any suggestion are welcome.
Thanks.


Below is my source code:

        fx = URB_FUNCTION_VENDOR_DEVICE;
        urbSize = sizeof(struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST);

        Urb = ExAllocatePool(NonPagedPool,urbSize);
        if (!Urb)               return STATUS_NO_MEMORY;

    UsbBuildVendorRequest(
            Urb,         
            fx,
            urbSize,
            TransferFlags,
            0,
            bRequest,
            wValue,
            wIndex, 
            pData,
            NULL,
            *pwLength,
            NULL);
    if (pData && (TransferFlags & USBD_TRANSFER_DIRECTION_IN))
        RtlFillMemory(pData, *pwLength, 0);

    KeInitializeEvent(&Event, NotificationEvent, FALSE);

    irp = IoBuildDeviceIoControlRequest(
            IOCTL_INTERNAL_USB_SUBMIT_URB,
            pDeviceExtension->topDevObj,
            NULL,
            0,
            NULL,
            0,
            TRUE, 
            &Event,
            &IoStatus);

    NextStack = IoGetNextIrpStackLocation(irp);
    NextStack->Parameters.Others.Argument1 = Urb;

    NtStatus = IoCallDriver(pDeviceExtension->topDevObj, irp);
                            
//return c0000001 always ...






Best Regards
Yi Zhang
2005-08-31


******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.com/

Other related posts:

  • » [wdmaudiodev] [Q] Vendor-specific command to USB audio device (Win2k)