ReactOS 0.4.15-dev-6068-g8061a6f
port_topology.cpp File Reference
#include "private.hpp"
#include <debug.h>
Include dependency graph for port_topology.cpp:

Go to the source code of this file.

Classes

class  CPortTopology
 

Macros

#define NDEBUG
 

Functions

 DEFINE_KSPROPERTY_TOPOLOGYSET (PortFilterTopologyTopologySet, TopologyPropertyHandler)
 
 DEFINE_KSPROPERTY_PINPROPOSEDATAFORMAT (PortFilterTopologyPinSet, PinPropertyHandler, PinPropertyHandler, PinPropertyHandler)
 
NTSTATUS NTAPI PcCreatePinDispatch (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI PcCreateItemDispatch (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NewPortTopology (OUT PPORT *OutPort)
 
PMINIPORTTOPOLOGY GetTopologyMiniport (PPORTTOPOLOGY Port)
 

Variables

static GUID InterfaceGuids [2]
 
KSPROPERTY_SET TopologyPropertySet []
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file port_topology.cpp.

Function Documentation

◆ DEFINE_KSPROPERTY_PINPROPOSEDATAFORMAT()

DEFINE_KSPROPERTY_PINPROPOSEDATAFORMAT ( PortFilterTopologyPinSet  ,
PinPropertyHandler  ,
PinPropertyHandler  ,
PinPropertyHandler   
)

◆ DEFINE_KSPROPERTY_TOPOLOGYSET()

DEFINE_KSPROPERTY_TOPOLOGYSET ( PortFilterTopologyTopologySet  ,
TopologyPropertyHandler   
)

◆ GetTopologyMiniport()

PMINIPORTTOPOLOGY GetTopologyMiniport ( PPORTTOPOLOGY  Port)

Definition at line 599 of file port_topology.cpp.

601{
603 return This->m_pMiniport;
604}
CPPORT Port[4]
Definition: headless.c:35

◆ NewPortTopology()

NTSTATUS NewPortTopology ( OUT PPORT OutPort)

Definition at line 576 of file port_topology.cpp.

578{
581
583 if (!This)
585
586 Status = This->QueryInterface(IID_IPort, (PVOID*)OutPort);
587
588 if (!NT_SUCCESS(Status))
589 {
590 delete This;
591 }
592
593 DPRINT("NewPortTopology %p Status %x\n", *OutPort, Status);
594 return Status;
595}
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define NonPagedPool
Definition: env_spec_w32.h:307
Status
Definition: gdiplustypes.h:25
#define TAG_PORTCLASS
Definition: private.hpp:24
#define DPRINT
Definition: sndvol32.h:71
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158

Referenced by PcNewPort().

◆ PcCreateItemDispatch()

NTSTATUS NTAPI PcCreateItemDispatch ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 500 of file port_topology.cpp.

503{
505 ISubdevice * SubDevice;
506 IIrpTarget *Filter;
507 PKSOBJECT_CREATE_ITEM CreateItem, PinCreateItem;
508
509 // access the create item
510 CreateItem = KSCREATE_ITEM_IRP_STORAGE(Irp);
511
512 DPRINT("PcCreateItemDispatch called DeviceObject %p %S Name\n", DeviceObject, CreateItem->ObjectClass.Buffer);
513
514 // get the subdevice
515 SubDevice = (ISubdevice*)CreateItem->Context;
516
517 // sanity checks
518 PC_ASSERT(SubDevice != NULL);
519
520
521#if KS_IMPLEMENTED
522 Status = KsReferenceSoftwareBusObject(DeviceExt->KsDeviceHeader);
524 {
525 DPRINT("PcCreateItemDispatch failed to reference device header\n");
526
528 goto cleanup;
529 }
530#endif
531
532 // get filter object
533 Status = SubDevice->NewIrpTarget(&Filter,
534 NULL,
535 NULL,
538 Irp,
539 NULL);
540 if (!NT_SUCCESS(Status))
541 {
542 DPRINT("Failed to get filter object\n");
543 Irp->IoStatus.Status = Status;
545 return Status;
546 }
547
548 // allocate pin create item
549 PinCreateItem = (PKSOBJECT_CREATE_ITEM)AllocateItem(NonPagedPool, sizeof(KSOBJECT_CREATE_ITEM), TAG_PORTCLASS);
550 if (!PinCreateItem)
551 {
552 // not enough memory
553 Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
556 }
557
558 // initialize pin create item
559 PinCreateItem->Context = (PVOID)Filter;
560 PinCreateItem->Create = PcCreatePinDispatch;
561 RtlInitUnicodeString(&PinCreateItem->ObjectClass, KSSTRING_Pin);
562 // FIXME copy security descriptor
563
564 // now allocate a dispatch object
565 Status = NewDispatchObject(Irp, Filter, 1, PinCreateItem);
566
567 // complete request
568 Irp->IoStatus.Status = Status;
570
571 return STATUS_SUCCESS;
572}
_In_ PIRP Irp
Definition: csq.h:116
NTSTATUS NTAPI NewDispatchObject(IN PIRP Irp, IN IIrpTarget *Target, IN ULONG CreateItemCount, IN PKSOBJECT_CREATE_ITEM CreateItem)
Definition: dispatcher.cpp:242
static void cleanup(void)
Definition: main.c:1335
KSDDKAPI NTSTATUS NTAPI KsReferenceSoftwareBusObject(IN KSDEVICE_HEADER Header)
Definition: device.c:780
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1801
#define KSSTRING_Pin
Definition: ks.h:48
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
Definition: misc.c:30
VOID FreeItem(IN PVOID Item)
Definition: misc.c:43
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define IoCompleteRequest
Definition: irp.c:1240
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
NTSTATUS NTAPI PcCreatePinDispatch(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
#define PC_ASSERT(exp)
Definition: private.hpp:26
#define STATUS_SUCCESS
Definition: shellext.h:65
base of all file and directory entries
Definition: entries.h:83
void * PVOID
Definition: typedefs.h:50
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
#define IO_NO_INCREMENT
Definition: iotypes.h:598

Referenced by PcRegisterSubdevice().

◆ PcCreatePinDispatch()

NTSTATUS NTAPI PcCreatePinDispatch ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 437 of file port_topology.cpp.

440{
442 IIrpTarget *Filter;
443 IIrpTarget *Pin;
444 PKSOBJECT_CREATE_ITEM CreateItem;
445
446 // access the create item
447 CreateItem = KSCREATE_ITEM_IRP_STORAGE(Irp);
448 // sanity check
449 PC_ASSERT(CreateItem);
450
451 DPRINT("PcCreatePinDispatch called DeviceObject %p %S Name\n", DeviceObject, CreateItem->ObjectClass.Buffer);
452
453 Filter = (IIrpTarget*)CreateItem->Context;
454
455 // sanity checks
458
459
460#if KS_IMPLEMENTED
461 Status = KsReferenceSoftwareBusObject(DeviceExt->KsDeviceHeader);
463 {
464 DPRINT("PcCreatePinDispatch failed to reference device header\n");
465
467 goto cleanup;
468 }
469#endif
470
471 Status = Filter->NewIrpTarget(&Pin,
473 NULL,
476 Irp,
477 NULL);
478
479 DPRINT("PcCreatePinDispatch Status %x\n", Status);
480
481 if (NT_SUCCESS(Status))
482 {
483 // create the dispatch object
484 // FIXME need create item for clock
486 DPRINT("Pin %p\n", Pin);
487 }
488
489 DPRINT("CreatePinWorkerRoutine completing irp %p\n", Irp);
490 // save status in irp
491 Irp->IoStatus.Status = Status;
492 Irp->IoStatus.Information = 0;
493 // complete the request
495 return Status;
496}
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:427
#define PC_ASSERT_IRQL(x)
Definition: private.hpp:30

Referenced by PcCreateItemDispatch().

Variable Documentation

◆ InterfaceGuids

GUID InterfaceGuids[2]
static
Initial value:
=
{
{
0x6994AD04, 0x93EF, 0x11D0, {0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
},
{
0xDDA54A40, 0x1E4C, 0x11D1, {0xA0, 0x50, 0x40, 0x57, 0x05, 0xC1, 0x00, 0x00}
}
}

Definition at line 44 of file port_topology.cpp.

◆ TopologyPropertySet

KSPROPERTY_SET TopologyPropertySet[]
Initial value:
=
{
{
sizeof(PortFilterTopologyTopologySet) / sizeof(KSPROPERTY_ITEM),
(const KSPROPERTY_ITEM*)&PortFilterTopologyTopologySet,
0,
},
{
sizeof(PortFilterTopologyPinSet) / sizeof(KSPROPERTY_ITEM),
(const KSPROPERTY_ITEM*)&PortFilterTopologyPinSet,
0,
}
}
#define KSPROPSETID_Pin
Definition: ks.h:617
#define KSPROPSETID_Topology
Definition: ks.h:842

Definition at line 59 of file port_topology.cpp.