Platform SDK: Files and I/O

FindFirstVolumeMountPoint

The FindFirstVolumeMountPoint function returns the name of a volume mount point on the specified volume. FindFirstVolumeMountPoint is used to begin scanning the volume mount points on a volume.

HANDLE FindFirstVolumeMountPoint(
  LPTSTR lpszRootPathName,     // volume name
  LPTSTR lpszVolumeMountPoint, // output buffer
  DWORD cchBufferLength        // size of output buffer
);

Parameters

lpszRootPathName
[in] Unique volume name of the volume to scan for volume mount points. A trailing backslash is required.
lpszVolumeMountPoint
[out] Pointer to a buffer that receives the name of the first volume mount point found.
cchBufferLength
[in] Specifies the length, in TCHARs, of the buffer that receives the volume mount point name.

Return Values

If the function succeeds, the return value is a search handle used in a subsequent call to the FindNextVolumeMountPoint and FindVolumeMountPointClose functions.

If the function fails to find a volume mount point on the volume, the return value is the INVALID_HANDLE_VALUE error code. To get extended error information, call GetLastError.

Remarks

The FindFirstVolumeMountPoint function opens a mount-point search handle and returns information about the first volume mount point found on the specified volume. After the search handle is established, you can use the FindNextVolumeMountPoint function to search for other volume mount points. When the search handle is no longer needed, close it with the FindVolumeMountPointClose function.

You should not assume any correlation between the order of volume mount points returned by these functions and the order of volume mount points returned by other tools.

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, FindNextVolumeMountPoint, FindVolumeMountPointClose