PgnoFromFileOffset Function (CHKSGFILES)

Topic Last Modified: 2007-10-04

The PgnoFromFileOffset function returns the logical database page number that corresponds to the supplied byte-index in the physical database file. If the file offset is invalid, or if ErrCheckDbHeaders has not been called for the databases, this function returns zero.

Syntax

Vitual ULONG PgnoFromFileOffset 
(
    Const ULONGLONG ibFileOffset
);

Parameters

  • ibFileOffset
    Input parameter. Offset into a database file, in bytes.

Return Value

The PgnoFromFileOffset function returns the database file logical page number that includes the specified offset.

Remarks

If the ibFileOffset parameter is invalid, PgnoFromFileOffset will return zero.

PgnoFromFileOffset also returns zero if ErrCheckDbHeaders has not been called on the CCheckSGFiles instance. Calling ErrCheckDbHeaders is required to initialize the database page size and number of pages allocated to database headers.

This function is intended for use when filling in the PAGE_INFO elements in preparation for calling ErrCheckDbPages. The rgPageInfo parameter to the ErrCheckDbPages function requires that each element in the array be a PAGE_INFO structure, with the ulPgno member values correctly initialized.

Requirements

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

When you are calling this API on a computer on which Exchange 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 that are to be checked.