| Previous | Next |
| WCM_E_STORECORRUPTED | WCM_E_NOTIFICATIONNOTFOUND |
WCM_E_INVALIDEXPRESSIONSYNTAX
WCM_E_INVALIDEXPRESSIONSYNTAX is the failure HRESULT 0x80220017 (signed decimal -2145255401, unsigned decimal 2149711895). Its severity bit is 1, facility is 34 (FACILITY_STATE_MANAGEMENT), and the facility-specific code field is 0x0017.
AllStat records the Windows SDK description as “Expression format is invalid.”
Documented meaning
The SMI expression grammar is invalid. The operation reached parsing a conditional, assertion, or restriction expression during metadata compilation. The first branch to test is whether operators or delimiters are malformed; keep that separate from the possibility that quoting or escaping altered an expression token.
Operation phase
At this boundary, capture the exact expression text and source location, then correlate it with tokenization after XML entity decoding. Assign ownership only after checking supported function/operator set for the target schema.
Root-cause branches
- operators or delimiters are malformed
- quoting or escaping altered an expression token
- a function call uses invalid argument syntax
- an authoring tool emits expression syntax from another rule language
Diagnostic record
- the exact expression text and source location
- tokenization after XML entity decoding
- supported function/operator set for the target schema
- the smallest subexpression that reproduces the parse failure
- manifest generator version and any templating transformations
Correction workflow
- reduce the expression until the failing token is isolated
- compare syntax with a known-good expression from the same SMI schema family
- fix escaping at the XML layer separately from expression grammar
- reject unsupported constructs during authoring
- recompile and inspect all ISettingsResult entries, not only the first
Retry policy
Retry only after changing the expression. No target-state change can make invalid grammar parse.
Nearby HRESULT distinctions
WCM_E_EXPRESSIONNOTFOUND reports an unresolved named definition. WCM_E_NOTSUPPORTEDFUNCTION can parse the call form but does not support the selected function.
Concrete example
A generator inserts a logical operator from a different expression language. XML remains well formed, but the SMI expression parser rejects the token.
Operational logging
For operational telemetry, retain supported function/operator set for the target schema; also record the smallest subexpression that reproduces the parse failure. Preserve a redacted summary of manifest generator version and any templating transformations; use a cryptographic hash when that evidence is a file, stream, or generated artifact.
Token-level verification
Store the decoded expression beside the original XML token. That comparison reveals whether the defect entered during entity decoding, template expansion, or expression authoring.
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.
