ReactOS  0.4.15-dev-4920-g5fa8403
CPortPinDMus Class Reference
Inheritance diagram for CPortPinDMus:
Collaboration diagram for CPortPinDMus:

Public Member Functions

STDMETHODIMP QueryInterface (REFIID InterfaceId, PVOID *Interface)
 
 CPortPinDMus (IUnknown *OuterUnknown)
 
virtual ~CPortPinDMus ()
 
- Public Member Functions inherited from CUnknownImpl< IPortPinDMus >
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 

Public Attributes

 IMP_IPortPinDMus
 
 IMP_IServiceSink
 
 IMP_IMasterClock
 
 IMP_IAllocatorMXF
 

Protected Member Functions

VOID TransferMidiDataToDMus ()
 
VOID TransferMidiData ()
 
- Protected Member Functions inherited from CUnknownImpl< IPortPinDMus >
 CUnknownImpl ()
 
virtual ~CUnknownImpl ()
 

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
 

Detailed Description

Definition at line 17 of file pin_dmus.cpp.

Constructor & Destructor Documentation

◆ CPortPinDMus()

CPortPinDMus::CPortPinDMus ( IUnknown OuterUnknown)
inline

Definition at line 27 of file pin_dmus.cpp.

27 {}

◆ ~CPortPinDMus()

virtual CPortPinDMus::~CPortPinDMus ( )
inlinevirtual

Definition at line 28 of file pin_dmus.cpp.

28 {}

Member Function Documentation

◆ QueryInterface()

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

Definition at line 300 of file pin_dmus.cpp.

303 {
304 
305  if (IsEqualGUIDAligned(refiid, IID_IIrpTarget) ||
307  {
308  *Output = PVOID(PUNKNOWN(this));
309  PUNKNOWN(*Output)->AddRef();
310  return STATUS_SUCCESS;
311  }
312 
313  return STATUS_UNSUCCESSFUL;
314 }
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235
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

◆ TransferMidiData()

VOID CPortPinDMus::TransferMidiData ( )
protected

Definition at line 183 of file pin_dmus.cpp.

184 {
186  PUCHAR Buffer;
189 
190  do
191  {
192  Status = m_IrpQueue->GetMapping(&Buffer, &BufferSize);
193  if (!NT_SUCCESS(Status))
194  {
195  return;
196  }
197 
198  if (m_Capture)
199  {
201  if (!NT_SUCCESS(Status))
202  {
203  DPRINT("Read failed with %x\n", Status);
204  return;
205  }
206  }
207  else
208  {
210  if (!NT_SUCCESS(Status))
211  {
212  DPRINT("Write failed with %x\n", Status);
213  return;
214  }
215  }
216 
217  if (!BytesWritten)
218  {
219  DPRINT("Device is busy retry later\n");
220  return;
221  }
222 
223  m_IrpQueue->UpdateMapping(BytesWritten);
224 
225  }while(TRUE);
226 
227 }
_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:56
DMUS_STREAM_TYPE m_Capture
Definition: pin_dmus.cpp:54
Definition: bufpool.h:45
Status
Definition: gdiplustypes.h:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PMINIPORTMIDISTREAM m_MidiStream
Definition: pin_dmus.cpp:47
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 230 of file pin_dmus.cpp.

231 {
235  PVOID Buffer;
237 
238  do
239  {
240  m_LastTag++;
242  if (!NT_SUCCESS(Status))
243  {
244  break;
245  }
246 
248  if (!NT_SUCCESS(Status))
249  break;
250 
251  //FIXME
252  //set up struct
253  //Event->Event.usFlags = DMUS_KEF_EVENT_COMPLETE;
254  Event->Event.cbStruct = sizeof(DMUS_KERNEL_EVENT);
255  Event->Event.cbEvent = (USHORT)BufferSize;
256  Event->Event.uData.pbData = (PBYTE)Buffer;
257 
258 
259  if (!Root)
260  Root = Event;
261  else
262  LastEvent->Event.pNextEvt = (struct _DMUS_KERNEL_EVENT *)Event;
263 
264  LastEvent = Event;
265  LastEvent->Event.pNextEvt = NULL;
266  LastEvent->Tag = UlongToPtr(m_LastTag);
267 
268  }while(TRUE);
269 
270  if (!Root)
271  {
272  return;
273  }
274 
275  Status = m_Mxf->PutMessage((PDMUS_KERNEL_EVENT)Root);
276  DPRINT("Status %x\n", Status);
277 }
ULONG m_LastTag
Definition: pin_dmus.cpp:62
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:56
_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:67
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 25 of file pin_dmus.cpp.

◆ IMP_IMasterClock

CPortPinDMus::IMP_IMasterClock

Definition at line 24 of file pin_dmus.cpp.

◆ IMP_IPortPinDMus

CPortPinDMus::IMP_IPortPinDMus

Definition at line 22 of file pin_dmus.cpp.

◆ IMP_IServiceSink

CPortPinDMus::IMP_IServiceSink

Definition at line 23 of file pin_dmus.cpp.

◆ m_Capture

DMUS_STREAM_TYPE CPortPinDMus::m_Capture
protected

Definition at line 54 of file pin_dmus.cpp.

Referenced by TransferMidiData().

◆ m_ConnectDetails

KSPIN_CONNECT* CPortPinDMus::m_ConnectDetails
protected

Definition at line 52 of file pin_dmus.cpp.

◆ m_DeviceObject

PDEVICE_OBJECT CPortPinDMus::m_DeviceObject
protected

Definition at line 55 of file pin_dmus.cpp.

◆ m_Filter

IPortFilterDMus* CPortPinDMus::m_Filter
protected

Definition at line 35 of file pin_dmus.cpp.

◆ m_Format

PKSDATAFORMAT CPortPinDMus::m_Format
protected

Definition at line 51 of file pin_dmus.cpp.

◆ m_IrpQueue

IIrpQueue* CPortPinDMus::m_IrpQueue
protected

Definition at line 56 of file pin_dmus.cpp.

Referenced by TransferMidiData(), and TransferMidiDataToDMus().

◆ m_KsPinDescriptor

KSPIN_DESCRIPTOR* CPortPinDMus::m_KsPinDescriptor
protected

Definition at line 36 of file pin_dmus.cpp.

◆ m_LastTag

ULONG CPortPinDMus::m_LastTag
protected

Definition at line 62 of file pin_dmus.cpp.

Referenced by TransferMidiDataToDMus().

◆ m_LookAsideBuffer

NPAGED_LOOKASIDE_LIST CPortPinDMus::m_LookAsideBuffer
protected

Definition at line 44 of file pin_dmus.cpp.

◆ m_LookAsideEvent

NPAGED_LOOKASIDE_LIST CPortPinDMus::m_LookAsideEvent
protected

Definition at line 43 of file pin_dmus.cpp.

◆ m_MidiMiniport

PMINIPORTMIDI CPortPinDMus::m_MidiMiniport
protected

Definition at line 46 of file pin_dmus.cpp.

◆ m_MidiStream

PMINIPORTMIDISTREAM CPortPinDMus::m_MidiStream
protected

Definition at line 47 of file pin_dmus.cpp.

Referenced by TransferMidiData().

◆ m_Miniport

PMINIPORTDMUS CPortPinDMus::m_Miniport
protected

Definition at line 37 of file pin_dmus.cpp.

◆ m_Mxf

PMXF CPortPinDMus::m_Mxf
protected

Definition at line 41 of file pin_dmus.cpp.

Referenced by TransferMidiDataToDMus().

◆ m_Port

IPortDMus* CPortPinDMus::m_Port
protected

Definition at line 34 of file pin_dmus.cpp.

◆ m_PostCompleted

ULONG CPortPinDMus::m_PostCompleted
protected

Definition at line 60 of file pin_dmus.cpp.

◆ m_PreCompleted

ULONG CPortPinDMus::m_PreCompleted
protected

Definition at line 59 of file pin_dmus.cpp.

◆ m_SchedulePreFetch

ULONGLONG CPortPinDMus::m_SchedulePreFetch
protected

Definition at line 42 of file pin_dmus.cpp.

◆ m_ServiceGroup

PSERVICEGROUP CPortPinDMus::m_ServiceGroup
protected

Definition at line 39 of file pin_dmus.cpp.

◆ m_State

KSSTATE CPortPinDMus::m_State
protected

Definition at line 50 of file pin_dmus.cpp.

◆ m_TotalPackets

ULONG CPortPinDMus::m_TotalPackets
protected

Definition at line 58 of file pin_dmus.cpp.


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