- Clean up well-known privileges.
- Implement checking tokens for privileges in the server.
- Implement NtPrivilegeCheck.

diff --git a/server/thread.c b/server/thread.c
index 059aec4..af6657e 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -767,6 +767,15 @@
     return snapshot;
 }
 
+/* gets the current impersonation token */
+struct token *thread_get_impersonation_token( struct thread *thread )
+{
+    if (thread->token)
+        return thread->token;
+    else
+        return thread->process->token;
+}
+
 /* signal that we are finished booting on the client side */
 DECL_HANDLER(boot_done)
 {