PFN_START_MIRACAST_SESSION callback function (netdispumdddi.h)

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

Syntax

PFN_START_MIRACAST_SESSION PfnStartMiracastSession;

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

Parameters

[in] 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.

[in] 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.
 

[in] pWfdConnectionStats

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

[out] 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

Requirement Value
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