3.1.4.15 DeleteBackup (Opnum 31)

The DeleteBackup method deletes a metabase backup.

 HRESULT DeleteBackup(
   [unique, in, string] LPCWSTR pszMDBackupName,
   [in] DWORD dwMDVersion
 );

pszMDBackupName: A string of up to 100 Unicode characters that names the backup.

dwMDVersion: Either an integer value specifying the version number of the backup to be deleted or the following constant.

Value

Meaning

MD_BACKUP_HIGHEST_VERSION

0xFFFFFFFE

Delete the existing backup with the highest version number.

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.

0x80070057

E_INVALIDARG

One or more arguments are invalid.

0x80070002

ERROR_FILE_NOT_FOUND

The system cannot find the file specified.

0x80070008

ERROR_NOT_ENOUGH_MEMORY

There is not enough memory to complete the operation.

The opnum field value for this method is 31.

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

  • If the pszMDBackupName parameter is not an empty string and it contains any characters in the following set ('/', '\', '*', '.', '?', '"', '&', '!', '@', '#', '$', '%', '^', '(', ')', '=', '+', '|', '`', '~'), return E_INVALIDARG.

  • If the pszMDBackupName parameter is empty or is not the name of a backup, return ERROR_FILE_NOT_FOUND.

  • Check the dwMDVersion parameter. If this parameter is equal to MD_BACKUP_HIGHEST_VERSION, find and delete the very last backup. Otherwise, find and delete the backup with the requested version number. If a backup does not exist, return ERROR_FILE_NOT_FOUND.