Upravit

Sdílet prostřednictvím


IVMDVDDrive::SetBusLocation method

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

Attaches the DVD drive to the specified bus location in the virtual machine.

Syntax

HRESULT SetBusLocation(
  [in] long busNumber,
  [in] long deviceNumber
);

Parameters

busNumber [in]

The bus number to which this drive is to be attached. For example, on an IDE bus, this number would represent whether to use the primary or secondary bus number.

deviceNumber [in]

The device number to which this drive is to be attached. For example, on an IDE bus, this number would represent whether to use the primary or secondary device location.

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.
E_FAIL
0x80004005
An unexpected error has occurred.
VM_E_VM_RUNNING_OR_SAVED
0xA004020B
The bus location cannot be set while the virtual machine is running or in a saved state.
VM_E_BUS_LOC_IN_USE
Another device is already attached to the specified bus location.
VM_E_DRIVE_INVALID
0xA0040502
The current drive could not be initialized.
VM_E_VM_UNKNOWN
0xA0040207
The changes could not be written to the preferences file because the virtual machine for this drive could not be determined.
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_IVMDVDDrive is defined as b96328f6-6732-437d-a00d-ffa47e43971c

See also

IVMDVDDrive