Rediger

Del via


IVMHardDiskConnection::SetBusLocation method

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

Sets the bus location to which this hard disk is attached.

Syntax

HRESULT SetBusLocation(
  [in] long vmBusNumber,
  [in] long vmDeviceNumber
);

Parameters

vmBusNumber [in]

The bus number to be used.

vmDeviceNumber [in]

The device number to be used.

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 bus location specified is not valid.
VM_E_VM_RUNNING_OR_SAVED
0xA004020B
The bus location could not be set because the virtual machine is in a running or saved state.
VM_E_DRIVE_BUS_LOC_IN_USE
0xA00400503
The bus location could not be set because another device is currently attached to this location.
VM_E_DRIVE_INVALID
0xA0040502
The current drive is not valid.
VM_E_VM_UNKNOWN
0xA0040207
The current virtual machine is not valid.
DISP_E_EXCEPTION
0x80020009
An unexpected error has occurred.

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_IVMHardDiskconnection is defined as aefa36a5-463a-46ae-9e6c-a1fb4e12e671

See also

IVMHardDiskConnection