Commit in reactos/ntoskrnl/se on MAIN
token.c+15-81.32 -> 1.33
Finish off NtDuplicateToken

reactos/ntoskrnl/se
token.c 1.32 -> 1.33
diff -u -r1.32 -r1.33
--- token.c	30 Dec 2003 18:52:06 -0000	1.32
+++ token.c	13 Mar 2004 19:25:47 -0000	1.33
@@ -1,4 +1,4 @@
-/* $Id: token.c,v 1.32 2003/12/30 18:52:06 fireball Exp $
+/* $Id: token.c,v 1.33 2004/03/13 19:25:47 jfilby Exp $
  *
  * COPYRIGHT:         See COPYING in the top level directory
  * PROJECT:           ReactOS kernel
@@ -817,7 +817,7 @@
 
 
 /*
- * @unimplemented
+ * @implemented
  */
 NTSTATUS STDCALL
 NtDuplicateToken(IN HANDLE ExistingTokenHandle,
@@ -827,7 +827,6 @@
 		 IN TOKEN_TYPE TokenType,
 		 OUT PHANDLE NewTokenHandle)
 {
-#if 0
    PACCESS_TOKEN Token;
    PACCESS_TOKEN NewToken;
    NTSTATUS Status;
@@ -839,19 +838,27 @@
 				      UserMode,
 				      (PVOID*)&Token,
 				      NULL);
+   if (!NT_SUCCESS(Status))
+    {
+      DPRINT1 ("Failed to reference token (Status %lx)\n", Status);
+      return Status;
+    }
    
    ExistingImpersonationLevel = Token->ImpersonationLevel;
-   SepDuplicateToken(Token,
+   Status = SepDuplicateToken(Token,
 		     ObjectAttributes,
 		     ImpersonationLevel,
 		     TokenType,
 		     ExistingImpersonationLevel,
 		     KeGetPreviousMode(),
 		     &NewToken);
-#else
-   UNIMPLEMENTED;
-   return(STATUS_NOT_IMPLEMENTED);
-#endif
+   if (!NT_SUCCESS(Status))
+    {
+      DPRINT1 ("Failed to duplicate token (Status %lx)\n", Status);
+      return Status;
+    }
+
+   return STATUS_SUCCESS;
 }
 
 VOID SepAdjustGroups(PACCESS_TOKEN Token,
CVSspam 0.2.8