All that logoff function did was close a couple windows and disable the active desktop.
code:
logoff(1)