KsPinGenerateEvents function (ks.h)

The KsPinGenerateEvents function generates events of an indicated type that are present in Pin's event list.

Syntax

void KsPinGenerateEvents(
  [in]           PKSPIN                     Pin,
  [in, optional] const GUID                 *EventSet,
  [in]           ULONG                      EventId,
  [in]           ULONG                      DataSize,
  [in, optional] PVOID                      Data,
  [in, optional] PFNKSGENERATEEVENTCALLBACK CallBack,
  [in, optional] PVOID                      CallBackContext
);

Parameters

[in] Pin

A pointer to the KSPIN structure on which to generate events.

[in, optional] EventSet

A pointer to the event set GUID to match to determine which events to generate. If this parameter is NULL, set GUID is not taken into account for determining matching events.

[in] EventId

The event ID to match to determine which events to generate.

[in] DataSize

The size in bytes of the data with which to generate the data event.

[in, optional] Data

A pointer to a data buffer. Specify if generating a data event.

[in, optional] CallBack

A pointer to a caller-specified function that is called to determine whether a given event should be generated. If NULL, no callback verification is performed to determine whether an event should be generated (only *EventSet *and EventId are used). Prototype as follows:

BOOLEAN CallBack
(IN PVOID Context,
    IN PKSEVENT_ENTRY EventEntry);

KsPinGenerateEvents passes the CallBackContext parameter unchanged as the Context parameter for the callback. The callback function returns TRUE if EventEntry should be generated. Otherwise, it returns FALSE.

[in, optional] CallBackContext

A pointer to a caller-specified context that is passed to the callback function CallBack.

Return value

None

Remarks

When calling this function, a minidriver must place Data and CallBackContext in a locked, nonpageable data segment. The CallBack is made at DISPATCH_LEVEL. The callback function must be in a locked segment and must be prepared to run at IRQL = DISPATCH_LEVEL. Note that there is an additional issue in DX8 only: EventSet must be in a locked data segment.

This is an inline function call to KsGenerateEvents, which performs the necessary typecasting. Minidrivers should usually call this version instead of directly calling KsGenerateEvents.

An event is generated if the following three conditions hold:

  • The event is present in *Pin's *event list and *EventId *matches the event's ID.

  • EventSet either matches the event's set GUID or is NULL.

  • *CallBack *is either NULL or authorizes the match.

For more information, see Event Handling in AVStream and KS Events.

Requirements

Requirement Value
Minimum supported client Available in Microsoft Windows XP and later operating systems and DirectX 8.0 and later DirectX versions.
Target Platform Desktop
Header ks.h (include Ks.h)
Library Ks.lib
IRQL <=DISPATCH_LEVEL (See Remarks)

See also

KSEVENT_ENTRY

KsAddEvent

KsFilterGenerateEvents

KsGenerateEvents