[NTOSKRNL]
authorPierre Schweitzer <pierre@reactos.org>
Sat, 19 Feb 2011 13:58:55 +0000 (13:58 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 19 Feb 2011 13:58:55 +0000 (13:58 +0000)
- No need to use ULONG when dealing with strings, USHORT is enough. This makes MSVC warnings silent.
- Fix a really nasty bug in FsRtlIsHpfsDbcsLegal()

svn path=/trunk/; revision=50817

reactos/ntoskrnl/fsrtl/dbcsname.c
reactos/ntoskrnl/fsrtl/name.c

index 9311cae..d99fa19 100644 (file)
@@ -46,8 +46,8 @@ FsRtlDissectDbcs(IN ANSI_STRING Name,
                  OUT PANSI_STRING FirstPart,
                  OUT PANSI_STRING RemainingPart)
 {
                  OUT PANSI_STRING FirstPart,
                  OUT PANSI_STRING RemainingPart)
 {
-    ULONG FirstPosition, i;
-    ULONG SkipFirstSlash = 0;
+    USHORT FirstPosition, i;
+    USHORT SkipFirstSlash = 0;
     PAGED_CODE();
 
     /* Zero the strings before continuing */
     PAGED_CODE();
 
     /* Zero the strings before continuing */
@@ -116,7 +116,7 @@ BOOLEAN
 NTAPI
 FsRtlDoesDbcsContainWildCards(IN PANSI_STRING Name)
 {
 NTAPI
 FsRtlDoesDbcsContainWildCards(IN PANSI_STRING Name)
 {
-    ULONG i;
+    USHORT i;
     PAGED_CODE();
 
     /* Check every character */
     PAGED_CODE();
 
     /* Check every character */
@@ -300,7 +300,7 @@ FsRtlIsFatDbcsLegal(IN ANSI_STRING DbcsName,
 {
     ANSI_STRING FirstPart, RemainingPart, Name;
     BOOLEAN LastDot;
 {
     ANSI_STRING FirstPart, RemainingPart, Name;
     BOOLEAN LastDot;
-    ULONG i;
+    USHORT i;
     PAGED_CODE();
 
     /* Just quit if the string is empty */
     PAGED_CODE();
 
     /* Just quit if the string is empty */
@@ -437,7 +437,7 @@ FsRtlIsHpfsDbcsLegal(IN ANSI_STRING DbcsName,
                      IN BOOLEAN LeadingBackslashPermissible)
 {
     ANSI_STRING FirstPart, RemainingPart, Name;
                      IN BOOLEAN LeadingBackslashPermissible)
 {
     ANSI_STRING FirstPart, RemainingPart, Name;
-    ULONG i;
+    USHORT i;
     PAGED_CODE();
 
     /* Just quit if the string is empty */
     PAGED_CODE();
 
     /* Just quit if the string is empty */
@@ -490,7 +490,7 @@ FsRtlIsHpfsDbcsLegal(IN ANSI_STRING DbcsName,
                 i++;
             }
             /* Then check for bad characters */
                 i++;
             }
             /* Then check for bad characters */
-            else if (!!FsRtlIsAnsiCharacterLegalHpfs(FirstPart.Buffer[i], WildCardsPermissible))
+            else if (!FsRtlIsAnsiCharacterLegalHpfs(FirstPart.Buffer[i], WildCardsPermissible))
             {
                 return FALSE;
             }
             {
                 return FALSE;
             }
index 8868ecc..29f6e90 100644 (file)
@@ -163,7 +163,7 @@ FsRtlAreNamesEqual(IN PCUNICODE_STRING Name1,
     UNICODE_STRING UpcaseName1;
     UNICODE_STRING UpcaseName2;
     BOOLEAN StringsAreEqual, MemoryAllocated = FALSE;
     UNICODE_STRING UpcaseName1;
     UNICODE_STRING UpcaseName2;
     BOOLEAN StringsAreEqual, MemoryAllocated = FALSE;
-    ULONG i;
+    USHORT i;
     NTSTATUS Status;
     PAGED_CODE();
 
     NTSTATUS Status;
     PAGED_CODE();
 
@@ -255,8 +255,8 @@ FsRtlDissectName(IN UNICODE_STRING Name,
                  OUT PUNICODE_STRING FirstPart,
                  OUT PUNICODE_STRING RemainingPart)
 {
                  OUT PUNICODE_STRING FirstPart,
                  OUT PUNICODE_STRING RemainingPart)
 {
-    ULONG FirstPosition, i;
-    ULONG SkipFirstSlash = 0;
+    USHORT FirstPosition, i;
+    USHORT SkipFirstSlash = 0;
     PAGED_CODE();
 
     /* Zero the strings before continuing */
     PAGED_CODE();
 
     /* Zero the strings before continuing */