If you are going to call Marshal.GetLastWin32Error, the function whose error you’re retrieving had better have SetLastError=true August 18, 2015 Aug 18, 2015 08/18/15 Raymond Chen Or it won't get anything.