summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorРуслан Ижбулатов <lrn1986@gmail.com>2021-07-31 10:50:12 +0000
committerРуслан Ижбулатов <lrn1986@gmail.com>2021-07-31 10:50:12 +0000
commit8c25302726a60b1b5c216326a14c474fc41f1aed (patch)
tree4289b6507ecad40dde96fd8916827cf8dbe25a0e
parent02742ef957b532789c003eef80ec7f51c370e3d5 (diff)
downloadglib-8c25302726a60b1b5c216326a14c474fc41f1aed.tar.gz
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.
-rw-r--r--gio/gwin32registrykey.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gio/gwin32registrykey.c b/gio/gwin32registrykey.c
index 398d8f45b..d1ac09041 100644
--- a/gio/gwin32registrykey.c
+++ b/gio/gwin32registrykey.c
@@ -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);