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)