[wdmaudiodev] Re: AVStream Clock CorrelatedTime Callback Invalid PKSPIN

  • From: Matthew van Eerde <Matthew.van.Eerde@xxxxxxxxxxxxx>
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Fri, 23 Aug 2013 14:37:26 +0000

From ks.h:

    _In_ PKSPIN Pin,
    _Out_ PLONGLONG SystemTime

Try adding FASTCALL to your DispatchCorrelatedTime declaration:

static LONGLONG FASTCALL DispatchCorrelatedTime ...

If you add /Gr to your compiler flags, that will cause the compiler to default 
to FASTCALL for functions which don't have an explicit calling convention.

From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Richard Lince
Sent: Friday, August 23, 2013 4:15 AM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] AVStream Clock CorrelatedTime Callback Invalid PKSPIN

Hi folks,

Im trying to Implement an audio clock in an AVStream driver as follows, 
however, the callback argument is an invalid pin pointer (and 'this' pointer in 

It seems to be common on the internet as an issue with no resolution, any ideas?

//class header

const static KSCLOCK_DISPATCH AudioClockDispatch;

static LONGLONG DispatchCorrelatedTime (  IN PKSPIN Pin,  OUT PLONGLONG 


   // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!  invalid PKSPIN Pin on callback  

    return (reinterpret_cast <CCaptureAudioPin *> (Pin -> Context)) -> 
CorrelatedTime ( Pin, SystemTime);

//class body

const KSCLOCK_DISPATCH CCaptureAudioPin::AudioClockDispatch = {
const KSPIN_DISPATCH CaptureAudioPinDispatch = {
    CCaptureAudioPin::DispatchCreate,       // Pin Create
    NULL,                                   // Pin Close
    CCaptureAudioPin::DispatchProcess,      // Pin Process
    NULL,                                   // Pin Reset
    CCaptureAudioPin::DispatchSetFormat,    // Pin Set Data Format
    CCaptureAudioPin::DispatchSetState,     // Pin Set Device State
    NULL,                                   // Pin Connect
    NULL,                                   // Pin Disconnect
    &CCaptureAudioPin::AudioClockDispatch,  // Clock Dispatch
    NULL                                    // Allocator Dispatch

Compiles and callback time is fine.

Thanks in advance if you have any ideas.


This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com

Other related posts: