ldap_conn_from_msg function
The ldap_conn_from_msg function returns the LDAP session handle (connection pointer) for a particular message.
Syntax
LDAP* ldap_conn_from_msg( _In_ LDAP *PrimaryConn, _In_ LDAPMessage *res );
Parameters
- PrimaryConn [in]
-
A pointer to the LDAP session handle of the message, if known. If the LDAP session handle for the message is unknown, then NULL may be passed for this parameter provided that the LDAP_OPT_REF_DEREF_CONN_PER_MSG session option had been previously set for the message session.
- res [in]
-
The LDAP message queried. If NULL is passed for this parameter, then the function will respond with a NULL return value.
Return value
The return value is the LDAP session handle (connection pointer) where the message originated from. This function returns NULL if the originating session has closed or if a NULL LDAPMessage pointer is passed to the function and the LDAP_OPT_REF_DEREF_CONN_PER_MSG session option was not previously set for the message session.
Remarks
This function is used to identify the LDAP session handle associated with the specified LDAP message. It returns a valid LDAP session handle only if one of the following conditions are met:
- The LDAPMessage originated from the same LDAP session handle passed to the function in the PrimaryConn parameter.
- The LDAP_OPT_REF_DEREF_CONN_PER_MSG session option was previously enabled on the LDAP session associated with the message.
If neither of these conditions are met, the function returns a NULL session handle.
Requirements
|
Minimum supported client |
Windows Vista |
|---|---|
|
Minimum supported server |
Windows Server 2008 |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
- LDAP
- LDAPMessage
- structures
- Establishing an LDAP Session
- Functions
- ldap_init
- ldap_set_option
- Return Values