| Previous | Next |
| WCM_E_INVALIDKEY | WCM_E_HANDLERNOTFOUND |
WCM_E_INVALIDSTREAM
WCM_E_INVALIDSTREAM is the failure HRESULT 0x8022001D (signed decimal -2145255395, unsigned decimal 2149711901). Its severity bit is 1, facility is 34 (FACILITY_STATE_MANAGEMENT), and the facility-specific code field is 0x001D.
AllStat records the Windows SDK description as “Tried to load invalid data from stream.”
Meaning in Settings Management Infrastructure
The serialized settings stream is invalid. The operation reached ISettingsContext::Deserialize or another stream-loading boundary before settings can be applied. The first branch to test is whether the XML is malformed or truncated; keep that separate from the possibility that the stream is positioned incorrectly.
Point of failure
At this boundary, capture stream byte length, position, encoding, and hash, then correlate it with XML parser diagnostics and ISettingsResult location data. Assign ownership only after checking the target object supplied to Deserialize.
Causes to test independently
- the XML is malformed or truncated
- the stream is positioned incorrectly
- the content is not the expected settings/answer-file section
- encoding declarations and actual byte encoding disagree
Data to collect
- stream byte length, position, encoding, and hash
- XML parser diagnostics and ISettingsResult location data
- the target object supplied to Deserialize
- the exact producer and any compression/transport step
- whether the stream round-trips through Serialize/Deserialize with the same SMI version
Step-by-step diagnosis
- save the received bytes before parsing
- validate well-formedness and expected root/section independently
- rewind or create a new IStream at the correct position
- eliminate text-mode or encoding conversion in transport
- generate the stream through supported SMI serialization where possible
Recovery strategy
Retry only with a corrected or repositioned stream. Reusing the same invalid bytes will not recover.
What this value does not mean
WCM_E_MANIFESTCOMPILATIONFAILED applies after an XML/XSD manifest reaches compilation; INVALIDSTREAM can fail earlier because the serialized container itself is unusable.
Illustrative scenario
A deployment service reads an answer-file fragment into a stream but leaves the cursor at the end before calling Deserialize. The consumer sees no valid settings data.
Implementation guidance
For operational telemetry, retain the target object supplied to Deserialize; also record the exact producer and any compression/transport step. Preserve a redacted summary of whether the stream round-trips through Serialize/Deserialize with the same SMI version; use a cryptographic hash when that evidence is a file, stream, or generated artifact.
Official Microsoft references.
- Microsoft: SMI error and success constants.
- Microsoft: Settings Management Infrastructure API.
- Microsoft: SMI interfaces.
- Microsoft: ISettingsContext::Deserialize.
- Microsoft: ISettingsResult::GetLine.
Looking for a different code? Search another status or error code.
