CChkSGFiles 函数CChkSGFiles.PgnoFromFileOffset function

适用于: Exchange Server 2003 |Exchange Server 2007 |Exchange Server 2010 |Exchange Server 2013Applies to: Exchange Server 2003 | Exchange Server 2007 | Exchange Server 2010 | Exchange Server 2013

返回与物理数据库文件中指定的字节索引相对应的逻辑数据库页面编号。Returns the logical database page number that corresponds to the specified byte index in the physical database file. 如果文件偏移量无效,或者尚未为数据库调用ErrCheckDbHeaders函数,则此函数返回0(零)。If the file offset is invalid, or if the ErrCheckDbHeaders function has not been called for the databases, this function returns 0 (zero).

Vitual ULONGPgnoFromFileOffset  
    Const ULONGLONGibFileOffset



输入参数。Input parameter. 数据库文件中的偏移量(以字节为单位)。The offset into a database file, in bytes.

返回值Return value

包含指定偏移量的数据库文件的逻辑页面编号。The database file's logical page number that includes the specified offset.


如果ibFileOffset参数无效,则PgnoFromFileOffset函数将返回0(零)。If the ibFileOffset parameter is invalid, the PgnoFromFileOffset function returns 0 (zero).

如果您未在CCheckSGFiles实例上调用ErrCheckDbHeaders函数,则PgnoFromFileOffset也返回0(零)。PgnoFromFileOffset also returns 0 (zero) if you haven't called the ErrCheckDbHeaders function on the CCheckSGFiles instance. 必须调用ErrCheckDbHeaders以初始化数据库页面大小和分配给数据库标头的页面数。You must call ErrCheckDbHeaders to initialize the database page size and number of pages allocated to database headers.

应使用PgnoFromFileOffset在准备调用ErrCheckDbPages的过程中填写页面 _ 信息结构元素。You should use PgnoFromFileOffset to fill in the PAGE_INFO structure elements in preparation for calling ErrCheckDbPages. ErrCheckDbPagesrgPageInfo参数要求数组中的每个元素都是一个PAGE_INFO结构,其中ulPgno成员的值已正确初始化。The rgPageInfo parameter to ErrCheckDbPages requires that each element in the array be a PAGE_INFO structure, with the ulPgno member values correctly initialized.

如果要在多线程应用程序中使用 CHKSGFILES,则可以在应用程序的多线程部分调用PgnoFromFileOffset函数。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 typically call this function multiple times for each database being checked.


Exchange Server 2013 仅包含64位版本的 CHKSGFILES API。Exchange Server 2013 only includes a 64-bit version of the CHKSGFILES API.

运行应用程序所使用的帐户必须具有对要检查的数据库和日志文件的读取权限。The account that the application is running under must have read permission to the database and log files that are to be checked.