LotusScript function replacements for NAMELookup and OSMemFree in nNotes.dll

Here are a couple of snippets out of the DomReg.nsf in the sandbox. I have used this code successfully for years.

I am about to move the Notes server to another OS and would like to make my LotusScript and Java calls indifferent to the underlying OS.

Are there LotusScript native functions to do the same thing that these two functions in nNotes.dll?

’ NAMELookup and OSMemFree are used in EnsureUserInNAB.

’ NOTE: if you are running this app on a platform other than

’ Windows 32 Intel, then you will have to change the name of the

’ dll in these two declarations. Look in your Notes executable

’ directory for *notes.dll to see what it is called, or for the proper

’ form of shared library on your platform.

Declare Sub NAMELookup Lib “nnotes.dll” _

(Byval serverName As Integer, _

Byval flags As Integer, _

Byval numNameSpaces As Integer, _

Byval nameSpaces As String, _

Byval numNames As Integer, _

Byval names As String, _

Byval numItems As Integer, _

Byval items As String, _

rethBuffer As Long _

)

Declare Sub OSMemFree Lib “nnotes.dll” (Byval hBuffer As Long)

Sub EnsureUserInNAB(Byval fullname As String)

Dim hBuf As Long     

Call NAMELookup(0, 0, 1, "$Users", 1, fullname, 1, "HTTPPassword", hBuf)

Call OSMemFree(hBuf)

Call NAMELookup(0, 0, 1, "$ServerAccess", 1, fullname, 1, "ListName", hBuf)

Call OSMemFree(hBuf)

End Sub

Subject: LotusScript function replacements for NAMELookup and OSMemFree in nNotes.dll…

I worked on that application many years ago as a contractor for Lotus. The intention of those calls was to get the server to update its cached authentication information so that new or changed usernames and passwords would take effect immediately. In reality those calls did not always do what they are intended to do. Usually, but not always. We did have a version that just did view refreshes on $Users and $ServerAccess, and those seemed to work pretty well, too, though again not always. Actually, the more users in the system, the more likely it was that the refreshes worked. My theory on that was actually that since the refreshes took longer if there were more users, the server’s internal polling cycle for refreshing cached info was more likely to come around while wating for the refresh to complete.

Anyhow, there were not LotusScript equivalents back then, and as far as I know there is still nothing today.

Subject: LotusScript function replacements for NAMELookup and OSMemFree in nNotes.dll…

For most platforms, the only changes you’ll need to do is update the name of the library to the platform specific-one.

e.g.: “libnotes.so” for Linux, “libnotes.a” for AIX.

The iSeries platform may be different, due to alignemnt issues and 128-bit pointers (IIRC). But then again, I haven’t seen much Domino on iSeries being used for HTTP.

cheers,

Bram