RegConnectRegistry function Null safety advapi32

int RegConnectRegistry(
  1. Pointer<Utf16> lpMachineName,
  2. int hKey,
  3. Pointer<IntPtr> phkResult
)

Establishes a connection to a predefined registry key on another computer.

LSTATUS RegConnectRegistryW(
  LPCWSTR lpMachineName,
  HKEY    hKey,
  PHKEY   phkResult
);

Implementation

int RegConnectRegistry(
    Pointer<Utf16> lpMachineName, int hKey, Pointer<IntPtr> phkResult) {
  final _RegConnectRegistry = _advapi32.lookupFunction<
      Int32 Function(
          Pointer<Utf16> lpMachineName, IntPtr hKey, Pointer<IntPtr> phkResult),
      int Function(Pointer<Utf16> lpMachineName, int hKey,
          Pointer<IntPtr> phkResult)>('RegConnectRegistryW');
  return _RegConnectRegistry(lpMachineName, hKey, phkResult);
}