Skip to content

Commit

Permalink
merge from Phase I
Browse files Browse the repository at this point in the history
  • Loading branch information
smurfiv_cp authored and smurfiv_cp committed Mar 23, 2011
1 parent 08caabe commit 7e9946f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 11 additions & 1 deletion LiquesceFaçade/Utils.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using System.Windows.Forms;
Expand Down Expand Up @@ -48,13 +49,22 @@ The caller does not have the required permission.
System.NotSupportedException: path is in an invalid format.
System.Security.SecurityException: The caller does not have the required permission.
*/ if ( ex.InnerException is SocketException)
*/
if ( ex.InnerException is SocketException)
{
return -((SocketException) ex.InnerException).ErrorCode;
}
else
{
int HrForException = Marshal.GetHRForException(ex);
if (ex is IOException)
{
switch (HrForException)
{
case -2147024784:
return Dokan.ERROR_DISK_FULL;
}
}
return (HiWord(HrForException) == 0x8007) ? -LoWord(HrForException) : Dokan.ERROR_EXCEPTION_IN_SERVICE;
}
}
Expand Down
6 changes: 4 additions & 2 deletions ThirdParty/DokanNet/Dokan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ public static class Dokan

// ReSharper disable InconsistentNaming
#pragma warning disable 169
#region File Operation Errors (From WinError.h)
#region File Operation Errors
// From WinError.h -> http://msdn.microsoft.com/en-us/library/ms819773.aspx
public const int ERROR_FILE_NOT_FOUND = -2; // MessageText: The system cannot find the file specified.
public const int ERROR_PATH_NOT_FOUND = -3; // MessageText: The system cannot find the path specified.
public const int ERROR_ACCESS_DENIED = -5; // MessageText: Access is denied.
public const int ERROR_SHARING_VIOLATION = -32;
public const int ERROR_INVALID_NAME = -123;
public const int ERROR_FILE_EXISTS = -80;
public const int ERROR_DISK_FULL = -112; // There is not enough space on the disk.
public const int ERROR_INVALID_NAME = -123;
public const int ERROR_DIR_NOT_EMPTY = -145; // MessageText: The directory is not empty.
public const int ERROR_ALREADY_EXISTS = -183;// MessageText: Cannot create a file when that file already exists.
public const int ERROR_EXCEPTION_IN_SERVICE = -1064;// An exception occurred in the service when handling thecontrol request.
Expand Down

0 comments on commit 7e9946f

Please sign in to comment.