We have developed the tools to read the emails from the Domino mailboxes and write those into the separate file in local disk(Its look like a backup). Recently we have created a new domino 9 test environment with our lab. But, our tools not working properly with our new domino work environment. To identify the problem about this issue, I have added some debug logs and it seems to look like the control hanged with the function "NAMELookup2". Here, I have added the code snippet,
DHANDLE hLookup;
char *pLookup;
if (NAMELookup2("Local", 0, 1, "$users", 1, dominoUser, 2, "FullName", &hLookup) == NOERROR) // hunged with this line
{
pLookup = (char *) OSLockObject(hLookup);
}
The same tool working fine with our other test environment. So, I think there is no problem with the code. I suspect that maybe the problem with our new work environment setup creation, or maybe missed to provide some kind permission to the users, or maybe I missed to add the mailboxes somewhere, etc.
Note:
- I have run the tool with admin privilege user.
It would be great if anyone gives some direction on this.
Thanks,
See this NAMELookup2 page for reference. The function is declared as:
where
NumItems
is the number of null-terminated item names starting at theItems
address. The code snippet in your question is passing a single item name ("FullName"
), but is settingNumItems
to 2. That is clearly wrong and could explain the hang.NumItems
should be 1.I am also suspicious of the
ServerName
argument. The documentation recommends passingNULL
when you want to do a local lookup. Passing"Local"
may be another way to accomplish the same, but you need to change your code in any case. I recommend changing the first argument toNULL
.