GetVolumePathName function kernel32

Win32Result<bool> GetVolumePathName(
  1. PCWSTR lpszFileName,
  2. PWSTR lpszVolumePathName,
  3. int cchBufferLength
)

Retrieves the volume mount point where the specified path is mounted.

To learn more, see learn.microsoft.com/windows/win32/api/fileapi/nf-fileapi-getvolumepathnamew.

Implementation

Win32Result<bool> GetVolumePathName(
  PCWSTR lpszFileName,
  PWSTR lpszVolumePathName,
  int cchBufferLength,
) {
  resolveGetLastError();
  final result_ = _GetVolumePathName(
    lpszFileName,
    lpszVolumePathName,
    cchBufferLength,
  );
  return .new(value: result_ != FALSE, error: GetLastError());
}