ConfigureMsgService causes application crash
Hello,
I have an application that generates PST files.
I use similar code on lines of HrCreatePersonalStore function to create
new PST.
I pass in PR_DISPLAY_NAME, PR_PST_PATH properties, and if a password is
specified, PR_PST_REMEMBER_PW, PR_PST_PW_SZ_NEW, PR_PST_PW_SZ_OLD
additional properties to ConfigureMsgService.
My problem is, on one of our test machines, this function causes the
application to crash. Interestingly, there is no exception shown but
the process dies a silent death. No traces, dialogs at all!
Here's a piece of code I use:
cValues = 5;
hr = MAPIAllocateBuffer(cValues * sizeof(SPropValue),
(LPVOID *)&aPropVals);
if (FAILED(hr))
return E_OUTOFMEMORY;
int lCurrentIndex = 0;
aPropVals[lCurrentIndex].ulPropTag = PR_DISPLAY_NAME_A;
aPropVals[lCurrentIndex].Value.lpszA = W2A(lpszPSTDisplayName);
lCurrentIndex++;
aPropVals[lCurrentIndex].ulPropTag = PR_PST_PATH;
aPropVals[lCurrentIndex].Value.lpszA = W2A(lpszPSTPath);
if (_tcslen(lpszPSTPassword) > 0)
{
// only set password related properties if one is specified
lCurrentIndex++;
aPropVals[lCurrentIndex].ulPropTag = PR_PST_REMEMBER_PW;
aPropVals[lCurrentIndex].Value.b = TRUE;
lCurrentIndex++;
aPropVals[lCurrentIndex].ulPropTag = PR_PST_PW_SZ_NEW;
aPropVals[lCurrentIndex].Value.lpszA =W2A (lpszPSTPassword);
lCurrentIndex++;
aPropVals[lCurrentIndex].ulPropTag = PR_PST_PW_SZ_OLD;
aPropVals[lCurrentIndex].Value.lpszA = *lppszProfilePassword;
}
hr = g_lpSvcAdmin->ConfigureMsgService(&g_MsgStoreUID,
0,
0 ,
lCurrentIndex + 1,
aPropVals);
=============
Has anyone experienced something like this before?
Am I missing anything in my code?
Any help would be much appreciated.
Thanks and regards,
-Abhijit.
date: 12 Aug 2005 06:28:57 -0700
author: unknown