SHGetDiskFreeSpaceEx function Null safety shell32

int SHGetDiskFreeSpaceEx(
  1. Pointer<Utf16> pszDirectoryName,
  2. Pointer<Uint64> pulFreeBytesAvailableToCaller,
  3. Pointer<Uint64> pulTotalNumberOfBytes,
  4. Pointer<Uint64> pulTotalNumberOfFreeBytes
)

Retrieves disk space information for a disk volume.

BOOL SHGetDiskFreeSpaceExW(
  LPCWSTR        pszDirectoryName,
  ULARGE_INTEGER *pulFreeBytesAvailableToCaller,
  ULARGE_INTEGER *pulTotalNumberOfBytes,
  ULARGE_INTEGER *pulTotalNumberOfFreeBytes
);

Implementation

int SHGetDiskFreeSpaceEx(
    Pointer<Utf16> pszDirectoryName,
    Pointer<Uint64> pulFreeBytesAvailableToCaller,
    Pointer<Uint64> pulTotalNumberOfBytes,
    Pointer<Uint64> pulTotalNumberOfFreeBytes) {
  final _SHGetDiskFreeSpaceEx = _shell32.lookupFunction<
      Int32 Function(
          Pointer<Utf16> pszDirectoryName,
          Pointer<Uint64> pulFreeBytesAvailableToCaller,
          Pointer<Uint64> pulTotalNumberOfBytes,
          Pointer<Uint64> pulTotalNumberOfFreeBytes),
      int Function(
          Pointer<Utf16> pszDirectoryName,
          Pointer<Uint64> pulFreeBytesAvailableToCaller,
          Pointer<Uint64> pulTotalNumberOfBytes,
          Pointer<Uint64> pulTotalNumberOfFreeBytes)>('SHGetDiskFreeSpaceExW');
  return _SHGetDiskFreeSpaceEx(pszDirectoryName, pulFreeBytesAvailableToCaller,
      pulTotalNumberOfBytes, pulTotalNumberOfFreeBytes);
}