2 out of 2 rated this helpful - Rate this topic

FindNextVolume function

Applies to: desktop apps only

Continues a volume search started by a call to the FindFirstVolume function. FindNextVolume finds one volume per call.

Syntax

BOOL WINAPI FindNextVolume(
  __in   HANDLE hFindVolume,
  __out  LPTSTR lpszVolumeName,
  __in   DWORD cchBufferLength
);

Parameters

hFindVolume [in]

The volume search handle returned by a previous call to the FindFirstVolume function.

lpszVolumeName [out]

A pointer to a string that receives the volume GUID path that is found.

cchBufferLength [in]

The length of the buffer that receives the volume GUID path, in TCHARs.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError. If no matching files can be found, the GetLastError function returns the ERROR_NO_MORE_FILES error code. In that case, close the search with the FindVolumeClose function.

Remarks

After the search handle is established by calling FindFirstVolume, you can use the FindNextVolume function to search for other volumes.

You should not assume any correlation between the order of the volumes that are returned by these functions and the order of the volumes that are on the computer. In particular, do not assume any correlation between volume order and drive letters as assigned by the BIOS (if any) or the Disk Administrator.

Examples

For an example, see Displaying Volume Paths.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

WinBase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

Unicode and ANSI names

FindNextVolumeW (Unicode) and FindNextVolumeA (ANSI)

See also

FindFirstVolume
FindVolumeClose
Volume Management Functions
Mounted Folders

 

 

Send comments about this topic to Microsoft

Build date: 4/17/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
next volume
BOOL WINAPI FindNextVolume(
  __in   HANDLE hFindVolume,
  __out  LPTSTR lpszVolumeName,
  __in   DWORD cchBufferLength
);
Generic volume
Drivers
Doesn't work with hidden volumes
The following should be included on this page:

If a volume has the VDS_VF_HIDDEN flag set, then it will not be returned by FindFirstVolume, FindNextVolume.

This information was found by reading documentation on the VDS_VOLUME_FLAG enumeration:
http://msdn.microsoft.com/en-us/library/aa383901%28VS.85%29.aspx