mirror of
https://github.com/reactos/reactos.git
synced 2025-05-28 21:48:19 +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>
|
#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
|
static
|
||||||
void
|
void
|
||||||
|
@ -66,15 +25,16 @@ TestIoVolumeDeviceToDosName(void)
|
||||||
VolumeDeviceNameBuffer,
|
VolumeDeviceNameBuffer,
|
||||||
sizeof(VolumeDeviceNameBuffer));
|
sizeof(VolumeDeviceNameBuffer));
|
||||||
VolumeNumber = 0;
|
VolumeNumber = 0;
|
||||||
Status = STATUS_SUCCESS;
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
Status = GetNextVolumeDevice(&VolumeDeviceName,
|
VolumeNumber++;
|
||||||
&VolumeNumber,
|
Status = RtlStringCbPrintfW(VolumeDeviceName.Buffer,
|
||||||
Status);
|
VolumeDeviceName.MaximumLength,
|
||||||
|
L"\\Device\\HarddiskVolume%lu",
|
||||||
|
VolumeNumber);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
trace("GetNextVolumeDevice(0x%lx) failed with %lx\n",
|
trace("RtlStringCbPrintfW(0x%lx) failed with %lx\n",
|
||||||
VolumeNumber, Status);
|
VolumeNumber, Status);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -111,7 +71,6 @@ TestIoVolumeDeviceToDosName(void)
|
||||||
RtlFreeUnicodeString(&DosName);
|
RtlFreeUnicodeString(&DosName);
|
||||||
}
|
}
|
||||||
ObDereferenceObject(FileObject);
|
ObDereferenceObject(FileObject);
|
||||||
Status = STATUS_SUCCESS;
|
|
||||||
}
|
}
|
||||||
ok(VolumeNumber > 1, "No volumes found\n");
|
ok(VolumeNumber > 1, "No volumes found\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue