<div class="content"><p> </p><p>The EnumDiskRegionsEx method enumerates all used and free
regions of a specified <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_c4133b2a-a990-4042-ba44-7fda3090f118" data-linktype="relative-path">disk</a></span>.</p><dl>
<dd>
<div><pre> HRESULT EnumDiskRegionsEx(
   [in] LdmObjectId diskId,
   [in, out] unsigned long* numRegions,
   [out, size_is(,*numRegions)] REGION_INFO_EX** regionList
 );
</pre></div>
</dd></dl><p><b>diskId: </b>Specifies the OID of the disk for
which regions are being enumerated.</p><p><b>numRegions: </b>Pointer to the number of regions
in <i>regionList</i>.</p><p><b>regionList: </b>Pointer to an array of <span><a href="9a20cc96-88c3-4194-9563-9778bea15376" data-linktype="relative-path">REGION_INFO_EX</a></span>
structures.</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>numRegions</i>
and <i>regionList</i> are not NULL.</p>
</li><li><p><span>    </span>Verify that the
disk specified by <i>diskId</i> is in the list of storage objects.</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>Enumerate all <span><a href="3c91641b-e5cd-409e-a445-2e4d61ae33c6#gt_753cb2b4-3f5c-48f3-97ef-61612c40499e" data-linktype="relative-path">disk
region</a></span> objects that reside on the specified disk.</p>
</li><li><p><span>    </span>Allocate a
buffer large enough to contain REGION_INFO_EX structures that describes all
regions that reside on the disk. </p>
</li><li><p><span>    </span>The buffer MUST
be populated with regions in the ascending order of the byte offset of the
region relative to the beginning of the disk. </p>
</li><li><p><span>    </span>Populate each
REGION_INFO_EX structure in the buffer with information about the region. </p>
</li><li><p><span>    </span>The buffer MUST
be returned to the client in the output parameter <i>regionList</i>. </p>
</li><li><p><span>    </span>The number of
REGION_INFO_EX structures in the buffer MUST be returned in the output
parameter <i>numRegions</i>. </p>
</li><li><p><span>    </span>Return a
response to the client containing 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>