[ros-diffs] [pschweitzer] 37253: Simplified the FsRtlIsFatDbcsLegal, FsRtlIsHpfsDbcsLegal functions using the previous macros. This removes a name parse.

pschweitzer at svn.reactos.org pschweitzer at svn.reactos.org
Sat Nov 8 19:36:23 CET 2008


Author: pschweitzer
Date: Sat Nov  8 12:36:22 2008
New Revision: 37253

URL: http://svn.reactos.org/svn/reactos?rev=37253&view=rev
Log:
Simplified the FsRtlIsFatDbcsLegal, FsRtlIsHpfsDbcsLegal functions using the previous macros. This removes a name parse.

Modified:
    branches/pierre-fsd/ntoskrnl/fsrtl/dbcsname.c

Modified: branches/pierre-fsd/ntoskrnl/fsrtl/dbcsname.c
URL: http://svn.reactos.org/svn/reactos/branches/pierre-fsd/ntoskrnl/fsrtl/dbcsname.c?rev=37253&r1=37252&r2=37253&view=diff
==============================================================================
--- branches/pierre-fsd/ntoskrnl/fsrtl/dbcsname.c [iso-8859-1] (original)
+++ branches/pierre-fsd/ntoskrnl/fsrtl/dbcsname.c [iso-8859-1] Sat Nov  8 12:36:22 2008
@@ -285,12 +285,7 @@
         if (FirstPart.Length < 3 || FirstPart.Length > 12)
             return FALSE;
 
-        if (!WildCardsPermissible && FsRtlDoesDbcsContainWildCards(&FirstPart))
-            return FALSE;
-
-        /* Now, we will parse the filename to find everything bad in
-         * It mustn't contain:
-         *   0x00-0x1F, 0x22, 0x2B, 0x2C, 0x2F, 0x3A, 0x3B, 0x3D, 0x5B, 0x5D, 0x7C */
+        /* Now, we will parse the filename to find everything bad in */
         for (i = 0; i < FirstPart.Length; i++)
         {
             /* First make sure the character it's not the Lead DBCS */
@@ -300,12 +295,8 @@
                     return FALSE;
                 i++;
             }
-            else if ((FirstPart.Buffer[i] < 0x1F) || (FirstPart.Buffer[i] == 0x22) ||
-                     (FirstPart.Buffer[i] == 0x2B) || (FirstPart.Buffer[i] == 0x2C) ||
-                     (FirstPart.Buffer[i] == 0x2F) || (FirstPart.Buffer[i] == 0x3A) ||
-                     (FirstPart.Buffer[i] == 0x3B) || (FirstPart.Buffer[i] == 0x3D) ||
-                     (FirstPart.Buffer[i] == 0x5B) || (FirstPart.Buffer[i] == 0x5D) ||
-                     (FirstPart.Buffer[i] == 0x7C))
+            /* Then check for bad characters */
+            else if (!FsRtlIsAnsiCharacterLegalFat(FirstPart.Buffer[i], WildCardsPermissible))
             {
                 return FALSE;
             }
@@ -427,12 +418,7 @@
         if (FirstPart.Length > 255)
             return FALSE;
 
-        if (!WildCardsPermissible && FsRtlDoesDbcsContainWildCards(&FirstPart))
-            return FALSE;
-
-        /* Now, we will parse the filename to find everything bad in
-         * It mustn't contain:
-         *   0x00-0x1F, 0x22, 0x2A, 0x2F, 0x3A, 0x3C, 0x3E, 0x3F, 0x7C */
+        /* Now, we will parse the filename to find everything bad in */
         for (i = 0; i < FirstPart.Length; i++)
         {
             /* First make sure the character it's not the Lead DBCS */
@@ -442,11 +428,8 @@
                     return FALSE;
                 i++;
             }
-            else if ((FirstPart.Buffer[i] < 0x1F) || (FirstPart.Buffer[i] == 0x22) ||
-                     (FirstPart.Buffer[i] == 0x2A) || (FirstPart.Buffer[i] == 0x2F) ||
-                     (FirstPart.Buffer[i] == 0x3A) || (FirstPart.Buffer[i] == 0x3C) ||
-                     (FirstPart.Buffer[i] == 0x3E) || (FirstPart.Buffer[i] == 0x3F) ||
-                     (FirstPart.Buffer[i] == 0x7C))
+            /* Then check for bad characters */
+            else if (!!FsRtlIsAnsiCharacterLegalHpfs(FirstPart.Buffer[i], WildCardsPermissible))
             {
                 return FALSE;
             }



More information about the Ros-diffs mailing list