Error struct
Names and predicates for Win32 error codes.
On this page
- Use
import ThinkMeta.ConcurrentTasks.Windows.Error;- Namespace
ThinkMeta::ConcurrentTasks::Windows- Platforms
- Windows
Syntax
struct ErrorRemarks
The codes are the values of GetLastError. The Windows wrappers return an ErrorCode: Success, or the Win32 error of the failed call.
See also
Names
| Name | Description |
|---|---|
ErrorCode |
A Win32 error code as returned by the Windows wrappers.
|
Methods
GetLastError
GetError
Turns a Win32 BOOL result into an ErrorCode.
Syntax
static Type GetError(BOOL b) noexcept;Parameters
bBOOL- The Win32 call's result: nonzero for success,
FALSEfor failure.
Return value
Type: Type
Success for TRUE, else GetLastError.
Remarks
Call it right after the API call, before anything else can overwrite the last error.
Succeeded
Failed
IsPending
Returns whether error is Pending.
Syntax
static constexpr bool IsPending(Type error) noexcept;Parameters
errorType- A Win32 error code.
Return value
Type: bool
true if error is ERROR_IO_PENDING; otherwise false.
TooManyAsynchronousRequests
Returns whether error means too many overlapped requests.
Syntax
static constexpr bool TooManyAsynchronousRequests(Type error) noexcept;Parameters
errorType- A Win32 error code.
Return value
Type: bool
true for ERROR_INVALID_USER_BUFFER and ERROR_NOT_ENOUGH_MEMORY; otherwise false.
Remarks
These are the codes Windows uses when too many overlapped requests are outstanding (ERROR_INVALID_USER_BUFFER, ERROR_NOT_ENOUGH_MEMORY): retry later.
IsEndOfStream
Returns whether error is EndOfStream.
Syntax
static constexpr bool IsEndOfStream(Type error) noexcept;Parameters
errorType- A Win32 error code.
Return value
Type: bool
true if error is ERROR_HANDLE_EOF; otherwise false.
Types
Type
A Win32 error code (DWORD).
Syntax
using Type = DWORD;Fields
Success
ERROR_SUCCESS (0): the operation succeeded.
Syntax
static constexpr Type Success = ERROR_SUCCESS;BadFormat
Syntax
static constexpr Type BadFormat = ERROR_BAD_FORMAT;InvalidBlock
Syntax
static constexpr Type InvalidBlock = ERROR_INVALID_BLOCK;EndOfFile
ERROR_HANDLE_EOF: a read started at or beyond the end of the file.
Syntax
static constexpr Type EndOfFile = ERROR_HANDLE_EOF;EndOfStream
Same value as EndOfFile, for streams and sockets.
Syntax
static constexpr Type EndOfStream = EndOfFile;See also
Pending
ERROR_IO_PENDING: an overlapped operation completes later.
Syntax
static constexpr Type Pending = ERROR_IO_PENDING;See also
InvalidHandle
Syntax
static constexpr Type InvalidHandle = ERROR_INVALID_HANDLE;InvalidUserBuffer
Syntax
static constexpr Type InvalidUserBuffer = ERROR_INVALID_USER_BUFFER;NotEnoughMemory
Syntax
static constexpr Type NotEnoughMemory = ERROR_NOT_ENOUGH_MEMORY;InvalidParameter
Syntax
static constexpr Type InvalidParameter = ERROR_INVALID_PARAMETER;NotFound
Syntax
static constexpr Type NotFound = ERROR_NOT_FOUND;FileNotFound
Syntax
static constexpr Type FileNotFound = ERROR_FILE_NOT_FOUND;WriteFault
Syntax
static constexpr Type WriteFault = ERROR_WRITE_FAULT;OperationAborted
Syntax
static constexpr Type OperationAborted = ERROR_OPERATION_ABORTED;TimedOut
ERROR_TIMEOUT: an operation with a timeout ran out of time.
Syntax
static constexpr Type TimedOut = ERROR_TIMEOUT;Remarks
Reported by the library's own timed operations (AsyncIo::AsyncFile::Read, say). IoCompletionPort::GetQueuedCompletionStatus reports its timeout as WaitTimedOut (WAIT_TIMEOUT, 258) instead; Thread::Wait returns Success and passes WAIT_TIMEOUT in its wait result.
WaitTimedOut
WAIT_TIMEOUT: a Win32 wait ran out of time (see TimedOut).
Syntax
static constexpr Type WaitTimedOut = WAIT_TIMEOUT;Generated from ThinkMeta.ConcurrentTasks.API @ c7663c4 (2026-11-19).