<div class="content" name="GetEncapsulateDiskInfoEx" uuid="533f5b54-61d2-46ef-aa8d-f4b53bc7b424"><p> </p><p>The GetEncapsulateDiskInfoEx method gathers the information
needed to convert the specified <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_425be2e8-ca0d-45db-afba-d9daee040d07" data-linktype="relative-path">basic disks</a></span> to
dynamic <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_c4133b2a-a990-4042-ba44-7fda3090f118" data-linktype="relative-path">disks</a></span>.</p><dl>
<dd>
<div><pre> HRESULT GetEncapsulateDiskInfoEx(
   [in] unsigned long diskCount,
   [in, size_is(diskCount)] DISK_SPEC* diskSpecList,
   [out] unsigned long* encapInfoFlags,
   [out] unsigned long* affectedDiskCount,
   [out, size_is(,*affectedDiskCount)] 
     DISK_INFO_EX** affectedDiskList,
   [out, size_is(,*affectedDiskCount)] 
     unsigned long** affectedDiskFlags,
   [out] unsigned long* affectedVolumeCount,
   [out, size_is(,*affectedVolumeCount)] 
     VOLUME_INFO** affectedVolumeList,
   [out] unsigned long* affectedRegionCount,
   [out, size_is(,*affectedRegionCount)] 
     REGION_INFO_EX** affectedRegionList,
   [out] TASK_INFO* tinfo
 );
</pre></div>
</dd></dl><p><b>diskCount: </b>Number of elements passed in the <i>diskSpecList</i>
array.</p><p><b>diskSpecList: </b>Array of <span><a href="20d25159-e6fc-4941-83b9-e97fd90833cd" data-linktype="relative-path">DISK_SPEC</a></span>
structures that specify the disks to be encapsulated. Memory for the array is
allocated and freed by the client.</p><p><b>encapInfoFlags: </b>Bitmap of <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_425bcab9-7911-4eae-b414-624b7a51eb5f" data-linktype="relative-path">flags</a></span>
that returns information about encapsulating the disks specified in <i>diskSpecList</i>.
The value of this field is generated by combining zero or more of the following
applicable flags with a logical OR operation.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>ENCAP_INFO_CANT_PROCEED 0x00000001</td>
  <td>Encapsulation for the disk will not succeed. The other flags specify the reason.</td>
 </tr><tr>
  <td>ENCAP_INFO_NO_FREE_SPACE 0x00000002</td>
  <td>Volume manager could not find sufficient free space on the disk for encapsulation.</td>
 </tr><tr>
  <td>ENCAP_INFO_BAD_ACTIVE 0x00000004</td>
  <td>Disk contains an active partition from which the current operating system was not started.</td>
 </tr><tr>
  <td>ENCAP_INFO_UNKNOWN_PART 0x00000008</td>
  <td>Volume manager was unable to determine the type of a partition on the disk because of corruption or other errors reading the disk. For example, any error that prevents the partition information from being read, or the partition is neither GPT nor MBR, or an OEM partition is found that is not at the beginning of the disk.</td>
 </tr><tr>
  <td>ENCAP_INFO_FT_UNHEALTHY 0x00000010</td>
  <td>Disk contains an FT set volume that is not functioning properly.</td>
 </tr><tr>
  <td>ENCAP_INFO_FT_QUERY_FAILED 0x00000020</td>
  <td>Volume manager was unable to obtain information about an FT set volume on the disk.</td>
 </tr><tr>
  <td>ENCAP_INFO_REBOOT_REQD 0x00000100</td>
  <td>Encapsulation of the disk requires a restart of the computer.</td>
 </tr><tr>
  <td>ENCAP_INFO_CONTAINS_FT 0x00000200</td>
  <td>Disk is part of an FT set volume.</td>
 </tr><tr>
  <td>ENCAP_INFO_VOLUME_BUSY 0x00000400</td>
  <td>Disk is currently in use.</td>
 </tr><tr>
  <td>ENCAP_INFO_PART_NR_CHANGE 0x00000800</td>
  <td>Encapsulation of the disk requires modification of the boot configuration.</td>
 </tr><tr>
  <td>ENCAP_INFO_MIXED_PARTITIONS 0x00001000</td>
  <td>Encapsulation of a GPT disk that contains basic partitions mixed with nonbasic partitions is not supported.</td>
 </tr><tr>
  <td>ENCAP_INFO_OPEN_FAILED 0x00002000</td>
  <td>Could not open a volume that resides on a disk in the set of disks specified for encapsulation.</td>
 </tr></tbody></table>
</dd></dl><p><b>affectedDiskCount: </b>Pointer to the number of
disks that will be affected by the encapsulation.</p><p><b>affectedDiskList: </b>Pointer to an array of new <span><a href="7d94d560-37f2-4031-8c3e-ecfd2dc1ec9f" data-linktype="relative-path">DISK_INFO_EX</a></span>
structures that represent the disks that will be affected by the encapsulation.</p><p><b>affectedDiskFlags: </b>Pointer to an array of
bitmaps of flags that provides information about the disks that will be
affected by the encapsulation. The value of this field is generated by
combining zero or more of the following applicable flags with a logical OR
operation.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>CONTAINS_FT 0x00000001</td>
  <td>Disk contains an FT set volume.</td>
 </tr><tr>
  <td>CONTAINS_RAID5 0x00000002</td>
  <td>Disk contains part of an FT RAID-5 set.</td>
 </tr><tr>
  <td>CONTAINS_REDISTRIBUTION 0x00000004</td>
  <td>Not used.</td>
 </tr><tr>
  <td>CONTAINS_BOOTABLE_PARTITION 0x00000008</td>
  <td>Disk contains a bootable partition.</td>
 </tr><tr>
  <td>CONTAINS_LOCKED_PARTITION 0x00000010</td>
  <td>Disk contains a locked partition.</td>
 </tr><tr>
  <td>CONTAINS_NO_FREE_SPACE 0x00000020</td>
  <td>Disk is full.</td>
 </tr><tr>
  <td>CONTAINS_EXTENDED_PARTITION 0x00000040</td>
  <td>Disk contains an extended partition.</td>
 </tr><tr>
  <td>PARTITION_NUMBER_CHANGE 0x00000080</td>
  <td>A partition number on the disk has changed.</td>
 </tr><tr>
  <td>CONTAINS_BOOTINDICATOR 0x00000100</td>
  <td>Disk contains the active partition.</td>
 </tr><tr>
  <td>CONTAINS_BOOTLOADER 0x00000200</td>
  <td>Disk contains the boot loader.</td>
 </tr><tr>
  <td>CONTAINS_SYSTEMDIR 0x00000400</td>
  <td>Partition contains the system directory.</td>
 </tr><tr>
  <td>CONTAINS_MIXED_PARTITIONS 0x00000800</td>
  <td>Partition contains partitions that will not be converted to dynamic.</td>
 </tr></tbody></table>
</dd></dl><p><b>affectedVolumeCount: </b>Pointer to the number of
volumes that will be affected by the encapsulation.</p><p><b>affectedVolumeList: </b>Pointer to an array of <span><a href="651f7cad-50c2-4800-b646-a0c47c138724" data-linktype="relative-path">VOLUME_INFO</a></span>
structures that represent the volumes that will be affected by the
encapsulation.</p><p><b>affectedRegionCount: </b>Pointer to the number of
regions that will be affected by the encapsulation.</p><p><b>affectedRegionList: </b>Pointer to an array of <span><a href="9a20cc96-88c3-4194-9563-9778bea15376" data-linktype="relative-path">REGION_INFO_EX</a></span>
structures that represent the regions that will be affected by the encapsulation.</p><p><b>tinfo: </b>Pointer to a <span><a href="d55c167e-c6ad-445f-951c-9ac2d0de7a11" data-linktype="relative-path">TASK_INFO</a></span> structure
the client can use to track the progress of the request.</p><p><b>Return Values: </b>The method MUST return 0 or a
nonerror <a href="../ms-dtyp/a9046ed2-bfb2-4d56-a719-2824afce59ac" data-linktype="relative-path"><span>HRESULT</span></a> on success, or
an implementation-specific nonzero error code on failure (as specified in <span><a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a></span>;
see also section <span><a href="31eea9e6-25b0-4309-8f4a-50c74fbedc9b" data-linktype="relative-path">2.2.1</a></span> for HRESULT
values predefined by the Disk Management Remote Protocol).</p><p>Upon receiving this message, the server MUST validate
parameters:</p><ol><li><p><span>    </span>Verify that <i>diskCount</i>
is not 0 and <i>diskSpecList</i> is not NULL.</p>
</li><li><p><span>    </span>For each
DISK_SPEC structure specified in <i>diskSpecList</i>, verify that the disk
specified by <i>diskId</i> is in the list of storage objects; and check whether
<i>lastKnownState</i> matches the <b>LastKnownState</b> field of the object.</p>
</li><li><p><span>    </span>Verify that <i>encapInfoFlags</i>
is not NULL. </p>
</li><li><p><span>    </span>Verify that <i>affectedDiskCount</i>,
<i>affectedDiskList</i>, and <i>affectedDiskFlags</i> are not NULL. </p>
</li><li><p><span>    </span>Verify that <i>affectedVolumeCount</i>
and <i>affectedVolumeList</i> are not NULL. </p>
</li><li><p><span>    </span>Verify that <i>affectedRegionCount</i>
and <i>affectedRegionList</i> are not NULL. </p>
</li><li><p><span>    </span>Verify that <i>tinfo</i>
is not NULL. </p>
</li></ol><p>If parameter validation fails, the server MUST fail the
operation immediately, returning an appropriate error as its response to the
client.</p><p>Otherwise, the server MUST compose a response to the client
as follows:</p><ol><li><p><span>    </span>Identify other
basic disks from the list of storage objects that need to be encapsulated
together with the basic disks specified by <i>diskSpecList</i>.</p>
</li><li><p><span>    </span>Allocate a
buffer large enough to contain DISK_INFO_EX structures that describe all basic
disks that need to be encapsulated together (including the disks specified by <i>diskSpecList</i>).
</p>
</li><li><p><span>    </span>Populate each
DISK_INFO_EX structure in the buffer with information about the disk. </p>
</li><li><p><span>    </span>The buffer MUST
be returned to the client in the output parameter <i>affectedDiskList</i>. </p>
</li><li><p><span>    </span>The number of
DISK_INFO_EX structures in the buffer MUST be returned to the client in the
output parameter <i>affectedDiskCount</i>. </p>
</li><li><p><span>    </span>Allocate a
second buffer large enough to contain bitmaps of flags, one for each disk
returned in <i>affectedDiskList</i>, that describes disk conditions that are of
interest to clients in the context of encapsulation. </p>
</li><li><p><span>    </span>Populate the
second buffer with the bitmaps of flags of the disks. </p>
</li><li><p><span>    </span>The second
buffer MUST be returned to the client in the output parameter <i>affectedDiskFlags</i>.
Note that the number of elements in the buffer is the same as the count of
disks, which is returned in <i>affectedDiskCount</i>. </p>
</li><li><p><span>    </span>Enumerate all
the FT volumes that reside on the disks returned in <i>affectedDiskList</i>
from the list of storage objects. </p>
</li><li><p><span>  </span>Allocate a third buffer
large enough to contain VOLUME_INFO structures that describe the enumerated FT
volumes. </p>
</li><li><p><span>  </span>Populate each VOLUME_INFO
structure in the third buffer with information about the FT volume. </p>
</li><li><p><span>  </span>The third buffer MUST be
returned to the client in the output parameter <i>affectedVolumeList</i>. </p>
</li><li><p><span>  </span>The number of VOLUME_INFO
structures in the third buffer MUST be returned to the client in the output
parameter <i>affectedVolumeCount</i>. </p>
</li><li><p><span>  </span>Enumerate all the <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_753cb2b4-3f5c-48f3-97ef-61612c40499e" data-linktype="relative-path">disk
regions</a></span> that reside on the disks returned in <i>affectedDiskList</i>
from the list of storage objects. </p>
</li><li><p><span>  </span>Allocate a fourth buffer
large enough to contain REGION_INFO_EX structures that describe the enumerated
disk regions. </p>
</li><li><p><span>  </span>Populate each REGION_INFO_EX
structure in the fourth buffer with information about the disk region. </p>
</li><li><p><span>  </span>The fourth buffer MUST be
returned to the client in the output parameter <i>affectedRegionList</i>. </p>
</li><li><p><span>  </span>The number of REGION_INFO_EX
structures in the fourth buffer MUST be returned to the client in the output parameter
<i>affectedRegionCount</i>. </p>
</li><li><p><span>  </span>Populate a 32-bit signed
integer bitmap of flags that describes conditions that will prevent the overall
encapsulation to proceed, or might be of interest to the client in the context
of encapsulation. If the encapsulation cannot proceed, the server MUST set the
ENCAP_INFO_CANT_PROCEED flag, and then set other flags as appropriate to
account for the reasons why the encapsulation is not possible. </p>
</li><li><p><span>  </span>The bitmap of flags MUST be
returned to the client in the output parameter <i>encapInfoFlags</i>. </p>
</li><li><p><span>  </span>Return a response that
contains the output parameters mentioned previously and the status of the
operation. </p>
</li></ol><p>The server MUST NOT change the list of storage objects as
part of processing this message.</p></div>