This stop code (0x0000009F) means a driver failed to complete a power request within the time allowed: a device did not go to sleep, wake up, or shut down when Windows told it to. The signature pattern is a PC that hangs for minutes when closing the lid, sleeping, or shutting down, then restarts with this blue screen. Microsoft documents it plainly: a driver has failed to complete a power IRP within a specific time.
DISM /Online /Cleanup-Image /RestoreHealth, then sfc /scannow, then check for Windows updates, Microsoft ships driver-framework fixes through them.If one device reliably triggers the stall, replace its driver with the version from the component maker rather than the PC brand, or leave the device disconnected and replace it if it is old. A crash that happens on a clean install with current drivers and BIOS can point at a failing motherboard power circuit, but that is the last stop, not the first.
Why does it happen when I close the lid or shut down? Because that is when the power request goes out. Sleeping, waking, hibernating, and shutting down all require every driver to change state on command. A driver that ignores or mishandles the request stalls the whole transition until Windows gives up and shows this code.
Is DRIVER_POWER_STATE_FAILURE a hardware failure? Occasionally a dying device causes it, but the large majority are driver software problems fixed by updates or by stopping Windows from power-managing the device. Suspect hardware only when the same device stalls across clean drivers on a fresh install.