Andrey Korotaev <unC0Rr@inbox.ru>

- Fix inverted logic in fs recognizer, and some comment fixes.
See issue #2325 for more details.

svn path=/trunk/; revision=30615
This commit is contained in:
Aleksey Bragin 2007-11-21 09:18:32 +00:00
parent 4f69fa75ae
commit fb08021b40

View file

@ -24,8 +24,8 @@ FsRecIsNtfsVolume(IN PPACKED_BOOT_SECTOR BootSector,
PAGED_CODE(); PAGED_CODE();
BOOLEAN Result; BOOLEAN Result;
/* Assume success */ /* Assume failure */
Result = TRUE; Result = FALSE;
if ((BootSector->Oem[0] == 'N') && if ((BootSector->Oem[0] == 'N') &&
(BootSector->Oem[1] == 'T') && (BootSector->Oem[1] == 'T') &&
@ -36,8 +36,8 @@ FsRecIsNtfsVolume(IN PPACKED_BOOT_SECTOR BootSector,
(BootSector->Oem[6] == ' ') && (BootSector->Oem[6] == ' ') &&
(BootSector->Oem[7] == ' ')) (BootSector->Oem[7] == ' '))
{ {
/* Fail */ /* Success */
Result = FALSE; Result = TRUE;
} }
/* Return the result */ /* Return the result */
@ -84,7 +84,7 @@ FsRecNtfsFsControl(IN PDEVICE_OBJECT DeviceObject,
(PVOID)&Bpb, (PVOID)&Bpb,
NULL)) NULL))
{ {
/* Check if it's an actual FAT volume */ /* Check if it's an actual NTFS volume */
if (FsRecIsNtfsVolume(Bpb, SectorSize, &SectorCount)) if (FsRecIsNtfsVolume(Bpb, SectorSize, &SectorCount))
{ {
/* It is! */ /* It is! */
@ -98,7 +98,7 @@ FsRecNtfsFsControl(IN PDEVICE_OBJECT DeviceObject,
(PVOID)&Bpb, (PVOID)&Bpb,
NULL)) NULL))
{ {
/* Check if it's an actual FAT volume */ /* Check if it's an actual NTFS volume */
if (FsRecIsNtfsVolume(Bpb, SectorSize, &SectorCount)) if (FsRecIsNtfsVolume(Bpb, SectorSize, &SectorCount))
{ {
/* It is! */ /* It is! */
@ -112,7 +112,7 @@ FsRecNtfsFsControl(IN PDEVICE_OBJECT DeviceObject,
(PVOID)&Bpb, (PVOID)&Bpb,
NULL)) NULL))
{ {
/* Check if it's an actual FAT volume */ /* Check if it's an actual NTFS volume */
if (FsRecIsNtfsVolume(Bpb, SectorSize, &SectorCount)) if (FsRecIsNtfsVolume(Bpb, SectorSize, &SectorCount))
{ {
/* It is! */ /* It is! */