<div class="content"><p> </p><p>The GetEncapsulateDiskInfo 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>. This is a
synchronous task.</p><dl>
<dd>
<div><pre> HRESULT GetEncapsulateDiskInfo(
   [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** 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** 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 specifies the disks to be encapsulated.</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
applicable flags defined as follows 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>
  <p>ENCAP_INFO_CANT_PROCEED</p>
  <p>0x00000001</p>
  </td>
  <td>
  <p>Encapsulation for disk will not succeed. The other
  flags specify the reason.</p>
  </td>
 </tr><tr>
  <td>
  <p>ENCAP_INFO_NO_FREE_SPACE</p>
  <p>0x00000002</p>
  </td>
  <td>
  <p><span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_3080678a-2e28-4e28-af89-8c010325a7b2" data-linktype="relative-path">Volume manager</a></span>
  could not find sufficient <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_4932fda9-4823-4a72-b4e7-629f89d8fd90" data-linktype="relative-path">free space</a></span> on the
  disk for encapsulation.</p>
  </td>
 </tr><tr>
  <td>
  <p>ENCAP_INFO_BAD_ACTIVE</p>
  <p>0x00000004</p>
  </td>
  <td>
  <p>Disk contains an <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_37f8831a-72a8-4808-9a39-6949f7172de9" data-linktype="relative-path">active partition</a></span>
  from which the current operating system was started.</p>
  </td>
 </tr><tr>
  <td>
  <p>ENCAP_INFO_UNKNOWN_PART</p>
  <p>0x00000008</p>
  </td>
  <td>
  <p>Volume manager was unable to determine the type of a
  partition on the disk.</p>
  </td>
 </tr><tr>
  <td>
  <p>ENCAP_INFO_FT_UNHEALTHY</p>
  <p>0x00000010</p>
  </td>
  <td>
  <p>Disk contains an <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_98c2ba19-d0f7-4db1-b6c1-4e7323cc5bc0" data-linktype="relative-path">FT</a></span> set <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_9a876829-33a1-4f0b-8b81-8552b7e5561c" data-linktype="relative-path">volume</a></span>
  that is not functioning properly.</p>
  </td>
 </tr><tr>
  <td>
  <p>ENCAP_INFO_FT_QUERY_FAILED</p>
  <p>0x00000020</p>
  </td>
  <td>
  <p>Volume manager was unable to obtain information about
  an FT set volume on the disk.</p>
  </td>
 </tr><tr>
  <td>
  <p>ENCAP_INFO_FT_HAS_RAID5</p>
  <p>0x00000040</p>
  </td>
  <td>
  <p>Disk is part of an FT <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_96e19472-82bc-4317-9b5b-8113e2fc6eb8" data-linktype="relative-path">RAID-5</a></span> set, which
  this interface does not support for encapsulation.</p>
  </td>
 </tr><tr>
  <td>
  <p>ENCAP_INFO_FT_ON_BOOT</p>
  <p>0x00000080</p>
  </td>
  <td>
  <p>Disk is both part of an FT set volume and bootable,
  which this interface does not support for encapsulation.</p>
  </td>
 </tr><tr>
  <td>
  <p>ENCAP_INFO_REBOOT_REQD</p>
  <p>0x00000100</p>
  </td>
  <td>
  <p>Encapsulation of the disk requires a restart of the
  computer.</p>
  </td>
 </tr><tr>
  <td>
  <p>ENCAP_INFO_CONTAINS_FT</p>
  <p>0x00000200</p>
  </td>
  <td>
  <p>Disk is part of an FT set volume.</p>
  </td>
 </tr><tr>
  <td>
  <p>ENCAP_INFO_VOLUME_BUSY</p>
  <p>0x00000400</p>
  </td>
  <td>
  <p>Disk is currently in use.</p>
  </td>
 </tr><tr>
  <td>
  <p>ENCAP_INFO_PART_NR_CHANGE</p>
  <p>0x00000800</p>
  </td>
  <td>
  <p>Encapsulation of the disk requires modification of the
  boot configuration.</p>
  </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="0ddf8059-f404-46a3-9d7e-e3d13c4080e6" data-linktype="relative-path">DISK_INFO</a></span>
structures that represents the disks that will be affected by the
encapsulation. Memory for the array is allocated by the server and freed by the
client.</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. Memory for the array is allocated by the server
and freed by the client. The value of this field is a logical &#39;OR&#39; of 0 or more
of the following applicable flags.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>CONTAINS_FT</p>
  <p>0x00000001</p>
  </td>
  <td>
  <p>Disk contains an FT set volume.</p>
  </td>
 </tr><tr>
  <td>
  <p>CONTAINS_RAID5</p>
  <p>0x00000002</p>
  </td>
  <td>
  <p>Disk contains part of an FT RAID-5 set.</p>
  </td>
 </tr><tr>
  <td>
  <p>CONTAINS_REDISTRIBUTION</p>
  <p>0x00000004</p>
  </td>
  <td>
  <p>Disk contains an unknown volume type.</p>
  </td>
 </tr><tr>
  <td>
  <p>CONTAINS_BOOTABLE_PARTITION</p>
  <p>0x00000008</p>
  </td>
  <td>
  <p>Disk contains a bootable partition.</p>
  </td>
 </tr><tr>
  <td>
  <p>CONTAINS_LOCKED_PARTITION</p>
  <p>0x00000010</p>
  </td>
  <td>
  <p>Disk contains a <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_f01b936e-6a19-4453-b672-d81e91982aad" data-linktype="relative-path">locked partition</a></span>.</p>
  </td>
 </tr><tr>
  <td>
  <p>CONTAINS_NO_FREE_SPACE</p>
  <p>0x00000020</p>
  </td>
  <td>
  <p>Disk is full.</p>
  </td>
 </tr><tr>
  <td>
  <p>CONTAINS_EXTENDED_PARTITION</p>
  <p>0x00000040</p>
  </td>
  <td>
  <p>Disk contains an empty partition.</p>
  </td>
 </tr><tr>
  <td>
  <p>PARTITION_NUMBER_CHANGE</p>
  <p>0x00000080</p>
  </td>
  <td>
  <p>A partition number on the disk has changed.</p>
  </td>
 </tr><tr>
  <td>
  <p>CONTAINS_BOOTINDICATOR</p>
  <p>0x00000100</p>
  </td>
  <td>
  <p>Disk contains the active partition.</p>
  </td>
 </tr><tr>
  <td>
  <p>CONTAINS_BOOTLOADER</p>
  <p>0x00000200</p>
  </td>
  <td>
  <p>Disk contains the <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_50119b99-3b17-4b96-9627-a4f23cb5b57d" data-linktype="relative-path">boot loader</a></span>.</p>
  </td>
 </tr><tr>
  <td>
  <p>CONTAINS_SYSTEMDIR</p>
  <p>0x00000400</p>
  </td>
  <td>
  <p>Partition contains the <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_6a25fd9f-d620-491c-88c8-fde36bc070c5" data-linktype="relative-path">system directory</a></span>.</p>
  </td>
 </tr><tr>
  <td>
  <p>CONTAINS_MIXED_PARTITIONS</p>
  <p>0x00000800</p>
  </td>
  <td>
  <p>Partition contains different types of partitions.</p>
  </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 represents the volumes that will be affected by the
encapsulation. Memory for the array is allocated by the server and freed by the
client.</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="5b6f15d9-489d-404c-88e8-64569315c65c" data-linktype="relative-path">REGION_INFO</a></span>
structures that represents the regions that will be affected by the
encapsulation. Memory for the array is allocated by the server and freed by the
client.</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
that the client can use to track the request&#39;s progress.</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>flags</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.<a id="Appendix_A_Target_163"></a><a aria-label="Product behavior note 163" href="5f5043a3-9e6d-40cc-a05b-1a4a3617df32#Appendix_A_163" data-linktype="relative-path">&lt;163&gt;</a></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>. If disks that have
existing FT Disk volume sets are being encapsulated, the server must get a list
of volume <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_147609d8-08a9-417c-90bb-c22273d22cea" data-linktype="relative-path">extents</a></span> for all
volumes that have at least one extent on the input disks. Then walk through the
list of volume extents and add it for each extent, if the disk on which the
extent is located is not in the <i>diskSpecList</i>.</p>
</li><li><p><span>    </span>Allocate a
buffer large enough to contain DISK_INFO 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 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 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 describe 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, excluding free regions.</p>
</li><li><p><span>  </span>Allocate a fourth buffer
large enough to contain REGION_INFO structures that describe the enumerated
disk regions. </p>
</li><li><p><span>  </span>Populate each REGION_INFO
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
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 describing 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><li><p><span>  </span> Fill in the <i>tinfo</i>
output parameter. This is a synchronous task.</p>
<ul><li><p><span><span>  </span></span> The
<i>tinfo</i> values MUST be set as follows.</p>
<table><thead>
  <tr>
   <th>
   <p>TASK_INFO member</p>
   </th>
   <th>
   <p>Required for this operation</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>TASK_INFO::id</p>
  </td>
  <td>
  <p>Required.</p>
  </td>
 </tr><tr>
  <td>
  <p>TASK_INFO::storageId</p>
  </td>
  <td>
  <p>Not required.</p>
  </td>
 </tr><tr>
  <td>
  <p>TASK_INFO::createTime</p>
  </td>
  <td>
  <p>Not required.<a id="Appendix_A_Target_164"></a><a aria-label="Product behavior note 164" href="5f5043a3-9e6d-40cc-a05b-1a4a3617df32#Appendix_A_164" data-linktype="relative-path">&lt;164&gt;</a></p>
  </td>
 </tr><tr>
  <td>
  <p>TASK_INFO::clientID</p>
  </td>
  <td>
  <p>Not required.<a id="Appendix_A_Target_165"></a><a aria-label="Product behavior note 165" href="5f5043a3-9e6d-40cc-a05b-1a4a3617df32#Appendix_A_165" data-linktype="relative-path">&lt;165&gt;</a></p>
  </td>
 </tr><tr>
  <td>
  <p>TASK_INFO::percentComplete</p>
  </td>
  <td>
  <p>Required for any task that returns REQ_IN_PROGRESS.</p>
  </td>
 </tr><tr>
  <td>
  <p>TASK_INFO::status</p>
  </td>
  <td>
  <p>Required.</p>
  </td>
 </tr><tr>
  <td>
  <p>TASK_INFO::type</p>
  </td>
  <td>
  <p>Required if PercentageComplete is being used.</p>
  </td>
 </tr><tr>
  <td>
  <p>TASK_INFO::error</p>
  </td>
  <td>
  <p>Required.</p>
  </td>
 </tr><tr>
  <td>
  <p>TASK_INFO::tflag</p>
  </td>
  <td>
  <p>Not required.<a id="Appendix_A_Target_166"></a><a aria-label="Product behavior note 166" href="5f5043a3-9e6d-40cc-a05b-1a4a3617df32#Appendix_A_166" data-linktype="relative-path">&lt;166&gt;</a></p>
  </td>
 </tr></tbody></table>
</li></ul></li></ol><p>The server MUST NOT change the list of storage objects as
part of processing this message.</p></div>