. constify ToolsAppCapability::name.
. skip files that don't end with the platform's shared library extension
when loading plugins
. compile with "-subsystem:windows" on Win32; to allow logging to a
console, add new command line flag that attaches to the parent's
console and redirects standard output streams.
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
* For old-style, the capability name. The RPC message for setting the
* capability will be "tools.capability.[name]". Ignored for TOOLS_CAP_NEW.
*/
- gchar *name;
+ const gchar *name;
/**
* The capability entry in the enum defined in guestCaps.h.
* Used only for TOOLS_CAP_NEW.
N_("Uninstalls the service from the Service Control Manager."), NULL },
{ "displayname", 'd', 0, G_OPTION_ARG_STRING, &state->displayName,
N_("Service display name (only used with -i)."), N_("name") },
+ { "console", '\0', 0, G_OPTION_ARG_NONE, &state->useConsole,
+ N_("Use the parent process's console window."), NULL },
#else
{ "background", 'b', 0, G_OPTION_ARG_FILENAME, &state->pidFile,
N_("Runs in the background and creates a pid file."), N_("pidfile") },
*/
#if defined(_WIN32)
-# define MODULE_NAME(x) #x ".dll"
-#elif defined(__APPLE__)
-# define MODULE_NAME(x) "lib" #x ".dylib"
+# define MODULE_NAME(x) #x G_MODULE_SUFFIX
#else
-# define MODULE_NAME(x) "lib" #x ".so"
+# define MODULE_NAME(x) "lib" #x G_MODULE_SUFFIX
#endif
#include <stdlib.h>
* regardless of how the filesystem returns entries.
*/
while ((staticEntry = g_dir_read_name(dir)) != NULL) {
- g_ptr_array_add(plugins, g_strdup(staticEntry));
+ if (g_str_has_suffix(staticEntry, "." G_MODULE_SUFFIX)) {
+ g_ptr_array_add(plugins, g_strdup(staticEntry));
+ }
}
g_dir_close(dir);
# define DUMP_STATE_EVENT_NAME_FMT L"Global\\VMwareToolsDumpStateEvent_%s"
#endif
+/* On Mac OS, G_MODULE_SUFFIX seems to be defined to "so"... */
+#if defined(__APPLE__)
+# if defined(G_MODULE_SUFFIX)
+# undef G_MODULE_SUFFIX
+# endif
+# define G_MODULE_SUFFIX "dylib"
+#endif
+
/** Defines the internal data about a plugin. */
typedef struct ToolsPlugin {
GModule *module;
gchar *pluginPath;
GPtrArray *plugins;
#if defined(_WIN32)
+ gboolean useConsole;
gchar *displayName;
#else
gchar *pidFile;