GetSCSIAddress function

Retrieves the SCSI address of the virtual hard disk (VHD) mounted using the MountVHD function.

Syntax

ULONG WINAPI GetSCSIAddress(
  _In_  PWCHAR VHDFileName,
  _In_  ULONG  Flags,
  _In_  ULONG  SCSIAddressLength,
  _Out_ PWCHAR SCSIAddress
);

Parameters

VHDFileName [in]

A pointer to a null-terminated Unicode string that specifies the path to the VHD file used in the call to MountVHD.

Flags [in]

This parameter is reserved. Use VHD_NORMAL (0).

SCSIAddressLength [in]

The size, in WCHARs, of the buffer pointed to by the SCSIAddress parameter.

SCSIAddress [out]

The address of a buffer to receive the SCSI address of the specified mounted VHD. The buffer must be at least MAX_PATH+1 WCHARs in size.

Return value

On successful call, the return value is ERROR_SUCCESS (0). Any of the system error codes can be returned. Common return values include the following.

Return code/value Description
ERROR_INVALID_DATA
13 (0xD)
A value other than VHD_NORMAL (0) was passed in the Flags parameter, the SCSIAddressLength parameter was zero, or the SCSIAddress parameter was NULL.
ERROR_DEV_NOT_EXIST
55 (0x37)
An error occurred while retrieving the SCSI address of the mounted disk.
ERROR_NOT_READY
21 (0x15)
The device is not yet ready. It takes some time for a newly mounted disk to appear in disk manager. Typically this error is handled by waiting for a short time and trying again.

Requirements

Download
Microsoft Virtual Server 2005 R2 SP1 Update onWindows Server 2008orWindows Server 2003
Header
VHDMount.h
Library
VHDMount.lib
DLL
VHDMount.dll

See also

Virtual Server Functions

MountVHD

VHD_FLAGS