Article ID: 260141 - Last Review: August 24, 2005 - Revision: 3.3 PRB: OpenMsgStore() and HrMailboxLogon() May Fail When You Open More Than 255 MailboxesThis article was previously published under Q260141 SYMPTOMS
If you attempt to open more than 255 mailboxes in a single process, you may receive an error. With the Messaging Application Programming Interface (MAPI), you can open mailboxes by using the OpenMsgStore method or the HrMailboxLogon function. When you try to open too many mailboxes, the OpenMsgStore method returns the MAPI_E_FAILONEPROVIDER error, and the HrMailboxLogon function returns the MAPI_E_CALL_FAILED error. NOTE: On success, OpenMsgStore and HRMailboxLogon both return S_OK and a valid IMsgStore interface. CAUSE
This behavior occurs because MAPI communicates between a client program and the Microsoft Exchange Server through the Emsmdb32.dll transport provider. This provider uses Microsoft Remote Procedure Calls (RPC) to communicate with the server. A single byte holds the index of the logon object, which limits the number of logons in a single session and process to 255. In fact, the actual limit may be lower because some of the index values are reserved.
RESOLUTION
There are two ways to work around this behavior:
STATUS
This behavior is by design.
MORE INFORMATION
Even if you structure your MAPI program to loop through mailboxes, releasing each message store interface after use, you may still encounter the limit. A message store connection cannot be released if any outstanding objects are open on the store. The most commonly leaked interfaces are IMAPITable, IMAPIFolder, and IMessage. Note that if you do loop through mailboxes on a server, you must release all interfaces in the reverse order from which they were obtained. Under extreme circumstances, if you cannot locate the source of leaked interfaces, you can call the MAPIUninitialize function to cause MAPI to invalidate and recover all outstanding interfaces and memory. REFERENCESFor additional information on opening mailboxes, click the article number below
to view the article in the Microsoft Knowledge Base:
194627
(http://support.microsoft.com/kb/194627/EN-US/
)
HOWTO: Open Mailboxes with Privileged Access
For additional information about how to loop through mailboxes, click the article number below
to view the article in the Microsoft Knowledge Base:
200160
(http://support.microsoft.com/kb/200160/EN-US/
)
HOWTO: Loop Through Mailboxes on Exchange Using GetMailboxTable
APPLIES TO
| Article Translations
|
Back to the top
