Errors v0.1.0

Source
The last Win32 error and the codes it reports.

ERROR_SUCCESS

pub const ERROR_SUCCESS: uint32 = 0;

ERROR_SUCCESS: the operation succeeded, which is the value GetLastError reports when nothing has failed.

Source

ERROR_FILE_NOT_FOUND

pub const ERROR_FILE_NOT_FOUND: uint32 = 2;

ERROR_FILE_NOT_FOUND: the named file does not exist.

Source

ERROR_PATH_NOT_FOUND

pub const ERROR_PATH_NOT_FOUND: uint32 = 3;

ERROR_PATH_NOT_FOUND: a directory along the path does not exist.

Source

ERROR_ACCESS_DENIED

pub const ERROR_ACCESS_DENIED: uint32 = 5;

ERROR_ACCESS_DENIED: the caller does not have the rights the operation needs. Also what a sharing violation looks like when the file is already open without the matching share mode.

Source

ERROR_INVALID_HANDLE

pub const ERROR_INVALID_HANDLE: uint32 = 6;

ERROR_INVALID_HANDLE: the handle is not one this operation can use.

Source

ERROR_NOT_ENOUGH_MEMORY

pub const ERROR_NOT_ENOUGH_MEMORY: uint32 = 8;

ERROR_NOT_ENOUGH_MEMORY: not enough storage to complete the operation. Distinct from ERROR_OUTOFMEMORY, and which of the two a call reports is the call's own business, so a caller checking for exhaustion has to accept either.

Source

ERROR_OUTOFMEMORY

pub const ERROR_OUTOFMEMORY: uint32 = 14;

ERROR_OUTOFMEMORY: not enough storage to complete the operation.

Source

ERROR_NOT_SUPPORTED

pub const ERROR_NOT_SUPPORTED: uint32 = 50;

ERROR_NOT_SUPPORTED: the operation is not supported on this object or this system.

Source

ERROR_FILE_EXISTS

pub const ERROR_FILE_EXISTS: uint32 = 80;

ERROR_FILE_EXISTS: the file already exists, and the call was told not to replace it.

Source

ERROR_INVALID_PARAMETER

pub const ERROR_INVALID_PARAMETER: uint32 = 87;

ERROR_INVALID_PARAMETER: an argument is not valid.

Source

ERROR_DISK_FULL

pub const ERROR_DISK_FULL: uint32 = 112;

ERROR_DISK_FULL: the volume has no room left.

Source

ERROR_PRIVILEGE_NOT_HELD

pub const ERROR_PRIVILEGE_NOT_HELD: uint32 = 1314;

ERROR_PRIVILEGE_NOT_HELD: the account lacks a privilege the operation requires. What refuses CreateSymbolicLinkW on a machine without Developer Mode, where creating a symbolic link needs SeCreateSymbolicLinkPrivilege — a restriction no other supported system places on the same operation.

Source

ERROR_NO_MORE_FILES

pub const ERROR_NO_MORE_FILES: uint32 = 18;

ERROR_NO_MORE_FILES: a directory enumeration has handed over its last entry. Reported by FindNextFileW at the end of an enumeration, where nothing has gone wrong at all — the caller distinguishes it from a real failure by this code.

Source

ERROR_ALREADY_EXISTS

pub const ERROR_ALREADY_EXISTS: uint32 = 183;

ERROR_ALREADY_EXISTS: the object already exists. Reported by CreateDirectoryW where ERROR_FILE_EXISTS is reported by the file calls, which is why a caller asking "was it already there" has to accept both.

Source

ERROR_INVALID_ADDRESS

pub const ERROR_INVALID_ADDRESS: uint32 = 487;

ERROR_INVALID_ADDRESS: the address is not one the operation can use.

Source

ERROR_COMMITMENT_LIMIT

pub const ERROR_COMMITMENT_LIMIT: uint32 = 1455;

ERROR_COMMITMENT_LIMIT: the system's commit limit is reached, so nothing more can be backed. What a large commit fails with when the page file cannot grow, as distinct from running out of address space.

Source

GetLastError

pub extern func GetLastError() -> uint32

Retrieves the calling thread's last-error code value.

See also: https://learn.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-getlasterror

Source

Returns: the calling thread's last error code, which only a documented failure sets