FltGetVolumeName() documentation bug?

I think there is another bug in the documentation and behavior for
FltGetVolumeName() routine.

The “Return Value” section says: “FltGetVolumeName returns STATUS_SUCCESS if
the volume name is found or the volume does not have a name.”

When VolumeName parameter = NULL and BufferSizeNeeded != NULL and the
volumen does not have a name, FltGetVolumeName() returns
STATUS_BUFFER_TOO_SMALL so BufferSizeNeeded must be verified:

Status = FltGetVolumeName( FltObjects->Volume, NULL, &BufferSizeNeeded
);

if (STATUS_BUFFER_TOO_SMALL == Status && BufferSizeNeeded)
{
VolumeName.Length = 0;
VolumeName.MaximumLength = BufferSizeNeeded + sizeof(WCHAR);
VolumeName.Buffer = ExAllocatePoolWithTag( NonPagedPool,
VolumeName.MaximumLength, ‘AzyX’ );

}

This seems to be logical because no buffer has been provided, but how can a
buffer be too small at the same time that BufferSizeNeeded is 0?. When the
volume does not have name FltGetVolumeName() could returns
STATUS_OBJECT_NAME_NOT_FOUND…

Thanks.
mK.


Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail

Misha,

I have contacted our documentation team and asked them to fix it. This
should be fixed in the next version of the IFSKit.

Thanks
Ravinder Thind

This posting is provided “AS IS” with no warranties, and confers no rights.

“Misha Karpin” wrote in message
news:xxxxx@ntfsd…
> I think there is another bug in the documentation and behavior for
> FltGetVolumeName() routine.
>
> The “Return Value” section says: “FltGetVolumeName returns STATUS_SUCCESS
if
> the volume name is found or the volume does not have a name.”
>
> When VolumeName parameter = NULL and BufferSizeNeeded != NULL and the
> volumen does not have a name, FltGetVolumeName() returns
> STATUS_BUFFER_TOO_SMALL so BufferSizeNeeded must be verified:
>
> Status = FltGetVolumeName( FltObjects->Volume, NULL, &BufferSizeNeeded
> );
>
> if (STATUS_BUFFER_TOO_SMALL == Status && BufferSizeNeeded)
> {
> VolumeName.Length = 0;
> VolumeName.MaximumLength = BufferSizeNeeded + sizeof(WCHAR);
> VolumeName.Buffer = ExAllocatePoolWithTag( NonPagedPool,
> VolumeName.MaximumLength, ‘AzyX’ );
> …
> }
>
> This seems to be logical because no buffer has been provided, but how can
a
> buffer be too small at the same time that BufferSizeNeeded is 0?. When the
> volume does not have name FltGetVolumeName() could returns
> STATUS_OBJECT_NAME_NOT_FOUND…
>
> Thanks.
> mK.
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>