mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Added patch to fix return value of RegNotifyChangeKeyValue for pending events.
This commit is contained in:
parent
a7440de8ce
commit
a98c140c42
@ -0,0 +1,74 @@
|
||||
From 63e3d8fa86ea5bb6dd9154754d57b680b00533ad Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Thu, 24 Mar 2016 02:42:22 +0100
|
||||
Subject: advapi32: Fix return value of RegNotifyChangeKeyValue for pending
|
||||
events.
|
||||
|
||||
Also remove handling for STATUS_TIMEOUT. Is it ever returned?
|
||||
---
|
||||
dlls/advapi32/registry.c | 2 +-
|
||||
dlls/advapi32/tests/registry.c | 28 ++++++++++++++++++++++++++++
|
||||
2 files changed, 29 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
|
||||
index 7992384..4b3d852 100644
|
||||
--- a/dlls/advapi32/registry.c
|
||||
+++ b/dlls/advapi32/registry.c
|
||||
@@ -2760,7 +2760,7 @@ LSTATUS WINAPI RegNotifyChangeKeyValue( HKEY hkey, BOOL fWatchSubTree,
|
||||
fdwNotifyFilter, fWatchSubTree, NULL, 0,
|
||||
fAsync);
|
||||
|
||||
- if (status && status != STATUS_TIMEOUT)
|
||||
+ if (status && status != STATUS_PENDING)
|
||||
return RtlNtStatusToDosError( status );
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c
|
||||
index f877b36..82f5015 100644
|
||||
--- a/dlls/advapi32/tests/registry.c
|
||||
+++ b/dlls/advapi32/tests/registry.c
|
||||
@@ -3452,6 +3452,33 @@ static void test_RegOpenCurrentUser(void)
|
||||
RegCloseKey(key);
|
||||
}
|
||||
|
||||
+static void test_RegNotifyChangeKeyValue(void)
|
||||
+{
|
||||
+ HKEY key, subkey;
|
||||
+ HANDLE event;
|
||||
+ DWORD dwret;
|
||||
+ LONG ret;
|
||||
+
|
||||
+ event = CreateEventW(NULL, FALSE, TRUE, NULL);
|
||||
+ ok(event != NULL, "CreateEvent failed, error %u\n", GetLastError());
|
||||
+ ret = RegCreateKeyA(hkey_main, "TestKey", &key);
|
||||
+ ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret);
|
||||
+
|
||||
+ ret = RegNotifyChangeKeyValue(key, TRUE, REG_NOTIFY_CHANGE_NAME, event, TRUE);
|
||||
+ ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret);
|
||||
+ dwret = WaitForSingleObject(event, 0);
|
||||
+ ok(dwret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %u\n", dwret);
|
||||
+
|
||||
+ ret = RegCreateKeyA(key, "SubKey", &subkey);
|
||||
+ ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret);
|
||||
+ dwret = WaitForSingleObject(event, 0);
|
||||
+ ok(dwret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", dwret);
|
||||
+
|
||||
+ RegDeleteKeyA(key, "");
|
||||
+ RegCloseKey(key);
|
||||
+ CloseHandle(event);
|
||||
+}
|
||||
+
|
||||
START_TEST(registry)
|
||||
{
|
||||
/* Load pointers for functions that are not available in all Windows versions */
|
||||
@@ -3486,6 +3513,7 @@ START_TEST(registry)
|
||||
test_delete_value();
|
||||
test_delete_key_value();
|
||||
test_RegOpenCurrentUser();
|
||||
+ test_RegNotifyChangeKeyValue();
|
||||
|
||||
/* cleanup */
|
||||
delete_key( hkey_main );
|
||||
--
|
||||
2.7.1
|
||||
|
1
patches/advapi32-RegNotifyChangeKeyValue/definition
Normal file
1
patches/advapi32-RegNotifyChangeKeyValue/definition
Normal file
@ -0,0 +1 @@
|
||||
Fixes: [39863] Fix return value of RegNotifyChangeKeyValue for pending events
|
@ -86,6 +86,7 @@ patch_enable_all ()
|
||||
enable_Pipelight="$1"
|
||||
enable_Staging="$1"
|
||||
enable_advapi32_LsaLookupSids="$1"
|
||||
enable_advapi32_RegNotifyChangeKeyValue="$1"
|
||||
enable_advapi32_SetSecurityInfo="$1"
|
||||
enable_amstream_GetMultiMediaStream="$1"
|
||||
enable_api_ms_win_Stub_DLLs="$1"
|
||||
@ -429,6 +430,9 @@ patch_enable ()
|
||||
advapi32-LsaLookupSids)
|
||||
enable_advapi32_LsaLookupSids="$2"
|
||||
;;
|
||||
advapi32-RegNotifyChangeKeyValue)
|
||||
enable_advapi32_RegNotifyChangeKeyValue="$2"
|
||||
;;
|
||||
advapi32-SetSecurityInfo)
|
||||
enable_advapi32_SetSecurityInfo="$2"
|
||||
;;
|
||||
@ -2536,6 +2540,21 @@ if test "$enable_advapi32_LsaLookupSids" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset advapi32-RegNotifyChangeKeyValue
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#39863] Fix return value of RegNotifyChangeKeyValue for pending events
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/advapi32/registry.c, dlls/advapi32/tests/registry.c
|
||||
# |
|
||||
if test "$enable_advapi32_RegNotifyChangeKeyValue" -eq 1; then
|
||||
patch_apply advapi32-RegNotifyChangeKeyValue/0001-advapi32-Fix-return-value-of-RegNotifyChangeKeyValue.patch
|
||||
(
|
||||
echo '+ { "Sebastian Lackner", "advapi32: Fix return value of RegNotifyChangeKeyValue for pending events.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset advapi32-SetSecurityInfo
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
|
Loading…
Reference in New Issue
Block a user