From: VMware, Inc <> Date: Mon, 26 Jul 2010 18:38:01 +0000 (-0700) Subject: Merge vixUser plugin changes from private branch. X-Git-Tag: 2010.07.25-280253~71 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f08c27bb30e4b44bfbbff182d5cf7706985ada7e;p=thirdparty%2Fopen-vm-tools.git Merge vixUser plugin changes from private branch. . vixUser plugin: remove lib/printer + minor cleanups to makefile. . Remove SetPrinter functionality from vixUser plugin. Code was removed from foundryToolsDaemon.c in change 957688. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/services/plugins/vixUser/vixUser.c b/open-vm-tools/services/plugins/vixUser/vixUser.c index 40821ac63..24f7e092a 100644 --- a/open-vm-tools/services/plugins/vixUser/vixUser.c +++ b/open-vm-tools/services/plugins/vixUser/vixUser.c @@ -33,7 +33,6 @@ #include "str.h" #include "strutil.h" #include "vixCommands.h" -#include "vixTools.h" #include "util.h" #include "vmware/tools/plugin.h" #include "vmware/tools/utils.h" @@ -221,103 +220,6 @@ abort: } -/** - * Handles the command to set the printer on the guest. - * - * XXX: This code is copied from foundryToolsDaemon.c. The original code - * should be cleaned up when the old service code is phased out. - * - * @param[in] data RPC request data. - * - * @return TRUE on success, FALSE on failure. - */ - -static gboolean -VixUserSetPrinter(RpcInData *data) -{ - static char resultBuffer[DEFAULT_RESULT_MSG_MAX_LENGTH]; -#if defined(_WIN32) - VixError err = VIX_OK; - char *printerName = NULL; - char *defaultString = NULL; - int defaultInt; - DWORD sysError = ERROR_SUCCESS; - g_debug(">ToolsDaemonTcloSetPrinter\n"); - - /* - * Parse the arguments - */ - printerName = ToolsDaemonTcloGetQuotedString(data->args, &data->args); - defaultString = ToolsDaemonTcloGetQuotedString(data->args, &data->args); - - /* - * Validate the arguments. - */ - if ((NULL == printerName) || (NULL == defaultString)) { - err = VIX_E_INVALID_ARG; - g_debug("Failed to get string args\n"); - goto abort; - } - - if (!StrUtil_StrToInt(&defaultInt, defaultString)) { - err = VIX_E_INVALID_ARG; - g_debug("Failed to convert int arg\n"); - goto abort; - } - - g_debug("Setting printer to: \"%s\", %ssetting as default\n", - printerName, (defaultInt != 0) ? "" : "not "); - - /* Actually set the printer. */ - if (!Printer_AddConnection(printerName, &sysError)) { - err = VIX_E_FAIL; - g_debug("Failed to add printer %s : %d %s\n", printerName, sysError, - Err_Errno2String(sysError)); - goto abort; - } - - /* Set this printer as the default if requested. */ - if (defaultInt != 0) { - if (!Win32U_SetDefaultPrinter(printerName)) { - /* - * We couldn't set this printer as default. Oh well. We'll - * still report success or failure based purely on whether - * the actual printer add succeeded or not. - */ - g_debug("Unable to set \"%s\" as the default printer\n", - printerName); - } - } - -abort: - /* - * All Foundry tools commands return results that start with a - * foundry error and a guest-OS-specific error. - */ - Str_Sprintf(resultBuffer, sizeof resultBuffer, "%"FMT64"d %d", err, sysError); - RPCIN_SETRETVALS(data, resultBuffer, TRUE); - - /* - * These were allocated by ToolsDaemonTcloGetQuotedString. - */ - free(printerName); - free(defaultString); - - g_debug("