Queue callback gets hangs RRS feed

  • Question

  • Hi all,

    i am trying to send the request from one driver to another driver using wdfrequestsend in asyn format, below is my code snifset

    CaifMuxEvtDeviceAdd(WDFDRIVER Driver, PWDFDEVICE_INIT DeviceInit)


      //To Create Remote IO target
     status = WdfIoTargetCreate(device,
     if(!NT_SUCCESS(status)) {
      MUXDBG(("\nRFM WdfIoTargetCreate Failed 0x%0x\n",status));
      return (status);


     status = WdfIoTargetOpen(ioTarget,
     if(!NT_SUCCESS(status)) {
      MUXDBG(("\nRFM WdfIoTargetOpen Failed 0x%0x\n",status));
      return (status);

    ..........create queue


    MuxEvtWrite(WDFQUEUE  Queue, WDFREQUEST  Request, size_t  Length)
     NTSTATUS status;
     WDFREQUEST localRequest;
     WDFMEMORY inBuffer;
     WDF_OBJECT_ATTRIBUTES reqAttributes;


        devContext = CaifMuxGetContextFromDevice(
                                    WdfIoQueueGetDevice(Queue) );

     status = WdfRequestRetrieveInputMemory(Request, &inBuffer);
      MUXDBGERR(("\n MUX WdfRequestRetrieveInputBuffer Failed 0x%0x\n",status));
      WdfRequestCompleteWithInformation(Request, status, 0);
     reqAttributes.ParentObject = devContext->fTarget;
     status = WdfRequestCreate(&reqAttributes, devContext->fTarget, &localRequest);
     if(!NT_SUCCESS(status)) {
      MUXDBGERR(("\n MUX WdfRequestCreate failed 0x%0x\n",status));

     status = WdfIoTargetFormatRequestForWrite(devContext->fTarget,localRequest, inBuffer, NULL, NULL);
     if(!NT_SUCCESS(status)) {
      MUXDBGERR(("\n MUX WdfIoTargetFormatRequestForWrite failed 0x%0x\n",status));

     WdfRequestSetCompletionRoutine(localRequest, EvtMuxWriteCompletionRoutine, devContext);

     if(!WdfRequestSend(localRequest, devContext->fTarget, WDF_NO_SEND_OPTIONS)) {
      MUXDBGERR(("\n MUX WdfRequestSend failed\n"));
      //To Get the status
      status = WdfRequestGetStatus(localRequest);
      if(!NT_SUCCESS(status)) {
       MUXDBGERR(("\n MUX WdfRequestGetStatus failed 0x%0x\n",status));
      MUXDBG(("\n WdfRequestComplete start\n"));
      WdfRequestComplete(localRequest, status);
      MUXDBG(("\n WdfRequestComplete End\n"));


        IN WDFREQUEST                  Request,
        IN WDFIOTARGET                 Target,
        IN WDFCONTEXT                  Context

    after the callback funtion called EvtMuxWriteCompletionRoutine and i am calling wdfobject(request) after this point system will hang

    Tuesday, March 6, 2012 11:17 AM


  • attach a debugger and see what is going on. perhaps you are stuck in a breakpoint. have you enabled kmdf verifier? that will probably help you figure out what is going wrong. you are also not completing the Request passed to MuxEvtWrite when you are in the completion routine, perhaps that is your hang (if it is a sequential queue, it won't present the next request until the current is completed).

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, March 6, 2012 5:13 PM