RegGetValue function Null safety advapi32

int RegGetValue(
  1. int hkey,
  2. Pointer<Utf16> lpSubKey,
  3. Pointer<Utf16> lpValue,
  4. int dwFlags,
  5. Pointer<Uint32> pdwType,
  6. Pointer<NativeType> pvData,
  7. Pointer<Uint32> pcbData
)

Retrieves the type and data for the specified registry value.

LSTATUS RegGetValueW(
  HKEY    hkey,
  LPCWSTR lpSubKey,
  LPCWSTR lpValue,
  DWORD   dwFlags,
  LPDWORD pdwType,
  PVOID   pvData,
  LPDWORD pcbData);

Implementation

int RegGetValue(
    int hkey,
    Pointer<Utf16> lpSubKey,
    Pointer<Utf16> lpValue,
    int dwFlags,
    Pointer<Uint32> pdwType,
    Pointer pvData,
    Pointer<Uint32> pcbData) {
  final _RegGetValue = _advapi32.lookupFunction<
      Int32 Function(
          IntPtr hkey,
          Pointer<Utf16> lpSubKey,
          Pointer<Utf16> lpValue,
          Uint32 dwFlags,
          Pointer<Uint32> pdwType,
          Pointer pvData,
          Pointer<Uint32> pcbData),
      int Function(
          int hkey,
          Pointer<Utf16> lpSubKey,
          Pointer<Utf16> lpValue,
          int dwFlags,
          Pointer<Uint32> pdwType,
          Pointer pvData,
          Pointer<Uint32> pcbData)>('RegGetValueW');
  return _RegGetValue(
      hkey, lpSubKey, lpValue, dwFlags, pdwType, pvData, pcbData);
}