PCPFNEVENT_HANDLER callback function (portcls.h)

An EventHandler routine processes event requests.

Syntax

PCPFNEVENT_HANDLER PcpfneventHandler;

NTSTATUS PcpfneventHandler(
  [in] PPCEVENT_REQUEST EventRequest
)
{...}

Parameters

[in] EventRequest

Pointer to an initialized PCEVENT_REQUEST structure

Return value

The event handler returns STATUS_SUCCESS if the call was successful. Otherwise, it returns an appropriate error code.

Remarks

Each event that a miniport driver exposes is associated with an event handler. The purpose of the event handler is to process event requests from the port driver and its clients. EventRequest is an input parameter to the handler that contains the following information about the event:

  • The event set GUID and event ID.
  • How the event is to be triggered.
  • Pointers to the target miniport object and (for a pin) stream object.
This is similar to the type of information that is provided with property requests.

The miniport driver exposes its event handlers through its IMiniport::GetDescription method. This method outputs a descriptor structure (see PCFILTER_DESCRIPTOR) that defines the filter that the miniport driver and its associated port driver implement together. This structure contains a pointer to the miniport driver's automation table (see PCAUTOMATION_TABLE), which in turn contains a pointer to an array of the miniport driver's events. Each array element is a PCEVENT_ITEM structure and contains a PCPFNEVENT_HANDLER function pointer to the handler for the event.

The EventHandler routine must reside in nonpaged memory.

Requirements

Requirement Value
Target Platform Desktop
Header portcls.h (include Portcls.h)

See also

IMiniport::GetDescription

IPortEvents::AddEventToEventList

IPortEvents::GenerateEventList

PCAUTOMATION_TABLE

PCEVENT_ITEM

PCEVENT_REQUEST

PCFILTER_DESCRIPTOR