<div class="content" name="EnumBackups" uuid="ee5a7c1c-4f65-4bd5-89cc-1d57cbc4ab3b"><p>The EnumBackups method enumerates <a href="1243ba70-74ca-44f9-be0b-dfd6697010b4#gt_086b13f2-2715-4000-a16c-6acc3d59cc19" data-linktype="relative-path">metabase</a> backups with a
specified backup name or all backups.</p><dl>
<dd>
<div><pre> HRESULT EnumBackups(
     [in, out, size_is(MD_BACKUP_MAX_LEN)] LPWSTR pszMDBackupName,
     [out] DWORD *pdwMDVersion,
     [out] PFILETIME  pftMDBackupTime,
     [in]  DWORD dwMDEnumIndex
 );
</pre></div>
</dd></dl><p><b>pszMDBackupName: </b>A buffer of size
MD_BACKUP_MAX_LEN. On input, the buffer can contain either a string of Unicode
characters that names the backup set to be enumerated or an empty string.</p><p><b>pdwMDVersion: </b>An integer value containing the
version number of the backup.</p><p><b>pftMDBackupTime: </b>A <a href="../ms-dtyp/2c57429b-fdd4-488f-b5fc-9e4cf020fcdf" data-linktype="relative-path">FILETIME</a>
structure containing the Coordinated Universal Time (UTC) date and time when
this backup was created.</p><p><b>dwMDEnumIndex: </b>An integer value specifying the
index number of the backup to be enumerated.</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 <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>.</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>0x80070103 ERROR_NO_MORE_ITEMS</td>
  <td>No more data is available.</td>
 </tr><tr>
  <td>0x80070057 E_INVALIDARG</td>
  <td>The pszMDBackupName parameter is NULL.</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 30.</p><p>When processing this call, the server MUST do the following:</p><ul><li><p><span><span> 
</span></span>If the <i>pszMDBackupName</i> parameter is NULL, the server MUST
return the error E_INVALIDARG.</p>
</li><li><p><span><span> 
</span></span>If the <i>pszMDBackupName</i> parameter is an empty string, the
server MUST enumerate all backups; otherwise, it enumerates only backups that
match the requested name.</p>
</li><li><p><span><span> 
</span></span>For the backups matching the name provided, find the backup with
an index equal to the <i>dwMDEnumIndex</i> parameter. If such a backup does not
exist, return the error ERROR_NO_MORE_ITEMS.</p>
</li><li><p><span><span> 
</span></span>If the <i>pszMDBackupName</i> parameter is an empty string, copy
the name of the backup to the <i>pszMDBackupName</i> buffer.</p>
</li><li><p><span><span> 
</span></span>Copy the version of the backup into the <i>pdwMDVersion</i>
parameter.</p>
</li><li><p><span><span> 
</span></span>Copy the backup time into the <i>pftMDBackupTime</i> parameter.</p>
</li></ul></div>