| Previous | Next |
| TYPE_E_CIRCULARTYPE | STG_E_FILENOTFOUND |
STG_E_INVALIDFUNCTION
Requested structured-storage operation is not valid
STG_E_INVALIDFUNCTION is HRESULT 2147680257 (0x80030001) from winerror.h. AllStat describes it as “Unable to perform requested operation.” The result belongs to an IStorage, IStream, ILockBytes, or file-backed storage method. The important boundary is not merely failure but which object and state transition established: the selected operation is not supported by that object, storage mode, or implementation.
The decisive meaning of this result is that the selected operation is not supported by that object, storage mode, or implementation. The severity bit does not decide handling; the controlling fact is that the selected operation is not supported by that object, storage mode, or implementation. Interpret it at the native boundary before a wrapper hides the condition that the selected operation is not supported by that object, storage mode, or implementation.
Where the result appears
- This result can surface in a IStorage, IStream, ILockBytes, property storage, compound-file parsing, or persistence code.
- map the failure to one concrete operation among StgOpenStorage, StgCreateStorageEx, IStorage, IStream, IPropertyStorage, STATSTG, and the selected STGM mode.
- Preserve storage path or identity, STGM mode, stream or storage name, transaction generation, file hash, and backing provider before releasing or replacing the object that returned this result.
An incident record for it must distinguish caller, runtime, provider, and backing resource while testing whether the selected operation is not supported by that object, storage mode, or implementation.
Typical causes and interpretation boundary
The immediate contract boundary is specific: the selected operation is not supported by that object, storage mode, or implementation. Common cause branches include the following:
- A method is called on the wrong storage abstraction.
- The backing provider deliberately omits the operation.
- The object was opened with a mode that makes the requested function unavailable.
Confirm the cause branch that explains why the selected operation is not supported by that object, storage mode, or implementation by using call arguments, object state, metadata, device information, or provider traces.
Correct handling and recovery
The primary recovery is to select a supported interface or mode and branch on capability instead of retrying the same method. The result failure report should expose enough an IStorage, IStream, ILockBytes, or file-backed storage method state to understand why the selected operation is not supported by that object, storage mode, or implementation without a production debugger.
Retry this result only when evidence shows the state behind “the selected operation is not supported by that object, storage mode, or implementation” can change and the operation is repeatable. Reconcile persistent, remote, device, or ownership state before repeating it.
Practical scenario
A component asks a read-only package stream to resize itself; the provider rejects the operation because resizing is not valid for that stream. Record the decisive state for it and verify recovery on a fresh object or request generation.
Difference from related HRESULTs
STG_E_UNIMPLEMENTEDFUNCTION says the function is not implemented; it can also mean that the function is inappropriate for this object Tests and telemetry should preserve that boundary for it.
Developer and administrator guidance
Developers handling it should make object lifetime and state transitions explicit, preserve the native HRESULT, and keep cleanup paths safe when initialization or output is partial. Exercise direct and transacted modes, read-only and writable paths, cancellation, malformed input, and cleanup after partial output.
Administrators should repair the component owning an IStorage, IStream, ILockBytes, or file-backed storage method as a versioned unit instead of copying arbitrary DLLs. Repair for it should target only the evidence-backed component, provider, document, device, or configuration.
References
- Microsoft: COM error codes for STG and RPC
- Microsoft: Structured Storage
- Microsoft: IStorage
- Microsoft: IStream
Looking for a different code? Search another status or error code.