what registry keys or settings control how XP closes desktop and restarts
(in the case of reboot)
ok, found it

)
Once you have the Registry Editor up and running, locate and double-click on
the key HKEY_CURRENT_USER. When the subtree is visible, open each of the
following subtrees in succession:
1.. Control Panel
2.. Desktop
Once you open the Desktop key, scroll through the values in that key until
you locate the WaitToKillAppTimeout value. Double-click on it to open the
Edit String dialog box. The default value in this dialog box is 20000, which
is 20 seconds expressed in milliseconds. Once you change the value, click
OK, close the Registry Editor, and then restart the system.