<div class="content" name="NetrServerDiskEnum" uuid="9160997b-3a34-496e-9f26-b3a857585aa7"><p>The NetrServerDiskEnum method retrieves a list of disk
drives on a <a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a>. The
method returns an array of three-character strings (a drive letter, a colon,
and a terminating null character).</p><dl>
<dd>
<div><pre> NET_API_STATUS NetrServerDiskEnum(
   [in, string, unique] SRVSVC_HANDLE ServerName,
   [in] DWORD Level,
   [in, out] DISK_ENUM_CONTAINER* DiskInfoStruct,
   [in] DWORD PreferedMaximumLength,
   [out] DWORD* TotalEntries,
   [in, out, unique] DWORD* ResumeHandle
 );
</pre></div>
</dd></dl><p><b>ServerName: </b>An <a href="5f8329ee-1965-4ea1-ad35-3b29fbb63232" data-linktype="relative-path">SRVSVC_HANDLE (section 2.2.1.1)</a>
pointer that identifies the server. The <a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a> MUST map this
structure to an RPC binding handle (see <a href="https://go.microsoft.com/fwlink/?LinkId=89824" data-linktype="external">[C706]</a> sections 4.3.5
and 5.1.5.2). The server MUST ignore this parameter.</p><p><b>Level: </b>Specifies the information level of the
data. It MUST be the following value.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0</td>
  <td>The buffer is of type DISK_INFO.</td>
 </tr></tbody></table>
</dd></dl><p><b>DiskInfoStruct: </b>A pointer to a structure of
type <a href="4f16d205-7147-4d22-ae3d-d7e690ed2ce4" data-linktype="relative-path">DISK_ENUM_CONTAINER</a>,
as specified in section 2.2.4.92. Although this parameter is defined as an [in,
out] parameter, it is used only as an [out] parameter. The server MUST ignore
any values that are passed in this parameter.</p><p><b>PreferedMaximumLength: </b>The server MUST ignore
this parameter.</p><p><b>TotalEntries: </b>The number of entries being
returned in the <b>Buffer</b> member of the <i>DiskInfoStruct</i> parameter.
This MUST be in the range 0–26.</p><p><b>ResumeHandle: </b>The server MUST ignore this
parameter.</p><p><b>Return Values: </b>The method returns 0x00000000
(NERR_Success) to indicate success; otherwise, it returns a nonzero error code.
The method can take any specific error code value, as specified in <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>
section <a href="../ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d" data-linktype="relative-path">2.2</a>.
The most common error codes are listed in the following table.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000 NERR_Success</td>
  <td>The client request succeeded.</td>
 </tr><tr>
  <td>0x0000007C ERROR_INVALID_LEVEL</td>
  <td>The system call level is not correct.</td>
 </tr><tr>
  <td>0x00000008 ERROR_NOT_ENOUGH_MEMORY</td>
  <td>Not enough storage is available to process this command.</td>
 </tr><tr>
  <td>0x00000005 ERROR_ACCESS_DENIED</td>
  <td>The caller does not have the permissions to perform the operation.</td>
 </tr></tbody></table>
</dd></dl><p>The server MUST ignore the <i>PreferedMaximumLength</i>
parameter.</p><p>The server MUST ignore the <i>ResumeHandle</i> parameter.</p><p>Upon successful processing of the request, the server MUST
set the <i>TotalEntries</i> parameter equal to the number of disk drive entries
that the server enumerated in the <b>Buffer</b> member of <i>DiskInfoStruct</i>
and the <b>EntriesRead</b> member of <i>DiskInfoStruct</i> MUST be set to 1
plus the value set for <i>TotalEntries</i>.</p><p>Upon successful processing of the request, the server MUST
return the enumerated disk drives in the <b>Buffer</b> member of <i>DiskInfoStruct</i>
in the format of the <b>DISK_INFO</b> structure. The server MUST allocate the
memory required to return all enumerated disk drives in the <b>Buffer</b>
member of the <i>InfoStruct</i> parameter. In cases where the RPC allocated a
buffer because the client specified a non-NULL value for the <i>Buffer</i>
parameter, the server MUST free the buffer that is allocated by the <a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a>. </p><p>The server SHOULD<a id="Appendix_A_Target_86"></a><a aria-label="Product behavior note 86" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#Appendix_A_86" data-linktype="relative-path">&lt;86&gt;</a> enforce
security measures to verify that the caller has the required permissions to
execute this routine. If the caller does not have the required credentials, the
server SHOULD<a id="Appendix_A_Target_87"></a><a aria-label="Product behavior note 87" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#Appendix_A_87" data-linktype="relative-path">&lt;87&gt;</a> fail the call.</p></div>