Skip to content

Shivu516/Windows-Hello-Fix

Repository files navigation

Windows Hello Camera Fix v2.0 📸⚡

"Because your camera shouldn't be picky"


🚀 Overview & Core Mechanics

Version 2.0: The Total Overhaul

This version is a ground-up rewrite of v1.0, utilizing a high-performance native C++ core. It sits passively in your system architecture to automate hardware state transitions during authentication cycles.

🛑 The Problem: A Biometric Identity Crisis

Many high-end laptops and 2-in-1s feature Windows Hello facial recognition, which utilizes two distinct front-facing sensors: a standard RGB (color) camera and an Infrared (IR) sensor.

In theory, they should work in harmony. In practice, they behave like two siblings fighting over a single toy. Upon waking from sleep or locking the screen, Windows frequently experiences a brief existential crisis. It attempts to authenticate your face using the slower, light-dependent RGB camera instead of the instant IR sensor, or it gets hopelessly confused trying to match live IR data against an RGB-based baseline template.

The result? You are left staring blankly at your screen during an endless "Looking for you" loading loop, only to be forced to type your PIN like a peasant.

💡 The Solution: Strategic Camera Blinding

Fortunately, Windows Hello can be tricked into working flawlessly by simply disabling the RGB color camera right before the system locks. Deprived of its favorite distraction, Windows is forced to use the superior IR sensor, resulting in near-instant unlocks—even in pitch-black darkness.

This program automates that exact act of digital sabotage. It safely turns off your RGB camera the moment you lock your PC, and politely turns it back on once you are safely logged in.

How It Works

  • Session Monitoring: The utility continuously tracks active Windows Session states.

  • On Lock: It instantly disables the conflicting or selected RGB sensor.

  • On Unlock: It re-enables the camera hardware immediately to restore normal operation.

Note: Because this program only triggers during lock and unlock events, it will not assist you if Windows Hello pops up while you are actively using the PC (such as authenticating browser passkeys or app logins). For those moments, your cameras will just have to figure it out themselves.


⚡ Performance & Optimization Tricks

  • Native SetupAPI & Configuration Manager Integration: Bypasses sluggish PowerShell scripts and command-line wrappers entirely. It utilizes direct C++ calls to the Windows kernel's Plug and Play (PnP) subsystem (SetupDiCallClassInstaller and CM_Enable_DevNode), allowing for near-instantaneous hardware toggling.

  • Direct Window Message Hooking (WndProc): Instead of relying on a slow background loop or Task Scheduler to poll for session changes, the app hooks directly into the Windows Message pipeline (WM_WTSSESSION_CHANGE). This allows the app to react to lock/unlock events in milliseconds.

  • Low-Level Power Interrupts: Registers directly for GUID_LIDSWITCH_STATE_CHANGE and GUID_POWER_BUTTON_TIMESTAMP events via RegisterPowerSettingNotification. This allows the application to detect physical laptop lid closures and power button presses instantly, beating standard Windows Hello wake sequences to the punch.

  • Intelligent Auto-Targeting (MI_00 Scanning): The application dynamically scans the DIGCF_PRESENT device tree on startup and parses interface substrings to automatically locate the correct RGB sensor interface (MI_00), eliminating user guesswork during setup.

  • Zero-Overhead Background Daemon Mode: When launched as a background task, the application drops its visual footprint to zero (Opacity = 0, ShowInTaskbar = false) and rests entirely passively. It uses 0% CPU while waiting for native OS interrupt signals, maintaining absolute battery efficiency.


🛡️ Safety Safeguards & Reliability Features

  • Hardware Event Debouncing (Thrash Protection): Windows is notorious for sending duplicate lock/unlock or power signals in rapid succession. The application engine utilizes a strict 1500ms cooldown threshold timestamp comparison to intercept and neutralize duplicate signals, preventing aggressive hardware driver thrashing or infinite toggle loops.

  • Check-Before-Change Logic: Before dispatching command signals to the hardware driver, the app actively queries the current Device Node Status. If the camera is already in the requested state, it cleanly aborts the operation. This saves CPU cycles and prevents the Windows FrameServer from crashing due to redundant driver calls.

  • Triple-Pass Verification & Self-Healing: It doesn't just blindly send a disable/enable command. It executes a verification loop up to three times to confirm the hardware state actually changed. If Windows ignores the request, the application automatically re-enumerates the device node (CM_Reenumerate_DevNode) and forces a driver reset.

  • Atomic Single-Instance Mutex: Utilizes a native Win32 Named Mutex (Global\WindowsHelloFix_AppMutex) to absolutely guarantee that only one instance of the hardware manager can run at a time, preventing data race corruption and crossed wires.

  • Ghost-Process Recovery: If a user tries to launch the app while a background instance is frozen or stuck, the GUI detects the dead lock and offers a "Force Reset" path. This instantly kills the ghost process, forces the camera back on, and restarts the application cleanly.

  • Shutdown & Logoff Protection: Intercepts WM_ENDSESSION and WM_QUERYENDSESSION system messages. Right before Windows powers down or logs the user out, the application executes a final override to disable the conflicting RGB camera, ensuring the biometric template remains pure for the next cold boot.

  • String Sanitization (TrimTrailingChars): Hardened C++ string parsing automatically strips out invisible carriage returns (\r\n) from the configuration file, preventing silent string-matching failures when the app compares saved settings to live hardware identifiers.


⚙️ Performance & Optimization Tricks

  • Native SetupAPI & Configuration Manager Integration: Bypasses sluggish PowerShell scripts and command-line wrappers entirely. It utilizes direct C++ calls to the Windows kernel's Plug and Play (PnP) subsystem (SetupDiCallClassInstaller and CM_Enable_DevNode), allowing for near-instantaneous hardware toggling.

  • Direct Window Message Hooking (WndProc): Instead of relying on a slow background loop or Task Scheduler to poll for session changes, the app hooks directly into the Windows Message pipeline (WM_WTSSESSION_CHANGE) to react to lock/unlock events in milliseconds.

  • Low-Level Power Interrupts: Registers directly for GUID_LIDSWITCH_STATE_CHANGE and GUID_POWER_BUTTON_TIMESTAMP events via RegisterPowerSettingNotification. This allows the application to detect physical laptop lid closures and power button presses instantly, beating standard Windows Hello wake sequences to the punch.

  • Intelligent Auto-Targeting (MI_00 Scanning): The application dynamically scans the DIGCF_PRESENT device tree on startup and parses interface substrings to automatically locate the correct RGB sensor interface (MI_00), eliminating user guesswork during setup.

  • Zero-Overhead Background Daemon Mode: When launched as a background task, the application drops its visual footprint to zero (Opacity = 0, ShowInTaskbar = false) and rests entirely passively. It uses 0% CPU while waiting for native OS interrupt signals, maintaining absolute battery efficiency.


⚠️ Current Limitations

  • Operational Scope: This utility is specifically engineered to handle Windows Sign-In (Lock/Unlock) and Sign-Out events exclusively.

  • Application Conflicts: It does NOT currently handle Windows Hello prompts triggered inside third-party applications or internal Windows system settings. Attempting to implement system-wide fixes during development introduced hardware collision issues that rendered the release unstable, resulting in the feature being omitted from this version.


Here is the updated Installation and Setup Guide section for your README.md. It clearly documents both paths so users can pick their favorite method, while explicitly warning them about how WinGet handles shortcuts.


🛠️ Installation and Setup Guide

You can install this utility either using the traditional graphical setup or directly through the Windows Package Manager (WinGet).

Option 1: Fast CLI Installation (Recommended)

Open your preferred terminal (PowerShell or Command Prompt) and execute the following deployment shortcut:

winget install hellofix

⚠️ Important WinGet Note: The package manager installs the application silently in headless mode. It will NOT create a desktop shortcut. To launch the application for the first time, open your Windows Start Menu and search for "Windows Hello Fix".

Option 2: Graphical Setup

Simply download and execute the latest compiled setup installer (Windows_Hello_Fix_Setup.exe) from the Releases tab and proceed through the automatic installation wizard.


⚙️ Initial Hardware Configuration

Because the core service executes seamlessly in the background, you must manually bind your camera hardware interface exactly once upon initial deployment:

  1. Launch the application from your Windows Start Menu.
  2. Select your targeted RGB Camera from the interface drop-down menu (the string identifier matches its exact naming convention inside the native Windows Device Manager).
  3. Toggle the monitoring status to Active, apply changes, and you are completely good to go! The background daemon will handle all subsequent automation sequences silently.

🧹 Uninstallation

And uninstallation is equally simple. You can remove the program using either of the following methods: 🗑️

  • Run the Uninstall.exe file located directly within the installation directory.

  • Search for Windows Hello Fix in the Windows Start Menu and select Uninstall.

  • Locate Windows Hello Fix within the Windows Settings Installed Apps list and choose Uninstall.


⚠️ Disclaimer

This tool directly modifies hardware states using built-in Windows utilities. While perfectly safe and easily reversible, ensure you are selecting the correct RGB camera during setup. Do not select your IR sensor, or Windows Hello will stop working entirely!


🌐 Keywords for Search Engines

Windows Hello face recognition slow fix, prioritise IR camera over RGB Windows 11, Windows Hello looking for you loop, disable RGB camera for face unlock, pnputil camera toggle script, infrared camera biometric enrollment trick, Windows Hello hardware conflict solution.


About

Makes Windows Hello Face Unlocks more reliable, and also allows face unlocks in complete darkness

Topics

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors