SetVhdDeviceElement method of the BcdObject class
Creates a virtual hard disk (VHD) boot device element.
boolean SetVhdDeviceElement( [in] ULONG Type, [in] PCWSTR Path, [in] ULONG ParentDeviceType, [in] PCWSTR ParentAdditionalOptions, [in] PCWSTR ParentPath, [in] ULONG CustomLocate );
The element type. This parameter is one of the values from the following enumerations:
It can also be a custom element type created for your own use.
The path to the VHD file.
The device type. This parameter can be one of the following values.
Device that initiated the boot.
File that contains file system metadata. This file is treated as a device.
Locate device. The ParentPath parameter is not used.
Either a GUID in string form with surrounding braces that represents another object in the store, or the empty string ("").
The path to the physical partition that contains the VHD file. If the ParentDeviceType parameter is Locate, this parameter is not used.
A BCD element that overrides the default locate heuristics for a VHD device.
If this parameter is zero, the application path (for example, \Windows\System32\winload.exe) is used to locate a boot device and the system root element (\Windows) is used to locate an operating system device.
A native VHD boot device element is identified by its VHD file name and a parent device that describes the physical partition that contains the VHD file. This kind of VHD device element also specifies a partition within the VHD and is the only VHD boot device that supports multi-boot scenarios within a single VHD. A native VHD boot device element provides the fastest performance because it is fully qualified; however, its entry in the BCD store is not portable and cannot be used in a BCD store that will be imported to a different system. To create native VHD boot device elements for mounted VHDs, use the SetPartitionDeviceElement method.
A VPART+PPART locate VHD device element is identified by its VHD file name only, and the parent device is not specified. The system resolves the VPART to the first VHD partition that contains the specified element and resolves the PPART to the first physical partition that contains the VHD file. A VPART+PPART locate VHD device element is slower and cannot be used for multi-boot scenarios, but its entry in the BCD store is portable. Use this kind of locate VHD device entry in a BCD store that will be imported on a different system.
A VPART locate VHD device element is identified by its VHD file name and its corresponding parent physical partition device. A VPART locate VHD device element has better performance than a VPART+PPART locate VHD device element, but its entry in the BCD store is not portable. The VPART locate device is the best choice for most applications because it provides reasonable performance and can be created without having to mount the VHD.
|Minimum supported client
||Windows 7 [desktop apps only]
|Minimum supported server
||Windows Server 2008 R2 [desktop apps only]