GWin32RegistryKey: Change STATUS_SUCCESS handling

This function can, in fact, return STATUS_SUCCESS. We shouldn't
assert that it doesn't.

For now interpret it just like STATUS_PENDING (i.e. APC will be called),
see how it goes (it isn't documented how the function behaves in this
case, we have to play it by ear).

Note that while we *can* use a better-documented RegNotifyChangeKeyValue() here,
it communicates back to us via event objects, which means that the registry
watcher would have to interact with the main loop directly and insert its
events (plural; one event per key) there. That would make the API more complicated.
Whereas the internal NT function communicates by calling an APC - we're good
as long as something somewhere puts the thread in alertable state.
This commit is contained in:
Руслан Ижбулатов 2021-07-31 10:50:12 +00:00
parent 02742ef957
commit 8c25302726

View File

@ -2550,9 +2550,7 @@ g_win32_registry_key_watch (GWin32RegistryKey *key,
0,
TRUE);
g_assert (status != STATUS_SUCCESS);
if (status == STATUS_PENDING)
if (status == STATUS_PENDING || status == STATUS_SUCCESS)
return TRUE;
g_atomic_int_set (&key->priv->change_indicator, G_WIN32_KEY_UNKNOWN);