Platform SDK: Files and I/O

FindNextVolume

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

BOOL FindNextVolume(
  HANDLE hFindVolume,      // volume search handle
  LPTSTR lpszVolumeName,   // output buffer
  DWORD cchBufferLength    // size of output buffer
);

Parameters

hFindVolume
[in] Volume search handle returned by a previous call to the FindFirstVolume function.
lpszVolumeName
[out] Pointer to a string that receives the unique volume name found.
cchBufferLength
[in] Specifies the length, in TCHARs, of the buffer that receives the name.

Return Values

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 volumes returned with these functions and the order of volumes 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.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Winbase.h; include Windows.h.
  Library: Use Kernel32.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows 2000.

See Also

File Systems Overview, File System Functions, FindFirstVolume, FindVolumeClose