HvDeletePort function

The HvDeletePort function deallocates a port object and the message buffers that are associated with the port object.

Syntax


HV_STATUS  HvDeletePort(
  _In_  HV_PARTITION_ID PortPartition,
  _In_  HV_PORT_ID PortId
);

Parameters

PortPartition [in]

An HV_PARTITION_ID value that identifies the partition from which a port is deleted. HV_PARTITION_ID is defined as an unsigned 64-bit (UINT64) value.

PortId [in]

An HV_PORT_ID value that identifies a port that HvCreatePort previously allocated.

Return value

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

Return codeDescription
HV_STATUS_SUCCESS

HvDeletePort successfully deleted a port.

HV_STATUS_ACCESS_DENIED

Neither of the following is true:

  • The caller is the parent of the specified partition.

  • The caller is the specified partition, and the partition has the CreatePort partition privilege.

HV_STATUS_INVALID_PARTITION_ID

The specified partition identifier is invalid.

HV_STATUS_INVALID_PORT_ID

The specified port identifier is invalid.

HV_STATUS_INVALID_PARTITION_STATE

The specified partition is not in the active state.

 

Remarks

When HvDeletePort is called to delete a port, any undelivered messages that are present in the queue will be lost. Subsequent references to the port identifier that the PortId parameter specifies will fail. Also, subsequent attempts to send messages or signal events through a connection to this port will fail.

Messages that arrived through the port might have already been copied to a virtual processor's SIM page. Therefore, messages with the deleted port's identifier might possibly arrive after HvDeletePort has been called.

HvDeletePort has the following restrictions:

  • The caller must possess the CreatePort privilege.

  • The partition that is specified by PortPartition must be in the active state.

  • The caller must be the parent of the partition that is specified by PortPartition, or the caller must possess the CreatePort privilege and specify its own partition identifier.

Native Interface

HvDeletePort [fast]

Call Code = 0x0058

Input Parameters

0

PortPartition (8 bytes)

8

PortId (4 bytes) Padding (4 bytes)

 

Requirements

Version

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

Header

Hvgdk.h (include Hvgdk.h)

IRQL

Any level

 

 

Send comments about this topic to Microsoft

Build date: 11/16/2013

Show:
© 2014 Microsoft. All rights reserved.