Επεξεργασία

Κοινή χρήση μέσω


IVMGuestOS::SetParameter method

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

Sets a named parameter within the guest operating system.

Syntax

HRESULT SetParameter(
  [in] BSTR inParameterName,
  [in] BSTR inParameterValue
);

Parameters

inParameterName [in]

The parameter name. It must be between 1 and 255 characters in length and cannot contain a backslash (\) character.

inParameterValue [in]

The parameter value.

Return value

This method can return one of these values.

Return code/value Description
S_OK
0
The operation was successful.
E_INVALIDARG
0x80000003
A parameter is not valid or not specified.
VM_E_TIMED_OUT
0xA0040202
The operation did not complete in a timely manner.
VM_E_VM_NOT_RUNNING
0xA0040206
The virtual machine (VM) is not running.
VM_E_VM_PAUSED
0xA00400507
The VM is paused.
VM_E_ADDITIONS_FEATURE_NOT_AVAIL
0xA0040505
Integration components are not installed in this VM.
DISP_E_EXCEPTION
0x80020009
An unexpected error has occurred.

Remarks

The VM must be running and integration components must be installed when this method is invoked. This method is only supported for Windows-based guest operating systems.

With integration components installed, the following key is automatically added to the guest operating system's registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters

When the guest operating system starts, the following registry string values are populated in the Parameters key:

  • HostName
  • PhysicalHostName
  • PhysicalHostNameFullyQualified
  • VirtualMachineName

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_IVMGuestOS is defined as 99fea0db-4880-499a-b6d8-73dff9bc91be

See also

IVMGuestOS