Domino Mailbox tool hung with NAMELookup2

79 Views Asked by At

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:

  1. I have run the tool with admin privilege user.

It would be great if anyone gives some direction on this.

Thanks,

1

There are 1 best solutions below

0
On

See this NAMELookup2 page for reference. The function is declared as:

STATUS LNPUBLIC NAMELookup2(const char far *ServerName, DWORD Flags,
    WORD NumNameSpaces, const char far *NameSpaces,
    WORD NumNames, const char far *Names,
    WORD NumItems, const char far *Items,
    DHANDLE far *rethBuffer);

where NumItems is the number of null-terminated item names starting at the Items address. The code snippet in your question is passing a single item name ("FullName"), but is setting NumItems 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 passing NULL 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 to NULL.