If you are going to call Marshal.GetLastWin32Error, the function whose error you’re retrieving had better be the one called most recently August 19, 2015 Aug 19, 2015 08/19/15 Raymond Chen Watch out for functions called behind your back.