mirror of
https://github.com/reactos/reactos.git
synced 2025-06-02 07:56:16 +00:00
[USETUP] Some fixes/improvements suggested by Thomas (2/2).
- In the partlist.c disk getters: Remove useless "IsListEmpty(&List->DiskListHead)" checks, because this is actually the kind of check the while() loop does just after... - Fix few DPRINTs. svn path=/branches/setup_improvements/; revision=74629
This commit is contained in:
parent
f88d029c9d
commit
c434a5ab21
2 changed files with 5 additions and 32 deletions
|
@ -1352,10 +1352,6 @@ GetDiskByBiosNumber(
|
||||||
PDISKENTRY DiskEntry;
|
PDISKENTRY DiskEntry;
|
||||||
PLIST_ENTRY Entry;
|
PLIST_ENTRY Entry;
|
||||||
|
|
||||||
/* Check for empty disks */
|
|
||||||
if (IsListEmpty(&List->DiskListHead))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
/* Loop over the disks and find the correct one */
|
/* Loop over the disks and find the correct one */
|
||||||
Entry = List->DiskListHead.Flink;
|
Entry = List->DiskListHead.Flink;
|
||||||
while (Entry != &List->DiskListHead)
|
while (Entry != &List->DiskListHead)
|
||||||
|
@ -1382,10 +1378,6 @@ GetDiskByNumber(
|
||||||
PDISKENTRY DiskEntry;
|
PDISKENTRY DiskEntry;
|
||||||
PLIST_ENTRY Entry;
|
PLIST_ENTRY Entry;
|
||||||
|
|
||||||
/* Check for empty disks */
|
|
||||||
if (IsListEmpty(&List->DiskListHead))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
/* Loop over the disks and find the correct one */
|
/* Loop over the disks and find the correct one */
|
||||||
Entry = List->DiskListHead.Flink;
|
Entry = List->DiskListHead.Flink;
|
||||||
while (Entry != &List->DiskListHead)
|
while (Entry != &List->DiskListHead)
|
||||||
|
@ -1414,10 +1406,6 @@ GetDiskBySCSI(
|
||||||
PDISKENTRY DiskEntry;
|
PDISKENTRY DiskEntry;
|
||||||
PLIST_ENTRY Entry;
|
PLIST_ENTRY Entry;
|
||||||
|
|
||||||
/* Check for empty disks */
|
|
||||||
if (IsListEmpty(&List->DiskListHead))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
/* Loop over the disks and find the correct one */
|
/* Loop over the disks and find the correct one */
|
||||||
Entry = List->DiskListHead.Flink;
|
Entry = List->DiskListHead.Flink;
|
||||||
while (Entry != &List->DiskListHead)
|
while (Entry != &List->DiskListHead)
|
||||||
|
@ -1446,10 +1434,6 @@ GetDiskBySignature(
|
||||||
PDISKENTRY DiskEntry;
|
PDISKENTRY DiskEntry;
|
||||||
PLIST_ENTRY Entry;
|
PLIST_ENTRY Entry;
|
||||||
|
|
||||||
/* Check for empty disks */
|
|
||||||
if (IsListEmpty(&List->DiskListHead))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
/* Loop over the disks and find the correct one */
|
/* Loop over the disks and find the correct one */
|
||||||
Entry = List->DiskListHead.Flink;
|
Entry = List->DiskListHead.Flink;
|
||||||
while (Entry != &List->DiskListHead)
|
while (Entry != &List->DiskListHead)
|
||||||
|
|
|
@ -679,12 +679,7 @@ NtPathToDiskPartComponents(
|
||||||
DiskNumber = wcstoul(Path, (PWSTR*)&Path, 10);
|
DiskNumber = wcstoul(Path, (PWSTR*)&Path, 10);
|
||||||
|
|
||||||
/* Either NULL termination, or a path separator must be present now */
|
/* Either NULL termination, or a path separator must be present now */
|
||||||
if (!Path)
|
if (*Path && *Path != OBJ_NAME_PATH_SEPARATOR)
|
||||||
{
|
|
||||||
DPRINT1("An error happened!\n");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
else if (*Path && *Path != OBJ_NAME_PATH_SEPARATOR)
|
|
||||||
{
|
{
|
||||||
DPRINT1("'%S' : expected a path separator!\n", Path);
|
DPRINT1("'%S' : expected a path separator!\n", Path);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -717,13 +712,7 @@ NtPathToDiskPartComponents(
|
||||||
PartNumber = wcstoul(Path, (PWSTR*)&Path, 10);
|
PartNumber = wcstoul(Path, (PWSTR*)&Path, 10);
|
||||||
|
|
||||||
/* Either NULL termination, or a path separator must be present now */
|
/* Either NULL termination, or a path separator must be present now */
|
||||||
if (!Path)
|
if (*Path && *Path != OBJ_NAME_PATH_SEPARATOR)
|
||||||
{
|
|
||||||
/* We fail here because wcstoul failed for whatever reason */
|
|
||||||
DPRINT1("An error happened!\n");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
else if (*Path && *Path != OBJ_NAME_PATH_SEPARATOR)
|
|
||||||
{
|
{
|
||||||
/* We shouldn't fail here because it just means this part of path is actually not a partition specifier. Or should we? */
|
/* We shouldn't fail here because it just means this part of path is actually not a partition specifier. Or should we? */
|
||||||
DPRINT1("'%S' : expected a path separator!\n", Path);
|
DPRINT1("'%S' : expected a path separator!\n", Path);
|
||||||
|
@ -788,7 +777,7 @@ OpenAndMapFile(
|
||||||
FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE);
|
FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to open file %wZ, Status 0x%08lx\n", &Name, Status);
|
DPRINT1("Failed to open file '%wZ', Status 0x%08lx\n", &Name, Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -810,7 +799,7 @@ OpenAndMapFile(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FileInfo.EndOfFile.HighPart != 0)
|
if (FileInfo.EndOfFile.HighPart != 0)
|
||||||
DPRINT1("WARNING!! The file %wZ is too large!\n", Name);
|
DPRINT1("WARNING!! The file '%wZ' is too large!\n", &Name);
|
||||||
|
|
||||||
*FileSize = FileInfo.EndOfFile.LowPart;
|
*FileSize = FileInfo.EndOfFile.LowPart;
|
||||||
|
|
||||||
|
@ -829,7 +818,7 @@ OpenAndMapFile(
|
||||||
*FileHandle);
|
*FileHandle);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to create a memory section for file %wZ, Status 0x%08lx\n", &Name, Status);
|
DPRINT1("Failed to create a memory section for file '%wZ', Status 0x%08lx\n", &Name, Status);
|
||||||
NtClose(*FileHandle);
|
NtClose(*FileHandle);
|
||||||
*FileHandle = NULL;
|
*FileHandle = NULL;
|
||||||
return Status;
|
return Status;
|
||||||
|
|
Loading…
Reference in a new issue