Skip to content

Commit 54466da

Browse files
Fredrik Orderudforderud
authored andcommitted
simbatt: Fix broken registry read-back
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.
1 parent 1b58b0d commit 54466da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

simbatt/func/miniclass.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ Return Value:
202202
}
203203

204204
Status = GetSimBattStateFromRegistry(Device, RegState);
205-
if (!NT_SUCCESS(Status)) {
205+
if (NT_SUCCESS(Status)) {
206206

207207
RtlZeroMemory(RegState, sizeof(SIMBATT_STATE));
208208
WdfWaitLockAcquire(DevExt->StateLock, NULL);

0 commit comments

Comments
 (0)