HvConnectPort function

The HvConnectPort function creates a connection to a previously-created port in another partition.

Syntax


HV_STATUS  HvConnectPort(
  _In_  HV_PARTITION_ID ConnectionPartition,
  _In_  HV_CONNECTION_ID ConnectionId,
  _In_  HV_PARTITION_ID PortPartition,
  _In_  HV_PORT_ID PortId,
  _In_  PCHV_CONNECTION_INFO ConnectionInfo
);

Parameters

ConnectionPartition [in]

An HV_PARTITION_ID value that identifies the partition that will send messages or signal events by using the connection that HvConnectPort creates. HV_PARTITION_ID is defined as an unsigned 64-bit (UINT64) value.

ConnectionId [in]

An HV_CONNECTION_ID value that specifies an identifier that is unique among all connection identifiers for the partition that the ConnectionPartition parameter specifies. The connection identifier is used to refer to the connection.

PortPartition [in]

An HV_PARTITION_ID value that identifies the partition whose port is being connected to.

PortId [in]

An HV_PORT_ID value that identifies a previously-created port within the partition that PortPartition specifies.

ConnectionInfo [in]

A pointer to an HV_CONNECTION_INFO structure that describes how the port should be connected. The connection depends on the type of the target port (that is, the port that the connection will be associated with).

Return value

HvConnectPort returns one of the following values. In addition to these values, HvConnectPort can also return one of the values that are specified in Common Hypercall Status Codes.

Return codeDescription
HV_STATUS_SUCCESS

HvConnectPort successfully created a connection to a port.

HV_STATUS_ACCESS_DENIED

Neither of the following is true:

  • The caller is the parent of the specified connection partition.

  • The caller is the specified connection partition, and the partition has the ConnectPort partition property.

HV_STATUS_INVALID_PARTITION_ID

One of the following invalid partition conditions exists:

  • The specified connection-partition identifier is invalid.

  • The specified port-partition identifier is invalid.

  • The port partition does not match the connection partition that the port was created with the HvCreatePort hypercall function.

HV_STATUS_INVALID_CONNECTION_ID

One of the following invalid port conditions exists:

  • The specified connection identifier is already in use.

  • The reserved portion (high 8 bits) of the ConnectionId are nonzero.

HV_STATUS_INVALID_PORT_ID

One of the following invalid port conditions exists:

  • The specified port identifier does not exist.

  • The PortPartition does not have a defined port with the specified port identifier.

  • The port specified by the port identifier is already connected.

  • The PortPartition does not match the ConnectionPartition that the port was created with the HvCreatePort hypercall function.

  • The reserved portion (high 8 bits) of the PortId are nonzero.

HV_STATUS_INVALID_ALIGNMENT

The specified monitor overlay page GPA is not page aligned.

HV_STATUS_INVALID_PARAMETER

The ConnectionInfo parameter is invalid.

HV_STATUS_INVALID_PARTITION_STATE

The specified port or connection partition is not in the active state.

HV_STATUS_INSUFFICIENT_MEMORY

The number of pages in the memory pool of the caller is insufficient to perform the operation.

HV_STATUS_NO_RESOURCES

A required system resource is unavailable or an implementation limit has been reached.

 

Remarks

HvConnectPort allocates the memory for the connection object from the memory pool of the partition that the ConnectionPartition parameter identifies.

The connection identifier that the ConnectionId parameter specifies must be unique among all connections that are associated with the connection partition (that is, the partition that the ConnectionPartition parameter specifies).

HvConnectPort has the following restrictions:

  • The caller must possess the ConnectPort privilege.

  • The partitions that are specified by ConnectionPartition and PortPartition must be in the active state.

  • The caller must be the parent of the partition that is specified by ConnectionPartition, or the caller must specify its own partition identifier.

Native Interface

HvConnectPort

Call Code = 0x0059

Input Parameters

0

ConnectionPartition (8 bytes)

8

ConnectionId (4 bytes) Padding (4 bytes)

16

PortPartition (8 bytes)

24

PortId (4 bytes) Padding (4 bytes)

30

ConnectionInfo (8 bytes)

 

Requirements

Version

HvConnectPort is available in version 1.0 and later versions of the hypervisor.

Header

Hvgdk.h (include Hvgdk.h)

IRQL

Any level

See also

HvCreatePort

 

 

Send comments about this topic to Microsoft

Build date: 11/16/2013

Show:
© 2014 Microsoft. All rights reserved.