cwbCO_SetDefaultUserMode

Purpose

This function sets, for the specified system object, the behavior with respect to any configured default user ID.

Syntax

 
UINT CWB_ENTRY cwbCO_SetDefaultUserMode(
                             cwbCO_SysHandle         system,
                             cwbCO_DefaultUserMode   mode );

Parameters

cwbCO_SysHandle system - input
Handle that previously was returned from cwbCO_CreateSystem or cwbCO_CreateSystemLike. It identifies the iSeries™ system.
cwbCO_DefaultUserMode mode - input
Specifies what will be done with the default user ID. Possible values are:
CWBCO_DEFAULT_USER_MODE_NOT_SET
No default user mode is currently in use. When this mode is active, and the Prompt Mode setting does not prohibit prompting, the user will be prompted at signon or connect time to select which of the remaining default user modes should be used from then on. The signon or connect cannot succeed until one of these other mode values is selected. Setting the Default User Mode back to this value will cause the prompt to appear the next time a default user ID is needed by iSeries Access.
CWBCO_DEFAULT_USER_USE
When no user ID has explicitly been set (by using cwbCO_SetUserIDEx) and a signon is to occur, use the default user ID that is configured for the iSeries system as named in the system object.
CWBCO_DEFAULT_USER_IGNORE
Specifies never to use a default user ID. When a signon takes place and no user ID has explicitly been set for this system object instance, the user will be prompted to enter a user ID if the Prompt Mode allows it (see cwbCO_SetPromptMode comments), and no initial value for the user ID will be filled in the prompt.
CWBCO_DEFAULT_USER_USEWINLOGON
The user ID that is used when logging on to Windows® will be used as the default if no user ID explicitly has been set for this system object (by using cwbCO_SetUserIDEx).
CWBCO_DEFAULT_USER_USE_KERBEROS
The kerberos principal created when logging into a Windows domain will be used as the default if no user ID has explicitly been set for this system object (using cwbCO_SetUserIDEx).

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 successfully has occurred by using the specified system object, so this setting no longer may be changed.
CWB_KERB_NOT_AVAILABLE
Kerberos security package is not available on this version of Windows.

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. The default user mode set with this API will be ignored if a user ID has been set explicitly with the cwbCO_SetUserIDEx API.

Error code CWB_KERB_NOT_AVAILABLE will be returned if you attempt to set CWBCO_DEFAULT_USER_USE_KERBEROS on a Windows platform that does not support Kerberos.