What does Windows error code 561 (ERROR_INVALID_LDT_SIZE) mean?

 
Could be also:
ConstantTypeOS
HTTP_STATUS_UNAUTHORIZEDHTTP CodeAny
Previous Next
ERROR_NO_GUID_TRANSLATION ERROR_INVALID_LDT_OFFSET

ERROR_INVALID_LDT_SIZE

An attempt was made to grow an LDT by setting its size, or the size was not an even number of selectors.

ERROR_INVALID_LDT_SIZE is Windows system result 561 (0x00000231). Microsoft defines it as “An attempt was made to grow an LDT by setting its size, or the size was not an even number of selectors.” The value should be captured immediately at the producing boundary because later diagnostics, cleanup, or retry code can overwrite a thread-local last-error value or collapse a richer native status.

How to classify the result

This result represents an x86 Local Descriptor Table size validation failure. The correct interpretation depends on the low-level x86 or WOW compatibility operation that supplied the LDT byte count and selector range.

The most important boundary for it is whether the operation reached a documented final state.

Where it can appear

  • This result can appear in legacy x86 execution support.
  • This result can appear in a debugger or compatibility component inspecting descriptor-table entries.
  • It can appear in low-level code translating a native LDT status into Win32.

When it is found only in a log, preserve the logger, event provider, process, thread, and translation path.

Typical causes

  • the requested size is not a multiple of the selector-entry size.
  • the operation attempts to grow the table through a size-setting path that does not permit growth.
  • a byte count was confused with an entry count.
  • 32-bit layout assumptions were used on an unsupported architecture.
  • integer truncation produced a misaligned final size.

These causes are starting points for it, not substitutes for evidence.

Evidence to preserve

  • Record processor architecture and WOW state for it.
  • Record requested LDT size in bytes and entries for it.
  • Record selector-entry structure size for it.
  • Record calling system service or compatibility component for it.
  • Record native status before Win32 mapping for it.

Also retain decimal 561, hexadecimal 0x00000231, UTC time, machine build, component version, and a correlation identifier.

Recovery and retry

The recovery objective for it is to Correct the count and alignment, or remove the unsupported attempt to grow the LDT through the size-setting request.

Do not retry the same size. Retry only after recalculating the request from validated entry boundaries and confirming the operation is supported on the current architecture.

Difference from related results

ERROR_INVALID_LDT_OFFSET concerns where the update starts; ERROR_INVALID_LDT_DESCRIPTOR concerns descriptor contents. It is about the total requested extent.

Keep the original constant in telemetry rather than replacing it with a nearby result that seems more familiar.

Practical validation scenario

A 32-bit compatibility tool multiplies a selector count by the wrong packed structure size and submits an odd extent. Logging the count, byte size, and sizeof result makes the alignment error visible before any descriptor is changed.

A useful test report for it includes the failing call, exact input, state before the call, raw output, expected state, and observed state after recovery.

Telemetry and support fields

  • Record invalid_ldt_size_operation for the producing API, callback, wait, driver, packaging phase, or service transition.
  • Record invalid_ldt_size_target for the stable session, selector, device, pin, content, resource, service, or validation identity.
  • Record invalid_ldt_size_state_before and invalid_ldt_size_requested_state using explicit units and enum names.
  • Record invalid_ldt_size_raw_status, the original result domain, and any later HRESULT or Win32 conversion.
  • Record invalid_ldt_size_attempt, elapsed time, process and thread IDs, server or device instance, and correlation ID.

Alerting for it should reflect the classification above.

Developer and administrator guidance

Keep LDT manipulation isolated behind architecture checks. Modern applications should not introduce new dependencies on x86 descriptor tables; compatibility tooling should validate every count before entering the system service.

Developers should preserve it at module boundaries and document whether ownership of buffers, handles, mutexes, callbacks, or transition contexts changes on return.

References


Looking for a different code? Search another status or error code.