cwbCO_GetUserID

Purpose

Get signon or default user ID of the input system as it is configured and possibly connected in the currently active environment. This API is obsolete, and has been replaced.

Syntax

 
unsigned int CWB_ENTRY cwbCO_GetUserID(
                             LPCSTR              systemName,
                             char               *userID,
                             unsigned int        userID_Type,
                             unsigned long      *bufferSize);

Parameters

LPCSTR systemName - input
Pointer to a buffer that contains the system name.
char *userID - output
Pointer to a buffer where the desired userID of the system is returned. This buffer should be large enough to hold at least CWBCO_MAX_USER_ID + 1 characters, including the terminating NULL character.
unsigned int userID_Type - input
Specify whether current user ID of connected system (CWBCO_CURRENT_USER_ID) or default user ID of configured system (CWBCO_DEFAULT_USER_ID) is to be returned.
unsigned long * bufferSize - input/output
Pointer to a value that indicates the size of the userID buffer. If the buffer is not big enough, the value needed is returned.

Return Codes

The following list shows common return values.

CWB_OK
Successful Completion.
CWB_INVALID_POINTER
One or more input pointers are invalid.
CWB_INVALID_PARAMETER
The value for userID_Type is invalid.
CWB_BUFFER_OVERFLOW
Not enough room in userID buffer to store the user ID. Use *bufferSize to determine the correct size. No error message is logged to the History Log since the caller is expected to recover from this error and continue.
CWBCO_SYSTEM_NOT_CONNECTED
The system of the "current user ID" is not connected.
CWBCO_SYSTEM_NOT_CONFIGURED
The system of the "default user ID" is not configured in the currently active environment.
CWBCO_INTERNAL_ERROR
Internal error.
CWB_NOT_ENOUGH_MEMORY
Insufficient memory; may have failed to allocate temporary buffer.
CWB_NON_REPRESENTABLE_UNICODE_CHAR
One or more input Unicode characters have no representation in the codepage being used.
CWB_API_ERROR
General API failure.

Usage

If the default user ID is specified, and none was entered when the connection was configured, CWB_OK will be returned and the user ID sent back to the caller will be the empty string, "\0". The user ID retrieved will be that of the specified system from the currently active environment.