Are you guaranteed that session is not NULL?
No, no garantueed, but i looked up some code-samples by google, and as far as i can tell, the current stub for MAPILogonEx will pass back garbage anyway to the application, so my thought was this patch would be rather harmless anyway.
Harmless unless some app passes NULL for session. A test case that shows that the function fails when session is NULL, or crashes, would help. If it crashes, your patch is fine. If it fails more gracefully, you'll need to do so as well. --Juan