| Previous | Next |
| WCM_E_INVALIDPATH | WCM_E_INVALIDVERSIONFORMAT |
WCM_E_WRONGESCAPESTRING
WCM_E_WRONGESCAPESTRING is the failure HRESULT 0x8022000C (signed decimal -2145255412, unsigned decimal 2149711884). Its severity bit is 1, facility is 34 (FACILITY_STATE_MANAGEMENT), and the facility-specific code field is 0x000C.
AllStat records the Windows SDK description as “Wrong XML escape sequence in string.”
Interpretation without overreach
XML escaping in the SMI string is invalid. The operation reached decoding a path, keyed-list value, or serialized settings string that uses XML entity escaping. The first branch to test is whether an ampersand begins an incomplete entity reference; keep that separate from the possibility that text was escaped twice and then partially decoded.
SMI object or metadata boundary
At this boundary, capture raw source bytes and decoded string at every transformation boundary, then correlate it with ISettingsResult line and column for XML-originated data. Assign ownership only after checking the exact path argument received by the SMI API.
Common origins
- an ampersand begins an incomplete entity reference
- text was escaped twice and then partially decoded
- a custom XML writer emitted a nonstandard entity name
- a path was truncated in the middle of a character/entity sequence
Useful artifacts
- raw source bytes and decoded string at every transformation boundary
- ISettingsResult line and column for XML-originated data
- the exact path argument received by the SMI API
- whether standard XML APIs or manual replacements performed escaping
- comparison between the original value and a round-trip through the chosen XML writer
How to isolate the defect
- replace hand-written entity substitution with a conforming XML serializer
- decode exactly once at the correct layer
- preserve opaque SMI paths rather than displaying and reconstructing them
- validate the final stream before deserialization
- add tests for ampersands, angle brackets, quotes, and non-ASCII key values
When another attempt is justified
Retry after repairing the source string. Repeating the operation with the same malformed escape cannot succeed.
Related result codes
WCM_E_INVALIDPATH covers general path grammar; WRONGESCAPESTRING pinpoints the XML-escape layer even when the unescaped logical value would otherwise be legal.
Example from an offline image
A keyed list contains an ampersand. One exporter writes it correctly, then a second exporter escapes the already escaped text and leaves an invalid sequence after partial decoding.
Developer and administrator notes
For operational telemetry, retain the exact path argument received by the SMI API; also record whether standard XML APIs or manual replacements performed escaping. Preserve a redacted summary of comparison between the original value and a round-trip through the chosen XML writer; 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: ISettingsItem::GetPath.
- Microsoft: ISettingsItem::RemoveSettingByPath.
Looking for a different code? Search another status or error code.