Changeset 1604


Ignore:
Timestamp:
1/19/2010 4:29:26 AM (5 years ago)
Author:
lowjoel
Message:

Don't corrupt the GetLastError?() code when closing the SafeHandle? instance.

Location:
branches/eraser6/CodeReview/Eraser.Util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/CodeReview/Eraser.Util/StreamInfo.cs

    r1593 r1604  
    395395            if (result.IsInvalid) 
    396396            { 
     397                int errorCode = Marshal.GetLastWin32Error(); 
    397398                result.Close(); 
    398                 throw Win32ErrorCode.GetExceptionForWin32Error(Marshal.GetLastWin32Error()); 
     399                throw Win32ErrorCode.GetExceptionForWin32Error(errorCode); 
    399400            } 
    400401 
  • branches/eraser6/CodeReview/Eraser.Util/VolumeInfo.cs

    r1593 r1604  
    490490            if (result.IsInvalid) 
    491491            { 
     492                int errorCode = Marshal.GetLastWin32Error(); 
    492493                result.Close(); 
    493                 throw Win32ErrorCode.GetExceptionForWin32Error(Marshal.GetLastWin32Error()); 
     494                throw Win32ErrorCode.GetExceptionForWin32Error(errorCode); 
    494495            } 
    495496 
Note: See TracChangeset for help on using the changeset viewer.