Rediger

Del via


IVMVirtualMachine::StartCommunicationChannel method

[Windows Virtual PC is no longer available for use as of Windows 8. Instead, use the Hyper-V WMI provider (V2).]

Sets up a communication channel between host and guest operating system.

Syntax

HRESULT StartCommunicationChannel(
  [in] VMEndpointType inHostEndpointType,
  [in] BSTR           inHostEndPointName,
  [in] VMEndpointType inGuestEndpointType,
  [in] BSTR           inGuestEndpointName
);

Parameters

inHostEndpointType [in]

This parameter must be vmEndpoint_NamedPipe (0).

inHostEndPointName [in]

The unique pipe name. This string must have the following form: "\\.\pipe\pipename". The pipename part of the name can include any character other than a backslash, including numbers and special characters. The entire pipe name string can be up to 256 characters long. Pipe names are not case sensitive.

inGuestEndpointType [in]

This parameter must be vmEndpoint_TCPIP (1).

inGuestEndpointName [in]

The port number on which the TCP server in the guest is listening.

Return value

This method can return one of these values.

Return code/value Description
S_OK
0
The operation was successful.
E_INVALIDARG
0x80000003
The inHostEndpointType parameter is not vmEndpoint_NamedPipe (0) or the inGuestEndpointType parameter is not vmEndpoint_TCPIP (1).
E_POINTER
0x80004003
The inHostEndPointName or inGuestEndpointName parameter is NULL or not a valid value.
DISP_E_EXCEPTION
0x80020009
An unexpected error has occurred.
HRESULT_FROM_WIN32(ERROR_INVALID_HANDLE)
0x80070006
A handle is not valid.
HRESULT_FROM_WIN32(ERROR_OUTOFMEMORY)
0x8007000e
There is not enough memory available to complete this request.
HRESULT_FROM_WIN32(ERROR_NOT_READY)
0x80070015
The underlying system it uses to provide network services is currently being initialized.
HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS)
0x800700b7
The pipe name is already in use.
HRESULT_FROM_WIN32(ERROR_PIPE_BUSY)
0x800700e7
One or more channels are running down and may become available shortly.
HRESULT_FROM_WIN32(ERROR_MAX_SESSIONS_REACHED)
0x80070161
The maximum numbers of communication channels available are in-use. Another channel cannot be started at this time.
HRESULT_FROM_WIN32(ERROR_REVISION_MISMATCH)
0x8007051a
There is a mismatch between the version of the host and guest subsystems. See the Windows Event Log for more detail.
VM_E_VM_NOT_RUNNING
0xA0040206
The VM is not running.

Remarks

The current implementation supports only named pipe interface on the host and TCP/IP interface on the guest operating system.

Requirements

Requirement Value
Minimum supported client
Windows 7 [desktop apps only]
Minimum supported server
None supported
End of client support
Windows 7
Product
Windows Virtual PC
Header
VPCCOMInterfaces.h
IID
IID_IVMVirtualMachine is defined as f7092aa1-33ed-4f78-a59f-c00adfc2edd7

See also

IVMVirtualMachine

VMEndpointType