EncryptFile function Null safety advapi32

int EncryptFile(
  1. Pointer<Utf16> lpFileName
)

Encrypts a file or directory. All data streams in a file are encrypted. All new files created in an encrypted directory are encrypted.

BOOL EncryptFileW(
  LPCWSTR lpFileName
);

Implementation

int EncryptFile(Pointer<Utf16> lpFileName) {
  final _EncryptFile = _advapi32.lookupFunction<
      Int32 Function(Pointer<Utf16> lpFileName),
      int Function(Pointer<Utf16> lpFileName)>('EncryptFileW');
  return _EncryptFile(lpFileName);
}