APPLICATION_EVENT_DATA structure

Contains an event sent by an application on the device. The data is determined by the application and the event identifier.

Syntax


typedef struct _APPLICATION_EVENT_DATA {
  DWORD          cbApplicationEventData;
  APPLICATION_ID ApplicationId;
  ENDPOINT_ID    EndpointId;
  DWORD          dwEventId;
  DWORD          cbEventData;
  BYTE           bEventData[1];
} APPLICATION_EVENT_DATA, *PAPPLICATION_EVENT_DATA;

Members

cbApplicationEventData

This member contains the total number of bytes in the event application data structure. The data can be of variable size. The size of the data is stored along with the first byte of that data. See the following code for implementation details.

cbApplicationEventData = sizeof(APPLICATION_EVENT_DATA) + (cbEventData - 1);

ApplicationId

The identifier of the application. See the following code for implementation details.

ApplicationId = the APPLICATION_ID (GUID)

The GUID of the gadget that raised the event.

EndpointId

The identifier of the endpoint. See the following code for implementation details.

EndpointId = the ENDPOINT_ID (GUID)

The GUID of the gadget that raised the event.

dwEventId

The endpoint-specific event identifier code

cbEventData

The size of the actual event. This can be zero (0). If it is 0, then the bEventData member is invalid, and should not be accessed.

bEventData

The first byte of the event data.

Remarks

This struct should always be allocated as:

offsetof(APPLICATION_EVENT_DATA, bEventData) + <event data size>

This size should be set in the cbApplicationEventData member. The cbEventData member should contain only <event data size>.

When allocating memory for an APPLICATION_EVENT_DATA struct, you should allocate cbApplicationEventData bytes, and the data should be contiguous starting with the bEventData member.


hr = m_pWdfDevice->PostEvent(SIDESHOW_APPLICATION_EVENT,
    WdfEventBroadcast,
    (BYTE*)pEventData,
    pEventData->cbApplicationEventData);

The type and content of application events are specific to each endpoint. Application events are only defined for the Simple Content Format endpoint. These events, the dwEventId and bEventData members of the structure are defined in WindowsSideShow.h.

There are also two general application events that are applicable to all endpoints:

  • SIDESHOW_EVENTID_APPLICATION_ENTER

  • SIDESHOW_EVENTID_APPLICATION_EXIT

Both of these events have 0-size data portions. They should be sent by a device when the user enters and exits that gadget on the device.

Requirements

Header

Windowssideshowdriverevents.h

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft