Question
· Jun 8, 2021

LDAP.mac -- Why use $$$WindowsCacheClient instead of $$$ISWINDOWS?

Reference: sample LDAP code routine LDAP.mac

Some IF statements reference macro $$$WindowsCacheClient as a boolean flag to mark if the client calling the LDAP server is running Windows. Other IF statements reference $$$ISWINDOWS. Are they not the same thing? That is, does the routine need $$$WindowsCacheClient at all?

Examples:

#define WindowsCacheClient 1

 if $$$WindowsCacheClient,$$$WindowsLDAPServer {
Status=##Class(%SYS.LDAP).Binds(LD,"",$lb(Username,Domain,Password),$$$LDAPAUTHNEGOTIATE)
Status'=$$$LDAPSUCCESS {
Status=Status_",ldap_Binds(AdminDN) - "_##Class(%SYS.LDAP).Err2String(Status)
Done
  }

 $$$ISWINDOWS,$$$UseSecureConnection {
LD=##Class(%SYS.LDAP).Init($$$LDAPServer,636)
 else {
LD=##Class(%SYS.LDAP).Init($$$LDAPServer)
 }

 

Product version: IRIS 2020.1
$ZV: IRIS for Windows (x86-64) 2020.1 (Build 217_1U) Tue May 26 2020 20:41:06 EDT
Discussion (2)1
Log in or sign up to continue

Methods how these macros are defined are quite different: $$$ISWINDOWS is calculated using system call and always 1 on Windows platform, in contrast $$$WindowsCacheClient is defined manually, so it and can be easily set to 0 if needed.

Many years ago I faced a problem with LDAP which was solved this way (I didn't change ISC code, it was my own "fork"). Don't remember other details, only the fact.