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

This commit is contained in:
Rob Shearman 2007-09-13 14:03:48 +01:00 committed by Alexandre Julliard
parent bcfe954451
commit 247b0c9b8e
2 changed files with 5 additions and 8 deletions

View File

@ -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:

View File

@ -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",