ReactOS  0.4.15-dev-3440-g915569a
CPortPinDMus Class Reference
Inheritance diagram for CPortPinDMus:
Collaboration diagram for CPortPinDMus:

Public Member Functions

STDMETHODIMP QueryInterface (REFIID InterfaceId, PVOID *Interface)
 
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 
 CPortPinDMus (IUnknown *OuterUnknown)
 
virtual ~CPortPinDMus ()
 

Public Attributes

 IMP_IPortPinDMus
 
 IMP_IServiceSink
 
 IMP_IMasterClock
 
 IMP_IAllocatorMXF
 

Protected Member Functions

VOID TransferMidiDataToDMus ()
 
VOID TransferMidiData ()
 

Protected Attributes

IPortDMus * m_Port
 
IPortFilterDMus * m_Filter
 
KSPIN_DESCRIPTOR * m_KsPinDescriptor
 
PMINIPORTDMUS m_Miniport
 
PSERVICEGROUP m_ServiceGroup
 
PMXF m_Mxf
 
ULONGLONG m_SchedulePreFetch
 
NPAGED_LOOKASIDE_LIST m_LookAsideEvent
 
NPAGED_LOOKASIDE_LIST m_LookAsideBuffer
 
PMINIPORTMIDI m_MidiMiniport
 
PMINIPORTMIDISTREAM m_MidiStream
 
KSSTATE m_State
 
PKSDATAFORMAT m_Format
 
KSPIN_CONNECTm_ConnectDetails
 
DMUS_STREAM_TYPE m_Capture
 
PDEVICE_OBJECT m_DeviceObject
 
IIrpQueue * m_IrpQueue
 
ULONG m_TotalPackets
 
ULONG m_PreCompleted
 
ULONG m_PostCompleted
 
ULONG m_LastTag
 
LONG m_Ref
 

Detailed Description

Definition at line 17 of file pin_dmus.cpp.

Constructor & Destructor Documentation

◆ CPortPinDMus()

CPortPinDMus::CPortPinDMus ( IUnknown OuterUnknown)
inline

Definition at line 43 of file pin_dmus.cpp.

43 {}

◆ ~CPortPinDMus()

virtual CPortPinDMus::~CPortPinDMus ( )
inlinevirtual

Definition at line 44 of file pin_dmus.cpp.

44 {}

Member Function Documentation

◆ QueryInterface()

NTSTATUS NTAPI CPortPinDMus::QueryInterface ( REFIID  InterfaceId,
PVOID Interface 
)

Definition at line 318 of file pin_dmus.cpp.

321 {
322 
323  if (IsEqualGUIDAligned(refiid, IID_IIrpTarget) ||
325  {
326  *Output = PVOID(PUNKNOWN(this));
327  PUNKNOWN(*Output)->AddRef();
328  return STATUS_SUCCESS;
329  }
330 
331  return STATUS_UNSUCCESSFUL;
332 }
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:240
void * PVOID
Definition: retypes.h:9
const GUID IID_IUnknown
ULONG AddRef()
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
Definition: arc.h:85
#define STATUS_SUCCESS
Definition: shellext.h:65

◆ STDMETHODIMP_() [1/2]

CPortPinDMus::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 22 of file pin_dmus.cpp.

23  {
25  return m_Ref;
26  }
#define InterlockedIncrement
Definition: armddk.h:53

◆ STDMETHODIMP_() [2/2]

CPortPinDMus::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 27 of file pin_dmus.cpp.

28  {
30 
31  if (!m_Ref)
32  {
33  delete this;
34  return 0;
35  }
36  return m_Ref;
37  }
#define InterlockedDecrement
Definition: armddk.h:52

◆ TransferMidiData()

VOID CPortPinDMus::TransferMidiData ( )
protected

Definition at line 201 of file pin_dmus.cpp.

202 {
204  PUCHAR Buffer;
207 
208  do
209  {
210  Status = m_IrpQueue->GetMapping(&Buffer, &BufferSize);
211  if (!NT_SUCCESS(Status))
212  {
213  return;
214  }
215 
216  if (m_Capture)
217  {
219  if (!NT_SUCCESS(Status))
220  {
221  DPRINT("Read failed with %x\n", Status);
222  return;
223  }
224  }
225  else
226  {
228  if (!NT_SUCCESS(Status))
229  {
230  DPRINT("Write failed with %x\n", Status);
231  return;
232  }
233  }
234 
235  if (!BytesWritten)
236  {
237  DPRINT("Device is busy retry later\n");
238  return;
239  }
240 
241  m_IrpQueue->UpdateMapping(BytesWritten);
242 
243  }while(TRUE);
244 
245 }
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
Definition: wdfiotarget.h:949
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define TRUE
Definition: types.h:120
unsigned char * PUCHAR
Definition: retypes.h:3
LONG NTSTATUS
Definition: precomp.h:26
IIrpQueue * m_IrpQueue
Definition: pin_dmus.cpp:72
DMUS_STREAM_TYPE m_Capture
Definition: pin_dmus.cpp:70
Definition: bufpool.h:45
Status
Definition: gdiplustypes.h:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PMINIPORTMIDISTREAM m_MidiStream
Definition: pin_dmus.cpp:63
unsigned int ULONG
Definition: retypes.h:1
#define DPRINT
Definition: sndvol32.h:71
#define BufferSize
Definition: mmc.h:75
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:251

◆ TransferMidiDataToDMus()

VOID CPortPinDMus::TransferMidiDataToDMus ( )
protected

Definition at line 248 of file pin_dmus.cpp.

249 {
253  PVOID Buffer;
255 
256  do
257  {
258  m_LastTag++;
260  if (!NT_SUCCESS(Status))
261  {
262  break;
263  }
264 
266  if (!NT_SUCCESS(Status))
267  break;
268 
269  //FIXME
270  //set up struct
271  //Event->Event.usFlags = DMUS_KEF_EVENT_COMPLETE;
272  Event->Event.cbStruct = sizeof(DMUS_KERNEL_EVENT);
273  Event->Event.cbEvent = (USHORT)BufferSize;
274  Event->Event.uData.pbData = (PBYTE)Buffer;
275 
276 
277  if (!Root)
278  Root = Event;
279  else
280  LastEvent->Event.pNextEvt = (struct _DMUS_KERNEL_EVENT *)Event;
281 
282  LastEvent = Event;
283  LastEvent->Event.pNextEvt = NULL;
284  LastEvent->Tag = UlongToPtr(m_LastTag);
285 
286  }while(TRUE);
287 
288  if (!Root)
289  {
290  return;
291  }
292 
293  Status = m_Mxf->PutMessage((PDMUS_KERNEL_EVENT)Root);
294  DPRINT("Status %x\n", Status);
295 }
ULONG m_LastTag
Definition: pin_dmus.cpp:78
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
struct _DMUS_KERNEL_EVENT * pNextEvt
Definition: dmusicks.h:20
IIrpQueue * m_IrpQueue
Definition: pin_dmus.cpp:72
_In_ PVOID _In_ ULONG Event
Definition: iotypes.h:467
Definition: bufpool.h:45
#define UlongToPtr(u)
Definition: config.h:106
Status
Definition: gdiplustypes.h:24
root entry for file system trees
Definition: entries.h:148
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
Definition: iotypes.h:1098
unsigned short USHORT
Definition: pedump.c:61
#define NULL
Definition: types.h:112
#define GetMessage
Definition: winuser.h:5770
DMUS_KERNEL_EVENT Event
Definition: pin_dmus.cpp:85
unsigned int ULONG
Definition: retypes.h:1
#define DPRINT
Definition: sndvol32.h:71
struct _DMUS_KERNEL_EVENT DMUS_KERNEL_EVENT
BYTE * PBYTE
Definition: pedump.c:66
#define BufferSize
Definition: mmc.h:75
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:251

Member Data Documentation

◆ IMP_IAllocatorMXF

CPortPinDMus::IMP_IAllocatorMXF

Definition at line 41 of file pin_dmus.cpp.

◆ IMP_IMasterClock

CPortPinDMus::IMP_IMasterClock

Definition at line 40 of file pin_dmus.cpp.

◆ IMP_IPortPinDMus

CPortPinDMus::IMP_IPortPinDMus

Definition at line 38 of file pin_dmus.cpp.

◆ IMP_IServiceSink

CPortPinDMus::IMP_IServiceSink

Definition at line 39 of file pin_dmus.cpp.

◆ m_Capture

DMUS_STREAM_TYPE CPortPinDMus::m_Capture
protected

Definition at line 70 of file pin_dmus.cpp.

Referenced by TransferMidiData().

◆ m_ConnectDetails

KSPIN_CONNECT* CPortPinDMus::m_ConnectDetails
protected

Definition at line 68 of file pin_dmus.cpp.

◆ m_DeviceObject

PDEVICE_OBJECT CPortPinDMus::m_DeviceObject
protected

Definition at line 71 of file pin_dmus.cpp.

◆ m_Filter

IPortFilterDMus* CPortPinDMus::m_Filter
protected

Definition at line 51 of file pin_dmus.cpp.

◆ m_Format

PKSDATAFORMAT CPortPinDMus::m_Format
protected

Definition at line 67 of file pin_dmus.cpp.

◆ m_IrpQueue

IIrpQueue* CPortPinDMus::m_IrpQueue
protected

Definition at line 72 of file pin_dmus.cpp.

Referenced by TransferMidiData(), and TransferMidiDataToDMus().

◆ m_KsPinDescriptor

KSPIN_DESCRIPTOR* CPortPinDMus::m_KsPinDescriptor
protected

Definition at line 52 of file pin_dmus.cpp.

◆ m_LastTag

ULONG CPortPinDMus::m_LastTag
protected

Definition at line 78 of file pin_dmus.cpp.

Referenced by TransferMidiDataToDMus().

◆ m_LookAsideBuffer

NPAGED_LOOKASIDE_LIST CPortPinDMus::m_LookAsideBuffer
protected

Definition at line 60 of file pin_dmus.cpp.

◆ m_LookAsideEvent

NPAGED_LOOKASIDE_LIST CPortPinDMus::m_LookAsideEvent
protected

Definition at line 59 of file pin_dmus.cpp.

◆ m_MidiMiniport

PMINIPORTMIDI CPortPinDMus::m_MidiMiniport
protected

Definition at line 62 of file pin_dmus.cpp.

◆ m_MidiStream

PMINIPORTMIDISTREAM CPortPinDMus::m_MidiStream
protected

Definition at line 63 of file pin_dmus.cpp.

Referenced by TransferMidiData().

◆ m_Miniport

PMINIPORTDMUS CPortPinDMus::m_Miniport
protected

Definition at line 53 of file pin_dmus.cpp.

◆ m_Mxf

PMXF CPortPinDMus::m_Mxf
protected

Definition at line 57 of file pin_dmus.cpp.

Referenced by TransferMidiDataToDMus().

◆ m_Port

IPortDMus* CPortPinDMus::m_Port
protected

Definition at line 50 of file pin_dmus.cpp.

◆ m_PostCompleted

ULONG CPortPinDMus::m_PostCompleted
protected

Definition at line 76 of file pin_dmus.cpp.

◆ m_PreCompleted

ULONG CPortPinDMus::m_PreCompleted
protected

Definition at line 75 of file pin_dmus.cpp.

◆ m_Ref

LONG CPortPinDMus::m_Ref
protected

Definition at line 80 of file pin_dmus.cpp.

Referenced by STDMETHODIMP_().

◆ m_SchedulePreFetch

ULONGLONG CPortPinDMus::m_SchedulePreFetch
protected

Definition at line 58 of file pin_dmus.cpp.

◆ m_ServiceGroup

PSERVICEGROUP CPortPinDMus::m_ServiceGroup
protected

Definition at line 55 of file pin_dmus.cpp.

◆ m_State

KSSTATE CPortPinDMus::m_State
protected

Definition at line 66 of file pin_dmus.cpp.

◆ m_TotalPackets

ULONG CPortPinDMus::m_TotalPackets
protected

Definition at line 74 of file pin_dmus.cpp.


The documentation for this class was generated from the following file: