RegEnumKeyEx function Null safety advapi32

int RegEnumKeyEx(
  1. int hKey,
  2. int dwIndex,
  3. Pointer<Utf16> lpName,
  4. Pointer<Uint32> lpcchName,
  5. Pointer<Uint32> lpReserved,
  6. Pointer<Utf16> lpClass,
  7. Pointer<Uint32> lpcchClass,
  8. Pointer<FILETIME> lpftLastWriteTime
)

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

LSTATUS RegEnumKeyExW(
  HKEY      hKey,
  DWORD     dwIndex,
  LPWSTR    lpName,
  LPDWORD   lpcchName,
  LPDWORD   lpReserved,
  LPWSTR    lpClass,
  LPDWORD   lpcchClass,
  PFILETIME lpftLastWriteTime);

Implementation

int RegEnumKeyEx(
    int hKey,
    int dwIndex,
    Pointer<Utf16> lpName,
    Pointer<Uint32> lpcchName,
    Pointer<Uint32> lpReserved,
    Pointer<Utf16> lpClass,
    Pointer<Uint32> lpcchClass,
    Pointer<FILETIME> lpftLastWriteTime) {
  final _RegEnumKeyEx = _advapi32.lookupFunction<
      Int32 Function(
          IntPtr hKey,
          Uint32 dwIndex,
          Pointer<Utf16> lpName,
          Pointer<Uint32> lpcchName,
          Pointer<Uint32> lpReserved,
          Pointer<Utf16> lpClass,
          Pointer<Uint32> lpcchClass,
          Pointer<FILETIME> lpftLastWriteTime),
      int Function(
          int hKey,
          int dwIndex,
          Pointer<Utf16> lpName,
          Pointer<Uint32> lpcchName,
          Pointer<Uint32> lpReserved,
          Pointer<Utf16> lpClass,
          Pointer<Uint32> lpcchClass,
          Pointer<FILETIME> lpftLastWriteTime)>('RegEnumKeyExW');
  return _RegEnumKeyEx(hKey, dwIndex, lpName, lpcchName, lpReserved, lpClass,
      lpcchClass, lpftLastWriteTime);
}