Platform SDK: Files and I/O |
It is useful to determine if a directory is a volume mount point when, for example, you are using a backup utility or search utility that is constrained to one volume. Such a utility can reach information on multiple volumes if you mount all volumes to the one the utility addresses.
To determine if a specified directory is a volume mount point, first call the GetFileAttributes function and inspect the FILE_ATTRIBUTE_REPARSE_POINT flag in the return value to see if the directory has an associated reparse point. If it does, use the FindFirstFile and FindNextFile functions to obtain the reparse tag. To determine if the reparse point is a volume mount point (and not some other form of reparse point), test whether the tag value equals the value IO_REPARSE_TAG_MOUNT_POINT. For more information, see Reparse Points.
To obtain the target volume of a volume mount point, use the function GetVolumeNameForVolumeMountPoint.