HrESEBackupReadFile Function

Topic Last Modified: 2006-06-12

The HrESEBackupReadFile function reads data in the application buffer.

Applies To

ESEbcli2 DLL Functions Interface

Syntax

HRESULT HrESEBackupReadFile
(
        HCCX hccsBackupContext,
        void* hFile,
        void* pvBuffer,
        WORD cbBuffer,
        WORD* pcbRead
);

Parameters

  • hccsBackupContext
    Input parameter. The backup context handle returned by the HrESEBackupPrepare Function in the phccxBackupContext parameter.
  • hFile
    Input parameter. Specifies the file handle for the file section, as returned in the rghFile array by the HrESEBackupOpenFile Function.
  • pvBuffer
    Input parameter. The buffer into which data will be placed. The buffer must be at least as large (in bytes) as specified by the pcbRead parameter.
  • cbBuffer
    The size, in bytes, of the buffer pointed to by pvBuffer.
  • pcbRead
    The amount of data, in bytes, placed into the buffer pointed to by pvBuffer.

Return Value

The following return codes can be returned. To retrieve the error string for an Exchange Storage Engine (ESE) error, use the standard FormatMessage function. For the general errors hrErrorFromESECall and hrErrorFromCallbackCall, more information about the error is available using the standard GetLastError function.

S_OK

Success.

ESE-specific error codes

ESE-specific error codes, as defined in esebkmsg.h.

Other

Other Microsoft® Win32® or remote procedure call (RPC) errors.

Remarks

Important

Always ensure that the application calculates the size of pvBuffer correctly. The cbBuffer parameter specifies the size in bytes. If the cbBuffer value indicates, incorrectly, that the buffer is larger than it really is, the ESE may overwrite adjacent memory, causing the application to encounter memory access violations and behave unexpectedly.

Applications that use this function must be run under a user account that has Microsoft Windows® server operating systems Backup and Restore privileges.