Fix issue with existing reg_dword entries #56160
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
When passing an invalid formatted reg_dword data in the state file, such as '000001', the registry code casts it to the proper type. In the case of '000001' it would be cast to an integer
1
. This conversion was happening after the comparison to see if changes were to be made, thus comparing'000001' to the existing integer
1
.This PR moves the casting of the state file data before the comparison so that it is comparing proper types.
Also fixes some issues with the comments being returned by the state file where it was returning incorrect duplicate strings.
<key name> added to <key name>
. Now it returns<key value> added to <key name>
Added tests for the integer comparison.
Fixed tests for the new comments
What issues does this PR fix or reference?
#55284
Tests written?
Yes
Commits signed with GPG?
Yes