ReactOS 0.4.15-dev-8428-g6910fa6
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 14 of file pin_dmus.cpp.

Constructor & Destructor Documentation

◆ CPortPinDMus()

CPortPinDMus::CPortPinDMus ( IUnknown OuterUnknown)
inline

Definition at line 24 of file pin_dmus.cpp.

24{}

◆ ~CPortPinDMus()

virtual CPortPinDMus::~CPortPinDMus ( )
inlinevirtual

Definition at line 25 of file pin_dmus.cpp.

25{}

Member Function Documentation

◆ QueryInterface()

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

Definition at line 290 of file pin_dmus.cpp.

293{
294
295 if (IsEqualGUIDAligned(refiid, IID_IIrpTarget) ||
297 {
298 *Output = PVOID(PUNKNOWN(this));
299 PUNKNOWN(*Output)->AddRef();
300 return STATUS_SUCCESS;
301 }
302
303 return STATUS_UNSUCCESSFUL;
304}
const GUID IID_IUnknown
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
ULONG AddRef()
@ Output
Definition: arc.h:85
#define STATUS_SUCCESS
Definition: shellext.h:65
void * PVOID
Definition: typedefs.h:50
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235

◆ TransferMidiData()

VOID CPortPinDMus::TransferMidiData ( )
protected

Definition at line 175 of file pin_dmus.cpp.

176{
181
182 do
183 {
184 Status = m_IrpQueue->GetMapping(&Buffer, &BufferSize);
185 if (!NT_SUCCESS(Status))
186 {
187 return;
188 }
189
190 if (m_Capture)
191 {
193 if (!NT_SUCCESS(Status))
194 {
195 DPRINT("Read failed with %x\n", Status);
196 return;
197 }
198 }
199 else
200 {
202 if (!NT_SUCCESS(Status))
203 {
204 DPRINT("Write failed with %x\n", Status);
205 return;
206 }
207 }
208
209 if (!BytesWritten)
210 {
211 DPRINT("Device is busy retry later\n");
212 return;
213 }
214
215 m_IrpQueue->UpdateMapping(BytesWritten);
216
217 }while(TRUE);
218
219}
LONG NTSTATUS
Definition: precomp.h:26
Definition: bufpool.h:45
IIrpQueue * m_IrpQueue
Definition: pin_dmus.cpp:52
PMINIPORTMIDISTREAM m_MidiStream
Definition: pin_dmus.cpp:44
DMUS_STREAM_TYPE m_Capture
Definition: pin_dmus.cpp:50
#define BufferSize
Definition: mmc.h:75
#define TRUE
Definition: types.h:120
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:25
#define DPRINT
Definition: sndvol32.h:73
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
_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:960
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254

◆ TransferMidiDataToDMus()

VOID CPortPinDMus::TransferMidiDataToDMus ( )
protected

Definition at line 222 of file pin_dmus.cpp.

223{
229
230 do
231 {
232 m_LastTag++;
234 if (!NT_SUCCESS(Status))
235 {
236 break;
237 }
238
240 if (!NT_SUCCESS(Status))
241 break;
242
243 //FIXME
244 //set up struct
245 //Event->Event.usFlags = DMUS_KEF_EVENT_COMPLETE;
246 Event->Event.cbStruct = sizeof(DMUS_KERNEL_EVENT);
247 Event->Event.cbEvent = (USHORT)BufferSize;
248 Event->Event.uData.pbData = (PBYTE)Buffer;
249
250 if (!Root)
251 Root = Event;
252 else
253 LastEvent->Event.pNextEvt = (struct _DMUS_KERNEL_EVENT *)Event;
254
255 LastEvent = Event;
256 LastEvent->Event.pNextEvt = NULL;
257 LastEvent->Tag = UlongToPtr(m_LastTag);
258
259 }while(TRUE);
260
261 if (!Root)
262 {
263 return;
264 }
265
266 Status = m_Mxf->PutMessage((PDMUS_KERNEL_EVENT)Root);
267 DPRINT("Status %x\n", Status);
268}
ULONG m_LastTag
Definition: pin_dmus.cpp:58
#define NULL
Definition: types.h:112
struct _DMUS_KERNEL_EVENT DMUS_KERNEL_EVENT
#define UlongToPtr(u)
Definition: config.h:106
BYTE * PBYTE
Definition: pedump.c:66
unsigned short USHORT
Definition: pedump.c:61
DMUS_KERNEL_EVENT Event
Definition: pin_dmus.cpp:63
root entry for file system trees
Definition: entries.h:148
struct _DMUS_KERNEL_EVENT * pNextEvt
Definition: dmusicks.h:20
#define GetMessage
Definition: winuser.h:5799
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
Definition: iotypes.h:1098

Member Data Documentation

◆ IMP_IAllocatorMXF

CPortPinDMus::IMP_IAllocatorMXF

Definition at line 22 of file pin_dmus.cpp.

◆ IMP_IMasterClock

CPortPinDMus::IMP_IMasterClock

Definition at line 21 of file pin_dmus.cpp.

◆ IMP_IPortPinDMus

CPortPinDMus::IMP_IPortPinDMus

Definition at line 19 of file pin_dmus.cpp.

◆ IMP_IServiceSink

CPortPinDMus::IMP_IServiceSink

Definition at line 20 of file pin_dmus.cpp.

◆ m_Capture

DMUS_STREAM_TYPE CPortPinDMus::m_Capture
protected

Definition at line 50 of file pin_dmus.cpp.

Referenced by TransferMidiData().

◆ m_ConnectDetails

KSPIN_CONNECT* CPortPinDMus::m_ConnectDetails
protected

Definition at line 48 of file pin_dmus.cpp.

◆ m_DeviceObject

PDEVICE_OBJECT CPortPinDMus::m_DeviceObject
protected

Definition at line 51 of file pin_dmus.cpp.

◆ m_Filter

IPortFilterDMus* CPortPinDMus::m_Filter
protected

Definition at line 32 of file pin_dmus.cpp.

◆ m_Format

PKSDATAFORMAT CPortPinDMus::m_Format
protected

Definition at line 47 of file pin_dmus.cpp.

◆ m_IrpQueue

IIrpQueue* CPortPinDMus::m_IrpQueue
protected

Definition at line 52 of file pin_dmus.cpp.

Referenced by TransferMidiData(), and TransferMidiDataToDMus().

◆ m_KsPinDescriptor

KSPIN_DESCRIPTOR* CPortPinDMus::m_KsPinDescriptor
protected

Definition at line 33 of file pin_dmus.cpp.

◆ m_LastTag

ULONG CPortPinDMus::m_LastTag
protected

Definition at line 58 of file pin_dmus.cpp.

Referenced by TransferMidiDataToDMus().

◆ m_LookAsideBuffer

NPAGED_LOOKASIDE_LIST CPortPinDMus::m_LookAsideBuffer
protected

Definition at line 41 of file pin_dmus.cpp.

◆ m_LookAsideEvent

NPAGED_LOOKASIDE_LIST CPortPinDMus::m_LookAsideEvent
protected

Definition at line 40 of file pin_dmus.cpp.

◆ m_MidiMiniport

PMINIPORTMIDI CPortPinDMus::m_MidiMiniport
protected

Definition at line 43 of file pin_dmus.cpp.

◆ m_MidiStream

PMINIPORTMIDISTREAM CPortPinDMus::m_MidiStream
protected

Definition at line 44 of file pin_dmus.cpp.

Referenced by TransferMidiData().

◆ m_Miniport

PMINIPORTDMUS CPortPinDMus::m_Miniport
protected

Definition at line 34 of file pin_dmus.cpp.

◆ m_Mxf

PMXF CPortPinDMus::m_Mxf
protected

Definition at line 38 of file pin_dmus.cpp.

Referenced by TransferMidiDataToDMus().

◆ m_Port

IPortDMus* CPortPinDMus::m_Port
protected

Definition at line 31 of file pin_dmus.cpp.

◆ m_PostCompleted

ULONG CPortPinDMus::m_PostCompleted
protected

Definition at line 56 of file pin_dmus.cpp.

◆ m_PreCompleted

ULONG CPortPinDMus::m_PreCompleted
protected

Definition at line 55 of file pin_dmus.cpp.

◆ m_SchedulePreFetch

ULONGLONG CPortPinDMus::m_SchedulePreFetch
protected

Definition at line 39 of file pin_dmus.cpp.

◆ m_ServiceGroup

PSERVICEGROUP CPortPinDMus::m_ServiceGroup
protected

Definition at line 36 of file pin_dmus.cpp.

◆ m_State

KSSTATE CPortPinDMus::m_State
protected

Definition at line 46 of file pin_dmus.cpp.

◆ m_TotalPackets

ULONG CPortPinDMus::m_TotalPackets
protected

Definition at line 54 of file pin_dmus.cpp.


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