Error struct
Names and predicates for Win32 error codes.
- Use
import ThinkMeta.ConcurrentTasks.Windows.Error;- Namespace
ThinkMeta::ConcurrentTasks::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 bool IsPending(const Type& error) noexcept;Parameters
errorconst Type&- 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 bool TooManyAsynchronousRequests(const Type& error) noexcept;Parameters
errorconst Type&- 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 bool IsEndOfStream(const Type& error) noexcept;Parameters
errorconst Type&- 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;OperationAborted
Syntax
static constexpr Type OperationAborted = ERROR_OPERATION_ABORTED;TimedOut
ERROR_TIMEOUT: a wait or operation with a timeout ran out of time.
Syntax
static constexpr Type TimedOut = ERROR_TIMEOUT;Generated from ThinkMeta.ConcurrentTasks.API @ 137ec1d (2026-10-17).