Skip to content

Commit

Permalink
Add error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Larine committed Jan 24, 2024
1 parent 4ca30ab commit 52f0e86
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/WinAPI/NativeMethods/ErrorCodes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
namespace Larin.WinAPI.NativeMethods;

/// <summary>
/// Windows System Error codes
/// </summary>
/// <remarks>https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes</remarks>
public static class ErrorCodes
{
/// <summary>
/// The operation completed successfully.
/// </summary>
public const int ERROR_SUCCESS = 0;

/// <summary>
/// Incorrect function.
/// </summary>
public const int ERROR_INVALID_FUNCTION = 1;

/// <summary>
/// The system cannot find the file specified.
/// </summary>
public const int ERROR_FILE_NOT_FOUND = 2;

/// <summary>
/// The system cannot find the path specified.
/// </summary>
public const int ERROR_PATH_NOT_FOUND = 3;

/// <summary>
/// The system cannot open the file.
/// </summary>
public const int ERROR_TOO_MANY_OPEN_FILES = 4;

/// <summary>
/// Access is denied.
/// </summary>
public const int ERROR_ACCESS_DENIED = 5;

/// <summary>
/// The handle is invalid.
/// </summary>
public const int ERROR_INVALID_HANDLE = 6;

/// <summary>
/// No more data is available.
/// </summary>
public const int ERROR_NO_MORE_ITEMS = 259;
}

0 comments on commit 52f0e86

Please sign in to comment.