KsGenerateDataEvent function

The KsGenerateDataEvent function generates one of the standard event notifications when given an event entry structure and callback data. This allows a device to determine when event notifications should be generated, yet still use this helper function to perform the actual notification.

Syntax

NTSTATUS KsGenerateDataEvent(
  _In_ PKSEVENT_ENTRY EventEntry,
  _In_ ULONG          DataSize,
  _In_ PVOID          Data
);

Parameters

EventEntry

Specifies the event entry structure that references the event data. The information is used to determine what type of notification to perform. If the notification type is not one of the predefined standards, an error is returned. In the case of a single, nonrecurring event, this entry will be invalid when returned from the function. Therefore, any code that enumerates a list of events must preincrement to acquire the next event in the list before passing this event to the function.

DataSize

Specifies the size in bytes of the Data parameter passed.

Data

Points to data to be passed to the client callback. This data is copied to one of the preallocated buffer slots set up when the event was enabled. The size of the data must be less than whatever was originally allocated or the event will fail.

Return Value

The KsGenerateDataEvent function returns STATUS_SUCCESS if successful, or if unsuccessful it returns an exception or memory error.

Remarks

It is assumed that the event list lock has been acquired before this function is called. This function can result in a call to the RemoveHandler for the event entry. Therefore, the function must not be called at higher than the IRQ level of the lock, or the Remove function must be able to handle being called at such an IRQ level.

This function is specifically for events that pass data back through a callback to a client.

Requirements

   
Target Platform Universal
Header ks.h (include Ks.h)
Library Ks.lib

See Also

KSBUFFER_ITEM

Send comments about this topic to Microsoft