RegOpenCurrentUser function Null safety advapi32

int RegOpenCurrentUser(
  1. int samDesired,
  2. Pointer<IntPtr> phkResult

Retrieves a handle to the HKEY_CURRENT_USER key for the user the current thread is impersonating.

LSTATUS RegOpenCurrentUser(
  REGSAM samDesired,
  PHKEY  phkResult);


int RegOpenCurrentUser(int samDesired, Pointer<IntPtr> phkResult) {
  final _RegOpenCurrentUser = _advapi32.lookupFunction<
      Int32 Function(Uint32 samDesired, Pointer<IntPtr> phkResult),
      int Function(
          int samDesired, Pointer<IntPtr> phkResult)>('RegOpenCurrentUser');
  return _RegOpenCurrentUser(samDesired, phkResult);