From d8fa27fec7ece71d828eb903773ddb11ad1bc4c3 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Thu, 13 Aug 2009 09:54:51 +0000 Subject: [PATCH] [KS] - Check if irp was allocated - Unimplement KsPinGetConnectedPinFileObject svn path=/trunk/; revision=42649 --- reactos/drivers/ksfilter/ks/api.c | 7 +++++++ reactos/drivers/ksfilter/ks/pin.c | 14 ++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/reactos/drivers/ksfilter/ks/api.c b/reactos/drivers/ksfilter/ks/api.c index 0626e62f494..db6e1b89eeb 100644 --- a/reactos/drivers/ksfilter/ks/api.c +++ b/reactos/drivers/ksfilter/ks/api.c @@ -1148,6 +1148,13 @@ KsSynchronousIoControlDevice( /* create the irp */ Irp = IoBuildDeviceIoControlRequest(IoControl, DeviceObject, InBuffer, InSize, OutBuffer, OutSize, FALSE, &Event, &IoStatusBlock); + if (!Irp) + { + /* no memory to allocate the irp */ + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* HACK */ IoStack = IoGetNextIrpStackLocation(Irp); IoStack->FileObject = FileObject; diff --git a/reactos/drivers/ksfilter/ks/pin.c b/reactos/drivers/ksfilter/ks/pin.c index 9f65572e931..7bb32b37c61 100644 --- a/reactos/drivers/ksfilter/ks/pin.c +++ b/reactos/drivers/ksfilter/ks/pin.c @@ -384,16 +384,14 @@ KsPinGetConnectedPinDeviceObject( } /* - @implemented + @unimplemented */ PFILE_OBJECT NTAPI KsPinGetConnectedPinFileObject( IN PKSPIN Pin) { - IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(Pin, IKsPinImpl, Pin); - - return This->FileObject; + return NULL; } /* @@ -1188,8 +1186,12 @@ KspCreatePin( This->ObjectHeader->Unknown = (PUNKNOWN)&This->lpVtbl; This->ObjectHeader->ObjectType = (PVOID)&This->Pin; - /* now inform the driver to create a new pin */ - Status = Descriptor->Dispatch->Create(&This->Pin, Irp); + /* does the driver have a pin dispatch */ + if (Descriptor->Dispatch && Descriptor->Dispatch->Create) + { + /* now inform the driver to create a new pin */ + Status = Descriptor->Dispatch->Create(&This->Pin, Irp); + } if (!NT_SUCCESS(Status) && Status != STATUS_PENDING) {