KSPROPERTY structure

The KSPROPERTY structure specifies a single kernel streaming property within a property set.

The KSEVENT, KSMETHOD, and KSPROPERTY structures are aliases for the KSIDENTIFIER structure. 因此,它们的定义是相同的。

Syntax

struct KSPROPERTY {
  GUID Set;
  ULONG Id;
  ULONG Flags;
};

Members

Set

指定标识内核流属性集的 GUID。 For more information about property set GUIDs, see the Remarks section below.

Id

指定属性集的成员。

Flags

指定请求类型。 If you are writing a stream class minidriver, also see KSPROPERTY_ITEM for class-specific flag information.

Flags should be one of the values listed in the following table. 某些标志可以使用按位 OR作组合使用。

Value Description
KSPROPERTY_TYPE_GET 检索指定属性项的值。
KSPROPERTY_TYPE_SET 设置指定属性项的值。
KSPROPERTY_TYPE_SETSUPPORT 如果驱动程序支持此属性集,则查询。
KSPROPERTY_TYPE_BASICSUPPORT 查询驱动程序处理此属性项的请求类型。 Returns KSPROPERTY_TYPE_GET or KSPROPERTY_TYPE_SET or both. 所有属性集都必须支持此标志。
KSPROPERTY_TYPE_DEFAULTVALUES 查询指定属性项的默认值。 Returns a structure of type KSPROPERTY_VALUES.
KSPROPERTY_TYPE_RELATIONS 查询依赖于此属性的当前设置的所有属性。 指定要返回属性关系列表;如果返回缓冲区是 ULONG 的大小,则返回此类列表所需的缓冲区空间量。 Each element is on FILE_QUAD_ALIGNMENT, preceded by a KSMULTIPLE_ITEM structure. 在查询对一般属性集的支持时,这无效。 所有属性集都必须支持此标志。
KSPROPERTY_TYPE_SERIALIZESET Serialize the property set, using the standard KSPROPERTY_SERIALHDR and KSPROPERTY_SERIAL structures.
KSPROPERTY_TYPE_UNSERIALIZESET Unserialize the property set, using the standard KSPROPERTY_SERIALHDR and KSPROPERTY_SERIAL structures.
KSPROPERTY_TYPE_SERIALIZESIZE Returns a ULONG specifying size of the property data when serialized as part of a KSPROPERTY_TYPE_SERIALIZESET request. 大小为零表示不需要序列化属性。
KSPROPERTY_TYPE_SERIALIZERAW 指定此属性集支持处理程序应序列化此集中的属性(如果存在)。 否则,调用将失败。 序列化格式为专用格式。 This operation must be the inverse of KSPROPERTY_TYPE_UNSERIALIZERAW.
KSPROPERTY_TYPE_TOPOLOGY Property passed is of type KSP_NODE, where NodeId indicates the numeric ID of the topology node. 请勿自行设置此标志;而是在此表中具有其他标志。
KSPROPERTY_TYPE_UNSERIALIZERAW 指定提供的缓冲区包含属于此集的属性组,如果存在,则应由属性集支持处理程序取消序列化。 否则,调用将失败。 序列化格式为专用格式。 This operation must be the inverse of KSPROPERTY_TYPE_SERIALIZERAW.

Remarks

传递的输出缓冲区的大小决定了从KSPROPERTY_TYPE_BASICSUPPORT请求返回的数据。 如果输出缓冲区是 ULONG 的大小,则仅返回访问标志。 If the output buffer is the size of the KSPROPERTY_DESCRIPTION structure, the structure is filled with the access flags, the inclusive size of the entire values information, the property value type information, and the number of member lists that correspond to the structure.

对于KSPROPERTY_TYPE_RELATIONS请求,返回的数据也取决于输出缓冲区的大小。 If the output buffer size is zero, the size required to return the related properties is returned in BytesReturned with a warning status of STATUS_BUFFER_OVERFLOW. If the buffer is the size of a KSMULTIPLE_ITEM structure, both the byte size and count of relations is returned. Otherwise, the buffer is expected to be long enough to return the KSMULTIPLE_ITEM structure and all related property identifiers, which is returned as a list of KSIDENTIFIER structures.

KSPROPERTY_TYPE_SERIALIZESET and KSPROPERTY_TYPE_UNSERIALIZESET requests allow interaction with multiple properties with a single call from the client. If the kernel streaming handler is being used to process property requests, these are broken up into multiple calls by the KsPropertyHandler function. 使用此处理程序时,属性集定义控制要序列化哪些属性。

For serialization requests, the SerializedSize member of the relevant KSPROPERTY_ITEM structure is checked for a nonzero value that indicates the size, in bytes, of the property. 如果 SerializedSize 成员的值为 1,则为未知且必须查询(所有未知属性以可以单独查询KSMULTIPLE_ITEM结构开头)。 To query for the total size a serialization would take, the client passes a zero length buffer in the call to DeviceIoControl. BytesReturned then returns the size, in bytes, that the buffer must be to serialize the set, and a warning status of STATUS_BUFFER_OVERFLOW. 然后,分配了该大小的缓冲区可以填充序列化的数据。

The format of the serialization buffer is a KSPROPERTY_SERIALHDR, followed by serialized properties. Each property that follows contains a header (KSPROPERTY_SERIAL), followed by the property data, with the start of each property on FILE_LONG_ALIGNMENT. Note that the serial header structure is defined to be on FILE_LONG_ALIGNMENT.

KSPROPERTY_TYPE_SERIALIZERAW and KSPROPERTY_TYPE_UNSERIALIZERAW are supported if a property item handler exists. The KsPropertyHandler function invokes the handler provided by the minidriver. 还可以通过将零长度缓冲区传递给序列化原始请求来查询序列化所需的缓冲区大小。 Because handlers are attached to property items rather than the property set, a specific item within the property set must be specified in the Property parameter. 此处理程序可以处理集中的多个属性。

Microsoft提供了多个系统定义的属性集 GUID。 Minidrivers specify one of these GUIDs in the Set member. Kernel streaming property sets typically begin with either a KSPROPSETID or a PROPSETID prefix. Kernel streaming property sets are defined in ks.h, ksmedia.h, bdamedia.h, and possibly other header files.

有关内核流式处理事件的详细信息,请参阅 KS 属性、事件和方法

Requirements

Header: ks.h (include Ks.h)

See also

KSEVENT

KSMETHOD

KSIDENTIFIER

KSMETHOD_ITEM

KSE_NODE

KSPROPERTY_DESCRIPTION

KSPROPERTY_ITEM

KSMULTIPLE_ITEM

KsPropertyHandler

KSPROPERTY_SERIALHDR

KSPROPERTY_SERIAL