Compartilhar via


IVMVirtualServer::GetHardDisk method

The GetHardDisk method returns a IVMHardDisk object corresponding to an existing disk image file.

Syntax

HRESULT GetHardDisk(
  [in]  BSTR        imagePath,
  [out] IVMHardDisk **hardDisk
);

Parameters

imagePath [in]

The full path to an existing disk image file.

hardDisk [out]

IVMHardDisk object corresponding to this disk image.

Return value

This method supports standard return values, as well as the following. For information on Virtual Server specific return values not listed below, see HRESULT Codes Specific to the Virtual Server.

Return code Description
S_OK
The operation was successful.
E_POINTER
The imagePath or hardDisk parameter is NULL.
E_FILE_NOT_FOUND
The system cannot find the file specified by the imagePath parameter.
E_PATH_NOT_FOUND
The system cannot find the path specified by the imagePath parameter.
E_INVALID_NAME
The imagePath parameter contains an invalid character (one of "*?:<>/|"").
E_BAD_PATHNAME
The imagePath parameter specifies an empty or relative path. An absolute path is required.
E_BUFFER_OVERFLOW
The path specified by the imagePath parameter is too long. The length of the path must be less than 260 characters.
DISP_E_EXCEPTION
An unexpected error occurred.

Requirements

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

See also

IVMVirtualServer