mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[KMTESTS:IO] Remove ReactOS-specific workaround in IoVolume test
ReactOS is now more compatible, and names volume devices as "\Device\HarddiskVolume%u"
This commit is contained in:
parent
8da0f868c5
commit
784725143e
1 changed files with 6 additions and 47 deletions
|
@ -7,47 +7,6 @@
|
|||
|
||||
#include <kmt_test.h>
|
||||
|
||||
static
|
||||
NTSTATUS
|
||||
GetNextVolumeDevice(
|
||||
_Inout_ PUNICODE_STRING VolumeDeviceName,
|
||||
_Inout_ PULONG VolumeNumber,
|
||||
_In_ NTSTATUS PreviousStatus)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
|
||||
#ifndef __REACTOS__
|
||||
*VolumeNumber++;
|
||||
Status = RtlStringCbPrintfW(VolumeDeviceName->Buffer,
|
||||
VolumeDeviceName->MaximumLength,
|
||||
L"\\Device\\HarddiskVolume%lu",
|
||||
*VolumeNumber);
|
||||
#else
|
||||
/* ROS's storage stack is old an broken, we don't have HarddiskVolumeN */
|
||||
ULONG DiskNumber, PartitionNumber;
|
||||
DiskNumber = *VolumeNumber >> 16;
|
||||
PartitionNumber = *VolumeNumber & 0xffff;
|
||||
if (!NT_SUCCESS(PreviousStatus))
|
||||
{
|
||||
if (PartitionNumber == 1)
|
||||
{
|
||||
/* Looks like this disk doesn't exist (or has no partitions),
|
||||
* so we're done */
|
||||
return STATUS_NO_MORE_ENTRIES;
|
||||
}
|
||||
DiskNumber++;
|
||||
PartitionNumber = 0;
|
||||
}
|
||||
PartitionNumber++;
|
||||
Status = RtlStringCbPrintfW(VolumeDeviceName->Buffer,
|
||||
VolumeDeviceName->MaximumLength,
|
||||
L"\\Device\\Harddisk%lu\\Partition%lu",
|
||||
DiskNumber,
|
||||
PartitionNumber);
|
||||
*VolumeNumber = DiskNumber << 16 | PartitionNumber;
|
||||
#endif
|
||||
return Status;
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
|
@ -66,15 +25,16 @@ TestIoVolumeDeviceToDosName(void)
|
|||
VolumeDeviceNameBuffer,
|
||||
sizeof(VolumeDeviceNameBuffer));
|
||||
VolumeNumber = 0;
|
||||
Status = STATUS_SUCCESS;
|
||||
while (1)
|
||||
{
|
||||
Status = GetNextVolumeDevice(&VolumeDeviceName,
|
||||
&VolumeNumber,
|
||||
Status);
|
||||
VolumeNumber++;
|
||||
Status = RtlStringCbPrintfW(VolumeDeviceName.Buffer,
|
||||
VolumeDeviceName.MaximumLength,
|
||||
L"\\Device\\HarddiskVolume%lu",
|
||||
VolumeNumber);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
trace("GetNextVolumeDevice(0x%lx) failed with %lx\n",
|
||||
trace("RtlStringCbPrintfW(0x%lx) failed with %lx\n",
|
||||
VolumeNumber, Status);
|
||||
break;
|
||||
}
|
||||
|
@ -111,7 +71,6 @@ TestIoVolumeDeviceToDosName(void)
|
|||
RtlFreeUnicodeString(&DosName);
|
||||
}
|
||||
ObDereferenceObject(FileObject);
|
||||
Status = STATUS_SUCCESS;
|
||||
}
|
||||
ok(VolumeNumber > 1, "No volumes found\n");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue