SetVolumeLabel function Null safety kernel32

int SetVolumeLabel(
  1. Pointer<Utf16> lpRootPathName,
  2. Pointer<Utf16> lpVolumeName
)

Sets the label of a file system volume.

BOOL SetVolumeLabelW(
  LPCWSTR lpRootPathName,
  LPCWSTR lpVolumeName);

Implementation

int SetVolumeLabel(Pointer<Utf16> lpRootPathName, Pointer<Utf16> lpVolumeName) {
  final _SetVolumeLabel = _kernel32.lookupFunction<
      Int32 Function(
          Pointer<Utf16> lpRootPathName, Pointer<Utf16> lpVolumeName),
      int Function(Pointer<Utf16> lpRootPathName,
          Pointer<Utf16> lpVolumeName)>('SetVolumeLabelW');
  return _SetVolumeLabel(lpRootPathName, lpVolumeName);
}