| Previous | Next |
| WCM_E_INVALIDKEY | WCM_E_HANDLERNOTFOUND |
WCM_E_INVALIDSTREAM
The Windows SDK describes the condition 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.
Official Microsoft references.
Looking for a different code? Search another status or error code.