GetFileAttributesEx function Null safety kernel32

int GetFileAttributesEx (
  1. Pointer<Utf16> lpFileName,
  2. int fInfoLevelId,
  3. Pointer<NativeType> lpFileInformation
)

Retrieves attributes for a specified file or directory.

BOOL GetFileAttributesExW(
  LPCWSTR                lpFileName,
  GET_FILEEX_INFO_LEVELS fInfoLevelId,
  LPVOID                 lpFileInformation
);

Implementation

int GetFileAttributesEx(
    Pointer<Utf16> lpFileName, int fInfoLevelId, Pointer lpFileInformation) {
  final _GetFileAttributesEx = _kernel32.lookupFunction<
      Int32 Function(Pointer<Utf16> lpFileName, Int32 fInfoLevelId,
          Pointer lpFileInformation),
      int Function(Pointer<Utf16> lpFileName, int fInfoLevelId,
          Pointer lpFileInformation)>('GetFileAttributesExW');
  return _GetFileAttributesEx(lpFileName, fInfoLevelId, lpFileInformation);
}