Share via


ErrCheckDbHeaders Function (CHKSGFILES)

Topic Last Modified: 2006-12-01

The ErrCheckDbHeaders() function validates the headers of the database files that were specified by ErrInit(). This function also returns the page size and number of pages in the databases.

Syntax

Vitual ERR ErrCheckDbHeaders 
(
        ULONG * const pcbDbPageSize,
        ULONG * const pcHeaderPagesPerDb,
        ULONG  const piDbErrorEncountered,
    Const ULONG ulFlags = NO_FLAGS
);

Parameters

  • pcbDbPageSize
    Output parameter. The page size of the databases, in bytes.
  • pcHeaderPagesPerDb
    Output parameter. The number of pages at the beginning of the database that are reserved by the database engine for internal use. Header pages should NOT be passed to the ErrCheckDbPages() function for validation.
  • piDbErrorEncountered
    Output parameter. If the return value of the function indicates an error, this parameter will be an index into the rgwszDb[] array passed to the ErrInit() function. The indexed array element represents the database in which the error was encountered. If the function does not return an error value, then this parameter value is invalid.
  • ulFlags
    Optional input parameter. This value is reserved for future use. The value passed should be zero.

Return Value

This function returns an error code from the ERR Enum (CHKSGFILES).

Remarks

ErrCheckDbHeaders() verifies that each database registered with ErrInit() has the same log signature and database page size. The lowest genMin and highest genMax are also used to determine the set of log files needed to bring all the registered databases to a clean-shutdown state.

The piDbErrorEncountered parameter is only set when an error is detected, as indicated by a non-zero ErrCheckDbHeaders() return value.

When an error occurs in this function, an error event will be added to the Windows Error Event Log.

ErrCheckDbHeaders() can only be called after ErrInit(), and must be called before ErrCheckDbPages() and ErrCheckLogs().

Requirements

When calling this API on a computer where the Exchange Server 2007 Administrative Tools role is installed on Microsoft Windows XP, use the 32-bit version of this API.

When calling this API on a computer when Exchange Server 2007 is installed on a 64-bit version of Windows, use the 64-bit version of this API.

The account that the application is running under must have read access permissions to the database and log files to be checked.