Skip to content

Commit

Permalink
simbatt: Fix broken registry read-back
Browse files Browse the repository at this point in the history
The GetSimBattStateFromRegistry function is currently using default settings if GetSimBattStateFromRegistry succeeds, whereas settings from registry are only applied if GetSimBattStateFromRegistry fails. This does not make sense to me.

Therefore proposing to remove the `!` negation from `if (!NT_SUCCESS(Status)) {` on the line after `Status = GetSimBattStateFromRegistry(Device, RegState);` so that default settings are loaded when registry read-back fails.
  • Loading branch information
Fredrik Orderud committed Jan 31, 2024
1 parent c657bc7 commit fa4567b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion simbatt/func/miniclass.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Return Value:
}

Status = GetSimBattStateFromRegistry(Device, RegState);
if (!NT_SUCCESS(Status)) {
if (NT_SUCCESS(Status)) {

RtlZeroMemory(RegState, sizeof(SIMBATT_STATE));
WdfWaitLockAcquire(DevExt->StateLock, NULL);
Expand Down

0 comments on commit fa4567b

Please sign in to comment.