ReactOS 0.4.16-dev-91-g764881a
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 11 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 587 of file port_topology.cpp.

589{
591 return This->m_pMiniport;
592}
CPPORT Port[4]
Definition: headless.c:35

◆ NewPortTopology()

NTSTATUS NewPortTopology ( OUT PPORT OutPort)

Definition at line 565 of file port_topology.cpp.

567{
570
572 if (!This)
574
575 Status = This->QueryInterface(IID_IPort, (PVOID*)OutPort);
576
577 if (!NT_SUCCESS(Status))
578 {
579 delete This;
580 }
581
582 DPRINT("NewPortTopology %p Status %x\n", *OutPort, Status);
583 return Status;
584}
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#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:73
#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 491 of file port_topology.cpp.

494{
496 ISubdevice * SubDevice;
497 IIrpTarget *Filter;
498 PKSOBJECT_CREATE_ITEM CreateItem, PinCreateItem;
499
500 // access the create item
501 CreateItem = KSCREATE_ITEM_IRP_STORAGE(Irp);
502
503 DPRINT("PcCreateItemDispatch called DeviceObject %p %S Name\n", DeviceObject, CreateItem->ObjectClass.Buffer);
504
505 // get the subdevice
506 SubDevice = (ISubdevice*)CreateItem->Context;
507
508 // sanity checks
509 PC_ASSERT(SubDevice != NULL);
510
511#if KS_IMPLEMENTED
512 Status = KsReferenceSoftwareBusObject(DeviceExt->KsDeviceHeader);
514 {
515 DPRINT("PcCreateItemDispatch failed to reference device header\n");
516
518 goto cleanup;
519 }
520#endif
521
522 // get filter object
523 Status = SubDevice->NewIrpTarget(&Filter,
524 NULL,
525 NULL,
528 Irp,
529 NULL);
530 if (!NT_SUCCESS(Status))
531 {
532 DPRINT("Failed to get filter object\n");
533 Irp->IoStatus.Status = Status;
535 return Status;
536 }
537
538 // allocate pin create item
539 PinCreateItem = (PKSOBJECT_CREATE_ITEM)AllocateItem(NonPagedPool, sizeof(KSOBJECT_CREATE_ITEM), TAG_PORTCLASS);
540 if (!PinCreateItem)
541 {
542 // not enough memory
543 Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
546 }
547
548 // initialize pin create item
549 PinCreateItem->Context = (PVOID)Filter;
550 PinCreateItem->Create = PcCreatePinDispatch;
551 RtlInitUnicodeString(&PinCreateItem->ObjectClass, KSSTRING_Pin);
552 // FIXME copy security descriptor
553
554 // now allocate a dispatch object
555 Status = NewDispatchObject(Irp, Filter, 1, PinCreateItem);
556
557 // complete request
558 Irp->IoStatus.Status = Status;
560
561 return STATUS_SUCCESS;
562}
_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:234
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:29
VOID FreeItem(IN PVOID Item)
Definition: misc.c:37
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 429 of file port_topology.cpp.

432{
434 IIrpTarget *Filter;
435 IIrpTarget *Pin;
436 PKSOBJECT_CREATE_ITEM CreateItem;
437
438 // access the create item
439 CreateItem = KSCREATE_ITEM_IRP_STORAGE(Irp);
440 // sanity check
441 PC_ASSERT(CreateItem);
442
443 DPRINT("PcCreatePinDispatch called DeviceObject %p %S Name\n", DeviceObject, CreateItem->ObjectClass.Buffer);
444
445 Filter = (IIrpTarget*)CreateItem->Context;
446
447 // sanity checks
450
451#if KS_IMPLEMENTED
452 Status = KsReferenceSoftwareBusObject(DeviceExt->KsDeviceHeader);
454 {
455 DPRINT("PcCreatePinDispatch failed to reference device header\n");
456
458 goto cleanup;
459 }
460#endif
461
462 Status = Filter->NewIrpTarget(&Pin,
464 NULL,
467 Irp,
468 NULL);
469
470 DPRINT("PcCreatePinDispatch Status %x\n", Status);
471
472 if (NT_SUCCESS(Status))
473 {
474 // create the dispatch object
475 // FIXME need create item for clock
477 DPRINT("Pin %p\n", Pin);
478 }
479
480 DPRINT("CreatePinWorkerRoutine completing irp %p\n", Irp);
481 // save status in irp
482 Irp->IoStatus.Status = Status;
483 Irp->IoStatus.Information = 0;
484 // complete the request
486 return Status;
487}
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:428
#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 41 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 56 of file port_topology.cpp.