| Previous | Next |
| DV_E_STATDATA | DV_E_TYMED |
DV_E_LINDEX
Invalid lindex
Windows defines DV_E_LINDEX as 2147745896 (0x80040068; signed value -2147221400). AllStat’s description is “Invalid lindex”. The code marks a specific failure: FORMATETC::lindex is invalid for the requested aspect or data format. The relevant operation is validating a FORMATETC before GetData, QueryGetData, SetData, or cache negotiation.
The high bit in 0x80040068 is set, so this is a failure rather than a success or informational result. Its facility field is 4 (FACILITY_ITF) and its low 16-bit code is 104 (0x0068). Those bit fields classify the value, but they do not identify the failing object by themselves; the native method, object identity, and first producer of DV_E_LINDEX remain essential.
Where it is raised
Understanding DV_E_LINDEX requires this subsystem context: COM data-transfer structures are compound contracts: a field can be numerically well formed yet invalid for the provider, object generation, requested aspect, or ownership rules. For DV_E_LINDEX, diagnosis therefore has to preserve the complete descriptor and the exact method that consumed it.
- Associate
DV_E_LINDEXwith one exact operation in IDataObject, FORMATETC/STGMEDIUM negotiation, data advisory enumeration, or OLE rendering. - Confirm that
DV_E_LINDEXcame from validating a FORMATETC before GetData, QueryGetData, SetData, or cache negotiation, rather than from cleanup or a wrapper that ran afterward. - Preserve any IErrorInfo, underlying Win32 result, provider message, or callback failure that preceded
DV_E_LINDEX; the HRESULT alone should not erase a more specific cause.
Telemetry checklist
A useful DV_E_LINDEX incident records the IDataObject identity, method, clipboard format, aspect, lindex, tymed mask, target-device size, advisory cookie, and ownership of every returned interface or medium. For DV_E_LINDEX, also retain the application and component build, architecture, process and thread IDs, COM apartment, operation correlation ID, elapsed time, and the first state-changing event before the failure. When logging DV_E_LINDEX, redact content and credentials while preserving types, lengths, hashes, opaque identities, and lifecycle generations needed to reproduce its contract.
- For
DV_E_LINDEX, record the exact signed lindex value and the selected DVASPECT. - For
DV_E_LINDEX, enumerate supported FORMATETC values and compare index semantics, not only cfFormat. - For
DV_E_LINDEX, check structure packing and language interop where -1 can become 4294967295.
Why this result is specific
DV_E_LINDEXcan result when the caller passes a nonnegative index for a format that is not page-oriented.DV_E_LINDEXcan result when the index is outside the provider-defined range for a multi-page or multi-item representation.DV_E_LINDEXcan result when a wrapper converts the documented -1 sentinel to an unsigned or truncated value.
Investigation order
- Capture
DV_E_LINDEXat the first native return before a wrapper maps it to a generic exception. - Identify the exact object, method, and lifecycle phase involved in validating a FORMATETC before GetData, QueryGetData, SetData, or cache negotiation.
- Record the exact signed lindex value and the selected DVASPECT.
- Enumerate supported FORMATETC values and compare index semantics, not only cfFormat.
- Check structure packing and language interop where -1 can become 4294967295.
- Reproduce
DV_E_LINDEXwith one controlled input or state change, and verify that the correction changes the decisive evidence rather than merely hiding the result.
Safe handling
Correction. For DV_E_LINDEX, use the index contract advertised for that format, commonly -1 when the entire aspect rather than one page is requested. Retry boundary. A retry is safe after correcting lindex before any medium is transferred; do not loop with the same index. Before repeating the DV_E_LINDEX operation, release every returned STGMEDIUM according to pUnkForRelease, retain advisory cookies only after successful DAdvise, and discard enumerated formats after the data object is replaced.
Practical scenario
A preview handler requests DVASPECT_CONTENT with lindex 0 even though the source supports only the whole presentation at lindex -1; changing only lindex makes QueryGetData succeed. This isolates DV_E_LINDEX within COM data transfer and advisory connections and provides a regression test for the stated correction.
Difference from related HRESULTs
DV_E_DVASPECT rejects the aspect value; DV_E_LINDEX says the selected position within that aspect is invalid. For DV_E_LINDEX, keep those outcomes separate in exception mappings, telemetry dimensions, user messages, and automated retry policy.
Developer and administrator guidance
For DV_E_LINDEX, copy complete FORMATETC and DVTARGETDEVICE structures, preserve signed lindex values, intersect tymed masks before requesting data, and encode STGMEDIUM ownership explicitly. Regression coverage for DV_E_LINDEX should include provider-advertised versus caller-invented formats, supported and unsupported DVASPECT/tymed combinations, sentinel lindex values, malformed target-device sizes, and replacement during advisory callbacks.
Operational repair for DV_E_LINDEX must target the evidence-backed owner: compare the data provider, consumer, and registered handler versions; repair a handler only when traces identify that provider as missing or incompatible. Retain before-and-after traces for DV_E_LINDEX so the change can be attributed and reversed.
References
- Microsoft: generic COM error codes — official Microsoft documentation relevant to
DV_E_LINDEX. - Microsoft: HRESULT values — official Microsoft documentation relevant to
DV_E_LINDEX. - Microsoft: IDataObject — official Microsoft documentation relevant to
DV_E_LINDEX. - Microsoft: FORMATETC structure — official Microsoft documentation relevant to
DV_E_LINDEX. - Microsoft: IViewObject — official Microsoft documentation relevant to
DV_E_LINDEX.
Looking for a different code? Search another status or error code.