From: Qian Hong Subject: [PATCH 1/2] server: Add request handler for OpenInputDesktop. Message-Id: <52683D1F.6040008@codeweavers.com> Date: Thu, 24 Oct 2013 05:18:23 +0800 Hello, This patch introduced dead code, I split it for easier reviewing, it could be squashed with [2/2]. - Superseded patch 99899 --- server/protocol.def | 10 ++++++++++ server/winstation.c | 24 ++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/server/protocol.def b/server/protocol.def index a7c5478..ffef0d5 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -2704,6 +2704,16 @@ enum coords_relative @END +/* Open a handle to current input desktop */ +@REQ(open_input_desktop) + unsigned int flags; /* desktop flags */ + unsigned int access; /* wanted access rights */ + unsigned int attributes; /* object attributes */ +@REPLY + obj_handle_t handle; /* handle to the desktop */ +@END + + /* Close a desktop */ @REQ(close_desktop) obj_handle_t handle; /* handle to the desktop */ diff --git a/server/winstation.c b/server/winstation.c index 57e6995..24d9720 100644 --- a/server/winstation.c +++ b/server/winstation.c @@ -551,6 +551,30 @@ DECL_HANDLER(open_desktop) } } +/* open a handle to current input desktop */ +DECL_HANDLER(open_input_desktop) +{ + struct winstation *winstation; + struct desktop *desktop; + + reply->handle = 0; + + /* FIXME: check access rights */ + winstation = get_process_winstation( current->process, 0 ); + + if (winstation) + { + if (!(winstation->flags & WSF_VISIBLE)) + set_error( STATUS_ILLEGAL_FUNCTION ); + else if (current->process->desktop && (desktop = get_desktop_obj( current->process, + current->process->desktop, 0 ))) + { + reply->handle = alloc_handle( current->process, desktop, req->access, req->attributes ); + release_object( desktop ); + } + release_object( winstation ); + } +} /* close a desktop */ DECL_HANDLER(close_desktop)