Directory Services

DsRestoreGetDatabaseLocations

The DsRestoreGetDatabaseLocations function is called both at backup time as well as at restoration time to get the database locations for different types of files.

HRESULT DsRestoreGetDatabaseLocations(
  HBC hbc,
  LPWSTR* pszDatabaseLocationList,
  LPDWORD pcbSize
);

Parameters

hbc
[in] Contains the backup context handle obtained with the DsRestorePrepare function. At backup time, do not pass an expiry token in DsRestorePrepare. This causes a restricted context handle to be returned, which may only be used with the DsRestoreGetDatabaseLocations function.
pszDatabaseLocationList
[out] Pointer to a string pointer that receives the list of database locations as UNC paths. This list receives a double null-terminated list of single null terminated strings.

This buffer is allocated by the DsRestoreGetDatabaseLocations function and must be freed when it is no longer needed by calling the DsBackupFree function.

The first character of each of the file names contains one of the BFT Constants that identifies the type of name.

pcbSize
[out] Pointer to DWORD value that receives the size, in bytes, of the pszDatabaseLocationList buffer.

Return Values

Returns S_OK if successful or a standard HRESULT, Win32 or RPC error code otherwise.

Requirements

Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Unicode: Implemented as Unicode and ANSI versions.
Header: Declared in Ntdsbcli.h.
Library: Use Ntdsbcli.lib.

See Also

DsRestorePrepare, DsBackupFree, Directory Backup Functions, Restoring Active Directory