| Previous | Next |
| WCM_E_VALIDATIONFAILED | WCM_E_MANIFESTCOMPILATIONFAILED |
WCM_E_RESTRICTIONFAILED
WCM_E_RESTRICTIONFAILED is the failure HRESULT 0x80220021 (signed decimal -2145255391, unsigned decimal 2149711905). Its severity bit is 1, facility is 34 (FACILITY_STATE_MANAGEMENT), and the facility-specific code field is 0x0021.
AllStat records the Windows SDK description as “Invalid setting value on restriction.”
Documented meaning
A value falls outside an SMI restriction. The operation reached validation of a value against facets such as allowed set, range, length, or pattern. The first branch to test is whether the value exceeds min/max bounds; keep that separate from the possibility that string length or pattern constraints fail.
Operation phase
At this boundary, capture item path, declared type, value, and raw representation, then correlate it with restriction facets returned for the item. Assign ownership only after checking target schema version and scope.
Root-cause branches
- the value exceeds min/max bounds
- string length or pattern constraints fail
- an enum-like value is not in the allowed set
- target-specific metadata narrows a restriction compared with another image
Diagnostic record
- item path, declared type, value, and raw representation
- restriction facets returned for the item
- target schema version and scope
- boundary values that pass and fail
- whether defaults and existing stored values satisfy the same restriction
Correction workflow
- retrieve restrictions before authoring the value
- compare at exact boundary and with the correct type
- avoid client-side validation rules copied from another Windows release
- correct source data rather than bypassing namespace validation
- test the final value through the same target schema
Retry policy
Retry after selecting a conforming value or correcting erroneous metadata. Delay has no effect on a facet violation.
Nearby HRESULT distinctions
WCM_E_ASSERTIONFAILED may involve relationships among settings. RESTRICTIONFAILED usually binds directly to facets on the value being validated.
Concrete example
A string setting accepts text but declares a maximum length. The submitted value parses correctly and then fails the length restriction.
Operational logging
For operational telemetry, retain target schema version and scope; also record boundary values that pass and fail. Preserve a redacted summary of whether defaults and existing stored values satisfy the same restriction; use a cryptographic hash when that evidence is a file, stream, or generated artifact.
Test the exact boundary
For numeric and length facets, include the nearest passing and failing values. For pattern or enumeration facets, retain the normalized candidate and the declared allowed form.
Official Microsoft references.
- Microsoft: SMI error and success constants.
- Microsoft: Settings Management Infrastructure API.
- Microsoft: SMI interfaces.
- Microsoft: WcmDataType.
- Microsoft: ISettingsItem::GetDataType.
Looking for a different code? Search another status or error code.