2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Kernel Streaming
4 * FILE: drivers/ksfilter/ks/misc.c
5 * PURPOSE: KS Allocator functions
6 * PROGRAMMER: Johannes Anderwald
14 IN POOL_TYPE PoolType
,
15 IN SIZE_T NumberOfBytes
)
17 PVOID Item
= ExAllocatePool(PoolType
, NumberOfBytes
);
21 RtlZeroMemory(Item
, NumberOfBytes
);
35 KspForwardIrpSynchronousCompletion(
36 IN PDEVICE_OBJECT DeviceObject
,
40 if (Irp
->PendingReturned
== TRUE
)
42 KeSetEvent ((PKEVENT
) Context
, IO_NO_INCREMENT
, FALSE
);
44 return STATUS_MORE_PROCESSING_REQUIRED
;
49 KspForwardIrpSynchronous(
50 IN PDEVICE_OBJECT DeviceObject
,
55 PDEVICE_EXTENSION DeviceExtension
;
56 PKSIDEVICE_HEADER DeviceHeader
;
58 ASSERT_IRQL_EQUAL(PASSIVE_LEVEL
);
60 /* get device extension */
61 DeviceExtension
= (PDEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
62 /* get device header */
63 DeviceHeader
= DeviceExtension
->DeviceHeader
;
65 /* initialize the notification event */
66 KeInitializeEvent(&Event
, NotificationEvent
, FALSE
);
68 IoCopyCurrentIrpStackLocationToNext(Irp
);
70 IoSetCompletionRoutine(Irp
, KspForwardIrpSynchronousCompletion
, (PVOID
)&Event
, TRUE
, TRUE
, TRUE
);
72 /* now call the driver */
73 Status
= IoCallDriver(DeviceHeader
->BaseDevice
, Irp
);
74 /* did the request complete yet */
75 if (Status
== STATUS_PENDING
)
77 /* not yet, lets wait a bit */
78 KeWaitForSingleObject(&Event
, Executive
, KernelMode
, FALSE
, NULL
);
79 Status
= Irp
->IoStatus
.Status
;
87 KSDDKAPI NTSTATUS NTAPI
88 KsPinDataIntersectionEx(
92 IN ULONG DescriptorsCount
,
93 IN
const KSPIN_DESCRIPTOR
* Descriptor
,
94 IN ULONG DescriptorSize
,
95 IN PFNKSINTERSECTHANDLEREX IntersectHandler OPTIONAL
,
96 IN PVOID HandlerContext OPTIONAL
)
99 return STATUS_UNSUCCESSFUL
;