<div class="content" name="GetEncapsulateDiskInfo" uuid="bd858871-f4eb-4487-aabe-be68580bd2d3"><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>ENCAP_INFO_CANT_PROCEED 0x00000001</td>
  <td>Encapsulation for 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 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.</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_FT_HAS_RAID5 0x00000040</td>
  <td>Disk is part of an FT RAID-5 set, which this interface does not support for encapsulation.</td>
 </tr><tr>
  <td>ENCAP_INFO_FT_ON_BOOT 0x00000080</td>
  <td>Disk is both part of an FT set volume and bootable, which this interface does not support for encapsulation.</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></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>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>Disk contains an unknown volume type.</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 empty 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 different types of partitions.</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>