none
AVStrMiniPinProcess routine NOT triggered RRS feed

  • Question

  • Hi, I'm developing an AVStream Mini Driver, reusing code from the AVStream simulated hardware example. Currently me KSPIN_DESCRIPTOR_EX structure and KSPIN_DISPATCH look like this.

    const KSPIN_DESCRIPTOR_EX FilterPinDescriptors_AVSHWS[AVSHWS_FILTER_PIN_COUNT] = {
      //
      // Video Capture Pin
      //
        {
          &PinDispatch_AVSHWS,                // Dispatch Table
          &PinAutomation,                     // Automatation Table
          {                                   // Pin Descriptor START
            0,                                  // Interfaces Count (NULL, 0 == default)
            NULL,                               // Interfaces
            0,                                  // Mediums Count (NULL, 0 == default)
            NULL,                               // Mediums
            SIZEOF_ARRAY(PinDataRanges_AVSHWS), // Range Count
            PinDataRanges_AVSHWS,               // Ranges
            KSPIN_DATAFLOW_OUT,                 // Dataflow
            KSPIN_COMMUNICATION_BOTH,           // Communication
            &PIN_CATEGORY_CAPTURE,              // Category
            &g_PINNAME_VIDEO_CAPTURE_AVSHWS,    // Name
            0                                   // Reserved
          },                                  // Pin Descriptor END
    #ifdef _X86_                                
          KSPIN_FLAG_GENERATE_MAPPINGS |      // Pin Flags
    #endif
          KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY,
          1,                                  // Instances Possible
          0,                                  // Instances Necessary
          &PinAllocatorFraming_AVSHWS,        // Allocator Framing
          reinterpret_cast <PFNKSINTERSECTHANDLEREX>
          (CCapturePin_AVSHWS::IntersectHandler)
        }
    };
    const KSPIN_DISPATCH PinDispatch_AVSHWS = {
      CCapturePin_AVSHWS::DispatchCreate_AVSHWS,     // Pin Create
      NULL,                                          // Pin Close
      CCapturePin_AVSHWS::DispatchProcess_AVSHWS,    // Pin Process
      NULL,                                          // Pin Reset
      CCapturePin_AVSHWS::DispatchSetFormat_AVSHWS,  // Pin Set Data Format
      CCapturePin_AVSHWS::DispatchSetState_AVSHWS,   // Pin Set Device State
      NULL,                                          // Pin Connect
      NULL,                                          // Pin Disconnect
      NULL,                                          // Clock Dispatch
      NULL                                           // Allocator Dispatch
    };

    My create routine (CCapturePin_AVSHWS::DispatchCreate_AVSHWS) does get triggered by Ks.sys (class driver), but, my process routine (CCapturePin_AVSHWS::DispatchProcess_AVSHWS) does NOT get triggered by Ks.sys. Here is a trace of the Ks.sys execution.

    ks!CKsQueue::AddFrame:
    8cc3784a 8bff                    mov     edi,edi
    ks!CKsQueue::AddFrame+0x2:
    8cc3784c 55                      push    ebp
    ks!CKsQueue::AddFrame+0x3:
    8cc3784d 8bec                    mov     ebp,esp
    ks!CKsQueue::AddFrame+0x5:
    8cc3784f 51                      push    ecx
    ks!CKsQueue::AddFrame+0x6:
    8cc37850 51                      push    ecx
    ks!CKsQueue::AddFrame+0x7:
    8cc37851 53                      push    ebx
    ks!CKsQueue::AddFrame+0x8:
    8cc37852 56                      push    esi
    ks!CKsQueue::AddFrame+0x9:
    8cc37853 57                      push    edi
    ks!CKsQueue::AddFrame+0xa:
    8cc37854 8bf1                    mov     esi,ecx
    ks!CKsQueue::AddFrame+0xc:
    8cc37856 a10850c48c              mov     eax,dword ptr [ks!WPP_GLOBAL_Control (8cc45008)]
    ks!CKsQueue::AddFrame+0x11:
    8cc3785b 3d0850c48c              cmp     eax,offset ks!WPP_GLOBAL_Control (8cc45008)
    ks!CKsQueue::AddFrame+0x16:
    8cc37860 7419                    je      ks!CKsQueue::AddFrame+0x31 (8cc3787b)
    ks!CKsQueue::AddFrame+0x18:
    8cc37862 80781d05                cmp     byte ptr [eax+1Dh],5
    ks!CKsQueue::AddFrame+0x1c:
    8cc37866 7213                    jb      ks!CKsQueue::AddFrame+0x31 (8cc3787b)
    ks!CKsQueue::AddFrame+0x31:
    8cc3787b 8d9eac000000            lea     ebx,[esi+0ACh]
    ks!CKsQueue::AddFrame+0x37:
    8cc37881 8bcb                    mov     ecx,ebx
    ks!CKsQueue::AddFrame+0x39:
    8cc37883 ff15d042c48c            call    dword ptr [ks!_imp_KfAcquireSpinLock (8cc442d0)]
    ks!CKsQueue::AddFrame+0x3f:
    8cc37889 8b7d08                  mov     edi,dword ptr [ebp+8]
    ks!CKsQueue::AddFrame+0x42:
    8cc3788c 8845ff                  mov     byte ptr [ebp-1],al
    ks!CKsQueue::AddFrame+0x45:
    8cc3788f 8b4f20                  mov     ecx,dword ptr [edi+20h]
    ks!CKsQueue::AddFrame+0x48:
    8cc37892 8b4124                  mov     eax,dword ptr [ecx+24h]
    ks!CKsQueue::AddFrame+0x4b:
    8cc37895 8d8ea4000000            lea     ecx,[esi+0A4h]
    ks!CKsQueue::AddFrame+0x51:
    8cc3789b 8b5104                  mov     edx,dword ptr [ecx+4]
    ks!CKsQueue::AddFrame+0x54:
    8cc3789e 890f                    mov     dword ptr [edi],ecx
    ks!CKsQueue::AddFrame+0x56:
    8cc378a0 895704                  mov     dword ptr [edi+4],edx
    ks!CKsQueue::AddFrame+0x56:
    8cc378a0 895704                  mov     dword ptr [edi+4],edx
    ks!CKsQueue::AddFrame+0x59:
    8cc378a3 8945f8                  mov     dword ptr [ebp-8],eax
    ks!CKsQueue::AddFrame+0x5c:
    8cc378a6 390a                    cmp     dword ptr [edx],ecx
    ks!CKsQueue::AddFrame+0x5e:
    8cc378a8 7405                    je      ks!CKsQueue::AddFrame+0x65 (8cc378af)
    ks!CKsQueue::AddFrame+0x65:
    8cc378af 893a                    mov     dword ptr [edx],edi
    ks!CKsQueue::AddFrame+0x67:
    8cc378b1 897904                  mov     dword ptr [ecx+4],edi
    ks!CKsQueue::AddFrame+0x6a:
    8cc378b4 8b8e48010000            mov     ecx,dword ptr [esi+148h]
    ks!CKsQueue::AddFrame+0x70:
    8cc378ba 8b4130                  mov     eax,dword ptr [ecx+30h]
    ks!CKsQueue::AddFrame+0x73:
    8cc378bd 85c0                    test    eax,eax
    ks!CKsQueue::AddFrame+0x75:
    8cc378bf 0f9445fe                sete    byte ptr [ebp-2]
    ks!CKsQueue::AddFrame+0x79:
    8cc378c3 85c0                    test    eax,eax
    ks!CKsQueue::AddFrame+0x7b:
    8cc378c5 750a                    jne     ks!CKsQueue::AddFrame+0x87 (8cc378d1)

    The last line (8cc378c5 750a                    jne     ks!CKsQueue::AddFrame+0x87 (8cc378d1)) is where the Ks.sys class driver does "something" that avoids my process routine from being triggered.

    ¿Can anyone give me a hint of why an AVStrMiniPinProcess could not be triggered?. According to me, KSPIN_DESCRIPTOR_EX structure and KSPIN_DISPATCH have the appropriate settings.

    Tuesday, October 7, 2014 4:13 AM