* Join the dirName and baseName together to create a (full) path.
*
* This code concatenates two strings together and omits a redundant
- * directory separator between the two. It does not treat a fully qualified
- * baseName the way one would expect:
+ * directory separator between the two.
*
+ * On Windows, the 'baseName' argument may not be a fully qualified path.
+ * That is, it may not be an absolute path containing a drive letter nor
+ * may it be a UNC path.
+ *
+ * Examples:
* File_PathJoin("", "b") -> "/b"
* File_PathJoin("/", "b") -> "/b"
* File_PathJoin("a", "b") -> "a/b"
* File_PathJoin("a/", "b") -> "a/b"
* File_PathJoin("a/////", "b") -> "a/b"
* File_PathJoin("a", "") -> "a/"
- * File_PathJoin("a", "/") -> "a/" (only posix)
- * File_PathJoin("a", "/b") -> "a/b" (only posix)
+ * File_PathJoin("a", "/") -> "a/"
+ * File_PathJoin("a", "/b") -> "a/b"
* File_PathJoin("a", "/////b") -> "a/b" (only posix)
- * File_PathJoin("a/", "/b") -> "a/b" (only posix)
+ * File_PathJoin("a/", "/b") -> "a/b"
* File_PathJoin("a/////", "/////b") -> "a/b" (only posix)
*
* Results:
Unicode
File_PathJoin(ConstUnicode dirName, // IN:
- ConstUnicode baseName) // IN:
+ ConstUnicode baseName) // IN: See above.
{
Unicode result;
Unicode newDir = NULL;
ASSERT(dirName);
ASSERT(baseName);
-#if defined(_WIN32)
- ASSERT(!Unicode_StartsWith(baseName, DIRSEPS));
- ASSERT(!Unicode_StartsWith(baseName, "/"));
- ASSERT(Unicode_LengthInCodePoints(baseName) < 2 ||
- Unicode_FindSubstrInRange(baseName, 1, 1, ":", 0, 1) ==
- UNICODE_INDEX_NOT_FOUND);
-#else
/*
* Remove ALL directory separators from baseName begin.
*/
- while(Unicode_StartsWith(baseName, DIRSEPS)) {
+#if defined(_WIN32)
+ {
+ ConstUnicode oldBaseName = baseName;
+
+ /*
+ * Reject drive letters in baseName.
+ */
+ ASSERT(Unicode_LengthInCodePoints(baseName) < 2 ||
+ Unicode_FindSubstrInRange(baseName, 1, 1, ":", 0, 1) ==
+ UNICODE_INDEX_NOT_FOUND);
+
+ while (*baseName == '/' || *baseName == '\\') {
+ baseName++;
+ }
+
+ /*
+ * Reject UNC paths for baseName.
+ */
+ ASSERT(baseName - oldBaseName < 2);
+ }
+#else
+ while (*baseName == '/') {
baseName++;
}
#endif
*
* VMRC is versioned x.y.z - ProgID is intentionally built using only x.y
*/
-#define PRODUCT_VMRC_PLUGIN_GUID_EMBEDDED 6FB1850B-AC2A-4AEA-9847-EBCE6AB2A62E
-#define PRODUCT_VMRC_PLUGIN_GUID_TYPELIB EF9A6976-4861-49B5-AFED-05281B5887C5
+#define PRODUCT_VMRC_PLUGIN_GUID_EMBEDDED 4AEA1010-0A0C-405E-9B74-767FC8A998CB
+#define PRODUCT_VMRC_PLUGIN_GUID_TYPELIB E82F3B76-A628-4486-B197-03780F86063A
#define PRODUCT_VMRC_PLUGIN_PROGID_EMBEDDED_BASE "VMware.RemoteConsole"
#define PRODUCT_VMRC_PLUGIN_PROGID_EMBEDDED PRODUCT_VMRC_PLUGIN_PROGID_EMBEDDED_BASE "." \
XSTR(VMRC_PLUGIN_VERSION_BASE)
#endif
#define PRODUCT_VMRC_PLUGIN_CURRENT_MIMETYPE \
- "application/x-vmware-remote-console"
-
-/*
- * legacy plugin mimetypes (currently unused but here for reference)
- */
-#define PRODUCT_VMRC_PLUGIN_LEGACY_MIMETYPES \
- "application/x-vmware-vmrc;version=2.5.0.199067" PRODUCT_VMRC_MIMETYPE_SEPARATOR \
- "application/x-vmware-vmrc;version=2.5.0.158248" PRODUCT_VMRC_MIMETYPE_SEPARATOR \
- "application/x-vmware-vmrc;version=2.5.0.116460" PRODUCT_VMRC_MIMETYPE_SEPARATOR \
- "application/x-vmware-vmrc;version=2.5.0.0" PRODUCT_VMRC_MIMETYPE_SEPARATOR \
- "application/x-vmware-mks;version=2.1.0.0" PRODUCT_VMRC_MIMETYPE_SEPARATOR \
- "application/x-vmware-mks;version=2.0.1.0" PRODUCT_VMRC_MIMETYPE_SEPARATOR \
- "application/x-vmware-mks;version=2.0.0.0" PRODUCT_VMRC_MIMETYPE_SEPARATOR
+ "application/x-vmware-remote-console-2012"
/*
* All supported plugin mimetypes
// See the VMRC_PLUGIN_VERSION section in /mk/defs-onetime.mk
#define VMRC_PLUGIN_VERSION_MAJOR 5
-#define VMRC_PLUGIN_VERSION_MINOR 0
+#define VMRC_PLUGIN_VERSION_MINOR 1
#define VMRC_PLUGIN_VERSION_Z 0
/*
* #define VMRC_PLUGIN_VERSION_NUMBER \
* XSTR(VMRC_PLUGIN_VERSION_MAJOR) "." XSTR(VMRC_PLUGIN_VERSION_MINOR) "." XSTR(VMRC_PLUGIN_VERSION_Z)
*/
-#define VMRC_PLUGIN_VERSION_NUMBER "5.0.0"
+#define VMRC_PLUGIN_VERSION_NUMBER "5.1.0"
/* this version number should always match real VMRC & plugin version number */
#define VMRC_VERSION VMRC_PLUGIN_VERSION_NUMBER
#ifdef _WIN32
-
-/*
- *-----------------------------------------------------------------------------
- *
- * utf::string::init_bstr_t --
- *
- * Utility function to construct from a _bstr_t object.
- * Copies the UTF-16 representation of the _bstr_t.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Makes a copy of the _bstr_t data and frees that data when
- * the utf::string is destroyed.
- *
- * Note:
- * WIN32 only call
- *
- *-----------------------------------------------------------------------------
- */
-
-void
-string::init_bstr_t(const _bstr_t &s) // IN
-{
- // If the input is empty, then there's nothing to do.
- if (s.length() == 0) {
- return;
- }
-
- Unicode utf8 = Unicode_AllocWithUTF16(static_cast<const utf16_t *>(s));
-
- try {
- mUstr = utf8;
- Unicode_Free(utf8);
- } catch (...) {
- Unicode_Free(utf8);
- throw;
- }
-
- ASSERT(Validate(mUstr));
-}
-
-
/*
*-----------------------------------------------------------------------------
*
mUtf16Cache(NULL),
mUtf16Length(npos)
{
- init_bstr_t(s);
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * utf::string::string --
- *
- * Constructor from a uvariant_t object. Copies the UTF-16 representation
- * of the ubstr_t interface.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Makes a copy of the uvariant_t data and frees that data when the
- * utf::string is destroyed.
- *
- * Note:
- * WIN32 only call
- *
- *-----------------------------------------------------------------------------
- */
-
-string::string(const uvariant_t &v) // IN
- : mUstr(),
- mUtf16Cache(NULL),
- mUtf16Length(npos)
-{
- ubstr_t s;
-
- try {
- s = v;
- } catch (...) {
- Warning("Invalid uvariant_t to ubstr_t conversion.\n");
- throw;
- }
-
// If the input is empty, then there's nothing to do.
if (s.length() == 0) {
return;
}
- mUstr = static_cast<const char *>(s);
- ASSERT(Validate(mUstr));
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * utf::string::string --
- *
- * Constructor from a _variant_t object. Copies the UTF-16 representation
- * of the _variant_t.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Makes a copy of the _variant_t data and frees that data when
- * the utf::string is destroyed.
- *
- * Note:
- * WIN32 only call
- *
- *-----------------------------------------------------------------------------
- */
-
-string::string(const _variant_t &v) // IN
- : mUstr(),
- mUtf16Cache(NULL),
- mUtf16Length(npos)
-{
- _bstr_t s;
+ Unicode utf8 = Unicode_AllocWithUTF16(static_cast<const utf16_t *>(s));
try {
- s = v;
+ mUstr = utf8;
+ Unicode_Free(utf8);
} catch (...) {
- Warning("Invalid _variant_t to _bstr_t conversion.\n");
+ Unicode_Free(utf8);
throw;
}
- init_bstr_t(s);
+ ASSERT(Validate(mUstr));
}
-
#endif
#ifdef _WIN32
string(const ubstr_t &s);
explicit string(const _bstr_t &s);
- string(const uvariant_t &v);
- explicit string(const _variant_t &v);
#endif
string(const utf16string &s);
// Cache accessors
const utf16_t *GetUtf16Cache() const;
-#ifdef _WIN32
- // Private utility constructor.
- void init_bstr_t(const _bstr_t &s);
-#endif
-
// utf::string is internally backed by Glib::ustring.
Glib::ustring mUstr;