AFSFcb *pFcb = NULL;
AFSObjectInfoCB *pObjectInfo = NULL;
AFSVolumeCB *pVolumeCB = NULL;
+ BOOLEAN bDosDevice = FALSE;
pIrpSp = IoGetCurrentIrpStackLocation( Irp);
try_return( ntStatus = STATUS_INVALID_DEVICE_REQUEST);
}
+ bDosDevice = pFileObject->FileName.Length > 4 * sizeof( WCHAR) &&
+ pFileObject->FileName.Buffer[0] == L'\\' &&
+ pFileObject->FileName.Buffer[1] == L';' &&
+ pFileObject->FileName.Buffer[3] == L':';
+
pVolumeCB = pObjectInfo->VolumeCB;
ulLength = pIrpSp->Parameters.QueryVolume.Length;
ntStatus = AFSQueryFsVolumeInfo( &pVolumeCB->VolumeInformation,
(PFILE_FS_VOLUME_INFORMATION)pBuffer,
+ bDosDevice,
&ulLength);
break;
NTSTATUS
AFSQueryFsVolumeInfo( IN AFSVolumeInfoCB *VolumeInfo,
IN PFILE_FS_VOLUME_INFORMATION Buffer,
+ IN BOOLEAN bDosDevice,
IN OUT PULONG Length)
{
if( *Length >= (ULONG)sizeof( FILE_FS_VOLUME_INFORMATION))
{
- ulLabelLength = VolumeInfo->VolumeLabelLength +
- VolumeInfo->CellLength + sizeof( WCHAR);
+ if ( bDosDevice)
+ {
+
+ ulLabelLength = VolumeInfo->VolumeLabelLength;
+ }
+ else
+ {
+
+ ulLabelLength = VolumeInfo->VolumeLabelLength +
+ VolumeInfo->CellLength + sizeof( WCHAR);
+ }
if( *Length >= (ULONG)(FIELD_OFFSET( FILE_FS_VOLUME_INFORMATION, VolumeLabel) + ulLabelLength))
{
if( *Length > 0)
{
- RtlCopyMemory( Buffer->VolumeLabel,
- VolumeInfo->Cell,
- min( *Length, VolumeInfo->CellLength));
+ if ( bDosDevice)
+ {
- *Length -= min( *Length, VolumeInfo->CellLength);
+ RtlCopyMemory( Buffer->VolumeLabel,
+ VolumeInfo->VolumeLabel,
+ min( *Length, VolumeInfo->VolumeLabelLength));
- if ( *Length >= sizeof( WCHAR))
+ *Length -= min( *Length, VolumeInfo->VolumeLabelLength);
+ }
+ else
{
- Buffer->VolumeLabel[ VolumeInfo->CellLength / sizeof( WCHAR)] = L'#';
+ RtlCopyMemory( Buffer->VolumeLabel,
+ VolumeInfo->Cell,
+ min( *Length, VolumeInfo->CellLength));
+
+ *Length -= min( *Length, VolumeInfo->CellLength);
+
+ if ( *Length >= sizeof( WCHAR))
+ {
+
+ Buffer->VolumeLabel[ VolumeInfo->CellLength / sizeof( WCHAR)] = L'#';
- *Length -= sizeof( WCHAR);
+ *Length -= sizeof( WCHAR);
- if ( *Length > 0) {
+ if ( *Length > 0) {
- RtlCopyMemory( &Buffer->VolumeLabel[ (VolumeInfo->CellLength + sizeof( WCHAR)) / sizeof( WCHAR)],
- VolumeInfo->VolumeLabel,
- min( *Length, VolumeInfo->VolumeLabelLength));
+ RtlCopyMemory( &Buffer->VolumeLabel[ (VolumeInfo->CellLength + sizeof( WCHAR)) / sizeof( WCHAR)],
+ VolumeInfo->VolumeLabel,
+ min( *Length, VolumeInfo->VolumeLabelLength));
- *Length -= min( *Length, VolumeInfo->VolumeLabelLength);
+ *Length -= min( *Length, VolumeInfo->VolumeLabelLength);
+ }
}
}
}