QsyGetEIMHandle()--Get EIM Handle Connected For System


  Syntax
 #include <qsyeimapi.h>

 #include <eim.h>

 int QsyGetEIMHandle(EimHandle      * eim,,
                          EimRc      * eimrc)
 
  Service Program Name: QSYS/QSYEIMAPI

  Default Public Authority: *USE

  Threadsafe: Yes

The QsyGetEIMHandle() function is used to allocate an EimHandle structure that is connected to EIM. The EIM host information used will be the ldapURL information set by the eimSetConfiguration() API. The connection information used will be the connectInfo set by the QsySetEIMConnectInfo() API. The EimHandle structure should be passed on subsequent calls to other EIM operations. When the handle is no longer needed, it should be destroyed by calling eimDestroyHandle() function.


Authorities and Locks

Authority required
*ALLOBJ and *SECADM special authorities

Parameters

eim  (Output)
The pointer to an EIM handle to be returned. This handle is used as input for other EIM APIs. The handle is temporary; you can use it only in the job that created it.

eimrc
(Input/Output)

The structure in which to return error code information. If the return value is not 0, eimrc is set with additional information. This parameter may be NULL. For the format of the structure, see EimRC--EIM Return Code Parameter.


Return Value

The return value from the API. Following each return value is the list of possible values for the messageCatalogMessageID field in the eimrc parameter for that value.

0
Request was successful.

EACCES
Access denied.


EBADDATA (3028)
eimrc is not valid.

EBUSY (3029)
Unable to allocate internal system object.


ECONVERT (3490)
Data conversion error.


EINVAL (3021)
Input parameter was not valid.


ENOMEM (3460)
Unable to allocate required space.


ENOSYS (3470)
System not configured.


EUNKNOWN (3474)
Unexpected exception.


Related Information


Example

The following example gets connection information used by the operating system.

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.

#include <eim.h>
#include <qsyeimapi.h>
            

int main(int argc, char *argv[])
{
    int rc;
    char       eimerr[100];
    EimRC     *err;
    EimHandle     handle;

    err = (EimRC *)eimerr;
    err->memoryProvidedByCaller = 100;

    if (0 != (rc = QsyGetEIMHandle(&handle,
                                        err)))
    {
        printf("Get connected handle error = %d", rc);
        return -1;
    }

    ...  other eim operations


    if (0 != (rc = eimDestroyHandle(&handle,
                                        err)))
    {
        printf("Destroy eim handle error = %d", rc);
        return -1;
    }
    
              
    return 0;
}


API introduced: V5R4

[ Back to top | Security APIs | APIs by category ]