Quantcast
Viewing all articles
Browse latest Browse all 2

Answer by David Heffernan for .NET C/C++ P/INVOKE exception

The error is because sessionData is null. That's because LsaGetLogonSessionData is failing. To diagnose this further, you need to start paying attention to the return value of the API functions and checking error codes in case of failure. That's your next step.

As an aside, you have declared the count variable incorrectly. In the C header file it is declared as ULONG. That's an unsigned 32 bit integer which makes it uint in C#. I've not checked anything more than this.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>