On Windows 7, MAPI call from elevated application fails when outlook in running as non-elevated RRS feed

  • Question

  • My application uses MAPI call, MAPISendMail() method. It works fine on XP, Vista, Windows 7 for standard user login that is irrespective of whether outlook 2010 (32-bit installation) is running or not. However, for admin user on Win 7: if outlook is not running: works fine. if outlook is running: failed with error MAPI_E_FAILURE

    My further investigation shows that my application and outlook have different privileges. Outlook requested Execution Level is "asInvoker" whereas my application has highestAvailable". So if I change execution level to "asInvoker" it works fine.

    Looks like issue is related with "User Interface Privilege Isolation" as per article on MSDN: http://msdn.microsoft.com/en-us/library/aa905330.aspx. "A lower privilege process cannot: Perform a window handle validation of higher process privilege"

    Is it possible to change execution level to 'asInvoker" through code during runtime?

    Or is there any way/ method to support my scenario, i.e., without changing execution level of application?

    Thanks in advance

    Thursday, March 3, 2011 9:17 AM