Restarting a system

I know this has been addressed here before, but I can't find the answer now.
How do I restart a system?  I understand that I should use ExitWindowsEx(
EWX_REBOOT, 0 ), but how do I know if the system's NT, and if it is, how do I
use AdjustTokenPrivileges to enable SE_SHUTDOWN_NAME?  Any help would be
greatly appreciated!

Thanks!
Carrie