Commit 247b0c9b authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

ntdll: Add a stub implementation of FSCTL_PIPE_IMPERSONATE that just…

ntdll: Add a stub implementation of FSCTL_PIPE_IMPERSONATE that just impersonates the token of the current process.
parent bcfe9544
......@@ -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:
......
......@@ -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",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment