HvPostMessage function

The HvPostMessage function attempts to post (that is, send asynchronously) a message to the specified connection, which has an associated destination port.

Syntax


HV_STATUS  HvPostMessage(
  _In_  HV_CONNECTION_ID ConnectionId,
  _In_  HV_MESSAGE_TYPE MessageType,
  _In_  UINT32 PayloadSize,
  _In_  PCVOID Message
);

Parameters

ConnectionId [in]

An HV_CONNECTION_ID value that specifies an identifier for the connection that HvConnectPort creates.

MessageType [in]

An HV_MESSAGE_TYPE value that specifies the message type that will appear within the message header. The caller can specify any 32-bit message type whose most significant bit is cleared, with the exception of zero. Message types with the high bit set are reserved for use by the hypervisor.

PayloadSize [in]

The number of bytes that are included in the message to which the Message parameter points.

Message [in]

A pointer to a buffer that contains the payload of the message--up to 240 bytes total. The hypervisor sends only the first n bytes to the destination partition, where the caller provides n in the PayloadSize parameter.

Return value

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

Return codeDescription
HV_STATUS_SUCCESS

HvPostMessage successfully sent a message.

HV_STATUS_ACCESS_DENIED

The caller's partition privilege flag PostMessages is cleared.

HV_STATUS_INVALID_CONNECTION_ID

The specified connection identifier is invalid.

HV_STATUS_INVALID_PORT_ID

One of the following invalid port conditions exists:

  • The port that is associated with the specified connection has been deleted.

  • The port that is associated with the specified connection belongs to a partition that is not in the active state.

  • The port that is associated with the specified connection is not a message-type port.

HV_STATUS_INVALID_PARAMETER

One of the following invalid parameter conditions exists:

  • The most significant bit of the specified message type is set.

  • The MessageType parameter specifies a value of zero.

  • The specified payload size exceeds 240 bytes.

HV_STATUS_INSUFFICIENT_BUFFERS

The port has no available guest message buffers.

HV_STATUS_INVALID_VP_INDEX

The target VP no longer exists or there are no available VPs to which the message can be posted.

HV_STATUS_INVALID_SYNIC_STATE

One of the following invalid SynIC conditions exists:

  • The target VP's SynIC is disabled and cannot accept posted messages. For ports that are targeted at HV_ANY_VP, this indicates that the SynIC of all of the partition's VPs are disabled.

  • The target VP's SIM page is disabled. For ports that are targeted at HV_ANY_VP, this indicates that the SIM page of all of the partition's VPs are disabled.

 

Remarks

If HvPostMessage successfully posts the message, the message will be queued for delivery to a virtual processor within the partition that is associated with the port that is associated with the connection that the ConnectionId parameter identifies.

HvPostMessage has the following restriction:

  • The partition that is the target of the connection must be in the active state.

Native Interface

HvPostMessage

Call Code = 0x005C

Input Parameters

0

ConnectionId (4 bytes) Padding (4 bytes)

8

MessageType (4 bytes) PayloadSize (4 bytes)

16

Message[0] (8 bytes)

...

248

Message[29] (8 bytes)

 

Requirements

Version

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

Header

Hvgdk.h (include Hvgdk.h)

IRQL

Any level

See also

HV_MESSAGE_TYPE

 

 

Send comments about this topic to Microsoft

Build date: 11/16/2013

Show:
© 2014 Microsoft. All rights reserved.