MoveFile function Null safety kernel32

int MoveFile(
  1. Pointer<Utf16> lpExistingFileName,
  2. Pointer<Utf16> lpNewFileName
)

Moves an existing file or a directory, including its children.

BOOL MoveFileW(
  LPCWSTR lpExistingFileName,
  LPCWSTR lpNewFileName
);

Implementation

int MoveFile(Pointer<Utf16> lpExistingFileName, Pointer<Utf16> lpNewFileName) {
  final _MoveFile = _kernel32.lookupFunction<
      Int32 Function(
          Pointer<Utf16> lpExistingFileName, Pointer<Utf16> lpNewFileName),
      int Function(Pointer<Utf16> lpExistingFileName,
          Pointer<Utf16> lpNewFileName)>('MoveFileW');
  return _MoveFile(lpExistingFileName, lpNewFileName);
}