What happens at System Shutdown ?

Hello,

My understanding (from some earlier posts in this newsgroup) is that
whatever initialization you do in

  1. DriverEntry(), undo it in Unload()
  2. AddDevice(), undo it in IRP_MN_REMOVE_DEVICE

But when the system shuts down, niether Unload() nor IRP_MN_REMOVE_DEVICE
is called. How are things “undone” in this case ?

What actually does happen during SHUTDOWN ? Could somebody please explain
?

Thanks
Puja