Rob Shearman : ntdll: Add a stub implementation of FSCTL_PIPE_IMPERSONATE that just impersonates the token of the current process .

Alexandre Julliard julliard at winehq.org
Fri Sep 14 10:15:58 CDT 2007


Module: wine
Branch: master
Commit: 247b0c9b8e954b9eb4a16fa91027e648458a566d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=247b0c9b8e954b9eb4a16fa91027e648458a566d

Author: Rob Shearman <rob at codeweavers.com>
Date:   Thu Sep 13 14:03:48 2007 +0100

ntdll: Add a stub implementation of FSCTL_PIPE_IMPERSONATE that just impersonates the token of the current process.

---

 dlls/kernel32/tests/pipe.c |    8 --------
 dlls/ntdll/file.c          |    5 +++++
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c
index 18cc233..09f406e 100644
--- a/dlls/kernel32/tests/pipe.c
+++ b/dlls/kernel32/tests/pipe.c
@@ -961,21 +961,17 @@ static void test_ImpersonateNamedPipeClient(HANDLE hClientToken, DWORD security_
     ok(ret, "ReadFile failed with error %d\n", GetLastError());
 
     ret = ImpersonateNamedPipeClient(hPipeServer);
-    todo_wine
     ok(ret, "ImpersonateNamedPipeClient failed with error %d\n", GetLastError());
 
     ret = OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, FALSE, &hToken);
-    todo_wine
     ok(ret, "OpenThreadToken failed with error %d\n", GetLastError());
 
     (*test_func)(0, hToken);
 
     ImpersonationLevel = 0xdeadbeef; /* to avoid false positives */
     ret = GetTokenInformation(hToken, TokenImpersonationLevel, &ImpersonationLevel, sizeof(ImpersonationLevel), &size);
-    todo_wine {
     ok(ret, "GetTokenInformation(TokenImpersonationLevel) failed with error %d\n", GetLastError());
     ok(ImpersonationLevel == SecurityImpersonation, "ImpersonationLevel should have been SecurityImpersonation(%d) instead of %d\n", SecurityImpersonation, ImpersonationLevel);
-    }
 
     CloseHandle(hToken);
 
@@ -988,11 +984,9 @@ static void test_ImpersonateNamedPipeClient(HANDLE hClientToken, DWORD security_
     ok(ret, "ReadFile failed with error %d\n", GetLastError());
 
     ret = ImpersonateNamedPipeClient(hPipeServer);
-    todo_wine
     ok(ret, "ImpersonateNamedPipeClient failed with error %d\n", GetLastError());
 
     ret = OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, FALSE, &hToken);
-    todo_wine
     ok(ret, "OpenThreadToken failed with error %d\n", GetLastError());
 
     (*test_func)(1, hToken);
@@ -1007,7 +1001,6 @@ static void test_ImpersonateNamedPipeClient(HANDLE hClientToken, DWORD security_
     WaitForSingleObject(hThread, INFINITE);
 
     ret = ImpersonateNamedPipeClient(hPipeServer);
-    todo_wine
     ok(ret, "ImpersonateNamedPipeClient failed with error %d\n", GetLastError());
 
     RevertToSelf();
@@ -1135,7 +1128,6 @@ static void test_dynamic_context_no_token(int call_index, HANDLE hToken)
     switch (call_index)
     {
     case 0:
-        todo_wine
         ok(are_all_privileges_disabled(hToken), "token should be a copy of the process one\n");
         break;
     case 1:
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index c7004d7..e920504 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -1186,6 +1186,11 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
         }
         break;
 
+    case FSCTL_PIPE_IMPERSONATE:
+        FIXME("FSCTL_PIPE_DISCONNECT: impersonating self\n");
+        status = RtlImpersonateSelf( SecurityImpersonation );
+        break;
+
     case FSCTL_LOCK_VOLUME:
     case FSCTL_UNLOCK_VOLUME:
         FIXME("stub! return success - Unsupported fsctl %x (device=%x access=%x func=%x method=%x)\n",




More information about the wine-cvs mailing list