[wdmaudiodev] 回复: Re: for help in implementation virtual audio driver

  • From: Weiji Zheng <weiji_zheng@xxxxxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Thu, 20 Jul 2006 14:28:24 +0800 (CST)

hi, Vargheese
   
  actaully, my own application can open the MSVAD if I modify code in 
IRP_MAJOR_CREATE as following:
   
  //dispatch function
extern "C"
NTSTATUS
PCP_Create
(
    IN      PDEVICE_OBJECT  pDeviceObject,
    IN      PIRP            pIrp
)
{
 PIO_STACK_LOCATION IrpStack = IoGetCurrentIrpStackLocation(pIrp);
 NTSTATUS ntStatus = STATUS_SUCCESS;
  
  pIrp->IoStatus.Status = STATUS_SUCCESS;
  pIrp->IoStatus.Information = 0;
  IoCompleteRequest(pIrp, IO_NO_INCREMENT);
  return STATUS_SUCCESS;
}
   
  but Graph Edit DOES not open the MSVAD(simple) because adapter driver does 
not dispatch IRP to PortCIs driver.
   
  Regards,
  --weiji zheng
  

  

Vargheese Baby <vargheese.baby@xxxxxxxxxxxxxxx> 写道:
        v\:* {behavior:url(#default#VML);}  o\:* {behavior:url(#default#VML);}  
w\:* {behavior:url(#default#VML);}  .shape {behavior:url(#default#VML);}        
st1\:*{behavior:url(#default#ieooui) }                Hi Weiji,
  I tried “IoRegisterDeviceInterface()” with MSVAD. Its not working for me. 
The following method will help you.
  In DriverEntry
  First call PcInitializeAdapterDriver
  Then assign your dispatch routines
   
  In AddDevice
  IoCreateDevice
  IoCreateSymbolicLink
   
  In Application
  Open the handle by CreateFile()
   
  Regards
  Vargheese
   
      
---------------------------------
  
  From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Weiji Zheng
Sent: Thursday, July 20, 2006 10:19 AM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] for help in implementation virtual audio driver

   
    Hi

     

    I am developing one project, that is, PCM data is transfered into MSVAD by 
usr mode, and MSVAD then put these PCM data into another application based on 
DirectSound, such as Skype, that means MSVAD will be open simultaneously both 
the applications.

     

    Actaully, I encounter the same question as following: 

1. how can I get the handle of the MSVAD(Simple)? 
2. I tried to use IoRegisterDeviceInterface() in AddDevice() of MSVAD(Simple), 
and then in my user mode application I use SetupDiGetDeviceInterfaceDetail() 
and CreateFile() to get the handle of the MSVAD device. It seems that I can get 
the handle of the MSVAD(Simple), but the Graph Edit con not find any device 
about MSVAD, Do you have any idea about this? 

     

    Maybe the implementation in IRP_MAJOR_CREATE is one key.

     

    //dispatch function
extern "C"
NTSTATUS
PCP_Create
(
    IN      PDEVICE_OBJECT  pDeviceObject,
    IN      PIRP            pIrp
)
{
 PIO_STACK_LOCATION IrpStack = IoGetCurrentIrpStackLocation(pIrp);
 //PDEVICE_EXTENSION pDevExt = 
(PDEVICE_EXTENSION)pDeviceObject->DeviceExtension;
 NTSTATUS ntStatus = STATUS_SUCCESS;
    
 DPF(D_TERSE, ("[enter PCP_Create]"));
 
 
 DbgPrint("the Flags is 0x%x\n", pIrp->Flags);
 DbgPrint("the RequestorMode is 0x%x\n", pIrp->RequestorMode);

     if(pIrp->RequestorMode == 0x1) //my own application
 {// Complete successfully
  pIrp->IoStatus.Status = STATUS_SUCCESS;
  pIrp->IoStatus.Information = 0;
  IoCompleteRequest(pIrp, IO_NO_INCREMENT);
  return STATUS_SUCCESS;
 }
 else //Graph Edit
 {
   //
   // Pass the IRPs on to PortCls
   //
   ntStatus = PcDispatchIrp( pDeviceObject, pIrp );
  if(NT_SUCCESS(ntStatus))
   DbgPrint("success to open device\n");
  else
   DbgPrint("fail to open device\n");
  return ntStatus;
 }
 
 
}

     

    But when I run own application(not Graph Edit), the system crash!

     

    so would you please give me some advice.

     

    thanks for any help.

     

    best regards

     

    --weiji zheng

    
    
---------------------------------
  
  雅虎免费邮箱-3.5G容量,20M附件 



                
---------------------------------
 雅虎1G免费邮箱百分百防垃圾信

Other related posts: