锁屏时停掉彩色相机,让 Windows Hello 人脸登录退回纯红外识别。 专治 2025 年 4 月微软改判定逻辑之后出现的「无法识别你」→ 直接掉回输密码。
2025 年 4 月微软修复了 CVE-2025-26644(Windows Hello 伪造漏洞),同时改了一条行为:
安装此更新后,为了提升安全性,Windows Hello 人脸识别在登录时要求彩色相机看到可见的人脸。
笔记本的 Windows Hello 是 IR(红外)+ RGB(彩色)双摄。改完之后,两个相机必须同时成功才算过。 而彩色相机没有补光,全靠环境光,现实里就是不停翻车:
| 你的情况 | 彩色相机看到的 | 结果 |
|---|---|---|
| 光线不好 / 晚上 | 一片噪点 | ❌ 无法识别你 |
| 光线太好 / 背后有窗 | 过曝一片白 | ❌ 失败 |
| 侧面强光 | 半张脸惨白 | ❌ 失败 |
| 头歪了、低头、凑太近 | 不是正脸 | ❌ 失败 |
| 坐得稍远或稍近 | 脸太小或被裁 | ❌ 失败 |
失败几次之后 Windows 就不再重试,直接把你扔到密码框。
打开「增强面部识别保护」只会让它更严,所以更糟 —— 这不是错觉。
硬件一点问题都没有,红外在全黑环境下照样能看清你的脸。坏的是那个彩色相机。
锁屏界面出现时把彩色相机停掉,登录成功的那一刻立刻恢复。
只剩红外相机时,Windows Hello 会退回 2025 年 4 月之前的纯红外识别路径, 上面那张表里的每一行都不再成立。
┌─────────────┐ LogonUI.exe 出现 ┌──────────────────────┐
│ 已解锁 │ ─────────────────────► │ 彩色相机 已停用 │
│ 彩色相机开 │ │ 红外相机 开启 │
└─────────────┘ └──────────────────────┘
▲ │
│ 登录成功 │
└────────────────────────────────────────────┘
彩色相机 恢复
因为解锁后立刻恢复,微信 / 腾讯会议 / Zoom / 相机 App / OBS / 任何用摄像头的软件都完全不受影响。
# 1. 看它认出了哪两个相机(不用管理员,不改任何东西)
.\HelloIRGuard.ps1 -Show
# 2. 先验证根因(2 分钟,需管理员)—— 只停彩色相机
.\HelloIRGuard.ps1 -TestDisable
# 现在按 Win+L 锁屏,在暗处 / 侧脸 / 逆光 各试一遍扫脸
.\HelloIRGuard.ps1 -TestEnable # 恢复
# 3. 装常驻(需管理员)—— SYSTEM 任务,开机自启,重启不丢
.\HelloIRGuard.ps1 -Install或者直接双击 install.cmd(会自动弹 UAC 提权)。
卸载:
.\HelloIRGuard.ps1 -Uninstall # 删任务 + 强制恢复彩色相机或双击 uninstall.cmd。
| 项目 | 值 |
|---|---|
| 任务名 | HelloIRGuard |
| 运行身份 | SYSTEM,RunLevel = Highest |
| 触发 | 开机 和 登录,双触发 |
| 运行时长限制 | 无(PT0S) |
| 电池 | 用电池也运行,拔电不中止 |
| 崩溃重试 | 3 次,间隔 1 分钟 |
| 单实例 | Global\HelloIRGuard_Mutex 互斥体 |
| 日志 | %ProgramData%\HelloIRGuard.log(超 512 KB 自动轮转) |
2026-11-22 00:26:57 锁屏 → 已停用彩色相机(Hello 只用 IR)
2026-11-22 00:27:07 解锁 → 已恢复彩色相机
每次锁屏/解锁应该成对出现,间隔就是你在锁屏界面停留的时间。
# 看日志
Get-Content "$env:ProgramData\HelloIRGuard.log" -Tail 20
# 算成功率:1019 = 每次扫描,1605 = 授权成功
$ev = Get-WinEvent -LogName 'Microsoft-Windows-Biometrics/Operational' -MaxEvents 2000
$scan = @($ev | Where-Object Id -eq 1019).Count
$ok = @($ev | Where-Object Id -eq 1605).Count
"{0} 次扫描 / {1} 次成功 = {2:P1}" -f $scan, $ok, ($ok / [Math]::Max($scan,1))本项目的基准机(ASUS FX608LPG):装之前 7 天 94 次扫描 / 53 次成功 ≈ 56%。 装好之后目标是扫描数 ≈ 成功数,也就是不再出现「识别失败 → 手输密码」。
详细的验证方法(包括怎么读 CM_Get_DevNode_Status 的 problem code)见 docs/VERIFY.md。
- 杀软的内核过滤器。 火绒、360 之类的会往相机设备类挂 filter driver。查:
除了
(Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Class\{ca3e7ab9-b4c3-4ae6-8251-579ef933890f}' -Name UpperFilters).UpperFilters
ksthunk之外还有别的,就退出它再测一轮。 - 人脸模板太旧。 如果你的录入时间早于好几次 Windows 大版本更新,重录: 设置 → 账户 → 登录选项 → 面部识别 → 提高识别能力。 一定要在你平时坐的位置、平时的光照下多录一遍(这条最关键,多数人只录了第一遍)。
- 快速启动。
HiberbootEnabled = 1会让相机和 USB 状态跨「关机」残留。改成0。 - USB 选择性暂停。 电源选项 → USB 设置 → USB 选择性暂停 → 已禁用。 否则 Hello 开始扫描时相机可能还在唤醒过程中。
- 异常关机。 Kernel-Power 41 / 6008 事件会反复损坏 NGC 容器和 WinBio 模板库,
表现就是「时好时坏」。查:
Get-WinEvent -FilterHashtable @{LogName='System';Id=41,6008}。
HelloIRGuard-Doctor.ps1 -Apply 可以一次把第 3、4 项和「增强防伪」都关掉:
.\HelloIRGuard-Doctor.ps1 -Status # 只读体检,把相关开关全打出来
.\HelloIRGuard-Doctor.ps1 -Apply # 关增强防伪 + 关相机节电 + 关快速启动
.\HelloIRGuard-Doctor.ps1 -Reenroll # 备份并清空人脸模板库(之后手动重录)
.\HelloIRGuard-Doctor.ps1 -Restore # 把 -Apply 改的恢复成默认- 没有任何官方开关能放松 Hello 的识别阈值。 人脸引擎
FaceRecognitionEngineAdapter是闭源的, 模板库是加密 + 签名的容器。网上教你改Threshold/RecognitionThreshold/ 「灵敏度」注册表值的, 全是编的,那些键根本不存在。 - 别手改
C:\Windows\System32\WinBioDatabase\*.DAT。 只会让录入直接失效,只能重录。 - 本脚本不碰你的人脸模板、PIN、NGC 密钥、TPM。它只做一件事:开关一个 PnP 设备节点。
- 彩色相机在锁屏期间确实不可见(这是设计)。如果你依赖锁屏界面的相机小组件,别用这个。
- 微软以后可能还会改。如果某个版本不再要求彩色相机,这东西就变成一个可以卸掉的无用组件。
| 机器 | 系统 | 相机 | 结果 |
|---|---|---|---|
| ASUS TX Gaming FX608LPG | Windows 26300.9974 (26H2) | ASUS FHD webcam (VID_3277&PID_0096&MI_00) + ASUS IR camera (MI_02) |
锁屏/解锁来回各 <1 秒,30 秒稳定性 0 次复活,强杀自愈 1 秒内恢复 |
原始日志在 docs/evidence/,包括那次踩坑:CM_Disable_DevNode 不写 ConfigFlags,
所以判断设备停没停必须用 CM_Get_DevNode_Status 的 problem code(22 = 已停用),
用 ConfigFlags 会得到「看起来没停」的错误结论。
Lock the color camera at the lock screen, so Windows Hello face sign-in falls back to pure IR. Fixes "We couldn't recognize you" caused by the April 2025 Windows Hello hardening.
In April 2025, Microsoft shipped a fix for CVE-2025-26644 (Windows Hello Spoofing Vulnerability). Along with it came a behavioral change:
After installing this update, for enhanced security, Windows Hello facial recognition requires color cameras to see a visible face when signing in.
If you have an IR + RGB dual-camera laptop (the standard Windows Hello hardware), this means face sign-in now needs both cameras to succeed at the same time. The RGB camera has no illuminator worth the name, so in real life this breaks constantly:
| Situation | What the color camera sees | Result |
|---|---|---|
| Dim room / night | nothing but noise | ❌ "We couldn't recognize you" |
| Backlit / window behind you | pure overexposure | ❌ fails |
| Strong side light | blown-out half face | ❌ fails |
| Head turned, tilted, leaning in | not a frontal face | ❌ fails |
| Standing a bit too close/far | face too small or cropped | ❌ fails |
And after a few failures Windows stops retrying and drops you to the password box. Turning on "Enhanced facial recognition protection" makes it stricter, so it gets worse.
The hardware is fine. IR sees your face in total darkness with zero problems. The color camera is the thing breaking the party.
Disable the color camera while the lock screen is up. Re-enable it the moment you sign in.
With only the IR camera present, Windows Hello falls back to the pre-April-2025 pure-IR path, and every row in that table above stops mattering.
┌─────────────┐ LogonUI.exe appears ┌──────────────────────┐
│ unlocked │ ──────────────────────► │ RGB camera DISABLED │
│ RGB = ON │ │ IR camera ON │
└─────────────┘ └──────────────────────┘
▲ │
│ sign-in succeeds │
└────────────────────────────────────────────┘
RGB camera RE-ENABLED
Because it is re-enabled right after unlock, WeChat / Teams / Zoom / the Camera app / OBS / anything else that uses the webcam is completely unaffected.
- Polls for the
LogonUI.exeprocess (200 ms interval). - When it appears, calls
CM_Disable_DevNode()(cfgmgr32.dll) on the color camera node. This takes a few milliseconds — nopnputilprocess spawn, no Task Scheduler races. - While locked, re-asserts the disabled state every 5 seconds (idempotent) in case PnP or some other driver puts the camera back.
- On unlock, calls
CM_Enable_DevNode()and verifies the node reportsproblem = 0.
State is read back with CM_Get_DevNode_Status(), not ConfigFlags.
(This bit me: CM_Disable_DevNode does not set CONFIGFLAG_DISABLED in the registry,
so a ConfigFlags-based check reports "still enabled" while the device is very much dead.)
- Windows 10 2004+ or Windows 11 (any build)
- Windows Hello face sign-in already enrolled, with an IR camera present
- PowerShell 5.1 or later
- Administrator rights to install / disable / enable (
-Showworks unelevated)
# 1. See what it detected — no changes, no admin needed
.\HelloIRGuard.ps1 -Show
# 2. Prove the root cause first (2 minutes, admin) — disables the RGB camera
.\HelloIRGuard.ps1 -TestDisable
# ... now Win+L and try face sign-in in the dark / at an angle
.\HelloIRGuard.ps1 -TestEnable # put it back
# 3. Install the watchdog (admin) — SYSTEM task, survives reboot
.\HelloIRGuard.ps1 -InstallOr just double-click install.cmd (self-elevates via UAC).
| Property | Value |
|---|---|
| Task name | HelloIRGuard |
| Runs as | SYSTEM, RunLevel = Highest |
| Triggers | At startup and at logon |
| Execution time limit | none (PT0S) |
| Battery | runs on battery, keeps running when unplugged |
| Restart on failure | 3 attempts, 1 minute apart |
| Single instance | Global\HelloIRGuard_Mutex |
| Log | %ProgramData%\HelloIRGuard.log (auto-rotates at 512 KB) |
.\HelloIRGuard.ps1 -Uninstall # removes the task AND re-enables the color cameraor double-click uninstall.cmd.
# live log
Get-Content "$env:ProgramData\HelloIRGuard.log" -Tail 20
# face sign-in attempts (1019) vs successful authorizations (1605)
Get-WinEvent -LogName 'Microsoft-Windows-Biometrics/Operational' -MaxEvents 2000 |
Where-Object Id -in 1019,1605 |
Group-Object { $_.TimeCreated.Date }, Id |
Select-Object Count, Name | Format-TableBaseline on the machine this was written for: 94 scans / 53 successes over 7 days (~56%). The goal is scans ≈ successes, i.e. no more "failed → type your password".
See docs/VERIFY.md for the full procedure, including how to read
CM_Get_DevNode_Status problem codes.
- Antivirus filter drivers. Some Chinese security suites (Huorong, 360) attach kernel
filters to the camera device class. Check:
Anything other than
(Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Class\{ca3e7ab9-b4c3-4ae6-8251-579ef933890f}' -Name UpperFilters).UpperFilters
ksthunkis worth testing around. - Stale face template. If your enrollment predates several Windows feature updates, re-enroll: Settings → Accounts → Sign-in options → Facial recognition → Improve recognition. Record once more from the chair you actually sit in, under the light you actually have.
- Fast Startup.
HiberbootEnabled = 1lets camera/USB state leak across "shutdowns". Try setting it to0. - USB selective suspend. Power Options → USB settings → USB selective suspend → Disabled. Otherwise the camera may still be waking up when Hello starts its scan.
- Unclean shutdowns. Kernel-Power 41 / 6008 events repeatedly corrupt the NGC container
and the WinBio template database.
Get-WinEvent -FilterHashtable @{LogName='System';Id=41,6008}.
HelloIRGuard-Doctor.ps1 -Apply handles items 3, 4 and the anti-spoofing switch in one go.
HelloIRGuard-Doctor.ps1 — read-only diagnostic + tuning helper.
.\HelloIRGuard-Doctor.ps1 -Status # dump every relevant switch and camera state
.\HelloIRGuard-Doctor.ps1 -Apply # turn off enhanced anti-spoofing, camera power saving, fast startup
.\HelloIRGuard-Doctor.ps1 -Reenroll # back up + clear the face template DB (then re-enroll)
.\HelloIRGuard-Doctor.ps1 -Restore # revert what -Apply changed- There is no official knob to loosen the Hello match threshold. The face engine
(
FaceRecognitionEngineAdapter) is closed-source and the template database is an encrypted, signed container. Anything on the internet telling you to changeThreshold/RecognitionThreshold/ a "sensitivity" registry value is making it up. - Do not edit
C:\Windows\System32\WinBioDatabase\*.DAT. You will only break enrollment. - This script does not touch your face templates, PIN, NGC keys, or TPM. It only toggles a PnP device node on and off.
- While the color camera is disabled, anything that enumerates cameras during the lock screen will not see it (by design). If you rely on a lock-screen camera widget, don't use this.
- Microsoft may change the behavior again in a future update. If a build stops requiring the color camera, this becomes a no-op you can uninstall.
| Machine | OS | Cameras | Result |
|---|---|---|---|
| ASUS TX Gaming FX608LPG | Windows 26300.9974 (26H2) | ASUS FHD webcam (VID_3277&PID_0096&MI_00) + ASUS IR camera (MI_02) |
lock/unlock toggle verified, <1 s each way |
Raw verification logs are in docs/evidence/ — API probe, 30-second
stability run, forced-kill self-healing, single-instance check.
More docs:
docs/VERIFY.md— how to check it's actually working, and how to measure your sign-in success rate from the biometric event logdocs/RELATED-WORK.md— official CVE/KB references plus every community project attacking the same problem, and how they differ
Pull requests with other hardware welcome — please include the camera instance IDs and
the Get-WinEvent baseline before/after.
Root-cause analysis builds on the community's work on the 2025-04 Hello change: LKalra-dev/HelloIR, yanhuixie/WindowsHelloIRHelper, and the ASUS-specific reports in seerge/g-helper#4999 and #4914. This project was written independently and adds automatic camera discovery, PnP resurrection defence, forced-kill self-healing, and deterministic single-instance locking.
MIT — see LICENSE.
Not affiliated with Microsoft. Windows and Windows Hello are trademarks of Microsoft Corporation.