Changeset 1577
- Timestamp:
- 1/18/2010 10:28:16 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/CodeReview/Eraser.Util/VolumeInfo.cs
r1574 r1577 142 142 return result; 143 143 144 //Iterate over the volume mountpoints 145 do 146 result.Add(new VolumeInfo(nextVolume.ToString())); 147 while (NativeMethods.FindNextVolume(handle, nextVolume, NativeMethods.LongPath)); 148 149 //Close the handle 150 if (Marshal.GetLastWin32Error() == Win32ErrorCode.NoMoreFiles) 144 try 145 { 146 //Iterate over the volume mountpoints 147 do 148 result.Add(new VolumeInfo(nextVolume.ToString())); 149 while (NativeMethods.FindNextVolume(handle, nextVolume, NativeMethods.LongPath)); 150 } 151 finally 152 { 153 //Close the handle 151 154 NativeMethods.FindVolumeClose(handle); 155 } 152 156 153 157 return result.AsReadOnly(); … … 353 357 return result; 354 358 355 //Iterate over the volume mountpoints 356 while (NativeMethods.FindNextVolumeMountPoint(handle, nextMountpoint, 357 NativeMethods.LongPath)) 358 { 359 result.Add(new VolumeInfo(nextMountpoint.ToString())); 360 } 361 362 //Close the handle 363 if (Marshal.GetLastWin32Error() == Win32ErrorCode.NoMoreFiles) 359 try 360 { 361 //Iterate over the volume mountpoints 362 while (NativeMethods.FindNextVolumeMountPoint(handle, nextMountpoint, 363 NativeMethods.LongPath)) 364 { 365 result.Add(new VolumeInfo(nextMountpoint.ToString())); 366 } 367 } 368 finally 369 { 370 //Close the handle 364 371 NativeMethods.FindVolumeMountPointClose(handle); 372 } 365 373 366 374 return result.AsReadOnly();
Note: See TracChangeset
for help on using the changeset viewer.
