microsoft / Windows-driver-samples

This repo contains driver samples prepared for use with Microsoft Visual Studio and the Windows Driver Kit (WDK). It contains both Universal Windows Driver and desktop-only driver samples.
Microsoft Public License
6.92k stars 4.93k forks source link

simbatt: Fix broken registry read-back #1064

Closed forderud closed 3 months ago

forderud commented 10 months ago

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.

forderud commented 5 months ago

Gentle reminder.

forderud commented 4 months ago

@JakobL-MSFT Is it possible to get some kind of explanation for why this PR was closed instead of being considered for merging? Am I misunderstanding something, or don't you want to fix bugs in the sample code?

JakobL-MSFT commented 4 months ago

I closed this PR unintentionally. I apologize. I am reopening the PR.

forderud commented 4 months ago

@JakobL-MSFT @tristanb-ntdev Anything holding back merging of this bugfix?