RegOpenKey function Null safety advapi32

int RegOpenKey(
  1. int hKey,
  2. Pointer<Utf16> lpSubKey,
  3. Pointer<IntPtr> phkResult
)

Opens the specified registry key.

LSTATUS RegOpenKeyW(
  HKEY    hKey,
  LPCWSTR lpSubKey,
  PHKEY   phkResult);

Implementation

int RegOpenKey(int hKey, Pointer<Utf16> lpSubKey, Pointer<IntPtr> phkResult) {
  final _RegOpenKey = _advapi32.lookupFunction<
      Int32 Function(
          IntPtr hKey, Pointer<Utf16> lpSubKey, Pointer<IntPtr> phkResult),
      int Function(int hKey, Pointer<Utf16> lpSubKey,
          Pointer<IntPtr> phkResult)>('RegOpenKeyW');
  return _RegOpenKey(hKey, lpSubKey, phkResult);
}