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 {
s Status=##Class(%SYS.LDAP).Binds(LD,"",$lb(Username,Domain,Password),$$$LDAPAUTHNEGOTIATE)
i Status'=$$$LDAPSUCCESS {
s Status=Status_",ldap_Binds(AdminDN) - "_##Class(%SYS.LDAP).Err2String(Status)
g Done
}
i $$$ISWINDOWS,$$$UseSecureConnection {
s LD=##Class(%SYS.LDAP).Init($$$LDAPServer,636)
} else {
s LD=##Class(%SYS.LDAP).Init($$$LDAPServer)
}
Comments
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.
Thanks, Alexey. I suppose a separate macro could have some value in testing if nothing else.