mirror of
https://github.com/reactos/reactos.git
synced 2025-06-06 01:40:36 +00:00
- Implement KsGetObjectFromFileObject, KsGetObjectFromFileObject, KsGetObjectTypeFromIrp, KsGetParent
svn path=/trunk/; revision=42268
This commit is contained in:
parent
5e12a7edb1
commit
ca60ae56c0
6 changed files with 47 additions and 14 deletions
|
@ -513,6 +513,11 @@ KsAllocateDeviceHeader(
|
|||
/* initialize create item list */
|
||||
InitializeListHead(&Header->ItemList);
|
||||
|
||||
/* initialize basic header */
|
||||
Header->BasicHeader.Type = KsObjectTypeDevice;
|
||||
Header->BasicHeader.KsDevice = &Header->KsDevice;
|
||||
Header->BasicHeader.Parent.KsDevice = &Header->KsDevice;
|
||||
|
||||
/* are there any create items provided */
|
||||
if (ItemsCount && ItemsList)
|
||||
{
|
||||
|
|
|
@ -653,7 +653,6 @@ KsInitializeDevice(
|
|||
KsSetDevicePnpAndBaseObject(Header, PhysicalDeviceObject, NextDeviceObject);
|
||||
/* initialize IKsDevice interface */
|
||||
Header->lpVtblIKsDevice = &vt_IKsDevice;
|
||||
Header->Type = KsObjectTypeDevice;
|
||||
Header->ref = 1;
|
||||
|
||||
/* FIXME Power state */
|
||||
|
|
|
@ -865,6 +865,7 @@ KspCreateFilter(
|
|||
This->FilterFactory = iface;
|
||||
This->FileObject = IoStack->FileObject;
|
||||
This->Header.KsDevice = &DeviceExtension->DeviceHeader->KsDevice;
|
||||
This->Header.Parent.KsFilterFactory = iface->lpVtbl->GetStruct(iface);
|
||||
This->Header.Type = KsObjectTypeFilter;
|
||||
|
||||
/* allocate the stream descriptors */
|
||||
|
@ -919,6 +920,7 @@ KspCreateFilter(
|
|||
This->Header.KsDevice = &DeviceExtension->DeviceHeader->KsDevice;
|
||||
This->ObjectHeader->Type = KsObjectTypeFilter;
|
||||
This->ObjectHeader->Unknown = (PUNKNOWN)&This->lpVtbl;
|
||||
This->ObjectHeader->ObjectType = (PVOID)&This->Filter;
|
||||
|
||||
|
||||
/* completed initialization */
|
||||
|
|
|
@ -185,6 +185,7 @@ IKsFilterFactory_fnInitialize(
|
|||
This->FilterFactory.FilterDescriptor = Descriptor;
|
||||
This->Header.KsDevice = &DeviceExtension->DeviceHeader->KsDevice;
|
||||
This->Header.Type = KsObjectTypeFilterFactory;
|
||||
This->Header.Parent.KsDevice = &DeviceExtension->DeviceHeader->KsDevice;
|
||||
This->DeviceHeader = DeviceExtension->DeviceHeader;
|
||||
|
||||
InitializeListHead(&This->SymbolicLinkList);
|
||||
|
|
|
@ -28,6 +28,7 @@ typedef struct
|
|||
|
||||
UNICODE_STRING ObjectClass;
|
||||
PUNKNOWN Unknown;
|
||||
PVOID ObjectType;
|
||||
|
||||
PDEVICE_OBJECT TargetDevice;
|
||||
LIST_ENTRY TargetDeviceListEntry;
|
||||
|
@ -55,11 +56,17 @@ typedef struct
|
|||
{
|
||||
KSOBJECTTYPE Type;
|
||||
PKSDEVICE KsDevice;
|
||||
union
|
||||
{
|
||||
PKSDEVICE KsDevice;
|
||||
PKSFILTERFACTORY KsFilterFactory;
|
||||
PKSFILTER KsFilter;
|
||||
}Parent;
|
||||
}KSBASIC_HEADER, *PKSBASIC_HEADER;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
KSOBJECTTYPE Type;
|
||||
KSBASIC_HEADER BasicHeader;
|
||||
KSDEVICE KsDevice;
|
||||
IKsDeviceVtbl *lpVtblIKsDevice;
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ KspCopyCreateRequest(
|
|||
}
|
||||
|
||||
/*
|
||||
@unimplemented
|
||||
@implemented
|
||||
*/
|
||||
KSDDKAPI
|
||||
PVOID
|
||||
|
@ -148,12 +148,17 @@ NTAPI
|
|||
KsGetObjectFromFileObject(
|
||||
IN PFILE_OBJECT FileObject)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
return NULL;
|
||||
PKSIOBJECT_HEADER ObjectHeader;
|
||||
|
||||
/* get object header */
|
||||
ObjectHeader = (PKSIOBJECT_HEADER)FileObject->FsContext;
|
||||
|
||||
/* return associated object */
|
||||
return ObjectHeader->ObjectType;
|
||||
}
|
||||
|
||||
/*
|
||||
@unimplemented
|
||||
@implemented
|
||||
*/
|
||||
KSDDKAPI
|
||||
KSOBJECTTYPE
|
||||
|
@ -161,20 +166,31 @@ NTAPI
|
|||
KsGetObjectTypeFromFileObject(
|
||||
IN PFILE_OBJECT FileObject)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
return (KSOBJECTTYPE)-1;
|
||||
PKSIOBJECT_HEADER ObjectHeader;
|
||||
|
||||
/* get object header */
|
||||
ObjectHeader = (PKSIOBJECT_HEADER)FileObject->FsContext;
|
||||
/* return type */
|
||||
return ObjectHeader->Type;
|
||||
}
|
||||
|
||||
/*
|
||||
@unimplemented
|
||||
@implemented
|
||||
*/
|
||||
KSOBJECTTYPE
|
||||
NTAPI
|
||||
KsGetObjectTypeFromIrp(
|
||||
IN PIRP Irp)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
return (KSOBJECTTYPE)-1;
|
||||
PKSIOBJECT_HEADER ObjectHeader;
|
||||
PIO_STACK_LOCATION IoStack;
|
||||
|
||||
/* get current irp stack */
|
||||
IoStack = IoGetCurrentIrpStackLocation(Irp);
|
||||
/* get object header */
|
||||
ObjectHeader = (PKSIOBJECT_HEADER)IoStack->FileObject->FsContext;
|
||||
/* return type */
|
||||
return ObjectHeader->Type;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -191,7 +207,7 @@ KsGetOuterUnknown(
|
|||
}
|
||||
|
||||
/*
|
||||
@unimplemented
|
||||
@implemented
|
||||
*/
|
||||
KSDDKAPI
|
||||
PVOID
|
||||
|
@ -199,8 +215,11 @@ NTAPI
|
|||
KsGetParent(
|
||||
IN PVOID Object)
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
return NULL;
|
||||
PKSBASIC_HEADER BasicHeader = (PKSBASIC_HEADER)((ULONG_PTR)Object - sizeof(KSBASIC_HEADER));
|
||||
/* sanity check */
|
||||
ASSERT(BasicHeader->Parent.KsDevice != NULL);
|
||||
/* return object type */
|
||||
return (PVOID)BasicHeader->Parent.KsDevice;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue