| Previous | Next |
| WCM_E_INVALIDLANGUAGEFORMAT | WCM_E_EXPRESSIONNOTFOUND |
WCM_E_KEYNOTCHANGEABLE
WCM_E_KEYNOTCHANGEABLE is the failure HRESULT 0x8022000F (signed decimal -2145255409, unsigned decimal 2149711887). Its severity bit is 1, facility is 34 (FACILITY_STATE_MANAGEMENT), and the facility-specific code field is 0x000F.
AllStat records the Windows SDK description as “Not allowed to change value in a key member.”
Exact meaning and contract boundary
A keyed-list identity member is immutable. The operation reached updating a member that defines the identity of an already created list element. The first branch to test is whether the caller uses SetValue on the list key instead of creating a new element; keep that separate from the possibility that a generic object mapper treats key and ordinary members identically.
Where the result appears
At this boundary, capture item setting type and GetKeyValue result, then correlate it with path of the list element and the schema’s key member. Assign ownership only after checking the update payload before field filtering.
Likely cause branches
- the caller uses SetValue on the list key instead of creating a new element
- a generic object mapper treats key and ordinary members identically
- migration code attempts to rename a keyed element in place
- the key value is included in a bulk update although it did not actually change
Evidence that resolves the ambiguity
- item setting type and GetKeyValue result
- path of the list element and the schema’s key member
- the update payload before field filtering
- whether a replacement element can preserve the remaining values
- references from other settings to the current keyed element
Diagnostic sequence
- exclude key members from ordinary update operations
- create a new list element with the desired key
- copy non-key values through supported item APIs
- remove the old element only after reference and rollback analysis
- make rename semantics explicit in the application instead of simulating them with SetValue
Retry and recovery
No delay-based retry is appropriate. Recovery is a create/copy/remove workflow governed by list semantics.
Difference from nearby WCM results
WCM_E_READONLYITEM can block any immutable item. KEYNOTCHANGEABLE specifically protects the identity member of a list element even when its other members are writable.
Practical scenario
A network-settings tool tries to rename a keyed profile by assigning its key field. The correct operation creates a new profile element and migrates non-key properties.
Logging and engineering guidance
For operational telemetry, retain the update payload before field filtering; also record whether a replacement element can preserve the remaining values. Preserve a redacted summary of references from other settings to the current keyed element; 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.