PFN_START_MIRACAST_SESSION callback function

Called by the operating system to start a Miracast connected session.

Syntax

PFN_START_MIRACAST_SESSION PfnStartMiracastSession;

NTSTATUS PfnStartMiracastSession(
  PVOID pMiracastContext,
  SOCKET MiracastRTSPSocket,
  MIRACAST_WFD_CONNECTION_STATS *pWfdConnectionStats,
  MIRACAST_SESSION_INFO *pSessionInfo
)
{...}

Parameters

pMiracastContext

A pointer to a context associated with a display adapter.

The operating system obtained the context when it called the Miracast user-mode driver's CreateMiracastContext function.

MiracastRTSPSocket

The operating system-supplied network socket handle of the Real Time Streaming Protocol (RTSP).

Note The Miracast user-mode driver should not close this socket. When the StopMiracastSession function is called, the operating system will close this socket.

*pWfdConnectionStats

A pointer to a MIRACAST_WFD_CONNECTION_STATS structure that indicates the Wi-Fi Direct connection statistics.

*pSessionInfo

A pointer to a MIRACAST_SESSION_INFO structure that the Miracast user-mode driver should complete after it has obtained the capabilities of the Miracast sink.

Return Value

On success, this function returns STATUS_SUCCESS. Otherwise, the function returns an error code defined in the Ntstatus.h header, including the following:

Return code Description
STATUS_DEVICE_INSUFFICIENT_RESOURCES The current suggested encode rate cannot sustain a Miracast sink that supports more than 1024 x 768 pixels.

Remarks

When this function is called, the Miracast user-mode driver should start communicating with the Miracast sink using the Miracast protocol. The driver should gather the capabilities of the sink and the attributes of the monitor that's connected to the sink. The driver should perform enough of the negotiation with the sink to determine whether a monitor is connected to the sink or not. If the driver determines that a monitor is connected to the sink, it should also determine whether the current suggested bit rate is high enough to at least support the lowest sink supported mode of 1024 x 768 pixels.

The driver should also set the value of these members of MIRACAST_SESSION_INFO pointed to by pSessionInfo in these cases:

Thread Safety

The operating system guarantees that only one of the CreateMiracastContext, DestroyMiracastContext, StartMiracastSession, and StopMiracastSession functions is called at a time.

Requirements

   
Minimum supported client Windows 8.1
Minimum supported server Windows Server 2012 R2
Target Platform Desktop
Header netdispumdddi.h (include Netdispumdddi.h)

See Also

CreateMiracastContext

DestroyMiracastContext

MIRACAST_SESSION_INFO

MIRACAST_WFD_CONNECTION_STATS

StopMiracastSession