| 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. The documented description is “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.
STG_E_INVALIDFUNCTION means 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 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
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 failure report should capture the relevant state during an IStorage, IStream, ILockBytes, or file-backed storage method so it is clear why the selected operation is not supported by that object, storage mode, or implementation.
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.
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.
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.
Developer and administrator guidance
Administrators should repair the component owning an IStorage, IStream, ILockBytes, or file-backed storage method as a versioned unit instead of copying arbitrary DLLs.
References
Looking for a different code? Search another status or error code.