svn path=/trunk/; revision=43869
IN PVOID Tag) PURE;
STDMETHOD_(BOOL, HasLastMappingFailed)(THIS) PURE;
IN PVOID Tag) PURE;
STDMETHOD_(BOOL, HasLastMappingFailed)(THIS) PURE;
- STDMETHOD_(VOID, PrintQueueStatus)(THIS) PURE;
+ STDMETHOD_(ULONG, GetCurrentIrpOffset)(THIS) PURE;
STDMETHOD_(VOID, SetMinimumDataThreshold)(THIS_
IN ULONG MinimumDataThreshold) PURE;
STDMETHOD_(ULONG, GetMinimumDataThreshold)(THIS) PURE;
STDMETHOD_(VOID, SetMinimumDataThreshold)(THIS_
IN ULONG MinimumDataThreshold) PURE;
STDMETHOD_(ULONG, GetMinimumDataThreshold)(THIS) PURE;
IN PVOID Tag); \
\
STDMETHODIMP_(BOOL) HasLastMappingFailed(THIS); \
IN PVOID Tag); \
\
STDMETHODIMP_(BOOL) HasLastMappingFailed(THIS); \
- STDMETHODIMP_(VOID) PrintQueueStatus(THIS); \
+ STDMETHODIMP_(ULONG) GetCurrentIrpOffset(THIS); \
STDMETHODIMP_(VOID) SetMinimumDataThreshold( \
IN ULONG MinimumDataThreshold); \
STDMETHODIMP_(ULONG) GetMinimumDataThreshold(VOID)
STDMETHODIMP_(VOID) SetMinimumDataThreshold( \
IN ULONG MinimumDataThreshold); \
STDMETHODIMP_(ULONG) GetMinimumDataThreshold(VOID)
virtual ~CIrpQueue(){}
protected:
virtual ~CIrpQueue(){}
protected:
+ volatile ULONG m_CurrentOffset;
LONG m_NumMappings;
ULONG m_NumDataAvailable;
BOOL m_StartStream;
LONG m_NumMappings;
ULONG m_NumDataAvailable;
BOOL m_StartStream;
// ASSERT(StreamHeader);
// add to current offset
// ASSERT(StreamHeader);
// add to current offset
- m_CurrentOffset += BytesWritten;
+ InterlockedExchangeAdd((volatile PLONG)&m_CurrentOffset, (LONG)BytesWritten);
// decrement available data counter
m_NumDataAvailable -= BytesWritten;
// decrement available data counter
m_NumDataAvailable -= BytesWritten;
-CIrpQueue::PrintQueueStatus()
+CIrpQueue::GetCurrentIrpOffset()
+ return m_CurrentOffset;
else if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING)
{
Position->PlayOffset = Pin->m_Position.PlayOffset % Pin->m_Position.WriteOffset;
else if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING)
{
Position->PlayOffset = Pin->m_Position.PlayOffset % Pin->m_Position.WriteOffset;
- Position->WriteOffset = Pin->m_IrpQueue->NumData();
+ Position->WriteOffset = (ULONGLONG)Pin->m_IrpQueue->GetCurrentIrpOffset();
+ DPRINT("Play %lu Write %lu\n", Position->PlayOffset, Position->WriteOffset);
if (NT_SUCCESS(Status))
{
if (NT_SUCCESS(Status))
{
- if (m_Capture)
- m_Position.WriteOffset += Data;
- else
- m_Position.WriteOffset += Data;
+ m_Position.WriteOffset += Data;