I've seen many systems hang at shutdown due to drivers failing to go into their low power state. This is the last thing that happens before reboot/power off.
Nothing in user mode (not even open file handles, registry handles, etc) should prevent the kernel from shutting down normally. Only invalid kernel mode state can cause this (i.e., drivers or an actual MS bug, which of course isn't possible

)
If you're interested, the process works like this:
1. You request the shell to shut down windows (or some app calls the Win32 ExitWindowsEx() function).
2. Csrss.exe (the user-mode portion of the Win32 subsystem) sends a query message to all threads that own top level windows (this allows apps to pop up the "save/discard/cancel" dialog box, and what permits you to hit "cancel" to stop the shutdown).
3. Csrss.exe waits until either all windows respond OK, or their gui thread has been blocked for more than the time defined in the registry key HKCU\ControlPanel\Desktop\HungAppTimeout. If any apps have hit this limit, Csrss pops up the infamous "End Program" dialog box allowing you to forcibly terminate hung apps.
4. Csrss.exe tells the service control manager (SCM) process to exit (services.exe).
5. SCM tells all Win32 services to stop. Csrss monitors this and waits for HKLM\CurrentControlSet\Control\WaitToKillServiceTimeout before forcibly killing services.exe. (Note that any services that haven't saved state or shut down normally by this point WILL be killed immediately, possibly corrupting their caches or databases. Many admins running servers in production environments purposely set this value higher for large databases to be closed normally (this is especially true with Exchange Server which does lots at shutdown)).
6. Csrss.exe calls the native API method NtShutdownSystem(), which tells the PnP Manager to do what is necessary to shut down the system.
7. The PnP manager does a number of things, which includes informing all device drivers (via an IRP) to lower their power states appropriately. THIS is where device drivers typically hang at shutdown. To transition from D0 (full-on) to D3 (off) means they must save any state necessary, flush caches, free hardware resources, etc. This is complicated code to get exactly right.
8. Finally the HAL is told to reboot or power off (depending on which kind of shutdown you selected). If you don't have an ACPI or APM-aware HAL, you will get the "Safe to Shut Down" screen and will have to power down yourself.
Note that standby and hibernation are different entirely.