14{
17 WCHAR VolumeDeviceNameBuffer[32];
23
24 RtlInitEmptyUnicodeString(&VolumeDeviceName,
25 VolumeDeviceNameBuffer,
26 sizeof(VolumeDeviceNameBuffer));
27
28 for (VolumeNumber = 0; VolumeNumber < 32; ++VolumeNumber)
29 {
32 L"\\Device\\HarddiskVolume%lu",
33 VolumeNumber);
35 {
36 trace(
"RtlStringCbPrintfW(%lu) failed with 0x%lx\n",
38 break;
39 }
40
47 {
48 trace(
"IoGetDeviceObjectPointer(%wZ) failed with 0x%lx\n",
49 &VolumeDeviceName,
Status);
50 continue;
51 }
52
56 {
57 trace(
"DOS name for %wZ is %wZ\n", &VolumeDeviceName, &
DosName);
58
59
60
62 "Unexpected DOS name maximum length %hu, expected %hu\n",
65 "DOS name too short (length: %lu)\n",
68 "Missing NUL-terminator (1)\n");
70 "Missing NUL-terminator (2)\n");
71
72
73
75 {
79 "Unexpected drive letter: %wZ\n", &
DosName);
80 }
81 else
82 {
84 "Unexpected volume path: %wZ\n", &
DosName);
86 "Invalid DOS volume path returned: %wZ\n", &
DosName);
87 }
89 }
91 }
92 ok(VolumeNumber > 1,
"No volumes found\n");
93}
#define ok_eq_hex(value, expected)
#define NT_SUCCESS(StatCode)
#define MOUNTMGR_IS_DOS_VOLUME_NAME(s)
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_ _When_(return==0, _At_(DosName->Buffer, __drv_allocatesMem(Mem))) 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