Bewerken

Delen via


IKsControl::KsEvent method (ksproxy.h)

The KsEvent method enables or disables an event, along with any other defined support operations available on an event set.

Syntax

HRESULT KsEvent(
  [in, optional] PKSEVENT Event,
  [in]           ULONG    EventLength,
  [in, out]      LPVOID   EventData,
  [in]           ULONG    DataLength,
  [in, out]      ULONG    *BytesReturned
);

Parameters

[in, optional] Event

Pointer to a KSEVENT structure that describes an event to enable the event and NULL to disable the event.

[in] EventLength

Size, in bytes, of the buffer at Event when the event is enabled and zero when the event is disabled.

[in, out] EventData

Pointer to a KSEVENTDATA structure that contains data for the event and buffer space that receives data for the event.

[in] DataLength

Size, in bytes, of the buffer at EventData.

[in, out] BytesReturned

Pointer to a variable that receives the size, in bytes, of the data that KsEvent stores in the buffer at EventData.

Return value

Returns NOERROR if successful; otherwise, returns an error code. If the call succeeds, the event is on the driver's list of events.

Remarks

To disable an event, set Event to NULL, EventLength to zero, and EventData to the pointer to the KSEVENTDATA structure that was previously used to enable the event.

The EventData parameter of IKsControl::KsEvent contains a handle in EventHandle.Event. You can wait for the handle to become available and get notifications when the minidriver calls KsXxxGenerateEvents or StreamClassStreamNotification.

Requirements

Requirement Value
Target Platform DesktopMobile
Header ksproxy.h (include Ksproxy.h)

See also

KSEVENT

KSEVENTDATA

KsFilterGenerateEvents

KsPinGenerateEvents