Index: /trunk/src/VBox/Runtime/common/filesystem/fatvfs.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/filesystem/fatvfs.cpp	(revision 66708)
+++ /trunk/src/VBox/Runtime/common/filesystem/fatvfs.cpp	(revision 66709)
@@ -394,5 +394,9 @@
 *   Global Variables                                                                                                             *
 *********************************************************************************************************************************/
-/** Codepage 437 translation table with invalid 8.3 characters marked as 0xffff.
+/**
+ * Codepage 437 translation table with invalid 8.3 characters marked as 0xffff or 0xfffe.
+ *
+ * The 0xfffe notation is used for characters that are valid in long file names but not short.
+ *
  * @remarks The valid first 128 entries are 1:1 with unicode.
  * @remarks Lower case characters are all marked invalid.
@@ -402,10 +406,10 @@
     0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
     0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
-    0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0xffff, 0xffff, 0xffff, 0x002d, 0xffff, 0xffff,
-    0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
+    0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0xffff, 0xfffe, 0xfffe, 0x002d, 0xfffe, 0xffff,
+    0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0xffff, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xffff,
     0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
-    0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0xffff, 0xffff, 0xffff, 0x005e, 0x005f,
-    0x0060, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
-    0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x007e, 0xffff,
+    0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0xfffe, 0xffff, 0xfffe, 0x005e, 0x005f,
+    0x0060, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe,
+    0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xffff, 0xffff, 0xffff, 0x007e, 0xffff,
     0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7, 0x00ea, 0x00eb, 0x00e8, 0x00ef, 0x00ee, 0x00ec, 0x00c4, 0x00c5,
     0x00c9, 0x00e6, 0x00c6, 0x00f4, 0x00f6, 0x00f2, 0x00fb, 0x00f9, 0x00ff, 0x00d6, 0x00dc, 0x00a2, 0x00a3, 0x00a5, 0x20a7, 0x0192,
@@ -2644,8 +2648,30 @@
 static int rtFsFatDir_ValidateLongName(PCRTUTF16 pwszEntry, size_t cwc)
 {
+    /* Length limitation. */
     if (cwc <= RTFSFAT_MAX_LFN_CHARS)
     {
-        RT_NOREF(pwszEntry);
-        /** @todo check for invalid characters. */
+        /* Character set limitations. */
+        for (size_t off = 0; off < cwc; off++)
+        {
+            RTUTF16 wc = pwszEntry[off];
+            if (wc < 128)
+            {
+                if (g_awchFatCp437Chars[wc] <= UINT16_C(0xfffe))
+                { /* likely */ }
+                else
+                    return VERR_INVALID_NAME;
+            }
+        }
+
+        /* Name limitations. */
+        if (   cwc == 1
+            && pwszEntry[0] == '.')
+            return VERR_INVALID_NAME;
+        if (   cwc == 2
+            && pwszEntry[0] == '.'
+            && pwszEntry[1] == '.')
+            return VERR_INVALID_NAME;
+
+        /** @todo Check for more invalid names, also in the 8.3 case! */
         return VINF_SUCCESS;
     }
@@ -2654,4 +2680,7 @@
 
 
+/**
+ * Worker for rtFsFatDir_GenerateShortName.
+ */
 static void rtFsFatDir_CopyShortName(char *pszDst, uint32_t cchDst, const char *pszSrc, size_t cchSrc, char chPad)
 {
@@ -3155,6 +3184,4 @@
         }
     }
-    else
-        rc = VERR_NET_NOT_UNIQUE_NAME;
     return rc;
 }
