cwbCO_GetPasswordExpireDate

Purpose

Retrieves the date and time the password will expire for the user ID that is set in the given system object on the iSeries™ system that it represents.

Syntax

 
UINT CWB_ENTRY cwbCO_GetPasswordExpireDate(
                             cwbCO_SysHandle       system,
                             cwb_DateTime         *expirationDateTime);

Parameters

cwbCO_SysHandle system - input
Handle returned previously from cwbCO_CreateSystem or cwbCO_CreateSystemLike. It identifies the iSeries system.
cwb_DateTime * expirationDateTime - output
A pointer to a structure that contains the date and time at which the password will expire for the current user ID, in the following format:
Bytes Content
1 - 2 Year (Example: 1998 = 0x07CF)
3 Month (January = 0x01)
4 Day (First day = 0x01;31st day = 0x1F)
5 Hour (Midnight = 0x00;23rd hour = 0x17)
6 Minute (On the hour = 0x00; 59th minute = 0x3B)
7 Second (On the minute = 0x00; 59th second = 0x3B)
8 One-hundredth of a second (on the second = 0x00; maximum = 0x63)
Note: On a given day, the maximum time is 23 hours, 59 minutes, and 59.99 seconds. Midnight is 0 hours, 0 minutes, and 0.0 seconds on the following day.

Return Codes

The following list shows common return values.

CWB_OK
Successful completion.
CWB_INVALID_API_HANDLE
Invalid system handle.
CWB_INVALID_POINTER
The pointer to the cwb_DateTime structure is NULL.
CWB_INV_BEFORE_VALIDATE
The user ID and password that were set in the specified system object have not been validated (so the password expire date is not available), or validation has occurred and the user profile password expiration interval is set to *NOMAX.

Usage

You successfully must have called cwbCO_VerifyUserIDPassword, cwbCO_Signon, or cwbCO_Connect before using this API. If you want to ensure that the value that is returned is recent, you either must call cwbCO_VerifyUserIDPassword explicitly, or set the Validate Mode to CWBCO_VALIDATE_ALWAYS before you call cwbCO_Signon or cwbCO_Connect.

If the user profile password expiration interval is set to *NOMAX, a password expire date does not exist. To detect this case, first validate the user ID and password as noted above, and then, if successful, call cwbCO_GetPasswordExpireDate. A return code of CWBCO_INV_BEFORE_VALIDATE means that the password expiration interval is set to *NOMAX.