KSDEVICE structure (ks.h)

The KSDEVICE structure describes a WDM functional device that is managed by AVStream.

Syntax

typedef struct _KSDEVICE {
  const KSDEVICE_DESCRIPTOR *Descriptor;
  KSOBJECT_BAG              Bag;
  PVOID                     Context;
  PDEVICE_OBJECT            FunctionalDeviceObject;
  PDEVICE_OBJECT            PhysicalDeviceObject;
  PDEVICE_OBJECT            NextDeviceObject;
  BOOLEAN                   Started;
  SYSTEM_POWER_STATE        SystemPowerState;
  DEVICE_POWER_STATE        DevicePowerState;
} KSDEVICE, *PKSDEVICE;

Members

Descriptor

A pointer to a KSDEVICE_DESCRIPTOR structure that describes the characteristics of the device and the static filters supported by it.

Bag

This member specifies the KSOBJECT_BAG (equivalent to type PVOID) associated with the device. See Object Bags.

Context

A pointer to a memory location that contains context information for the device. AVStream stores a pointer to a device extension in this member for minidrivers that allocate a device extension in AVStrMiniDeviceStart. Memory allocated for context should be placed in the object bag using KsAddItemToObjectBag. Context is initialized to NULL at create time.

FunctionalDeviceObject

A pointer to a DEVICE_OBJECT structure that is the WDM functional device object for the device being described.

PhysicalDeviceObject

A pointer to a DEVICE_OBJECT structure that is the WDM physical device object for the device being described.

NextDeviceObject

A pointer to a DEVICE_OBJECT structure that is the next device in the driver stack as determined by IoAttachDeviceToDeviceStack.

Started

This member indicates whether this particular device has been started or not. If TRUE, the device has been started. If FALSE, the device has not been started. This flag is set during the processing of the IRP_MN_START_DEVICE and is reset during the processing of the IRP_MN_STOP_DEVICE. A device that is not started returns STATUS_DEVICE_NOT_READY in response to all requests to create a filter.

SystemPowerState

A SYSTEM_POWER_STATE-typed value that indicates the current power state of the system. SYSTEM_POWER_STATE values are defined in wdm.h.

DevicePowerState

A DEVICE_POWER_STATE-typed value that indicates the current power state of the device. DEVICE_POWER_STATE values are defined in wdm.h.

Remarks

Clients typically use this structure if they must implement specific PnP or Power Management behavior that is not provided by AVStream. A pointer to a KSDEVICE structure is the first parameter to all dispatch routines specified in KSDEVICE_DISPATCH, and the client is free to use the context information to attach its own context for these routines. In addition, clients may obtain a pointer to the KSDEVICE structure from a WDM device object pointer by calling KsGetDeviceForDeviceObject.

As mentioned above, Context is initialized to NULL at create time. However, descendants of this KSDEVICE structure have their corresponding Context members set to the value of the parent object's Context member. This happens when the new object is created. For more information, see AVStream Object Hierarchy and Object Bags. Also see the reference pages for the possible AVStream descendant objects: KSFILTERFACTORY, KSFILTER and KSPIN.

Requirements

Requirement Value
Minimum supported client Available in Microsoft Windows XP and later operating systems and in Microsoft DirectX 8.0 and later versions.
Header ks.h (include Ks.h)

See also

KSDEVICE_DESCRIPTOR

KSDEVICE_DISPATCH

KSFILTER

KSFILTERFACTORY

KSPIN

KsAddItemToObjectBag

KsGetDeviceForDeviceObject