]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
[ghi] Remove trash folder RPCs.
authorVMware, Inc <>
Thu, 24 Feb 2011 21:45:55 +0000 (13:45 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 24 Feb 2011 21:45:55 +0000 (13:45 -0800)
It was decided not to add the corresponding elements to the Fusion UI,
and AFAIK no host has ever used these RPCs, or plans to.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/include/unityCommon.h
open-vm-tools/lib/include/vmware/guestrpc/capabilities.h
open-vm-tools/services/plugins/unity/Makefile.am
open-vm-tools/services/plugins/unity/ghIntegration/ghIntegration.h
open-vm-tools/services/plugins/unity/ghiTclo.cpp
open-vm-tools/services/plugins/unity/ghiTclo.h
open-vm-tools/services/plugins/unity/ghiTrashFolder.x [deleted file]
open-vm-tools/services/plugins/unity/unityPlugin.cpp

index 40398c40c036f0131f4c463bdd849feaf4cf89d4..823475621a099597247abcafaa42ccad9cd900bb 100644 (file)
 #define GHI_RPC_RESTORE_DEFAULT_GUEST_HANDLER         "ghi.guest.handler.restoreDefault"
 #define GHI_RPC_OUTLOOK_SET_TEMP_FOLDER               "ghi.guest.outlook.set.tempFolder"
 #define GHI_RPC_OUTLOOK_RESTORE_TEMP_FOLDER           "ghi.guest.outlook.restore.tempFolder"
-#define GHI_RPC_TRASH_FOLDER_ACTION                   "ghi.guest.trashFolder.action"
-#define GHI_RPC_TRASH_FOLDER_GET_ICON                 "ghi.guest.trashFolder.getIcon"
 #define GHI_RPC_TRAY_ICON_START_UPDATES               "ghi.guest.trayIcon.startUpdates"
 #define GHI_RPC_TRAY_ICON_STOP_UPDATES                "ghi.guest.trayIcon.stopUpates"
 #define GHI_RPC_TRAY_ICON_SEND_EVENT                  "ghi.guest.trayIcon.sendEvent"
 #define UNITY_RPC_UNITY_ACTIVE            "unity.active"
 #define GHI_RPC_LAUNCHMENU_CHANGE         "tools.ghi.launchmenu.change"
 #define GHI_RPC_PROTOCOL_HANDLER_INFO     "tools.ghi.protocolhandler.info"
-#define GHI_RPC_TRASH_FOLDER_STATE        "ghi.guest.trashFolder.state"
 #define GHI_RPC_TRAY_ICON_UPDATE          "ghi.guest.trayIcon.update"
 #define GHI_RPC_HOST_SHELL_ACTION         "ghi.host.shell.action"
 #define UNITY_RPC_REQUEST_OPERATION       "unity.operation.request"
index 2958d9d309a33a5a6747e8ada4d09890047c92d4..a054fbee37ebb644819438bb6dc10a923c507392 100644 (file)
@@ -59,9 +59,7 @@ typedef enum {
    GHI_CAP_SET_HANDLER                  = 14, // supports setting the handler for types/protocols
    UNITY_CAP_STATUS_UNITY_ACTIVE        = 15, // supports GuestRpc bits for Unity Status
    GHI_CAP_SET_OUTLOOK_TEMP_FOLDER      = 16, // supports setting the Outlook temp folder
-   GHI_CAP_TRASH_FOLDER                 = 17, // supports ghi.guest.trashFolder.action,
-                                              // ghi.guest.trashFolder.state, and
-                                              // ghi.guest.trashFolder.getIcon commands
+                                              // 17 is obsolete, do not use
    CAP_SET_TOPO_MODES                   = 18, // supports setting topology modes in video driver
    GHI_CAP_TRAY_ICONS                   = 19, // supports ghi.guest.trayIcon commands
    GHI_CAP_SET_FOCUSED_WINDOW           = 20, // supports ghi.guest.setFocusedWindow
@@ -130,7 +128,6 @@ static GuestCapElem guestCapTable[] = {
    { GHI_CAP_SET_HANDLER,                  GHI_CAP_VMDB_PATH,   "setHandler" },
    { UNITY_CAP_STATUS_UNITY_ACTIVE,        UNITY_CAP_VMDB_PATH, "unityActive" },
    { GHI_CAP_SET_OUTLOOK_TEMP_FOLDER,      GHI_CAP_VMDB_PATH,   "setOutlookTempFolder" },
-   { GHI_CAP_TRASH_FOLDER,                 GHI_CAP_VMDB_PATH,   "trashFolder" },
    { CAP_SET_TOPO_MODES,                   CAP_VMDB_PATH,       "displayTopologyModesSet" },
    { GHI_CAP_TRAY_ICONS,                   GHI_CAP_VMDB_PATH,   "trayIcons" },
    { GHI_CAP_SET_FOCUSED_WINDOW,           GHI_CAP_VMDB_PATH,   "setFocusedWindow"},
index 3f06b06a785e566fa9c1f348b7b79a0c9892e712..375ec736109b629a532b9982c097d62fc8f0044f 100644 (file)
@@ -87,7 +87,6 @@ RPCGEN_SRCS += ghiTrayIcon_xdr.c
 RPCGEN_SRCS += ghiSetFocusedWindow_xdr.c
 RPCGEN_SRCS += ghiSetGuestHandler_xdr.c
 RPCGEN_SRCS += ghiSetOutlookTempFolder_xdr.c
-RPCGEN_SRCS += ghiTrashFolder_xdr.c
 RPCGEN_SRCS += unityActive_xdr.c
 RPCGEN_SRCS += unity_xdr.c
 
@@ -101,7 +100,6 @@ RPCGEN_HDRS += ghiTrayIcon.h
 RPCGEN_HDRS += ghiSetFocusedWindow.h
 RPCGEN_HDRS += ghiSetGuestHandler.h
 RPCGEN_HDRS += ghiSetOutlookTempFolder.h
-RPCGEN_HDRS += ghiTrashFolder.h
 RPCGEN_HDRS += unityActive.h
 RPCGEN_HDRS += unity.h
 
@@ -248,20 +246,6 @@ ghiSetOutlookTempFolder.h: ghiSetOutlookTempFolder.x
 ghiSetOutlookTempFolder_xdr.c: ghiSetOutlookTempFolder.x ghiSetOutlookTempFolder.h
        $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/ghiSetOutlookTempFolder.x
 
-ghiTrashFolder.h: ghiTrashFolder.x
-       if [ $(top_builddir) != $(top_srcdir) ]; then                                    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiCommonDefines.h $(builddir);    \
-          cp -f $(top_srcdir)/services/plugins/unity/ghiTrashFolder.x $(builddir);         \
-       fi
-       $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/ghiTrashFolder.x
-       $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
-       mv $@.tmp $@
-       $(MKDIR_P) $(top_builddir)/lib/include/guestrpc
-       cp $@ $(top_builddir)/lib/include/guestrpc
-
-ghiTrashFolder_xdr.c: ghiTrashFolder.x ghiTrashFolder.h
-       $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/ghiTrashFolder.x
-
 unityActive.h: unityActive.x
        if [ $(top_builddir) != $(top_srcdir) ]; then                                    \
           cp -f $(top_srcdir)/services/plugins/unity/unityActive.x $(builddir);         \
index 13891d2a19a65c2fb6f9ea653b8ec336d64bb6fd..bfb994152b4016aefd4467f91c12db854cf15c70 100644 (file)
@@ -49,7 +49,6 @@ typedef Bool (*GHISendTrashFolderStateRPCFn)(Bool empty);
 
 typedef struct GHIHostCallbacks {
    GHILaunchMenuChangeRPCFn launchMenuChange;
-   GHISendTrashFolderStateRPCFn sendTrashFolderState;
 } GHIHostCallbacks;
 
 Bool GHI_IsSupported(void);
index d17d1f1a240a290843dbb579c2ea8752bf720bdc..28e13f1a7f0815fb7c46907fb36cb6bc0951b15f 100644 (file)
@@ -50,7 +50,6 @@ extern "C" {
 #include "guestrpc/ghiShellAction.h"
 #include "guestrpc/ghiStartMenu.h"
 #include "guestrpc/ghiTrayIcon.h"
-#include "guestrpc/ghiTrashFolder.h"
 #include "vmware/guestrpc/capabilities.h"
 
 static DynBuf gTcloUpdate;
@@ -1196,216 +1195,6 @@ GHITcloRestoreOutlookTempFolder(RpcInData *data) // IN/OUT: RPC data
 }
 
 
-/*
- *-----------------------------------------------------------------------------
- *
- * GHITcloTrashFolderAction --
- *
- *      Wrapper function for the ghi.guest.trashFolder.action RPC.
- *
- * Results:
- *      TRUE on success, FALSE on failure.
- *
- * Side effects:
- *      XXX.
- *
- *-----------------------------------------------------------------------------
- */
-
-gboolean
-GHITcloTrashFolderAction(RpcInData *data)       // IN/OUT:
-{
-   Bool ret = FALSE;
-
-   Debug("%s: Enter.\n", __FUNCTION__);
-
-   /* Check our arguments. */
-   ASSERT(data);
-   if (!data) {
-      return FALSE;
-   }
-
-   ASSERT(data->name);
-   ASSERT(data->args);
-
-   if (!data->name || !data->args) {
-      Debug("%s: Invalid arguments.\n", __FUNCTION__);
-      return RPCIN_SETRETVALS(data, "Invalid arguments.", FALSE);
-   }
-
-   Debug("%s: Got RPC, name: \"%s\", argument length: %"FMTSZ"u.\n",
-         __FUNCTION__, data->name, data->argsSize);
-
-   /*
-    * XXX: Trash/Recycle Folder support is not used by the host at this time
-    * so we can ignore this RPC.
-    */
-
-   /*
-    * We don't have any out parameters, so we write empty values into the
-    * result fields of the RpcInData structure.
-    */
-   RPCIN_SETRETVALS(data, "", FALSE);
-
-   /* Set our return value and return to the caller. */
-   ret = TRUE;
-
-   Debug("%s: Exit.\n", __FUNCTION__);
-   return ret;
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * GHISendTrashFolderStateRPC --
- *
- *      Send the ghi.guest.trashFolder.state RPC to the host. This function is
- *      used by the platform-specific GHI backends to notify the host when the
- *      state of the Trash (aka Recycle Bin) folder changes. Currently, the only
- *      information sent using this RPC is the empty/non-empty state of the
- *      Trash folder.
- *
- * Results:
- *      TRUE if RPC was sent successfully, FALSE otherwise.
- *
- * Side effects:
- *      XXX.
- *
- *-----------------------------------------------------------------------------
- */
-
-Bool
-GHISendTrashFolderStateRPC(Bool empty)  // IN: TRUE if the trash folder is empty.
-{
-   Bool ret = FALSE;
-   DynBuf outBuf;
-
-   GHITrashFolderStateV1 *v1ptr = NULL;
-   GHITrashFolderState msg;
-   XDR xdrs;
-
-   Debug("%s: Enter.\n", __FUNCTION__);
-
-   memset(&msg, 0, sizeof msg);
-   DynBuf_Init(&outBuf);
-
-   /* Create the GHITrashFolderStateV1 structure to send. */
-   v1ptr = (GHITrashFolderStateV1*) Util_SafeMalloc(sizeof *v1ptr);
-   if (NULL == v1ptr) {
-      Debug("%s: Failed to allocate trash folder state buffer.\n", __FUNCTION__);
-      goto exit;
-   }
-
-   v1ptr->empty = empty;
-
-   /* Create the GHITrashFolderState structure to send. */
-   msg.ver = GHI_TRASH_FOLDER_STATE_V1;
-   msg.GHITrashFolderState_u.trashFolderStateV1 = v1ptr;
-   v1ptr = NULL; /* This will be freed by VMX_XDR_FREE(). */
-
-   /* Create a new DynXdr structure for this message. */
-   ASSERT_MEM_ALLOC(DynXdr_Create(&xdrs));
-
-   /* Encode the structure into our DynXdr. */
-   if (!xdr_GHITrashFolderState(&xdrs, &msg)) {
-      Debug("%s: Failed to encode XDR data.\n", __FUNCTION__);
-      goto exit;
-   }
-
-   /* Append our RPC name and a space to the DynBuf. */
-   if (!DynBuf_Append(&outBuf,
-                      GHI_RPC_TRASH_FOLDER_STATE,
-                      strlen(GHI_RPC_TRASH_FOLDER_STATE))) {
-      Debug("%s: Failed to append RPC name to DynBuf.\n", __FUNCTION__);
-      goto exit;
-   }
-
-   if (!DynBuf_Append(&outBuf, " ", 1)) {
-      Debug("%s: Failed to append space to DynBuf.\n", __FUNCTION__);
-      goto exit;
-   }
-
-   /* Append the XDR serialized data to the DynBuf. */
-   if (!DynBuf_Append(&outBuf, DynXdr_Get(&xdrs), xdr_getpos(&xdrs)) )
-   {
-      Debug("%s: Failed to append XDR serialized data to DynBuf.\n",
-            __FUNCTION__);
-      goto exit;
-   }
-
-   if (!RpcOut_SendOneRaw(DynBuf_Get(&outBuf),
-                          DynBuf_GetSize(&outBuf),
-                          NULL,
-                          NULL)) {
-      Debug("%s: Failed to send RPC to host!\n", __FUNCTION__);
-      goto exit;
-   }
-   ret = TRUE;
-
-exit:
-   DynBuf_Destroy(&outBuf);
-   DynXdr_Destroy(&xdrs, TRUE);
-   VMX_XDR_FREE(xdr_GHITrashFolderState, &msg);
-   Debug("%s: Exit.\n", __FUNCTION__);
-   return ret;
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * GHITcloTrashFolderGetIcon --
- *
- *      Return the icon for the Trash folder (aka Recycle Bin) to the host.
- *
- * Results:
- *      TRUE on success, FALSE on failure.
- *
- * Side effects:
- *      XXX.
- *
- *-----------------------------------------------------------------------------
- */
-
-gboolean
-GHITcloTrashFolderGetIcon(RpcInData *data) // IN/OUT:
-{
-   Bool ret = FALSE;
-
-   Debug("%s: Enter.\n", __FUNCTION__);
-
-   /* Check our arguments. */
-   ASSERT(data);
-   ASSERT(data->name);
-
-   if (!(data && data->name)) {
-      Debug("%s: Invalid arguments.\n", __FUNCTION__);
-      goto exit;
-   }
-
-   Debug("%s: Got RPC, name: \"%s\", argument length: %"FMTSZ"u.\n",
-         __FUNCTION__, data->name, data->argsSize);
-
-
-   /*
-    * XXX: Trash/Recycle Folder support is not used by the host at this time
-    * so we can ignore this RPC.
-    */
-
-   /*
-    * Write the result into the RPC out parameters.
-    */
-   RPCIN_SETRETVALS(data, "", FALSE);
-
-   ret = TRUE;
-
-exit:
-   Debug("%s: Exit.\n", __FUNCTION__);
-   return ret;
-}
-
-
 /*
  *-----------------------------------------------------------------------------
  *
index ba1c416b7eac189e21fa9230031a83422d4e22b4..cbbb7c32b301f61e6f52399fc755a803b829d01a 100644 (file)
@@ -33,9 +33,7 @@ extern "C" {
    void GHITcloInit();
    void GHITcloCleanup();
 
-   /*
-    * RPC Entry points
-    */
+   /* RPC Entry points */
    gboolean GHITcloGetBinaryInfo(RpcInData *data);
    gboolean GHITcloGetBinaryHandlers(RpcInData *data);
    gboolean GHITcloGetStartMenuItem(RpcInData *data);
@@ -43,48 +41,17 @@ extern "C" {
    gboolean GHITcloCloseStartMenu(RpcInData *data);
    gboolean GHITcloShellOpen(RpcInData *data);
    gboolean GHITcloShellAction(RpcInData *data);
-
    gboolean GHITcloSetGuestHandler(RpcInData *data);
    gboolean GHITcloRestoreDefaultGuestHandler(RpcInData *data);
-
-   /*
-    * RPC Handlers
-    */
-
-   /* ghi.guest.outlook.set.tempFolder */
    gboolean GHITcloSetOutlookTempFolder(RpcInData* data);
-
-   /* ghi.guest.outlook.restore.tempFolder */
    gboolean GHITcloRestoreOutlookTempFolder(RpcInData* data);
-
-   /* ghi.guest.trashFolder.action */
-   gboolean GHITcloTrashFolderAction(RpcInData *data);
-
-   /* ghi.guest.trashFolder.getIcon */
-   gboolean GHITcloTrashFolderGetIcon(RpcInData *data);
-
-   /* ghi.guest.trayIcon.sendEvent */
    gboolean GHITcloTrayIconSendEvent(RpcInData *data);
-
-   /* ghi.guest.trayIcon.startUpdates */
    gboolean GHITcloTrayIconStartUpdates(RpcInData *data);
-
-   /* ghi.guest.trayIcon.stopUpdates */
    gboolean GHITcloTrayIconStopUpdates(RpcInData *data);
-
-   /* ghi.guest.setFocusedWindow */
    gboolean GHITcloSetFocusedWindow(RpcInData *data);
-
-   /* ghi.guest.getExecInfoHash */
    gboolean GHITcloGetExecInfoHash(RpcInData *data);
 
-   /*
-    * Send a tray icon update to the host.
-    */
-   Bool GHISendTrayIconUpdateRpc(XDR *xdrs);
-
    /* Callback functions to send data to the host */
+   Bool GHISendTrayIconUpdateRpc(XDR *xdrs);
    Bool GHILaunchMenuChangeRPC(int numFolderKeys, const char **folderKeysChanged);
-   Bool GHISendTrashFolderStateRPC(Bool empty);
 };
-
diff --git a/open-vm-tools/services/plugins/unity/ghiTrashFolder.x b/open-vm-tools/services/plugins/unity/ghiTrashFolder.x
deleted file mode 100644 (file)
index 01f50a3..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*********************************************************
- * Copyright (C) 2009 VMware, Inc. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation version 2.1 and no later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the Lesser GNU General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA.
- *
- *********************************************************/
-
-/*
- * ghiTrashFolder.x --
- *
- *    Definition of the data structures used in the GuestRpc commands that
- *    manipulate the Trash folder (aka Recycle Bin).
- */
-
-/*
- * Using the opaque type causes rpcgen to emit code that calls the htonl and
- * ntohl functions. On Windows, these functions are defined in winsock2.h, so
- * we need to #include that header in the generated code.
- */
-%#ifdef WIN32
-%#include "winsock2.h"
-%#endif /* WIN32 */
-
-enum GHITrashFolderActionVersion {
-   GHI_TRASH_FOLDER_ACTION_V1 = 1
-};
-
-enum GHITrashFolderStateVersion {
-   GHI_TRASH_FOLDER_STATE_V1 = 1
-};
-
-enum GHITrashFolderGetIconVersion {
-   GHI_TRASH_FOLDER_GET_ICON_V1 = 1
-};
-
-/* The maximum length of the verb to apply to the trash folder. */
-const GHI_TRASH_FOLDER_ACTION_MAX_LEN = 64;
-
-/*
- * The maximum size of the trash folder icon, 48x48x4 bytes, plus
- * 1,024 bytes for the PNG metadata.
- */
-const GHI_TRASH_FOLDER_MAX_ICON_SIZE  = 10240;
-
-struct GHITrashFolderActionV1 {
-   string action<GHI_TRASH_FOLDER_ACTION_MAX_LEN>;
-};
-
-struct GHITrashFolderStateV1 {
-   Bool empty;
-};
-
-struct GHITrashFolderGetIconV1 {
-   int    height;
-   int    width;
-   opaque pngData<GHI_TRASH_FOLDER_MAX_ICON_SIZE>;
-};
-
-union GHITrashFolderAction switch (GHITrashFolderActionVersion ver) {
-case GHI_TRASH_FOLDER_ACTION_V1:
-   struct GHITrashFolderActionV1 *trashFolderActionV1;
-};
-
-union GHITrashFolderState switch (GHITrashFolderStateVersion ver) {
-case GHI_TRASH_FOLDER_STATE_V1:
-   struct GHITrashFolderStateV1 *trashFolderStateV1;
-};
-
-union GHITrashFolderGetIcon switch (GHITrashFolderGetIconVersion ver) {
-case GHI_TRASH_FOLDER_GET_ICON_V1:
-   struct GHITrashFolderGetIconV1 *trashFolderGetIconV1;
-};
index 5dea02bbb404159f6edda565f0edc0b952a911ad..3e59bdc6b9410e20f5f327a76fa1ec4067380e4a 100644 (file)
@@ -133,7 +133,7 @@ UnityPlugin::Initialize(ToolsAppCtx *ctx)       // IN: Host application context.
    GHIHostCallbacks ghiHostCallbacks;
    memset(&ghiHostCallbacks, 0, sizeof ghiHostCallbacks);
    ghiHostCallbacks.launchMenuChange = &GHILaunchMenuChangeRPC;
-   ghiHostCallbacks.sendTrashFolderState = &GHISendTrashFolderStateRPC;
+
 #if defined(G_PLATFORM_WIN32)
    GHI_Init(ctx->mainLoop, NULL, ghiHostCallbacks);
    GHI_RegisterNotifyIconCallback(&gNotifyIconCallback);
@@ -291,8 +291,6 @@ UnityPlugin::GetRpcCallbackList()
       rpcList.push_back(RpcChannelCallbackEntry(GHI_RPC_RESTORE_DEFAULT_GUEST_HANDLER, GHITcloRestoreDefaultGuestHandler));
       rpcList.push_back(RpcChannelCallbackEntry(GHI_RPC_OUTLOOK_SET_TEMP_FOLDER, GHITcloSetOutlookTempFolder));
       rpcList.push_back(RpcChannelCallbackEntry(GHI_RPC_OUTLOOK_RESTORE_TEMP_FOLDER, GHITcloRestoreOutlookTempFolder));
-      rpcList.push_back(RpcChannelCallbackEntry(GHI_RPC_TRASH_FOLDER_ACTION, GHITcloTrashFolderAction));
-      rpcList.push_back(RpcChannelCallbackEntry(GHI_RPC_TRASH_FOLDER_GET_ICON, GHITcloTrashFolderGetIcon));
       rpcList.push_back(RpcChannelCallbackEntry(GHI_RPC_TRAY_ICON_SEND_EVENT, GHITcloTrayIconSendEvent));
       rpcList.push_back(RpcChannelCallbackEntry(GHI_RPC_TRAY_ICON_START_UPDATES, GHITcloTrayIconStartUpdates));
       rpcList.push_back(RpcChannelCallbackEntry(GHI_RPC_TRAY_ICON_STOP_UPDATES, GHITcloTrayIconStopUpdates));