Share via


MountVHD function

Mounts the specified virtual hard disk file (.vhd file) as a virtual disk device.

Syntax

ULONG WINAPI MountVHD(
  _In_ PWCHAR VHDFileName,
  _In_ ULONG  Flags
);

Parameters

VHDFileName [in]

A pointer to a null-terminated Unicode string that specifies the full path to the VHD file. Relative paths to the VHD file are not supported.

Flags [in]

This parameter is reserved. Use VHD_NORMAL (0).

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.
ERROR_DEV_NOT_EXIST
55 (0x37)
An error occurred while mounting the file.

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

GetSCSIAddress

UnmountVHD

VHD_FLAGS