> I'm no MAPI expert... but I suppose you can specify a
> username/password during MAPI logon, can't you?
Hi Henning Krause/Dan,
Thanks for your guidance on this. But even after Impersonating
also, I am unable to open exchange private/public stores. Could anyone
please help me out in finding the root cause?
---------------------------------------------
THIS IS HOW MAIN METHOD LOOKS LIKE THIS :
main() {
HANDLE retval;
if (LogonUser( "shivaraj@exchdomain.com", "", "password",
LOGON32_LOGON_INTERACTIVE,
LOGON32_PROVIDER_DEFAULT, &retval)) {
printf("User logged on sucessfull.\n");
lngError = ImpersonateLoggedOnUser(retval);
if(lngError){
printf("\nimpersonate succeded");
}
}
/* here with i have put my exchange specific code to retrieve exchange
server mailbox information*/
//after this i am closing handle
CloseHandle(retval);
} //end of main
--------------------------------------------------
I am getting
"User logged on sucessfull" and
"impersonate succeded" as result.
So it seems there is no issues with impersonation but still i am unable
to open private store ( i.e HrOpenExchangePrivateStore function call).
Any idea why this is so?
Regards,
Shivaraj
> > I'm no MAPI expert... but I suppose you can specify a
> > username/password during MAPI logon, can't you?
[quoted text clipped - 7 lines]
>
> -- dan
Dan Mitchell - 18 Jan 2007 17:56 GMT
> Thanks for your guidance on this. But even after Impersonating
> also, I am unable to open exchange private/public stores. Could anyone
[quoted text clipped - 3 lines]
> LOGON32_LOGON_INTERACTIVE,
> LOGON32_PROVIDER_DEFAULT, &retval)) {
Are you sure you want the "@" in the username there? I've only ever
used LogonUser with just the username, the second argument is the domain
you should log in to.
> printf("User logged on sucessfull.\n");
And just because you're getting non-zero back from this, I wouldn't
assume everything is working properly. What happens if (for example) you
try and read a file that only the impersonated user can read, the
original user can't? That's a good way to check that the impersonation
is really working as you think.
Did you read the post on Stephen's blog? There's a lot more info there,
and also in the comments.
-- dan