Microsoft KB Archive/215463

{|
 * width="100%"|

BUG: MAPILogonEx Memory Leak

 * }

Q215463

-

The information in this article applies to:


 * Extended Messaging Application Programming Interface (MAPI), version 1.0

-

SYMPTOMS
The applications that repetitively log on to MAPI or Collaboration Data Objects (CDO 1.1 and 1.2x only) to process very large message volumes can exhibit problems after running normally for long periods of time. The following problems might be seen:


 * Corrupt message properties
 * System resource depeletion
 * Unexpected termination

CAUSE
A memory heap created at the start of a MAPI session is not destroyed when the session is released.

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

Steps to Reproduce Behavior
To reproduce the behavior, place MAPILogonEx in a loop construct and run the program so that the loop runs at least 6000 times, for example:

while (1) { LPMAPISESSION  lpSession; HRESULT hr; int x; hr = MAPILogonEx(0, szLogonProfile, NULL, MAPI_NEW_SESSION | MAPI_LOGON_UI | MAPI_NO_MAIL|MAPI_USE_DEFAULT, &lpSession); if (hr != S_OK) {  printf ("ERROR %x",hr); break; };

x++; printf("LOGON %d\n",x);

hr = lpSession -> Logoff (NULL,NULL,0); if (hr != S_OK) {   printf ("ERROR at Logoff %x",hr); break; };

hr = lpSession ->Release; if (hr != S_OK) {  printf ("ERROR at Release %x",hr); break; }; } Additional query words:

Keywords : kbCDO kbCDO121 kbMsg kbMAPI100bug kbGrpMsg

Issue type : kbbug

Technology :