cwbCO_SetValidateMode

Purpose

This function sets, for the specified system object, the validate mode, which affects behavior when validating the user ID and password.

Syntax

 
UINT CWB_ENTRY cwbCO_SetValidateMode(
                             cwbCO_SysHandle     system,
                             cwbCO_ValidateMode  mode );

Parameters

cwbCO_SysHandle system - input
Handle that previously was returned from cwbCO_CreateSystem or cwbCO_CreateSystemLike. It identifies the iSeries™ system.
cwbCO_ValidateMode mode - input
Specifies the validate mode. Possible values are:
CWBCO_VALIDATE_IF_NECESSARY
If validation of this user ID on this iSeries system has occurred from this PC within the last 24 hours, and the validation was successful, then use the results of the last validation and do not connect to validate at this time. There may be other scenarios where re-validation will occur; iSeries Access for Windows® will re-validate as needed.
CWBCO_VALIDATE_ALWAYS
Communication with the iSeries system to validate user ID and password will occur every time this validation is requested or required. Setting this mode forces the validation to occur (when the system object is not signed on yet). Once a system object is signed on, this setting is ignored.

Return Codes

The following list shows common return values.

CWB_OK
Successful completion.
CWB_INVALID_API_HANDLE
Invalid system handle.
CWB_INVALID_PARAMETER
The mode parameter is an invalid value.
CWB_RESTRICTED_BY_POLICY
A policy exists that prohibits the user from changing this value.
CWB_INV_AFTER_SIGNON
Signon has successfully occurred using the specified system object, so this setting no longer may be changed.

Usage

This API cannot be used after a successful signon has occurred for the specified system object. A signon has occurred if either cwbCO_Signon or cwbCO_Connect has been called successfully for this system object.