Author: janderwald
Date: Thu Jul 23 02:47:21 2009
New Revision: 42150
URL:
http://svn.reactos.org/svn/reactos?rev=42150&view=rev
Log:
- Implement KsQueryObjectAccessMask, KsQueryObjectCreateItem
- Use KSQUEUE_SPINLOCK_IRP_STORAGE macro for access the stored spin lock
Modified:
trunk/reactos/drivers/ksfilter/ks/api.c
trunk/reactos/drivers/ksfilter/ks/irp.c
trunk/reactos/drivers/ksfilter/ks/kstypes.h
Modified: trunk/reactos/drivers/ksfilter/ks/api.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/api.c?…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/api.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/api.c [iso-8859-1] Thu Jul 23 02:47:21 2009
@@ -245,7 +245,7 @@
}
/*
- @unimplemented
+ @implemented
*/
KSDDKAPI
ACCESS_MASK
@@ -253,8 +253,11 @@
KsQueryObjectAccessMask(
IN KSOBJECT_HEADER Header)
{
- UNIMPLEMENTED;
- return STATUS_UNSUCCESSFUL;
+ PKSIOBJECT_HEADER ObjectHeader = (PKSIOBJECT_HEADER)Header;
+
+ /* return access mask */
+ return ObjectHeader->AccessMask;
+
}
/*
@@ -402,7 +405,7 @@
/*
- @unimplemented
+ @implemented
*/
KSDDKAPI
PKSOBJECT_CREATE_ITEM
@@ -410,8 +413,8 @@
KsQueryObjectCreateItem(
IN KSOBJECT_HEADER Header)
{
- UNIMPLEMENTED;
- return NULL;
+ PKSIOBJECT_HEADER ObjectHeader = (PKSIOBJECT_HEADER)Header;
+ return ObjectHeader->OriginalCreateItem;
}
NTSTATUS
@@ -648,6 +651,13 @@
/* store parent device */
ObjectHeader->ParentDeviceObject =
IoGetRelatedDeviceObject(IoStack->FileObject);
+
+ /* store originating create item */
+ ObjectHeader->OriginalCreateItem = KSCREATE_ITEM_IRP_STORAGE(Irp);
+
+ /* FIXME store access mask see KsQueryObjectAccessMask */
+ ObjectHeader->AccessMask =
IoStack->Parameters.Create.SecurityContext->DesiredAccess;
+
/* store result */
*Header = ObjectHeader;
@@ -1145,3 +1155,4 @@
return STATUS_UNSUCCESSFUL;
}
+
Modified: trunk/reactos/drivers/ksfilter/ks/irp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/irp.c?…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/irp.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/irp.c [iso-8859-1] Thu Jul 23 02:47:21 2009
@@ -830,10 +830,8 @@
/* get current irp stack */
IoStack = IoGetCurrentIrpStackLocation(Irp);
- /* get internal queue lock
- * see KsAddIrpToCancelableQueue
- */
- SpinLock = (PKSPIN_LOCK)Irp->Tail.Overlay.DeviceQueueEntry.DeviceListEntry.Flink;
+ /* get internal queue lock */
+ SpinLock = KSQUEUE_SPINLOCK_IRP_STORAGE(Irp);
/* acquire spinlock */
KeAcquireSpinLock(SpinLock, &OldLevel);
@@ -993,10 +991,8 @@
PKSPIN_LOCK SpinLock;
KIRQL OldLevel;
- /* get internal queue lock
- * see KsAddIrpToCancelableQueue
- */
- SpinLock = (PKSPIN_LOCK)Irp->Tail.Overlay.DeviceQueueEntry.DeviceListEntry.Flink;
+ /* get internal queue lock */
+ SpinLock = KSQUEUE_SPINLOCK_IRP_STORAGE(Irp);
/* acquire spinlock */
KeAcquireSpinLock(SpinLock, &OldLevel);
@@ -1053,11 +1049,8 @@
InsertHeadList(QueueHead, &Irp->Tail.Overlay.ListEntry);
}
- /* store the spinlock in the device queue list entry,
- * as other fields may have been internally been used
- * used in KsCancelRoutine
- */
- Irp->Tail.Overlay.DeviceQueueEntry.DeviceListEntry.Flink = (PLIST_ENTRY)SpinLock;
+ /* store internal queue lock */
+ KSQUEUE_SPINLOCK_IRP_STORAGE(Irp) = SpinLock;
/* now set the cancel routine */
OldDriverCancel = IoSetCancelRoutine(Irp, DriverCancel);
@@ -1093,10 +1086,8 @@
PKSPIN_LOCK SpinLock;
KIRQL OldLevel;
- /* get internal queue lock
- * see KsAddIrpToCancelableQueue
- */
- SpinLock = (PKSPIN_LOCK)Irp->Tail.Overlay.DeviceQueueEntry.DeviceListEntry.Flink;
+ /* get internal queue lock */
+ SpinLock = KSQUEUE_SPINLOCK_IRP_STORAGE(Irp);
/* acquire spinlock */
KeAcquireSpinLock(SpinLock, &OldLevel);
Modified: trunk/reactos/drivers/ksfilter/ks/kstypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/kstype…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] Thu Jul 23 02:47:21 2009
@@ -20,6 +20,8 @@
PFNKSCONTEXT_DISPATCH PowerDispatch;
PVOID PowerContext;
LIST_ENTRY PowerDispatchEntry;
+ PKSOBJECT_CREATE_ITEM OriginalCreateItem;
+ ACCESS_MASK AccessMask;
}KSIOBJECT_HEADER, *PKSIOBJECT_HEADER;