How windows driver(NDIS Miniport Driver) distinguish between reboot action and shutdown action

xiaojiang gu 0 Reputation points
2025-04-18T03:37:12.7133333+00:00

Hi all:

    I am a windows driver developer. I want to know the difference between reboot and shutdown. Because driver needs to do different actions for these two scenario. Does it have any API interface to distinguish them? Can anybody give some suggestions or anybody have solutions about it?

    Because NDIS miniport driver can not capture power IRP, I want to know how to implement this fucntion.

    Thanks.
Windows Driver Kit (WDK)
Windows Driver Kit (WDK)
A set of Microsoft tools that are used to develop, test, and deploy Windows drivers.
177 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Silvio Lorenzo Torre 155 Reputation points
    2025-04-18T08:17:38.6933333+00:00

    Hi Xiaojiang Gu, it's not so easy...

    Both shutdown and reboot follow same sequence in Windows (services stop, drivers unload) and NDIS driver typically receives a MiniportHaltEx call during both ad Windows does not provide an explicit & direct API.

    Both are treated as system halt operations from the driver's point of view.

    You need a workaround, something like a user‑mode service to write a “Rebooting” registry flag before restart, which the driver reads on unload.

    I hope it's helpful to you,

    Regards,

    S.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.