14{
17 WCHAR VolumeDeviceNameBuffer[32];
23
24 RtlInitEmptyUnicodeString(&VolumeDeviceName,
25 VolumeDeviceNameBuffer,
26 sizeof(VolumeDeviceNameBuffer));
27 VolumeNumber = 0;
28 while (1)
29 {
30 VolumeNumber++;
33 L"\\Device\\HarddiskVolume%lu",
34 VolumeNumber);
36 {
37 trace(
"RtlStringCbPrintfW(0x%lx) failed with %lx\n",
39 break;
40 }
41
48 {
49 trace(
"IoGetDeviceObjectPointer(%wZ) failed with %lx\n",
50 &VolumeDeviceName,
Status);
51 continue;
52 }
53
57 {
58 trace(
"DOS name for %wZ is %wZ\n", &VolumeDeviceName, &
DosName);
60 {
64 "Unexpected drive letter: %wZ\n", &
DosName);
65 }
66 else
67 {
69 "Unexpected volume path: %wZ\n", &
DosName);
70 }
72 }
74 }
75 ok(VolumeNumber > 1,
"No volumes found\n");
76}
#define ok_eq_hex(value, expected)
#define NT_SUCCESS(StatCode)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSYSAPI BOOLEAN NTAPI RtlPrefixUnicodeString(IN PUNICODE_STRING String1, IN PUNICODE_STRING String2, IN BOOLEAN CaseInSensitive)
NTSTATUS NTAPI IoGetDeviceObjectPointer(IN PUNICODE_STRING ObjectName, IN ACCESS_MASK DesiredAccess, OUT PFILE_OBJECT *FileObject, OUT PDEVICE_OBJECT *DeviceObject)
NTSTATUS NTAPI IoVolumeDeviceToDosName(IN PVOID VolumeDeviceObject, OUT PUNICODE_STRING DosName)
NTSTRSAFEVAPI RtlStringCbPrintfW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
#define RTL_CONSTANT_STRING(s)
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
#define ObDereferenceObject
_Out_ PUNICODE_STRING DosName