| Previous | Next |
| STG_E_FILEALREADYEXISTS | STG_E_MEDIUMFULL |
STG_E_INVALIDPARAMETER
Structured-storage parameter is invalid
STG_E_INVALIDPARAMETER is HRESULT 2147680343 (0x80030057) from winerror.h. AllStat describes it as “Invalid parameter error.” The result belongs to a storage method receiving names, modes, offsets, sizes, interface pointers, or reserved fields. A reliable this result diagnosis preserves the raw value and reconstructs the state that made this true: one or more arguments violate the documented contract of the selected storage operation.
The decisive meaning of this result is that one or more arguments violate the documented contract of the selected storage operation. The severity bit does not decide handling; the controlling fact is that one or more arguments violate the documented contract of the selected storage operation. The important boundary is not merely failure but which object and state transition established: one or more arguments violate the documented contract of the selected storage operation.
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 one or more arguments violate the documented contract of the selected storage operation.
Typical causes and interpretation boundary
The immediate contract boundary is specific: one or more arguments violate the documented contract of the selected storage operation. Common cause branches include the following:
- Reserved parameters are nonzero.
- An STGM combination is contradictory.
- A name, size, or pointer is outside the permitted range.
Confirm the cause branch that explains why one or more arguments violate the documented contract of the selected storage operation by using call arguments, object state, metadata, device information, or provider traces.
Correct handling and recovery
The primary recovery is to validate arguments at the caller boundary and preserve the exact method-specific contract instead of normalizing this to a generic failure. The result failure report should expose enough a storage method receiving names, modes, offsets, sizes, interface pointers, or reserved fields state to understand why one or more arguments violate the documented contract of the selected storage operation without a production debugger.
When it follows cancellation or replacement, create a new generation before applying the recovery: validate arguments at the caller boundary and preserve the exact method-specific contract instead of normalizing this to a generic failure. Reconcile persistent, remote, device, or ownership state before repeating it.
Practical scenario
A caller combines STGM_CREATE with an incompatible sharing mode when opening a substorage, and the storage implementation rejects the mode set. Record the decisive state for it and verify recovery on a fresh object or request generation.
Difference from related HRESULTs
E_INVALIDARG is generic; it preserves that the rejected argument belongs to a storage operation 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.
A it runbook should preserve the original artifact and logs before the proposed recovery—validate arguments at the caller boundary and preserve the exact method-specific contract instead of normalizing this to a generic failure—changes evidence. 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.
