GetVolumePathNamesForVolumeName function Null safety kernel32

int GetVolumePathNamesForVolumeName(
  1. Pointer<Utf16> lpszVolumeName,
  2. Pointer<Utf16> lpszVolumePathNames,
  3. int cchBufferLength,
  4. Pointer<Uint32> lpcchReturnLength
)

Retrieves a list of drive letters and mounted folder paths for the specified volume.

BOOL GetVolumePathNamesForVolumeNameW(
  LPCWSTR lpszVolumeName,
  LPWCH   lpszVolumePathNames,
  DWORD   cchBufferLength,
  PDWORD  lpcchReturnLength
);

Implementation

int GetVolumePathNamesForVolumeName(
    Pointer<Utf16> lpszVolumeName,
    Pointer<Utf16> lpszVolumePathNames,
    int cchBufferLength,
    Pointer<Uint32> lpcchReturnLength) {
  final _GetVolumePathNamesForVolumeName = _kernel32.lookupFunction<
          Int32 Function(
              Pointer<Utf16> lpszVolumeName,
              Pointer<Utf16> lpszVolumePathNames,
              Uint32 cchBufferLength,
              Pointer<Uint32> lpcchReturnLength),
          int Function(
              Pointer<Utf16> lpszVolumeName,
              Pointer<Utf16> lpszVolumePathNames,
              int cchBufferLength,
              Pointer<Uint32> lpcchReturnLength)>(
      'GetVolumePathNamesForVolumeNameW');
  return _GetVolumePathNamesForVolumeName(
      lpszVolumeName, lpszVolumePathNames, cchBufferLength, lpcchReturnLength);
}