thebookisclosed/ViVe · error · FeaturePropertyOverflowException
Operation must not be higher than 4.
Error message
Operation must not be higher than 4.
What it means
The RTL_FEATURE_CONFIGURATION_UPDATE struct's Operation setter validates that the RTL_FEATURE_CONFIGURATION_OPERATION value fits in the 3 bits the native RTL_FEATURE_CONFIGURATION structure reserves for it. Assigning a value numerically greater than 4 (the highest defined operation) throws FeaturePropertyOverflowException so an invalid operation never reaches the native feature configuration APIs, where it would be truncated or rejected as an unsupported operation.
Solutions
- Use only defined RTL_FEATURE_CONFIGURATION_OPERATION members (0-4); validate any parsed integer is <= 4 before casting.
- Check the enum definition in your ViVe/SDK version for the exact set of valid operations.
- Guard the assignment with an explicit range check or wrap it in try-catch on FeaturePropertyOverflowException.
- Update the library/package if you legitimately need an operation value newer than this build supports.
Example fix
// before
config.Operation = (RTL_FEATURE_CONFIGURATION_OPERATION)opValue; // throws if opValue > 4
// after
if ((uint)opValue > 4)
throw new ArgumentOutOfRangeException(nameof(opValue), "Operation must be 0-4");
config.Operation = (RTL_FEATURE_CONFIGURATION_OPERATION)opValue; Defensive patterns
Strategy: validation
Validate before calling
public static bool IsValidOperation(RTL_FEATURE_CONFIGURATION_OPERATION op) =>
(uint)op <= 4; Type guard
public static bool IsDefinedOperation(RTL_FEATURE_CONFIGURATION_OPERATION op) =>
Enum.IsDefined(typeof(RTL_FEATURE_CONFIGURATION_OPERATION), op) && (uint)op <= 4; Try / catch
try
{
config.Operation = op;
}
catch (FeaturePropertyOverflowException ex)
{
// ex.Property == "Operation", max 4
throw new InvalidOperationException($"Invalid Operation '{op}': must be 0-4.", ex);
} Prevention
- Use only named RTL_FEATURE_CONFIGURATION_OPERATION members; never cast unchecked integers.
- Clamp or reject user/config-supplied operation codes to 0-4 before assignment.
- Re-check enum definitions when upgrading Windows SDK or ViVe versions.
- Cover each operation your application issues with tests so an out-of-range value surfaces in CI.
When it happens
Trigger: Setting the Operation property on RTL_FEATURE_CONFIGURATION_UPDATE to a value > 4, e.g. struct.Operation = (RTL_FEATURE_CONFIGURATION_OPERATION)5, or assigning an integer parsed from user input/configuration, or an enum value introduced by a newer/foreign SDK definition that exceeds the 3-bit field.
Common situations: Casting unvalidated command-line or config values into RTL_FEATURE_CONFIGURATION_OPERATION; copying an operation enum from a different Windows build where new operations were appended past the 3-bit storage; off-by-one arithmetic (Operation + 1) when sequencing feature configuration updates.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
- Priority must not be higher than 15.
- EnabledState must not be higher than 2.
- VariantPayloadKind must not be higher than 3.
- EnabledStateOptions must not be higher than 1.
- Variant must not be higher than 63.
AI-assisted analysis of thebookisclosed/ViVe@3f8c6a3425 (2026-09-14).
Data as JSON: /api/errors/8d7e569a4fffa1d6.
Report an issue: GitHub.
Appendix: source
Thrown at ViVe/NativeStructs.cs:221
}
set
{
if ((uint)value > 3)
throw new FeaturePropertyOverflowException("VariantPayloadKind", 3);
_variantPayloadKind = value;
}
}
public RTL_FEATURE_CONFIGURATION_OPERATION Operation
{
get
{
return _operation;
}
set
{
if ((uint)value > 4)
throw new FeaturePropertyOverflowException("Operation", 4);
_operation = value;
}
}
public bool UserPolicyPriorityCompatible
{
get
{
return !((uint)EnabledStateOptions != 0 || _variant != 0 || (uint)_variantPayloadKind != 0 || VariantPayload != 0);
}
}
}
}
View on GitHub (pinned to 3f8c6a3425)