Author: pschweitzer
Date: Fri Aug 21 08:03:11 2015
New Revision: 68777
URL:
http://svn.reactos.org/svn/reactos?rev=68777&view=rev
Log:
[NTOSKRNL]
Implement the TokenImpersonationLevel case of SeQueryInformationToken().
This fixes VBoxSF driver not being able to expose shared folders in ReactOS
Modified:
trunk/reactos/ntoskrnl/se/token.c
Modified: trunk/reactos/ntoskrnl/se/token.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/token.c?rev=68…
==============================================================================
--- trunk/reactos/ntoskrnl/se/token.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/se/token.c [iso-8859-1] Fri Aug 21 08:03:11 2015
@@ -1076,8 +1076,40 @@
IN TOKEN_INFORMATION_CLASS TokenInformationClass,
OUT PVOID *TokenInformation)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ NTSTATUS Status;
+ PSECURITY_IMPERSONATION_LEVEL SeImpersonationLvl;
+ PAGED_CODE();
+
+ switch (TokenInformationClass)
+ {
+ case TokenImpersonationLevel:
+ /* It is mandatory to have an impersonation token */
+ if (((PTOKEN)Token)->TokenType != TokenImpersonation)
+ {
+ Status = STATUS_INVALID_INFO_CLASS;
+ break;
+ }
+
+ /* Allocate the output buffer */
+ SeImpersonationLvl = ExAllocatePoolWithTag(PagedPool,
sizeof(SECURITY_IMPERSONATION_LEVEL), TAG_SE);
+ if (SeImpersonationLvl == NULL)
+ {
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ break;
+ }
+
+ /* Set impersonation level and return the structure */
+ *SeImpersonationLvl = ((PTOKEN)Token)->ImpersonationLevel;
+ *TokenInformation = SeImpersonationLvl;
+ Status = STATUS_SUCCESS;
+ break;
+
+ default:
+ UNIMPLEMENTED;
+ break;
+ }
+
+ return Status;
}
/*