Share via


IVMGuestOS2::GetParameter method

Retrieves a configuration parameter inside the guest operating system.

Syntax

HRESULT GetParameter(
  [in]  BSTR inParameterName,
  [out] BSTR *outParameterValue
);

Parameters

inParameterName [in]

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

outParameterValue [out]

The parameter value.

Return value

This method can return one of these values.

Return code Description
S_OK
The operation was successful.
E_INVALIDARG
The outParameterValue parameter is not valid or not specified.
VM_E_VM_NOT_RUNNING
The virtual machine is not running.
VM_E_VM_PAUSED
The virtual machine is paused.
VM_E_ADDITIONS_FEATURE_NOT_AVAIL
Additions are not installed in this virtual machine.
DISP_E_EXCEPTION
An unexpected error has occurred.

Remarks

The virtual machine must be running and Additions must be installed when this method is invoked. This method is supported only for Windows-based guest operating systems.

With Additions 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

Download
Microsoft Virtual Server 2005 R2 SP1 Update onWindows Server 2008orWindows Server 2003
Header
VsComInterfaces.h

See also

IVMGuestOS2

IVMGuestOS::SetParameter