Share via


PgnoFromFileOffset Function (CHKSGFILES)

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

Important

Storage groups are not available in Microsoft Exchange Server 2010. For backward compatibility with databases and storage groups in earlier versions of Exchange Server, the CHKSGFILES API includes the capability to specify storage groups. When you run CHKSGFILES against Exchange 2010 databases, you should set parameters that specify a storage group identifier to an empty string.

Vitual ULONGPgnoFromFileOffset 
(
    Const ULONGLONGibFileOffset
);

Parameters

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

Return Value

The database file’s logical page number that includes the specified offset.

Remarks

If the ibFileOffset parameter is invalid, the PgnoFromFileOffset function returns 0 (zero).

PgnoFromFileOffset also returns 0 (zero) if you haven’t called the ErrCheckDbHeaders function on the CCheckSGFiles instance. You must call ErrCheckDbHeaders to initialize the database page size and number of pages allocated to database headers.

You should use PgnoFromFileOffset to fill in the PAGE_INFO structure elements in preparation for calling ErrCheckDbPages. The rgPageInfo parameter to ErrCheckDbPages requires that each element in the array be a PAGE_INFO structure, with the ulPgno member values correctly initialized.

If you’re using CHKSGFILES in a multithreaded application, you can call the PgnoFromFileOffset function in the multithreaded portion of the application. Note that you would normally call this function multiple times for each database being checked. For more information, see Using CHKSGFILES in a Multithreaded Application in this SDK.

Requirements

Exchange 2010 only includes a 64-bit version of CHKSGFILES.

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