RegEnumKey function Null safety advapi32

int RegEnumKey(
  1. int hKey,
  2. int dwIndex,
  3. Pointer<Utf16> lpName,
  4. int cchName
)

Enumerates the subkeys of the specified open registry key. The function retrieves the name of one subkey each time it is called.

LSTATUS RegEnumKeyW(
  HKEY   hKey,
  DWORD  dwIndex,
  LPWSTR lpName,
  DWORD  cchName);

Implementation

int RegEnumKey(int hKey, int dwIndex, Pointer<Utf16> lpName, int cchName) {
  final _RegEnumKey = _advapi32.lookupFunction<
      Int32 Function(
          IntPtr hKey, Uint32 dwIndex, Pointer<Utf16> lpName, Uint32 cchName),
      int Function(int hKey, int dwIndex, Pointer<Utf16> lpName,
          int cchName)>('RegEnumKeyW');
  return _RegEnumKey(hKey, dwIndex, lpName, cchName);
}