<div class="content"><p>The EnumerateNtmsObjectR method enumerates the objects of
the container specified by <i>lpContainerId</i>.</p><dl>
<dd>
<div><pre> HRESULT EnumerateNtmsObjectR(
   [in, unique] const LPNTMS_GUID lpContainerId,
   [out, size_is(*lpdwListBufferSize), length_is(*lpdwListSize)] 
     LPNTMS_GUID lpList,
   [in] DWORD* lpdwListBufferSize,
   [out] DWORD* lpdwListSize,
   [out] DWORD* lpdwOutputSize,
   [in] DWORD dwType,
   [in] DWORD dwOptions
 );
</pre></div>
</dd></dl><p><b>lpContainerId: </b>A pointer to the identifier of
the container for which to enumerate objects. If this parameter is set to NULL,
top-level objects MUST be enumerated.</p><dl>
<dd>
<p>If the <i>lpContainerId</i> parameter is set to
NULL, the server MUST enumerate top-level objects (such as libraries). If more
than one object is listed, the object can be enumerated from more than one
container. The NULL container is the highest-level container, and enumerates
all objects in a system. <i>lpContainerId</i> can be an object identifier (for
example, a library identifier) which would return the objects associated with
it, depending on the type of object chosen in the <i>dwType</i> parameter.</p>
</dd></dl><p><b>lpList: </b>An array of identifiers for the
objects of <i>lpContainerId</i>.</p><p><b>lpdwListBufferSize: </b>A pointer to the size, in
bytes, of the <i>lpList</i> buffer. </p><p><b>lpdwListSize: </b>A pointer to the number of
elements in <i>lpList</i>.</p><p><b>lpdwOutputSize: </b>A pointer to the required size
of the <i>lpdwListSize</i> parameter if more data need to be returned than can
fit in the <i>lpList</i> buffer. In such a case, <i>lpdwListSize</i> MUST be
set to 0.</p><p><b>dwType: </b>A value from the <a href="5b190198-a0cb-4e20-90a3-234009357051" data-linktype="relative-path">NtmsObjectsTypes (section 2.2.1.6)</a>
enumeration specifying the type of the container.</p><p><b>dwOptions: </b>Enumeration options. This is
applicable only when <b>dwType</b> is NTMS_MEDIA_POOL; if <b>dwType</b> is not
NTMS_MEDIA_POOL, this MUST be set to NTMS_ENUM_DEFAULT</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>0x00000000</p>
  <p>S_OK</p>
  </td>
  <td>
  <p>The call was successful.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x80070005</p>
  <p>ERROR_ACCESS_DENIED</p>
  </td>
  <td>
  <p>Access to an object was denied. </p>
  </td>
 </tr><tr>
  <td>
  <p>0x80070008</p>
  <p>ERROR_NOT_ENOUGH_MEMORY</p>
  </td>
  <td>
  <p>An allocation failure occurred during processing.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x80070057</p>
  <p>ERROR_INVALID_PARAMETER</p>
  </td>
  <td>
  <p>The parameter is NULL or invalid.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x800710D8</p>
  <p>ERROR_OBJECT_NOT_FOUND</p>
  </td>
  <td>
  <p>The <i>lpContainerId</i> parameter is invalid.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x8007007A</p>
  <p>ERROR_INSUFFICIENT_BUFFER</p>
  </td>
  <td>
  <p>The specified buffer size is too small. The required
  size is returned in the <i>lpdwOutputSize</i> parameter.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>Upon receiving this message, the server MUST verify that <i>lpdwListSize</i>
is not NULL. If it is NULL, the server MUST immediately fail the operation and
return ERROR_INVALID_PARAMETER (0x80070057).</p><p>If parameter validation succeeds, the server MUST verify
that the user has the required access rights, and get the object type code from
the RSM object type. If the client does not have the required access rights, the
server MUST return ERROR_ACCESS_DENIED (0x80070005).</p><p>The server behavior depends upon the value of <i>dwOptions</i>.</p><table><thead>
  <tr>
   <th>
   <p> Value </p>
   </th>
   <th>
   <p> Meaning </p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>NTMS_ENUM_DEFAULT</p>
  <p>0x00000000</p>
  </td>
  <td>
  <p>Do not include enumeration of the root pool when
  enumerating the media pools.</p>
  </td>
 </tr><tr>
  <td>
  <p>NTMS_ENUM_ROOTPOOL</p>
  <p>0x00000001</p>
  </td>
  <td>
  <p>Enumerates the root pool, in addition to all other
  top-level media pools. The root pool MUST be returned as the first GUID in
  the list. Enumerating the root pool is only required to get or set the
  security attributes on the object. <i>dwType</i> MUST be NTMS_MEDIA_POOL and <i>lpContainerId</i>
  MUST be NULL. </p>
  </td>
 </tr></tbody></table><p>If the total size of available object IDs is greater than
the current buffer size, the server MUST return ERROR_INSUFFICIENT_BUFFER
(0x0000007A) and set <i>lpdwOutputSize</i> to the required size and set <i>lpdwListSize</i>
to 0. The client can then <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_0e546e86-71c4-45cc-9ef1-4a78f6cb425a" data-linktype="relative-path">allocate</a>
a larger buffer and try again.</p><p>Since an ID can be added by another process, it is possible
for a subsequent method with a resized list to get an error indicating that the
list is too small. If the <i>lpContainerId</i> parameter is set to NULL, RSM
MUST enumerate top-level objects (such as libraries).</p><p>If more than one object is listed, the object can be
enumerated from more than one container. The NULL container is the
highest-level container, and enumerates all objects in a system. </p></div>