RegNotifyChangeKeyValue function advapi32

WIN32_ERROR RegNotifyChangeKeyValue(
  1. HKEY hKey,
  2. bool bWatchSubtree,
  3. REG_NOTIFY_FILTER dwNotifyFilter,
  4. HANDLE? hEvent,
  5. bool fAsynchronous,
)

Notifies the caller about changes to the attributes or contents of a specified registry key.

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

Implementation

@pragma('vm:prefer-inline')
WIN32_ERROR RegNotifyChangeKeyValue(
  HKEY hKey,
  bool bWatchSubtree,
  REG_NOTIFY_FILTER dwNotifyFilter,
  HANDLE? hEvent,
  bool fAsynchronous,
) => .new(
  _RegNotifyChangeKeyValue(
    hKey,
    bWatchSubtree ? TRUE : FALSE,
    dwNotifyFilter,
    hEvent ?? nullptr,
    fAsynchronous ? TRUE : FALSE,
  ),
);