RegLoadKey function Null safety advapi32

int RegLoadKey(
  1. int hKey,
  2. Pointer<Utf16> lpSubKey,
  3. Pointer<Utf16> lpFile
)

Creates a subkey under HKEY_USERS or HKEY_LOCAL_MACHINE and loads the data from the specified registry hive into that subkey.

LSTATUS RegLoadKeyW(
  HKEY    hKey,
  LPCWSTR lpSubKey,
  LPCWSTR lpFile);

Implementation

int RegLoadKey(int hKey, Pointer<Utf16> lpSubKey, Pointer<Utf16> lpFile) {
  final _RegLoadKey = _advapi32.lookupFunction<
      Int32 Function(
          IntPtr hKey, Pointer<Utf16> lpSubKey, Pointer<Utf16> lpFile),
      int Function(int hKey, Pointer<Utf16> lpSubKey,
          Pointer<Utf16> lpFile)>('RegLoadKeyW');
  return _RegLoadKey(hKey, lpSubKey, lpFile);
}