FindFirstVolume function Null safety kernel32

int FindFirstVolume (
  1. Pointer<Utf16> lpszVolumeName,
  2. int cchBufferLength
)

Retrieves the name of a volume on a computer. FindFirstVolume is used to begin scanning the volumes of a computer.

HANDLE FindFirstVolumeW(
  LPWSTR lpszVolumeName,
  DWORD  cchBufferLength
);

Implementation

int FindFirstVolume(Pointer<Utf16> lpszVolumeName, int cchBufferLength) {
  final _FindFirstVolume = _kernel32.lookupFunction<
      IntPtr Function(Pointer<Utf16> lpszVolumeName, Uint32 cchBufferLength),
      int Function(Pointer<Utf16> lpszVolumeName,
          int cchBufferLength)>('FindFirstVolumeW');
  return _FindFirstVolume(lpszVolumeName, cchBufferLength);
}