Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54085
Fixes test randomly crashing on Win10 Testbot machines.
I think the test added by me after (test_DeviceAccessInformation) this one is just getting hit by the consequences of test_DeviceInformation. I guess what is happening here is that sometimes Windows accesses the handlers (maybe releases) after test_DeviceInformation() is exited already and the test interface implementation (which implements reference counting but uses structure on stack) accesses the popped stack data.
It is the second patch which seems to actually fix the test crash.
From: Paul Gofman pgofman@codeweavers.com
--- dlls/windows.devices.enumeration/tests/devices.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/windows.devices.enumeration/tests/devices.c b/dlls/windows.devices.enumeration/tests/devices.c index b146f4b0698..72bce374410 100644 --- a/dlls/windows.devices.enumeration/tests/devices.c +++ b/dlls/windows.devices.enumeration/tests/devices.c @@ -110,8 +110,9 @@ static HRESULT WINAPI device_watcher_handler_Invoke( ITypedEventHandler_DeviceWa impl->invoked = TRUE; impl->args = args;
+ IDeviceWatcher_AddRef( sender ); ref = IDeviceWatcher_Release( sender ); - ok( ref == 2, "got ref %lu\n", ref ); + ok( ref == 3, "got ref %lu\n", ref );
SetEvent( impl->event );
From: Paul Gofman pgofman@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54085 --- dlls/windows.devices.enumeration/tests/devices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/windows.devices.enumeration/tests/devices.c b/dlls/windows.devices.enumeration/tests/devices.c index 72bce374410..c65312ea800 100644 --- a/dlls/windows.devices.enumeration/tests/devices.c +++ b/dlls/windows.devices.enumeration/tests/devices.c @@ -139,7 +139,7 @@ static void test_DeviceInformation( void ) { static const WCHAR *device_info_name = L"Windows.Devices.Enumeration.DeviceInformation";
- struct device_watcher_handler stopped_handler, added_handler; + static struct device_watcher_handler stopped_handler, added_handler; EventRegistrationToken stopped_token, added_token; IInspectable *inspectable, *inspectable2; IActivationFactory *factory;