RegQueryValue function advapi32

WIN32_ERROR RegQueryValue(
  1. HKEY hKey,
  2. PCWSTR? lpSubKey,
  3. PWSTR? lpData,
  4. Pointer<Int32>? lpcbData,
)

Retrieves the data associated with the default or unnamed value of a specified registry key.

The data must be a null-terminated string.

To learn more, see learn.microsoft.com/windows/win32/api/winreg/nf-winreg-regqueryvaluew.

Implementation

@pragma('vm:prefer-inline')
WIN32_ERROR RegQueryValue(
  HKEY hKey,
  PCWSTR? lpSubKey,
  PWSTR? lpData,
  Pointer<Int32>? lpcbData,
) => .new(
  _RegQueryValue(
    hKey,
    lpSubKey ?? nullptr,
    lpData ?? nullptr,
    lpcbData ?? nullptr,
  ),
);