Partager via


ErrInit Function (CHKSGFILES)

Topic Last Modified: 2008-09-05

The ErrInit() function initializes the CCheckSGFiles object instance by specifying the databases to be checked and the path and base name of the transaction log files to be checked. Applications should call this function immediately after successfully calling the New() function.

Syntax

Vitual ERR ErrInit 
(
    Const WCHAR * const rgwszDb[],
    Const ULONG cDB,
    __in_z const WCHAR * const wszLogPath,
    __in_z const WCHAR * const wszBaseName,
    Const ULONG ulFlags = NO_FLAGS
);

Parameters

  • rgwszDb[]
    Input parameter. An array that specifies the databases to check. Each array element is a null-terminated Unicode string that contains the path and file name of the database to check.
  • cDB
    Input parameter. The number of valid database path elements in the rgwszDb array.
  • wszLogPath
    Input parameter. The full path of the transaction log files to check, in the form of a null-terminated Unicode string.
  • wszBaseName
    Input parameter. The three-letter base name of the Exchange transaction log files, in the form of a null-terminated Unicode string.
  • 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

This function registers the databases and log files that will be checked. This function must be called after calling the New() function, and before calling any other ChkSGFiles function.

All the database names, the log file path and the base name must be provided as null-terminated Unicode strings.

It is permitted to check both the database and log files, or to check only the database files, or to check only the log files. However, when calling this function, the application must specify at least one thing to check. Passing 0 for cDb and NULL for wszLogPath will return an error.

If cDB is non-zero, passing a NULL rgwszDb will result in an error. To check the database files, the application must provide the database names.

If NULL is passed for wszBaseName, but wszLogPath is not NULL, an error will be returned. A log file base name is always required when checking log files.

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.