ReactOS  0.4.15-dev-4614-ga5a6101
pin_wavecyclic.cpp File Reference
#include "private.hpp"
#include <debug.h>
Include dependency graph for pin_wavecyclic.cpp:

Go to the source code of this file.

Classes

class  CPortPinWaveCyclic
 
struct  LOOPEDSTREAMING_EVENT_CONTEXT
 
struct  ENDOFSTREAM_EVENT_CONTEXT
 
struct  SETPIN_CONTEXT
 

Macros

#define NDEBUG
 

Typedefs

typedef struct LOOPEDSTREAMING_EVENT_CONTEXTPLOOPEDSTREAMING_EVENT_CONTEXT
 
typedef struct ENDOFSTREAM_EVENT_CONTEXTPENDOFSTREAM_EVENT_CONTEXT
 
typedef struct SETPIN_CONTEXTPSETPIN_CONTEXT
 

Functions

NTSTATUS NTAPI PinWaveCyclicState (IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
 
NTSTATUS NTAPI PinWaveCyclicDataFormat (IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
 
NTSTATUS NTAPI PinWaveCyclicAudioPosition (IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
 
NTSTATUS NTAPI PinWaveCyclicAllocatorFraming (IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
 
NTSTATUS NTAPI PinWaveCyclicAddEndOfStreamEvent (IN PIRP Irp, IN PKSEVENTDATA EventData, IN PKSEVENT_ENTRY EventEntry)
 
NTSTATUS NTAPI PinWaveCyclicAddLoopedStreamEvent (IN PIRP Irp, IN PKSEVENTDATA EventData, IN PKSEVENT_ENTRY EventEntry)
 
NTSTATUS NTAPI PinWaveCyclicDRMHandler (IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
 
 DEFINE_KSPROPERTY_CONNECTIONSET (PinWaveCyclicConnectionSet, PinWaveCyclicState, PinWaveCyclicDataFormat, PinWaveCyclicAllocatorFraming)
 
 DEFINE_KSPROPERTY_AUDIOSET (PinWaveCyclicAudioSet, PinWaveCyclicAudioPosition)
 
 DEFINE_KSPROPERTY_DRMSET (PinWaveCyclicDRMSet, PinWaveCyclicDRMHandler)
 
VOID CALLBACK PinSetStateWorkerRoutine (IN PDEVICE_OBJECT DeviceObject, IN PVOID Context)
 
NTSTATUS NewPortPinWaveCyclic (OUT IPortPinWaveCyclic **OutPin)
 

Variables

KSEVENT_ITEM PinWaveCyclicConnectionEventSet
 
KSEVENT_ITEM PinWaveCyclicStreamingEventSet
 
KSPROPERTY_SET PinWaveCyclicPropertySet []
 
KSEVENT_SET PinWaveCyclicEventSet []
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file pin_wavecyclic.cpp.

Typedef Documentation

◆ PENDOFSTREAM_EVENT_CONTEXT

◆ PLOOPEDSTREAMING_EVENT_CONTEXT

◆ PSETPIN_CONTEXT

Function Documentation

◆ DEFINE_KSPROPERTY_AUDIOSET()

DEFINE_KSPROPERTY_AUDIOSET ( PinWaveCyclicAudioSet  ,
PinWaveCyclicAudioPosition   
)

◆ DEFINE_KSPROPERTY_CONNECTIONSET()

DEFINE_KSPROPERTY_CONNECTIONSET ( PinWaveCyclicConnectionSet  ,
PinWaveCyclicState  ,
PinWaveCyclicDataFormat  ,
PinWaveCyclicAllocatorFraming   
)

◆ DEFINE_KSPROPERTY_DRMSET()

DEFINE_KSPROPERTY_DRMSET ( PinWaveCyclicDRMSet  ,
PinWaveCyclicDRMHandler   
)

◆ NewPortPinWaveCyclic()

NTSTATUS NewPortPinWaveCyclic ( OUT IPortPinWaveCyclic **  OutPin)

Definition at line 1401 of file pin_wavecyclic.cpp.

1403 {
1405 
1407  if (!This)
1409 
1410  This->AddRef();
1411 
1412  // store result
1413  *OutPin = (IPortPinWaveCyclic*)This;
1414 
1415  return STATUS_SUCCESS;
1416 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define TAG_PORTCLASS
Definition: private.hpp:24
#define NULL
Definition: types.h:112
#define STATUS_SUCCESS
Definition: shellext.h:65

◆ PinSetStateWorkerRoutine()

VOID CALLBACK PinSetStateWorkerRoutine ( IN PDEVICE_OBJECT  DeviceObject,
IN PVOID  Context 
)

Definition at line 415 of file pin_wavecyclic.cpp.

418 {
419  PSETPIN_CONTEXT PinWorkContext = (PSETPIN_CONTEXT)Context;
421 
422  // try set stream
423  Status = PinWorkContext->Pin->m_Stream->SetState(PinWorkContext->NewState);
424 
425  DPRINT1("Setting state %u %x\n", PinWorkContext->NewState, Status);
426  if (NT_SUCCESS(Status))
427  {
428  // store new state
429  PinWorkContext->Pin->m_State = PinWorkContext->NewState;
430 
431  if (PinWorkContext->Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING && PinWorkContext->Pin->m_State == KSSTATE_STOP)
432  {
433  /* FIXME complete pending irps with successful state */
434  PinWorkContext->Pin->m_IrpQueue->CancelBuffers();
435  }
436  //HACK
437  //PinWorkContext->Pin->m_IrpQueue->CancelBuffers();
438  }
439 
440  // store result
441  PinWorkContext->Irp->IoStatus.Information = sizeof(KSSTATE);
442  PinWorkContext->Irp->IoStatus.Status = Status;
443 
444  // complete irp
445  IoCompleteRequest(PinWorkContext->Irp, IO_NO_INCREMENT);
446 
447  // free work item
448  IoFreeWorkItem(PinWorkContext->WorkItem);
449 
450  // free work context
451  FreeItem(PinWorkContext, TAG_PORTCLASS);
452 
453 }
KSPIN_INTERFACE Interface
Definition: ks.h:2601
#define TAG_PORTCLASS
Definition: private.hpp:24
LONG NTSTATUS
Definition: precomp.h:26
IO_STATUS_BLOCK IoStatus
PIO_WORKITEM WorkItem
CPortPinWaveCyclic * Pin
VOID NTAPI IoFreeWorkItem(IN PIO_WORKITEM IoWorkItem)
Definition: iowork.c:64
struct SETPIN_CONTEXT * PSETPIN_CONTEXT
VOID FreeItem(IN PVOID Item)
Definition: misc.c:43
IIrpQueue * m_IrpQueue
#define IoCompleteRequest
Definition: irp.c:1240
Status
Definition: gdiplustypes.h:24
ULONG Id
Definition: dmksctrl.h:77
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PMINIPORTWAVECYCLICSTREAM m_Stream
KSSTATE
Definition: ks.h:1214
#define DPRINT1
Definition: precomp.h:8
PKSPIN_CONNECT m_ConnectDetails
#define IO_NO_INCREMENT
Definition: iotypes.h:598

◆ PinWaveCyclicAddEndOfStreamEvent()

NTSTATUS NTAPI PinWaveCyclicAddEndOfStreamEvent ( IN PIRP  Irp,
IN PKSEVENTDATA  EventData,
IN PKSEVENT_ENTRY  EventEntry 
)

Definition at line 243 of file pin_wavecyclic.cpp.

247 {
251 
252  // get sub device descriptor
253  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
254 
255  // sanity check
257  PC_ASSERT(Descriptor->PortPin);
259 
260  // cast to pin impl
261  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
262 
263  // get extra size
264  Entry = (PENDOFSTREAM_EVENT_CONTEXT)(EventEntry + 1);
265 
266  // not a looped event
267  Entry->bLoopedStreaming = FALSE;
268 
269  // insert item
270  (void)ExInterlockedInsertTailList(&Pin->m_EventList, &EventEntry->ListEntry, &Pin->m_EventListLock);
271 
272  // done
273  return STATUS_SUCCESS;
274 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:339
struct _Entry Entry
Definition: kefuncs.h:629
#define PC_ASSERT(exp)
Definition: private.hpp:26
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:424
PLIST_ENTRY NTAPI ExInterlockedInsertTailList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:140
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define STATUS_SUCCESS
Definition: shellext.h:65
struct SUBDEVICE_DESCRIPTOR * PSUBDEVICE_DESCRIPTOR
base of all file and directory entries
Definition: entries.h:82
#define PC_ASSERT_IRQL(x)
Definition: private.hpp:30

◆ PinWaveCyclicAddLoopedStreamEvent()

NTSTATUS NTAPI PinWaveCyclicAddLoopedStreamEvent ( IN PIRP  Irp,
IN PKSEVENTDATA  EventData,
IN PKSEVENT_ENTRY  EventEntry 
)

Definition at line 278 of file pin_wavecyclic.cpp.

282 {
287 
288  // get sub device descriptor
289  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSEVENT_ITEM_IRP_STORAGE(Irp);
290 
291  // sanity check
293  PC_ASSERT(Descriptor->PortPin);
295 
296  // cast to pin impl
297  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
298 
299  // cast to looped event
301 
302  // get extra size
303  Entry = (PLOOPEDSTREAMING_EVENT_CONTEXT)(EventEntry + 1);
304 
305  Entry->bLoopedStreaming = TRUE;
306  Entry->Position = Data->Position;
307 
308  DPRINT1("Added event\n");
309 
310  // insert item
311  (void)ExInterlockedInsertTailList(&Pin->m_EventList, &EventEntry->ListEntry, &Pin->m_EventListLock);
312 
313  // done
314  return STATUS_SUCCESS;
315 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:339
struct _Entry Entry
Definition: kefuncs.h:629
#define TRUE
Definition: types.h:120
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG _In_opt_ PVOID Data
Definition: wdfdevice.h:4527
#define PC_ASSERT(exp)
Definition: private.hpp:26
_In_ PIRP Irp
Definition: csq.h:116
struct LOOPEDSTREAMING_EVENT_CONTEXT * PLOOPEDSTREAMING_EVENT_CONTEXT
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:424
PLIST_ENTRY NTAPI ExInterlockedInsertTailList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:140
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define DPRINT1
Definition: precomp.h:8
#define STATUS_SUCCESS
Definition: shellext.h:65
struct SUBDEVICE_DESCRIPTOR * PSUBDEVICE_DESCRIPTOR
base of all file and directory entries
Definition: entries.h:82
#define PC_ASSERT_IRQL(x)
Definition: private.hpp:30

◆ PinWaveCyclicAllocatorFraming()

NTSTATUS NTAPI PinWaveCyclicAllocatorFraming ( IN PIRP  Irp,
IN PKSIDENTIFIER  Request,
IN OUT PVOID  Data 
)

Definition at line 319 of file pin_wavecyclic.cpp.

323 {
326 
327  // get sub device descriptor
328  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSEVENT_ITEM_IRP_STORAGE(Irp);
329 
330  // sanity check
332  PC_ASSERT(Descriptor->PortPin);
334 
335  // cast to pin impl
336  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
337 
338 
339  if (Request->Flags & KSPROPERTY_TYPE_GET)
340  {
341  // copy pin framing
342  RtlMoveMemory(Data, &Pin->m_AllocatorFraming, sizeof(KSALLOCATOR_FRAMING));
343 
344  Irp->IoStatus.Information = sizeof(KSALLOCATOR_FRAMING);
345  return STATUS_SUCCESS;
346  }
347 
348  // not supported
349  return STATUS_NOT_SUPPORTED;
350 }
return STATUS_NOT_SUPPORTED
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:339
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
if(dx==0 &&dy==0)
Definition: linetemp.h:174
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
#define PC_ASSERT(exp)
Definition: private.hpp:26
_In_ PIRP Irp
Definition: csq.h:116
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:424
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define STATUS_SUCCESS
Definition: shellext.h:65
struct SUBDEVICE_DESCRIPTOR * PSUBDEVICE_DESCRIPTOR
#define PC_ASSERT_IRQL(x)
Definition: private.hpp:30

◆ PinWaveCyclicAudioPosition()

NTSTATUS NTAPI PinWaveCyclicAudioPosition ( IN PIRP  Irp,
IN PKSIDENTIFIER  Request,
IN OUT PVOID  Data 
)

Definition at line 354 of file pin_wavecyclic.cpp.

358 {
362 
363  // get sub device descriptor
364  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
365 
366  // sanity check
368  PC_ASSERT(Descriptor->PortPin);
370 
371  // cast to pin impl
372  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
373 
374  //sanity check
375  PC_ASSERT(Pin->m_Stream);
376 
377  if (Request->Flags & KSPROPERTY_TYPE_GET)
378  {
379  // FIXME non multithreading-safe
380  // copy audio position
381 
383 
384  if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_STREAMING)
385  {
386  RtlMoveMemory(Data, &Pin->m_Position, sizeof(KSAUDIO_POSITION));
387  DPRINT("Play %lu Record %lu\n", Pin->m_Position.PlayOffset, Pin->m_Position.WriteOffset);
388  }
389  else if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING)
390  {
391  Position->PlayOffset = Pin->m_Position.PlayOffset;
392  Position->WriteOffset = (ULONGLONG)Pin->m_IrpQueue->GetCurrentIrpOffset();
393  DPRINT("Play %lu Write %lu\n", Position->PlayOffset, Position->WriteOffset);
394  }
395 
396  Irp->IoStatus.Information = sizeof(KSAUDIO_POSITION);
397  return STATUS_SUCCESS;
398  }
399 
400  // not supported
401  return STATUS_NOT_SUPPORTED;
402 }
return STATUS_NOT_SUPPORTED
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:339
static COORD Position
Definition: mouse.c:34
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
#define PC_ASSERT(exp)
Definition: private.hpp:26
_In_ PIRP Irp
Definition: csq.h:116
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:424
uint64_t ULONGLONG
Definition: typedefs.h:67
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71
struct SUBDEVICE_DESCRIPTOR * PSUBDEVICE_DESCRIPTOR
struct KSAUDIO_POSITION * PKSAUDIO_POSITION
#define PC_ASSERT_IRQL(x)
Definition: private.hpp:30

◆ PinWaveCyclicDataFormat()

NTSTATUS NTAPI PinWaveCyclicDataFormat ( IN PIRP  Irp,
IN PKSIDENTIFIER  Request,
IN OUT PVOID  Data 
)

Definition at line 530 of file pin_wavecyclic.cpp.

534 {
538  PIO_STACK_LOCATION IoStack;
539 
540  // get current irp stack location
542 
543  // get sub device descriptor
544  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
545 
546  // sanity check
548  PC_ASSERT(Descriptor->PortPin);
549 
550  // cast to pin impl
551  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
552 
553  //sanity check
554  PC_ASSERT(Pin->m_Stream);
555  PC_ASSERT(Pin->m_Format);
556 
557  if (Request->Flags & KSPROPERTY_TYPE_SET)
558  {
559  // try to change data format
560  PKSDATAFORMAT NewDataFormat, DataFormat = (PKSDATAFORMAT)Irp->UserBuffer;
561  ULONG Size = min(Pin->m_Format->FormatSize, DataFormat->FormatSize);
562 
563  if (RtlCompareMemory(DataFormat, Pin->m_Format, Size) == Size)
564  {
565  // format is identical
566  Irp->IoStatus.Information = DataFormat->FormatSize;
567  return STATUS_SUCCESS;
568  }
569 
570  // new change request
571  PC_ASSERT(Pin->m_State != KSSTATE_RUN);
572  // FIXME queue a work item when Irql != PASSIVE_LEVEL
574 
575  // allocate new data format
576  NewDataFormat = (PKSDATAFORMAT)AllocateItem(NonPagedPool, DataFormat->FormatSize, TAG_PORTCLASS);
577  if (!NewDataFormat)
578  {
579  // not enough memory
580  return STATUS_NO_MEMORY;
581  }
582 
583  // copy new data format
584  RtlMoveMemory(NewDataFormat, DataFormat, DataFormat->FormatSize);
585 
586  // set new format
587  Status = Pin->m_Stream->SetFormat(NewDataFormat);
588  if (NT_SUCCESS(Status))
589  {
590  // free old format
591  FreeItem(Pin->m_Format, TAG_PORTCLASS);
592 
593  // store new format
594  Pin->m_Format = NewDataFormat;
595  Irp->IoStatus.Information = NewDataFormat->FormatSize;
596 
597 #if 0
598  PC_ASSERT(NewDataFormat->FormatSize == sizeof(KSDATAFORMAT_WAVEFORMATEX));
602 
603 
604  DPRINT("NewDataFormat: Channels %u Bits %u Samples %u\n", ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nChannels,
605  ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.wBitsPerSample,
606  ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nSamplesPerSec);
607 #endif
608 
609  }
610  else
611  {
612  // failed to set format
613  FreeItem(NewDataFormat, TAG_PORTCLASS);
614  }
615 
616 
617  // done
618  return Status;
619  }
620  else if (Request->Flags & KSPROPERTY_TYPE_GET)
621  {
622  // get current data format
623  PC_ASSERT(Pin->m_Format);
624 
625  if (Pin->m_Format->FormatSize > IoStack->Parameters.DeviceIoControl.OutputBufferLength)
626  {
627  // buffer too small
628  Irp->IoStatus.Information = Pin->m_Format->FormatSize;
629  return STATUS_MORE_ENTRIES;
630  }
631  // copy data format
632  RtlMoveMemory(Data, Pin->m_Format, Pin->m_Format->FormatSize);
633  // store result size
634  Irp->IoStatus.Information = Pin->m_Format->FormatSize;
635 
636  // done
637  return STATUS_SUCCESS;
638  }
639 
640  // unsupported request
641  return STATUS_NOT_SUPPORTED;
642 }
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
return STATUS_NOT_SUPPORTED
#define KSDATAFORMAT_SUBTYPE_PCM
Definition: ksmedia.h:1021
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:339
#define TAG_PORTCLASS
Definition: private.hpp:24
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
Definition: misc.c:30
LONG NTSTATUS
Definition: precomp.h:26
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
#define KSDATAFORMAT_SPECIFIER_WAVEFORMATEX
Definition: ksmedia.h:1031
#define PC_ASSERT(exp)
Definition: private.hpp:26
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235
VOID FreeItem(IN PVOID Item)
Definition: misc.c:43
_In_ PIRP Irp
Definition: csq.h:116
Status
Definition: gdiplustypes.h:24
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:424
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define KSDATAFORMAT_TYPE_AUDIO
Definition: ksmedia.h:983
#define STATUS_MORE_ENTRIES
Definition: udferr_usr.h:124
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define min(a, b)
Definition: monoChain.cc:55
unsigned int ULONG
Definition: retypes.h:1
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
struct SUBDEVICE_DESCRIPTOR * PSUBDEVICE_DESCRIPTOR
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
KSDATAFORMAT * PKSDATAFORMAT

◆ PinWaveCyclicDRMHandler()

NTSTATUS NTAPI PinWaveCyclicDRMHandler ( IN PIRP  Irp,
IN PKSIDENTIFIER  Request,
IN OUT PVOID  Data 
)

Definition at line 230 of file pin_wavecyclic.cpp.

234 {
235  DPRINT1("PinWaveCyclicDRMHandler\n");
236  ASSERT(0);
238 }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define ASSERT(a)
Definition: mode.c:44
#define DPRINT1
Definition: precomp.h:8

◆ PinWaveCyclicState()

NTSTATUS NTAPI PinWaveCyclicState ( IN PIRP  Irp,
IN PKSIDENTIFIER  Request,
IN OUT PVOID  Data 
)

Definition at line 458 of file pin_wavecyclic.cpp.

462 {
467 
468  // get sub device descriptor
469  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
470 
471  // sanity check
473  PC_ASSERT(Descriptor->PortPin);
475 
476  // cast to pin impl
477  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
478 
479  //sanity check
480  PC_ASSERT(Pin->m_Stream);
481 
482  if (Request->Flags & KSPROPERTY_TYPE_SET)
483  {
484  // try set stream
485  Status = Pin->m_Stream->SetState(*State);
486 
487  DPRINT("Setting state %u %x\n", *State, Status);
488  if (NT_SUCCESS(Status))
489  {
490  // store new state
491  Pin->m_State = *State;
492 
493  if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING && Pin->m_State == KSSTATE_STOP)
494  {
495  // FIXME
496  // complete with successful state
497  Pin->m_Stream->Silence(Pin->m_CommonBuffer, Pin->m_CommonBufferSize);
498  Pin->m_IrpQueue->CancelBuffers();
499  Pin->m_Position.PlayOffset = 0;
500  Pin->m_Position.WriteOffset = 0;
501  }
502  else if (Pin->m_State == KSSTATE_STOP)
503  {
504  Pin->m_Stream->Silence(Pin->m_CommonBuffer, Pin->m_CommonBufferSize);
505  Pin->m_IrpQueue->CancelBuffers();
506  Pin->m_Position.PlayOffset = 0;
507  Pin->m_Position.WriteOffset = 0;
508  }
509  // store result
510  Irp->IoStatus.Information = sizeof(KSSTATE);
511  }
512  return Status;
513  }
514  else if (Request->Flags & KSPROPERTY_TYPE_GET)
515  {
516  // get current stream state
517  *State = Pin->m_State;
518  // store result
519  Irp->IoStatus.Information = sizeof(KSSTATE);
520 
521  return STATUS_SUCCESS;
522  }
523 
524  // unsupported request
525  return STATUS_NOT_SUPPORTED;
526 }
return STATUS_NOT_SUPPORTED
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:339
LONG NTSTATUS
Definition: precomp.h:26
_In_ ULONG _In_ ULONG State
Definition: potypes.h:516
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define PC_ASSERT(exp)
Definition: private.hpp:26
enum KSSTATE * PKSSTATE
_In_ PIRP Irp
Definition: csq.h:116
Status
Definition: gdiplustypes.h:24
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:424
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
KSSTATE
Definition: ks.h:1214
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
struct SUBDEVICE_DESCRIPTOR * PSUBDEVICE_DESCRIPTOR
#define PC_ASSERT_IRQL(x)
Definition: private.hpp:30

Variable Documentation

◆ PinWaveCyclicConnectionEventSet

KSEVENT_ITEM PinWaveCyclicConnectionEventSet
Initial value:
=
{
sizeof(KSEVENTDATA),
0,
0
}
NTSTATUS NTAPI PinWaveCyclicAddEndOfStreamEvent(IN PIRP Irp, IN PKSEVENTDATA EventData, IN PKSEVENT_ENTRY EventEntry)

Definition at line 139 of file pin_wavecyclic.cpp.

◆ PinWaveCyclicEventSet

KSEVENT_SET PinWaveCyclicEventSet[]
Initial value:
=
{
{
sizeof(PinWaveCyclicStreamingEventSet) / sizeof(KSEVENT_ITEM),
(const KSEVENT_ITEM*)&PinWaveCyclicStreamingEventSet
},
{
sizeof(PinWaveCyclicConnectionEventSet) / sizeof(KSEVENT_ITEM),
(const KSEVENT_ITEM*)&PinWaveCyclicConnectionEventSet
}
}
KSEVENT_ITEM PinWaveCyclicConnectionEventSet
#define KSEVENTSETID_Connection
Definition: ksmedia.h:1136
const GUID KSEVENTSETID_LoopedStreaming
Definition: capturebuffer.c:18
KSEVENT_ITEM PinWaveCyclicStreamingEventSet

Definition at line 185 of file pin_wavecyclic.cpp.

◆ PinWaveCyclicPropertySet

KSPROPERTY_SET PinWaveCyclicPropertySet[]
Initial value:
=
{
{
sizeof(PinWaveCyclicConnectionSet) / sizeof(KSPROPERTY_ITEM),
(const KSPROPERTY_ITEM*)&PinWaveCyclicConnectionSet,
0,
},
{
sizeof(PinWaveCyclicAudioSet) / sizeof(KSPROPERTY_ITEM),
(const KSPROPERTY_ITEM*)&PinWaveCyclicAudioSet,
0,
},
{
sizeof(PinWaveCyclicDRMSet) / sizeof(KSPROPERTY_ITEM),
(const KSPROPERTY_ITEM*)&PinWaveCyclicDRMSet,
0,
}
}
#define KSPROPSETID_DrmAudioStream
Definition: ksmedia.h:1151
#define KSPROPSETID_Audio
Definition: ksmedia.h:1051
#define KSPROPSETID_Connection
Definition: ks.h:346
#define NULL
Definition: types.h:112

Definition at line 160 of file pin_wavecyclic.cpp.

◆ PinWaveCyclicStreamingEventSet

KSEVENT_ITEM PinWaveCyclicStreamingEventSet
Initial value:

Definition at line 149 of file pin_wavecyclic.cpp.