3.1.4.14 EnumBackups (Opnum 30)

The EnumBackups method enumerates metabase backups with a specified backup name or all backups.

 HRESULT EnumBackups(
     [in, out, size_is(MD_BACKUP_MAX_LEN)] LPWSTR pszMDBackupName,
     [out] DWORD *pdwMDVersion,
     [out] PFILETIME  pftMDBackupTime,
     [in]  DWORD dwMDEnumIndex
 );

pszMDBackupName: 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.

pdwMDVersion: An integer value containing the version number of the backup.

pftMDBackupTime: A FILETIME structure containing the Coordinated Universal Time (UTC) date and time when this backup was created.

dwMDEnumIndex: An integer value specifying the index number of the backup to be enumerated.

Return Values: 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 HRESULT values, see [MS-ERREF].

Return value/code

Description

0x00000000

S_OK

The call was successful.

0x80070103

ERROR_NO_MORE_ITEMS

No more data is available.

0x80070057

E_INVALIDARG

The pszMDBackupName parameter is NULL.

The opnum field value for this method is 30.

When processing this call, the server MUST do the following:

  • If the pszMDBackupName parameter is NULL, the server MUST return the error E_INVALIDARG.

  • If the pszMDBackupName parameter is an empty string, the server MUST enumerate all backups; otherwise, it enumerates only backups that match the requested name.

  • For the backups matching the name provided, find the backup with an index equal to the dwMDEnumIndex parameter. If such a backup does not exist, return the error ERROR_NO_MORE_ITEMS.

  • If the pszMDBackupName parameter is an empty string, copy the name of the backup to the pszMDBackupName buffer.

  • Copy the version of the backup into the pdwMDVersion parameter.

  • Copy the backup time into the pftMDBackupTime parameter.