<div class="content" name="R_EnumData" uuid="98dea7b4-ca6c-4a22-8754-ded604a04a1b"><p>The R_EnumData method enumerates the data entries of a node
in the <a href="1243ba70-74ca-44f9-be0b-dfd6697010b4#gt_086b13f2-2715-4000-a16c-6acc3d59cc19" data-linktype="relative-path">metabase</a>.</p><dl>
<dd>
<div><pre> HRESULT R_EnumData(
   [in] METADATA_HANDLE hMDHandle,
   [unique, in, string] LPCWSTR pszMDPath,
   [in, out] METADATA_RECORD* pmdrMDData,
   [in] DWORD dwMDEnumDataIndex,
   [out] DWORD* pdwMDRequiredDataLen,
   [out] IIS_CRYPTO_BLOB** ppDataBlob
 );
</pre></div>
</dd></dl><p><b>hMDHandle: </b>An unsigned 32-bit integer value
containing an open metabase handle specifying the key to be enumerated.</p><p><b>pszMDPath: </b>A pointer to a Unicode string that
contains the path of the node to be enumerated, relative to the path of the <i>hMDHandle</i>
parameter.</p><p><b>pmdrMDData: </b>A pointer to a <a href="10608402-8619-4ea9-be90-d57f21393ce0" data-linktype="relative-path">METADATA_RECORD</a> structure
that specifies the retrieved data.</p><p><b>dwMDEnumDataIndex: </b>An integer value specifying
the index of the entry retrieved.</p><p><b>pdwMDRequiredDataLen: </b>Pointer to a <a href="../ms-dtyp/262627d8-3418-4627-9218-4ffe110850b2" data-linktype="relative-path">DWORD</a>
that receives the required buffer size if the method returns
ERROR_INSUFFICIENT_BUFFER as specified in <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>.</p><p><b>ppDataBlob: </b>An <a href="bbe15a83-a32d-48a3-9564-8dacea965e83" data-linktype="relative-path">IIS_CRYPTO_BLOB</a> structure
containing the data value as encrypted opaque data.</p><p><b>Return Values: </b>A signed 32-bit value that
indicates return status. If the method returns a negative value, it failed. If
the 12-bit facility code (bits 16–27) is set to 0x007, the value contains a
Win32 error code in the lower 16 bits. Zero or positive values indicate success,
with the lower 16 bits in positive nonzero values containing warnings or flags
defined in the method implementation. For more information about Win32 error
codes and <a href="../ms-dtyp/a9046ed2-bfb2-4d56-a719-2824afce59ac" data-linktype="relative-path">HRESULT</a>
values, see [MS-ERREF].</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000 S_OK</td>
  <td>The call was successful.</td>
 </tr><tr>
  <td>0x80070003 ERROR_PATH_NOT_FOUND</td>
  <td>The system cannot find the path specified.</td>
 </tr><tr>
  <td>0x80070005 E_ACCESSDENIED</td>
  <td>General access denied error.</td>
 </tr><tr>
  <td>0x80070006 ERROR_INVALID_HANDLE</td>
  <td>The handle is invalid.</td>
 </tr><tr>
  <td>0x80070057 E_INVALIDARG</td>
  <td>One or more arguments are invalid.</td>
 </tr><tr>
  <td>0x8007007A ERROR_INSUFFICIENT_BUFFER</td>
  <td>The data area passed to a system call is too small.</td>
 </tr><tr>
  <td>0x80070103 ERROR_NO_MORE_ITEMS</td>
  <td>No more data is available.</td>
 </tr></tbody></table>
</dd></dl><p>The <a href="1243ba70-74ca-44f9-be0b-dfd6697010b4#gt_e127848e-c66d-427d-b3aa-9f904fa4ada7" data-linktype="relative-path">opnum</a>
field value for this method is 12. </p><p>The client indicates how much decrypted data it is ready to
receive by passing the number of bytes in the <b>dwMDDataLen</b> field of the <i>pmdrMDData</i>
parameter. If this value is too small to contain the decrypted data value, the
server MUST return ERROR_INSUFFICIENT_BUFFER and return the number of bytes
required to hold the data in the <i>pdwMDRequiredDataLen</i> parameter.</p><p>When processing this call, the <a href="1243ba70-74ca-44f9-be0b-dfd6697010b4#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a> MUST do the
following:</p><ul><li><p><span><span> 
</span></span>Check the handle. This handle is valid if it is either the master
root handle or a handle returned from a previous <a href="a54be1d0-009a-493d-a53e-e2f7fbe87293" data-linktype="relative-path">OpenKey</a> call. If the
handle is invalid, return ERROR_INVALID_HANDLE.</p>
</li><li><p><span><span> 
</span></span>The server SHOULD check whether the handle was opened for read
access. If not, return E_ACCESSDENIED.<a id="Appendix_A_Target_13"></a><a aria-label="Product behavior note 13" href="88fd1df0-e63e-41ca-9bf3-bedcab57cd86#Appendix_A_13" data-linktype="relative-path">&lt;13&gt;</a></p>
</li><li><p><span><span> 
</span></span>The server SHOULD check whether the relative path points to the
existing subnode of the parent handle. If not, return ERROR_PATH_NOT_FOUND.</p>
</li><li><p><span><span> 
</span></span>Obtain the requested data using an index parameter. If the index
is equal or greater than the number of data items associated with the node,
return ERROR_NO_MORE_ITEMS.</p>
</li><li><p><span><span> 
</span></span>To return the data value to the client, build the IIS_CRYPTO_BLOB
structure as specified in the rules of the <a href="7f8d396e-6eff-4141-a61c-859262b1e0a7" data-linktype="relative-path">R_GetData</a> method.</p>
</li></ul></div>