ntdll: Move the FSCTL_PIPE_IMPERSONATE semi-stub to the server.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-07-10 07:57:07 +02:00
parent 4a49af0cbe
commit 9ac3f24f74
2 changed files with 13 additions and 2 deletions

View File

@ -5665,8 +5665,8 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
case FSCTL_PIPE_IMPERSONATE:
FIXME("FSCTL_PIPE_IMPERSONATE: impersonating self\n");
status = RtlImpersonateSelf( SecurityImpersonation );
break;
return server_ioctl_file( handle, event, apc, apc_context, io, code,
in_buffer, in_size, out_buffer, out_size );
case FSCTL_IS_VOLUME_MOUNTED:
case FSCTL_LOCK_VOLUME:

View File

@ -1138,6 +1138,17 @@ static int pipe_server_ioctl( struct fd *fd, ioctl_code_t code, struct async *as
pipe_end_disconnect( &server->pipe_end, STATUS_PIPE_DISCONNECTED );
return 1;
case FSCTL_PIPE_IMPERSONATE:
if (current->process->token) /* FIXME: use the client token */
{
struct token *token;
if (!(token = token_duplicate( current->process->token, 0, SecurityImpersonation, NULL )))
return 0;
if (current->token) release_object( current->token );
current->token = token;
}
return 1;
default:
return pipe_end_ioctl( &server->pipe_end, code, async );
}