| 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. The documented description is “Invalid parameter error.” The result belongs to a storage method receiving names, modes, offsets, sizes, interface pointers, or reserved fields. A reliable 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.
STG_E_INVALIDPARAMETER means that 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 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
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 failure report should capture the relevant state during a storage method receiving names, modes, offsets, sizes, interface pointers, or reserved fields so it is clear why one or more arguments violate the documented contract of the selected storage operation.
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.
Practical scenario
A caller combines STGM_CREATE with an incompatible sharing mode when opening a substorage, and the storage implementation rejects the mode set.
Difference from related HRESULTs
E_INVALIDARG is generic; it preserves that the rejected argument belongs to a storage operation.
Developer and administrator guidance
A 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.
References
Looking for a different code? Search another status or error code.