Site icon EfmSoft

What does NTSTATUS 0xC0000118 (STATUS_INVALID_LDT_SIZE) mean?

 
Previous Next
STATUS_NO_LDT STATUS_INVALID_LDT_OFFSET

STATUS_INVALID_LDT_SIZE

LDT size changes are constrained by descriptor-table geometry

STATUS_INVALID_LDT_SIZE is more specific than a general bad-buffer failure. The NTSTATUS definition identifies two invalid conditions: an attempt to grow an LDT through this size-setting operation, or a size that is not an even number of selectors. The size is therefore interpreted in terms of descriptor entries, not as an arbitrary byte allocation.

An x86 selector references a descriptor, and Microsoft documents the descriptor representation through LDT_ENTRY. Selector-inspection APIs return that descriptor data for a thread. In compatibility code, keeping byte counts, selector counts, and descriptor sizes distinct is essential: a value copied from a byte-oriented API into a selector-count calculation can be aligned as an integer yet still be invalid for the LDT contract.

Capture the old size, requested size, selector count, and caller operation before any rounding. Verify the unit used by every intermediate field and whether the code path is trying to grow rather than shrink or otherwise modify the existing table. Do not “fix” the request by rounding the size down, because that can silently discard descriptor entries and invalidate selectors still referenced by 16-bit code. Correct the source calculation and preserve the compatibility subsystem state that owns the LDT.

What to inspect

References


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

Exit mobile version